OSDN Git Service

android-x86/external-llvm.git
6 years ago[CMake] Pass Clang defaults to runtimes builds
Petr Hosek [Tue, 22 May 2018 00:43:04 +0000 (00:43 +0000)]
[CMake] Pass Clang defaults to runtimes builds

This enables the use of Clang default options from runtimes CMake files.

Differential Revision: https://reviews.llvm.org/D47168

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332923 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAG] fold FP binops with undef operands to NaN
Sanjay Patel [Mon, 21 May 2018 23:54:19 +0000 (23:54 +0000)]
[DAG] fold FP binops with undef operands to NaN

This is the FP sibling of D43141 with the corresponding IR change in rL327212.

We can't propagate undef here because if a variable operand is a NaN, these
binops must propagate NaN. Neither global nor node-level fast-math makes a
difference. If we have 'nnan', I think later folds can turn the NaN into undef.

The tests in X86/fp-undef.ll are meant to be the definitive verification for
these folds - everything reduces identically now.

The other test changes are collateral damage. They may need to be altered to
preserve their intent.

Differential Revision: https://reviews.llvm.org/D47026

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332920 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ORC] Make some more operations on VSO private. These should be done via a
Lang Hames [Mon, 21 May 2018 23:46:29 +0000 (23:46 +0000)]
[ORC] Make some more operations on VSO private. These should be done via a
MaterializationResponsibility instance.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332919 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LKH] Add a replacement RTDyldLayer.
Lang Hames [Mon, 21 May 2018 23:45:40 +0000 (23:45 +0000)]
[LKH] Add a replacement RTDyldLayer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332918 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoReapply r332907 "[GlobalISel] Improving InstructionSelect's performance by reducing...
Roman Tereshin [Mon, 21 May 2018 23:28:51 +0000 (23:28 +0000)]
Reapply r332907 "[GlobalISel] Improving InstructionSelect's performance by reducing MatchTable..."

Apparently the compile time problem was caused by the fact that not
all compilers / STL implementations can automatically convert
std::unique_ptr<Derived> to std::unique_ptr<Base>. Fixed (hopefully)
by making sure it's std::unique_ptr<Derived>&& (rvalue ref) to
std::unique_ptr<Base> conversion instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332917 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove 128/256-bit cvtdq2ps, cvtudq2ps, cvtqq2pd, cvtuqq2pd intrinsics.
Craig Topper [Mon, 21 May 2018 23:15:00 +0000 (23:15 +0000)]
[X86] Remove 128/256-bit cvtdq2ps, cvtudq2ps, cvtqq2pd, cvtuqq2pd intrinsics.

These can all be implemented with sitofp/uitofp instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332916 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objcopy] Add --strip-unneeded option
Paul Semel [Mon, 21 May 2018 22:50:32 +0000 (22:50 +0000)]
[llvm-objcopy] Add --strip-unneeded option

This option removes symbols that are not needed by relocations.

Differential Revision: https://reviews.llvm.org/D46896

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332915 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r332907 "[GlobalISel] Improving InstructionSelect's performance by reducing...
Roman Tereshin [Mon, 21 May 2018 22:21:24 +0000 (22:21 +0000)]
Revert r332907 "[GlobalISel] Improving InstructionSelect's performance by reducing MatchTable..."

There is a compile time error I didn't see locally, investigating now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332912 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix warning from r332654 with LLVM_ATTRIBUTE_USED
Diego Caballero [Mon, 21 May 2018 22:12:38 +0000 (22:12 +0000)]
Fix warning from r332654 with LLVM_ATTRIBUTE_USED

r332654 tried to fix an unused function warning with
a void cast. This approach worked for clang and gcc
but not for MSVC. This commit replaces the void cast
with the LLVM_ATTRIBUTE_USED approach.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332910 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUnbreak kaleidoscope example.
Peter Collingbourne [Mon, 21 May 2018 22:09:45 +0000 (22:09 +0000)]
Unbreak kaleidoscope example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332908 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[GlobalISel] Improving InstructionSelect's performance by reducing MatchTable, mostly...
Roman Tereshin [Mon, 21 May 2018 22:04:39 +0000 (22:04 +0000)]
[GlobalISel] Improving InstructionSelect's performance by reducing MatchTable, mostly NFC, perf patch 1

This patch starts a series of patches that decrease time spent by
GlobalISel in its InstructionSelect pass by roughly 60% for -O0 builds
for large inputs as measured on sqlite3-amalgamation
(http://sqlite.org/download.html) targeting AArch64.

The performance improvements are achieved solely by reducing the
number of matching GIM_* opcodes executed by the MatchTable's
interpreter during the selection by approx. a factor of 30, which also
brings contribution of this particular part of the selection process
to the overall runtime of InstructionSelect pass down from approx.
60-70% to 5-7%, thus making further improvements in this particular
direction not very profitable.

The improvements described above are expected for any target that
doesn't have many complex patterns. The targets that do should
strictly benefit from the changes, but by how much exactly is hard to
estimate beforehand. It's also likely that such target WILL benefit
from further improvements to MatchTable, most likely the ones that
bring it closer to a perfect decision tree.

This commit specifically is rather large mostly NFC commit that does
necessary preparation work and refactoring, there will be a following
series of small patches introducing a specific optimization each
shortly after.

This commit specifically is expected to cause a small compile time
regression (around 2.5% of InstructionSelect pass time), which should
be fixed by the next commit of the series.

Every commit planned shares the same Phabricator Review.

Reviewers: qcolombet, dsanders, bogner, aemerson, javed.absar

Reviewed By: qcolombet

Subscribers: rovka, llvm-commits, kristof.beyls

Differential Revision: https://reviews.llvm.org/D44700

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332907 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAGCombiner] isAllOnesConstantOrAllOnesSplatConstant(): look through bitcasts
Roman Lebedev [Mon, 21 May 2018 21:41:10 +0000 (21:41 +0000)]
[DAGCombiner] isAllOnesConstantOrAllOnesSplatConstant(): look through bitcasts

Summary:
As pointed out in D46528, we errneously transform cases like `xor X, -1`,
even though we use said function.
It's because the `-1` is actually a bitcast there.
So i think we can just look through it in the function.

Differential Revision: https://reviews.llvm.org/D47156

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332905 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAGCombine][X86][AArch64] Masked merge unfolding: vector edition.
Roman Lebedev [Mon, 21 May 2018 21:41:02 +0000 (21:41 +0000)]
[DAGCombine][X86][AArch64] Masked merge unfolding: vector edition.

Summary:
This **appears** to be the last missing piece for the masked merge pattern handling in the backend.

This is [[ https://bugs.llvm.org/show_bug.cgi?id=37104 | PR37104 ]].

[[ https://bugs.llvm.org/show_bug.cgi?id=6773 | PR6773 ]] will introduce an IR canonicalization that is likely bad for the end assembly.
Previously, `andps`+`andnps` / `bsl` would be generated. (see `@out`)
Now, they would no longer be generated  (see `@in`), and we need to make sure that they are generated.

Differential Revision: https://reviews.llvm.org/D46528

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332904 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AArch64][NFC] Add tests for vector masked merge unfolding
Roman Lebedev [Mon, 21 May 2018 21:40:51 +0000 (21:40 +0000)]
[X86][AArch64][NFC] Add tests for vector masked merge unfolding

Summary:
This is [[ https://bugs.llvm.org/show_bug.cgi?id=37104 | PR37104 ]].

[[ https://bugs.llvm.org/show_bug.cgi?id=6773 | PR6773 ]] will introduce an IR canonicalization that is likely bad for the end assembly.
Previously, `andps`+`andnps` / `bsl` would be generated. (see `@out`)
Now, they would no longer be generated  (see `@in`).

Differential Revision: https://reviews.llvm.org/D46008

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332903 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ORC] Preserve Materializing symbol flag during resolution.
Lang Hames [Mon, 21 May 2018 21:11:22 +0000 (21:11 +0000)]
[ORC] Preserve Materializing symbol flag during resolution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332899 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ORC] Lookup now returns an error if any symbols are not found.
Lang Hames [Mon, 21 May 2018 21:11:21 +0000 (21:11 +0000)]
[ORC] Lookup now returns an error if any symbols are not found.

Also tightens the behavior of ExecutionSession::failQuery. Queries can usually
only be failed by marking a symbol as failed-to-materialize, but
ExecutionSession::failQuery provides a second route, and both routes may be
executed from different threads. In the case that a query has already been
failed due to a materialization error, ExecutionSession::failQuery will
direct the error to ExecutionSession::reportError instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332898 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ORC] Remove the optional MaterializationResponsibility argument from lookup.
Lang Hames [Mon, 21 May 2018 21:11:21 +0000 (21:11 +0000)]
[ORC] Remove the optional MaterializationResponsibility argument from lookup.

The lookup function provides blocking symbol resolution for JIT clients (not
layers themselves) so it does not need to track symbol dependencies via a
MaterializationResponsibility.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332897 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ORC] Add IRLayer and ObjectLayer interfaces and related MaterializationUnits.
Lang Hames [Mon, 21 May 2018 21:11:13 +0000 (21:11 +0000)]
[ORC] Add IRLayer and ObjectLayer interfaces and related MaterializationUnits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332896 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAGCombiner] Use computeKnownBits to match rotate patterns that have had their amoun...
Craig Topper [Mon, 21 May 2018 21:09:18 +0000 (21:09 +0000)]
[DAGCombiner] Use computeKnownBits to match rotate patterns that have had their amount masking modified by simplifyDemandedBits

SimplifyDemandedBits can remove bits from the masks for the shift amounts we need to see to detect rotates.

This patch uses zeroes from computeKnownBits to fill in some of these mask bits to make the match work.

As currently written this calls computeKnownBits even when the mask hasn't been simplified because it made the code simpler. If we're worried about compile time performance we can improve this.

I know we're talking about making a rotate intrinsic, but hopefully we can go ahead and do this change and just make sure the rotate intrinsic also handles it.

Differential Revision: https://reviews.llvm.org/D47116

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332895 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] regenerate checks; NFC
Sanjay Patel [Mon, 21 May 2018 21:09:14 +0000 (21:09 +0000)]
[InstCombine] regenerate checks; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332894 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Simplify some X86 address mode folding code, NFCI
Reid Kleckner [Mon, 21 May 2018 21:03:19 +0000 (21:03 +0000)]
[X86] Simplify some X86 address mode folding code, NFCI

This code should really do exactly the same thing for 32-bit x86 and
64-bit small code models, with the exception that RIP-relative
addressing can't use base and index registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332893 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove some unneeded check lines that I copy and pasted when I made vector...
Craig Topper [Mon, 21 May 2018 21:01:13 +0000 (21:01 +0000)]
[X86] Remove some unneeded check lines that I copy and pasted when I made vector tests from some scalar test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332892 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove masking from vpternlog intrinsics. Use a select in IR instead.
Craig Topper [Mon, 21 May 2018 20:58:09 +0000 (20:58 +0000)]
[X86] Remove masking from vpternlog intrinsics. Use a select in IR instead.

This removes 6 intrinsics since we no longer need separate mask and maskz intrinsics.

Differential Revision: https://reviews.llvm.org/D47124

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332890 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix a make_unique ambiguity.
Peter Collingbourne [Mon, 21 May 2018 20:56:28 +0000 (20:56 +0000)]
Fix a make_unique ambiguity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332889 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] remove fptrunc (select) code; NFCI
Sanjay Patel [Mon, 21 May 2018 20:39:35 +0000 (20:39 +0000)]
[InstCombine] remove fptrunc (select) code; NFCI

This pattern is handled within commonCastTransforms(),
so the code here is dead AFAICT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332887 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoLTO: Replace split dwarf implementation that uses objcopy with one that uses direct...
Peter Collingbourne [Mon, 21 May 2018 20:26:49 +0000 (20:26 +0000)]
LTO: Replace split dwarf implementation that uses objcopy with one that uses direct emission.

Part of PR37466.

Differential Revision: https://reviews.llvm.org/D47091

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332884 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add tests for cast-of-select; NFC
Sanjay Patel [Mon, 21 May 2018 20:23:58 +0000 (20:23 +0000)]
[InstCombine] add tests for cast-of-select; NFC

In all cases, we're pulling the cast above the select.
That's not a good canonicalization if we're creating
a select that then mismatches the operand size of its
condition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332883 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoCodeGen: Add a dwo output file argument to addPassesToEmitFile and hook it up to...
Peter Collingbourne [Mon, 21 May 2018 20:16:41 +0000 (20:16 +0000)]
CodeGen: Add a dwo output file argument to addPassesToEmitFile and hook it up to dwo output.

Part of PR37466.

Differential Revision: https://reviews.llvm.org/D47089

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332881 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRemove CMake workaround for LLD PR24476 which is no longer needed
Reid Kleckner [Mon, 21 May 2018 20:14:46 +0000 (20:14 +0000)]
Remove CMake workaround for LLD PR24476 which is no longer needed

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332880 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Fix typo "DWARG" in test comment (NFC)
Brian Gesiak [Mon, 21 May 2018 19:48:27 +0000 (19:48 +0000)]
[DebugInfo] Fix typo "DWARG" in test comment (NFC)

Summary:
The correct spelling is "DWARF", the debugging format, not "DWARG".
The typo is in a (not executed by lit) comment in a test file, so
fixing it does not result in any functional change.

Test Plan: check-llvm, just in case

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332878 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Introduce an ELF dwo object writer and teach llvm-mc about it.
Peter Collingbourne [Mon, 21 May 2018 19:44:54 +0000 (19:44 +0000)]
MC: Introduce an ELF dwo object writer and teach llvm-mc about it.

Part of PR37466.

Differential Revision: https://reviews.llvm.org/D47051

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332875 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Update GCCBuiltin names for DS FP atomic intrinsics
Matt Arsenault [Mon, 21 May 2018 19:43:02 +0000 (19:43 +0000)]
AMDGPU: Update GCCBuiltin names for DS FP atomic intrinsics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332874 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Use absolute addresses in location lists
Jonas Devlieghere [Mon, 21 May 2018 19:36:54 +0000 (19:36 +0000)]
[DebugInfo] Use absolute addresses in location lists

Rather than relying on the user to do the address calculating in
DW_AT_location we should just dump the absolute address.

rdar://problem/38513870

Differential revision: https://reviews.llvm.org/D47152

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332873 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add test cases for D47012.
Craig Topper [Mon, 21 May 2018 19:33:42 +0000 (19:33 +0000)]
[X86] Add test cases for D47012.

Patch by Thomasz Krupa.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332872 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Extract a derived class from ELFObjectWriter. NFCI.
Peter Collingbourne [Mon, 21 May 2018 19:30:59 +0000 (19:30 +0000)]
MC: Extract a derived class from ELFObjectWriter. NFCI.

This class will be used to create regular, non-split ELF files.

Part of PR37466.

Differential Revision: https://reviews.llvm.org/D47049

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332870 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add test cases for missed vector rotate matching due to SimplifyDemandedBits...
Craig Topper [Mon, 21 May 2018 19:27:50 +0000 (19:27 +0000)]
[X86] Add test cases for missed vector rotate matching due to SimplifyDemandedBits interfering with the AND masks

As requested in D47116

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332869 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Separate creating a generic object writer from creating a target object writer...
Peter Collingbourne [Mon, 21 May 2018 19:20:29 +0000 (19:20 +0000)]
MC: Separate creating a generic object writer from creating a target object writer. NFCI.

With this we gain a little flexibility in how the generic object
writer is created.

Part of PR37466.

Differential Revision: https://reviews.llvm.org/D47045

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332868 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Extract ELFObjectWriter's ELF writing functionality into an ELFWriter class....
Peter Collingbourne [Mon, 21 May 2018 19:18:28 +0000 (19:18 +0000)]
MC: Extract ELFObjectWriter's ELF writing functionality into an ELFWriter class. NFCI.

The idea is that we will be able to use this class to create multiple
files.

Differential Revision: https://reviews.llvm.org/D47048

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332867 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix ubsan bounds check failure.
Peter Collingbourne [Mon, 21 May 2018 19:09:47 +0000 (19:09 +0000)]
Fix ubsan bounds check failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332866 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[EarlyCSE] Improve EarlyCSE of some absolute value cases.
Craig Topper [Mon, 21 May 2018 18:42:42 +0000 (18:42 +0000)]
[EarlyCSE] Improve EarlyCSE of some absolute value cases.

Change matchSelectPattern to return X and -X for ABS/NABS in a well defined order. Adjust EarlyCSE to account for this. Ensure the SPF result is some kind of min/max and not abs/nabs in one place in InstCombine that made me nervous.

Prevously we returned the two operands of the compare part of the abs pattern. The RHS is always going to be a 0i, 1 or -1 constant. This isn't a very meaningful thing to return for any one. There's also some freedom in the abs pattern as to what happens when the value is equal to 0. This freedom led to early cse failing to match when different constants were used in otherwise equivalent operations. By returning the input and its negation in a defined order we can ensure an exact match. This also makes sure both patterns use the exact same subtract instruction for the negation. I believe CSE should evebntually make this happen and properly merge the nsw/nuw flags. But I'm not familiar with CSE and what order it does things in so it seemed like it might be good to really enforce that they were the same.

Differential Revision: https://reviews.llvm.org/D47037

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332865 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Remove stream and output functions from MCObjectWriter. NFCI.
Peter Collingbourne [Mon, 21 May 2018 18:28:57 +0000 (18:28 +0000)]
MC: Remove stream and output functions from MCObjectWriter. NFCI.

Part of PR37466.

Differential Revision: https://reviews.llvm.org/D47043

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332864 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Have the object writers return the number of bytes written. NFCI.
Peter Collingbourne [Mon, 21 May 2018 18:23:50 +0000 (18:23 +0000)]
MC: Have the object writers return the number of bytes written. NFCI.

This removes the last external use of the stream.

Part of PR37466.

Differential Revision: https://reviews.llvm.org/D47042

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332863 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] Add divergence analysis as a dependency for ISel
Stanislav Mekhanoshin [Mon, 21 May 2018 18:18:52 +0000 (18:18 +0000)]
[AMDGPU] Add divergence analysis as a dependency for ISel

AMDGPUDAGToDAGISel adds DivergenceAnalysis in getAnalysisUsage
but does not list it in pass dependencies which may lead to
crash.

Differential Revision: https://reviews.llvm.org/D47151

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332862 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Change object writers to use endian::Writer. NFCI.
Peter Collingbourne [Mon, 21 May 2018 18:17:42 +0000 (18:17 +0000)]
MC: Change object writers to use endian::Writer. NFCI.

Part of PR37466.

Differential Revision: https://reviews.llvm.org/D47040

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332861 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[VPlan] Reland r332654 and silence unused func warning
Diego Caballero [Mon, 21 May 2018 18:14:23 +0000 (18:14 +0000)]
[VPlan] Reland r332654 and silence unused func warning

r332654 was reverted due to an unused function warning in
release build. This commit includes the same code with the
warning silenced.

Differential Revision: https://reviews.llvm.org/D44338

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332860 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Change MCAssembler::writeSectionData and writeFragmentPadding to take a raw_ostre...
Peter Collingbourne [Mon, 21 May 2018 18:11:35 +0000 (18:11 +0000)]
MC: Change MCAssembler::writeSectionData and writeFragmentPadding to take a raw_ostream. NFCI.

Also clean up a couple of hacks where we were writing the section
contents to another stream by setting the object writer's stream,
writing and setting it back.

Part of PR37466.

Differential Revision: https://reviews.llvm.org/D47038

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332858 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Change MCAsmBackend::writeNopData() to take a raw_ostream instead of an MCObjectW...
Peter Collingbourne [Mon, 21 May 2018 17:57:19 +0000 (17:57 +0000)]
MC: Change MCAsmBackend::writeNopData() to take a raw_ostream instead of an MCObjectWriter. NFCI.

To make this work I needed to add an endianness field to MCAsmBackend
so that writeNopData() implementations know which endianness to use.

Part of PR37466.

Differential Revision: https://reviews.llvm.org/D47035

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332857 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU/GlobalISel: Address post-commit review comments for r332379
Tom Stellard [Mon, 21 May 2018 17:49:31 +0000 (17:49 +0000)]
AMDGPU/GlobalISel: Address post-commit review comments for r332379

MCRegisterInfo::getPhysRegSize() will be deprecated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332856 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] Fix PR37526: MinMax patterns produce an infinite loop.
Alexey Bataev [Mon, 21 May 2018 17:46:34 +0000 (17:46 +0000)]
[InstCombine] Fix PR37526: MinMax patterns produce an infinite loop.

Summary:
This patch fixes PR37526 by simplifying the newly generated LoadInst
instructions. If the pointer address is a bitcast from the pointer to
the NewType, we can just remove this extra bitcast instead of creating
the new one. This fixes the PR37526 + may speed up the whole compilation
process.

Reviewers: spatel, RKSimon, hfinkel

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D47144

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332855 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-mca] Removed an empty line generated by the timeline view. NFC.
Andrea Di Biagio [Mon, 21 May 2018 17:11:56 +0000 (17:11 +0000)]
[llvm-mca] Removed an empty line generated by the timeline view. NFC.

Also, regenerate all tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332853 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][BtVer2] Add a 'J' prefix to the PRF/RCU defs. NFC
Andrea Di Biagio [Mon, 21 May 2018 16:30:26 +0000 (16:30 +0000)]
[X86][BtVer2] Add a 'J' prefix to the PRF/RCU defs. NFC

This is to keep the Jaguar model's naming convention. Processor resources all
have a 'J' prefix in the BtVer2 scheduling model.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332851 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LLVM-C] Add DIBuilder Bindings For ObjC Classes
Robert Widmann [Mon, 21 May 2018 16:27:35 +0000 (16:27 +0000)]
[LLVM-C] Add DIBuilder Bindings For ObjC Classes

Summary: Add LLVMDIBuilderCreateObjCIVar, LLVMDIBuilderCreateObjCProperty, and LLVMDIBuilderCreateInheritance to allow declaring metadata for Objective-C class hierarchies and their associated properties and instance variables.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: harlanhaskins, llvm-commits

Differential Revision: https://reviews.llvm.org/D47123

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332850 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] - Avoid SFB pass - fix bug in updating the offsets for newly created copies
Lama Saba [Mon, 21 May 2018 16:23:16 +0000 (16:23 +0000)]
[X86] - Avoid SFB pass - fix bug in updating the offsets for newly created copies

Change-Id: I169ab6fe7e187727c0298c2a1e2868a683f3e688

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332849 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARF] Refactor callback usage for .debug_line error handling
James Henderson [Mon, 21 May 2018 15:30:54 +0000 (15:30 +0000)]
[DWARF] Refactor callback usage for .debug_line error handling

Change the "recoverable" error callback to take an Error instaed of a
string.

Reviewed by: JDevlieghere

Differential Revision: https://reviews.llvm.org/D46831

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332845 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Add an assert to ensure that rotation amount is converted to a scale
Simon Pilgrim [Mon, 21 May 2018 15:17:23 +0000 (15:17 +0000)]
[X86][SSE] Add an assert to ensure that rotation amount is converted to a scale

Missed in rL332832 where we added SSE v4i32 rotations for PR37426.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332844 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoARM: be conservative when asked load/store alignment of weird type.
Tim Northover [Mon, 21 May 2018 12:43:54 +0000 (12:43 +0000)]
ARM: be conservative when asked load/store alignment of weird type.

Chances are we'll be asked again after type legalization, but before that point
it's better to claim misaligned accesses aren't allowed than to assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332840 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agorevert r332610, it breaks cfi, see D46326
Nico Weber [Mon, 21 May 2018 11:44:39 +0000 (11:44 +0000)]
revert r332610, it breaks cfi, see D46326

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332838 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips] Revert Merge MipsLongBranch and MipsHazardSchedule passes
Aleksandar Beserminji [Mon, 21 May 2018 11:38:52 +0000 (11:38 +0000)]
[mips] Revert Merge MipsLongBranch and MipsHazardSchedule passes

Revert this patch due buildbot failure.

Differential Revision: https://reviews.llvm.org/D46641

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332837 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CVP] Require DomTree for new Pass Manager
David Green [Mon, 21 May 2018 11:06:28 +0000 (11:06 +0000)]
[CVP] Require DomTree for new Pass Manager

We were previously using a DT in CVP through SimplifyQuery, but not requiring it in
the new pass manager. Hence it would crash if DT was not already available. This now
gets DT directly and plumbs it through to where it is used (instead of using it
through SQ).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332836 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix up a few grammar issues.
Eric Christopher [Mon, 21 May 2018 10:27:36 +0000 (10:27 +0000)]
Fix up a few grammar issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332835 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips] Merge MipsLongBranch and MipsHazardSchedule passes
Aleksandar Beserminji [Mon, 21 May 2018 10:20:02 +0000 (10:20 +0000)]
[mips] Merge MipsLongBranch and MipsHazardSchedule passes

MipsLongBranchPass and MipsHazardSchedule passes are joined to one pass
because of mutual conflict. When MipsHazardSchedule inserts 'nop's, it
potentially breaks some jumps, so they have to be expanded to long
branches. When some branch is expanded to long branch, it potentially
creates a hazard situation, which should be fixed by adding nops.
New pass is called MipsBranchExpansion, it combines these two passes,
and runs them alternately until one of them reports no changes were made.

Differential Revision: https://reviews.llvm.org/D46641

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332834 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Support v4i32 rotations (PR37426)
Simon Pilgrim [Mon, 21 May 2018 09:45:59 +0000 (09:45 +0000)]
[X86][SSE] Support v4i32 rotations (PR37426)

As suggested by Fabian on PR37426, we can use PMULUDQ to perform v4i32 vector rotations as the upper 32bits of the multiply will contain the 'wrapped' bits of the rotation.

v8i16/v16i8 rotations would be straightforward to add to lowerRotate in the future - ideally we'd mostly share code with the vector shifts lowering.

Differential Revision: https://reviews.llvm.org/D46954

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332832 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agowin: try more to fix dia tests with newer msvc versions
Nico Weber [Mon, 21 May 2018 02:55:41 +0000 (02:55 +0000)]
win: try more to fix dia tests with newer msvc versions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332828 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agowin: try to fix dia tests with newer msvc versions
Nico Weber [Mon, 21 May 2018 02:09:57 +0000 (02:09 +0000)]
win: try to fix dia tests with newer msvc versions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332827 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LLVM-C] Improve Bindings For Aliases
Robert Widmann [Sun, 20 May 2018 23:49:08 +0000 (23:49 +0000)]
[LLVM-C] Improve Bindings For Aliases

Summary: Add wrappers for a module's alias iterators and a getter and setter for the aliasee value.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits, harlanhaskins

Differential Revision: https://reviews.llvm.org/D46808

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332826 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove mask arguments from permvar builtins/intrinsics. Use a select in IR...
Craig Topper [Sun, 20 May 2018 23:34:04 +0000 (23:34 +0000)]
[X86] Remove mask arguments from permvar builtins/intrinsics. Use a select in IR instead.

Someday maybe we'll use selects for all intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332824 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert 332750, llvm part (see comment on D46910).
Nico Weber [Sun, 20 May 2018 23:03:17 +0000 (23:03 +0000)]
Revert 332750, llvm part (see comment on D46910).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332823 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips] Add microMIPSR6 ll/sc instructions.
Simon Dardis [Sun, 20 May 2018 17:21:00 +0000 (17:21 +0000)]
[mips] Add microMIPSR6 ll/sc instructions.

Previously the compiler was using the microMIPSR3 variants, incorrectly.

Reviewers: atanasyan, abeserminji, smaksimovic

Differential Revision: https://reviews.llvm.org/D46948

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332820 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] choose 1 form of abs and nabs as canonical
Sanjay Patel [Sun, 20 May 2018 14:23:23 +0000 (14:23 +0000)]
[InstCombine] choose 1 form of abs and nabs as canonical

We already do this for min/max (see the blob above the diff),
so we should do the same for abs/nabs.
A sign-bit check (<s 0) is used as a predicate for other IR
transforms and it's likely the best for codegen.

This might solve the motivating cases for D47037 and D47041,
but I think those patches still make sense. We can't guarantee
this canonicalization if the icmp has more than one use.

Differential Revision: https://reviews.llvm.org/D47076

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332819 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[cmake] Add a switch to enable/disable bindings.
Vassil Vassilev [Sun, 20 May 2018 08:37:54 +0000 (08:37 +0000)]
[cmake] Add a switch to enable/disable bindings.

Differential Revision: https://reviews.llvm.org/D42026

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332816 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add test cases to show missed rotate opportunities due to SimplifyDemandedBits.
Craig Topper [Sun, 20 May 2018 02:32:45 +0000 (02:32 +0000)]
[X86] Add test cases to show missed rotate opportunities due to SimplifyDemandedBits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332815 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[GlobalMerge] Exit early if only one global is to be merged
Haicheng Wu [Sat, 19 May 2018 18:00:02 +0000 (18:00 +0000)]
[GlobalMerge] Exit early if only one global is to be merged

To save some compilation time and prevent some unnecessary changes.

Differential Revision: https://reviews.llvm.org/D46640

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332813 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRe-revert "[Option] Fix PR37006 prefix choice in findNearest"
Brian Gesiak [Sat, 19 May 2018 16:21:01 +0000 (16:21 +0000)]
Re-revert "[Option] Fix PR37006 prefix choice in findNearest"

Summary:
Reverting due to a test failure in an llvm-mt test on some buildbots, namely
http://green.lab.llvm.org/green/job/clang-stage2-configure-Rlto/26020/.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332812 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LLVM-C] Use Length-Providing Value Name Getters and Setters
Robert Widmann [Sat, 19 May 2018 15:08:36 +0000 (15:08 +0000)]
[LLVM-C] Use Length-Providing Value Name Getters and Setters

Summary:
- Provide LLVMGetValueName2 and LLVMSetValueName2 that return and take the length of the provided C string respectively
- Deprecate LLVMGetValueName and LLVMSetValueName

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits, harlanhaskins

Differential Revision: https://reviews.llvm.org/D46890

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332810 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[IRCE] Fix miscompile with range checks against negative values
Max Kazantsev [Sat, 19 May 2018 13:06:37 +0000 (13:06 +0000)]
[IRCE] Fix miscompile with range checks against negative values

In the patch rL329547, we have lifted the over-restrictive limitation on collected range
checks, allowing to work with range checks with the end of their range not being
provably non-negative. However it appeared that the non-negativity of this value was
assumed in the utility function `ClampedSubtract`. In particular, its reasoning is based
on the fact that `0 <= SINT_MAX - X`, which is not true if `X` is negative.

The function `ClampedSubtract` is only called twice, once with `X = 0` (which is OK)
and the second time with `X = IRC.getEnd()`, where we may now see the problem if
the end is actually a negative value. In this case, we may sometimes miscompile.

This patch is the conservative fix of the miscompile problem. Rather than rejecting
non-provably non-negative `getEnd()` values, we will check it for non-negativity in
runtime. For this, we use function `smax(smin(X, 0), -1) + 1` that is equal to `1` if `X`
is non-negative and is equal to 0 if `X` is negative. If we multiply `Begin, End` of safe
iteration space by this function calculated for `X = IRC.getEnd()`, we will get the original
`[Begin, End)` if `IRC.getEnd()` was non-negative (and, thus, `ClampedSubtract` worked
correctly) and the empty range `[0, 0)` in case if ` IRC.getEnd()` was negative.

So we in fact prohibit execution of the main loop if at least one of range checks was
made against a negative value (and we figured it out in runtime). It is still better than
what we have before (non-negativity had to be proved in compile time) and prevents
us from miscompile, however it is sometiles too restrictive for unsigned range checks
against a negative value (which in fact can be eliminated).

Once we re-implement `ClampedSubtract` in a way that it handles negative `X` correctly,
this limitation can be lifted, too.

Differential Revision: https://reviews.llvm.org/D46860
Reviewed By: samparker

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332809 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MergeICmps] Don't crash when memcmp is not available
Benjamin Kramer [Sat, 19 May 2018 12:51:59 +0000 (12:51 +0000)]
[MergeICmps] Don't crash when memcmp is not available

Fixes clang crashing with -fno-builtin, PR37527.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332808 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix MSVC unused variable warning. NFCI.
Simon Pilgrim [Sat, 19 May 2018 12:46:02 +0000 (12:46 +0000)]
Fix MSVC unused variable warning. NFCI.

AMDGPURegisterInfo::getSubRegFromChannel is a static method - we don't need to get the AMDGPURegisterInfo instance.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332807 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUn-revert "[Option] Fix PR37006 prefix choice in findNearest"
Brian Gesiak [Sat, 19 May 2018 12:03:26 +0000 (12:03 +0000)]
Un-revert "[Option] Fix PR37006 prefix choice in findNearest"

Summary:
In https://reviews.llvm.org/rL332804 I loosed the assertion in
the Clang driver test that forced me to revert
https://reviews.llvm.org/rL332299. Once this lands I should be
able to narrow down what caused PS4 buildbots to fail, and
reinstate the check in that test.

Test Plan: check-llvm & check-clang

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332805 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix build warning compiling TestPlugin on Windows and disable Passes plugin stuff...
Nico Weber [Sat, 19 May 2018 03:05:30 +0000 (03:05 +0000)]
Fix build warning compiling TestPlugin on Windows and disable Passes plugin stuff on Windows since it fundamentally can't work

Aaron Ballman reported that TestPlugin warned about it using exception handling
without /EHsc flag, and that llvmGetPassInfo() had conflicting export
attributes (dllimport in the header, dllexport in the source file).

/EHsc is because TestPlugin didn't use the llvm_ cmake functions, so
llvm_update_compile_flags didn't get called for the target
(llvm_update_compile_flags explicitly passes /Ehs-c-, which fixes the warning).
Use add_llvm_loadable_module instead of add_library(... MODULE) to fix this.
This also has the side effect of not building the plugin on Windows. That's not
a big problem, since before the plugin was built on Windows, but the test
didn't attempt to load it, due to -DLLVM_ENABLE_PLUGIN not being passed to
PluginsTests.cpp during compilation on Windows. This makes the plugin behavior
consistent with e.g. lib/Transforms/Hello/CMakeLists.txt. (This also
automatically sets LTDL_SHLIB_EXT correctly.)

The dllimport/dllexport warning is more serious: Since LLVM doesn't generally
use export annotations for its code, the only way the plugin could link was by
linking in some LLVM libraries both into the test and the dll, so the plugin
would call the llvm code in the dll instead of the copy in the main executable.
This means globals weren't shared, and things generally can't work. (I think
there's a build config where you can build a LLVM.dll which might work, but
that wasn't how the test was configured. If that config is used, the dll should
still be built, but I haven't checked).

Now that add_llvm_loadable_module is used, LLVM_LINK_COMPONENTS got linked into
both executable and plugin on posix too, so unset it after the executable so
that the plugin doesn't end up with a 2nd copy of things on posix.

https://reviews.llvm.org/D47082

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332796 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix evaluator for non-zero alloca addr space
Yaxun Liu [Sat, 19 May 2018 02:58:16 +0000 (02:58 +0000)]
Fix evaluator for non-zero alloca addr space

The evaluator goes through BB and creates global vars as temporary values to evaluate
results of LLVM instructions. It creates undef for alloca, however it assumes alloca
in addr space 0. If the next instruction is addrspace cast to 0, then we get an invalid
cast instruction.

This patch let the temp global var have an address space matching alloca addr space,
so that the valuation can be done.

Differential Revision: https://reviews.llvm.org/D47081

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332794 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoEnable colored diagnostics in ninja builds when building with gcc 4.9+.
Nico Weber [Sat, 19 May 2018 02:36:27 +0000 (02:36 +0000)]
Enable colored diagnostics in ninja builds when building with gcc 4.9+.

GCC has supported -fdiagnostics-color since 4.9.

https://reviews.llvm.org/D47083

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332793 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoPropagate nonnull and dereferenceable throught launder
Piotr Padlewski [Fri, 18 May 2018 23:54:33 +0000 (23:54 +0000)]
Propagate nonnull and dereferenceable throught launder

Summary:
invariant.group.launder should not stop propagation
of nonnull and dereferenceable, because e.g. we would not be
able to hoist loads speculatively.

Reviewers: rsmith, amharc, kuhar, xbolva00, hfinkel

Subscribers: hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D46972

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332788 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDissallow non-empty metadata for invariant.group
Piotr Padlewski [Fri, 18 May 2018 23:53:46 +0000 (23:53 +0000)]
Dissallow non-empty metadata for invariant.group

Summary:
This feature is not needed, but it might be usefull in the future
to use metadata to mark what which function should support it
(and strip it when not).

Reviewers: rsmith, sanjoy, amharc, kuhar

Subscribers: hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D45419

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332787 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoConstant fold launder of null and undef
Piotr Padlewski [Fri, 18 May 2018 23:52:57 +0000 (23:52 +0000)]
Constant fold launder of null and undef

Summary:
This might be useful because clang will add
some barriers for pointer comparisons.

Reviewers: majnemer, dberlin, hfinkel, nlewycky, davide, rsmith, amharc,
kuhar

Subscribers: davide, amharc, llvm-commits

Differential Revision: https://reviews.llvm.org/D32423

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332786 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MemDep] Fixed handling of invariant.group
Piotr Padlewski [Fri, 18 May 2018 22:40:34 +0000 (22:40 +0000)]
[MemDep] Fixed handling of invariant.group

Summary:
Memdep had funny bug related to invariant.groups - because it did not
invalidated cache, in some very rare cases it was possible to show memory
dependence of the instruction that was deleted, but because other
instruction took it's place it resulted in call to vtable!
Thanks @amharc for repro!.

Reviewers: dberlin, kuhar, amharc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D45320

Co-authored-by: Krzysztof Pszeniczny <krzysztof.pszeniczny@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332781 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[x86] add more FP with FMF simplification tests; NFC
Sanjay Patel [Fri, 18 May 2018 22:31:43 +0000 (22:31 +0000)]
[x86] add more FP with FMF simplification tests; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332780 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDAG: Fix crash on shift with large shift amounts
Matt Arsenault [Fri, 18 May 2018 21:54:16 +0000 (21:54 +0000)]
DAG: Fix crash on shift with large shift amounts

Fixes bug 37521.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332774 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFixing buildbot error introduced with r332759.
Wolfgang Pieb [Fri, 18 May 2018 21:44:28 +0000 (21:44 +0000)]
Fixing buildbot error introduced with r332759.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332772 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Add pass to optimize reqd_work_group_size
Matt Arsenault [Fri, 18 May 2018 21:35:00 +0000 (21:35 +0000)]
AMDGPU: Add pass to optimize reqd_work_group_size

Eliminate loads from the dispatch packet when they will have
a known value.

Also pattern match the code used by the library to handle partial
workgroup dispatches, which isn't necessary if reqd_work_group_size
is used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332771 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] Qualify a select pattern based transform to restrct to only min/max...
Craig Topper [Fri, 18 May 2018 21:21:56 +0000 (21:21 +0000)]
[InstCombine] Qualify a select pattern based transform to restrct to only min/max and ignore abs/nabs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332770 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Object: Add more error checking for object file reading
Sam Clegg [Fri, 18 May 2018 21:08:26 +0000 (21:08 +0000)]
[WebAssembly] Object: Add more error checking for object file reading

This should address some the assert failures the fuzzer has been
finding such as:
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6719

Differential Revision: https://reviews.llvm.org/D47046

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332769 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAddressing a couple of compiler warnings introduced with r332759.
Wolfgang Pieb [Fri, 18 May 2018 20:51:16 +0000 (20:51 +0000)]
Addressing a couple of compiler warnings introduced with r332759.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332766 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFixing build error introduced with r332759.
Wolfgang Pieb [Fri, 18 May 2018 20:35:13 +0000 (20:35 +0000)]
Fixing build error introduced with r332759.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332762 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[msan] Don't check divisor shadow in fdiv.
Evgeniy Stepanov [Fri, 18 May 2018 20:19:53 +0000 (20:19 +0000)]
[msan] Don't check divisor shadow in fdiv.

Summary:
Floating point division by zero or even undef does not have undefined
behavior and may occur due to optimizations.

Fixes https://bugs.llvm.org/show_bug.cgi?id=37523.

Reviewers: kcc

Subscribers: hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D47085

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332761 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARF v5] Improved support for .debug_rnglists (consumer). Enables any consumer to
Wolfgang Pieb [Fri, 18 May 2018 20:12:54 +0000 (20:12 +0000)]
[DWARF v5] Improved support for .debug_rnglists (consumer). Enables any consumer to
extract DWARF v5 encoded rangelists.

Reviewer: JDevlieghere

Differential Revision: https://reviews.llvm.org/D45549

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332759 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Change cast from r332739 to a static cast
Jessica Paquette [Fri, 18 May 2018 20:04:21 +0000 (20:04 +0000)]
[NFC] Change cast from r332739 to a static cast

The casts in the delta computation for size remarks should have
been static casts. This fixes that.

Thanks to Dávid Bolvanský for pointing that out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332758 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSupport: Simplify endian stream interface. NFCI.
Peter Collingbourne [Fri, 18 May 2018 19:46:24 +0000 (19:46 +0000)]
Support: Simplify endian stream interface. NFCI.

Provide some free functions to reduce verbosity of endian-writing
a single value, and replace the endianness template parameter with
a field.

Part of PR37466.

Differential Revision: https://reviews.llvm.org/D47032

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332757 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoadding baseline fp fold tests for unsafe on and off
Michael Berg [Fri, 18 May 2018 19:30:49 +0000 (19:30 +0000)]
adding baseline fp fold tests for unsafe on and off

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332756 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDelete a test that was missed in the revert r332747.
Amara Emerson [Fri, 18 May 2018 19:21:40 +0000 (19:21 +0000)]
Delete a test that was missed in the revert r332747.

r332747 originally reverted r332654 which added this test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332755 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU/NFC: Set symbol's type that is coming from an argument in
Konstantin Zhuravlyov [Fri, 18 May 2018 18:41:37 +0000 (18:41 +0000)]
AMDGPU/NFC: Set symbol's type that is coming from an argument in
EmitAMDGPUSymbolType, instead of hard-coding it to STT_AMDGPU_HSA_KERNEL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332753 91177308-0d34-0410-b5e6-96231b3b80d8