Commit Graph

157836 Commits

Author SHA1 Message Date
Max Kazantsev 0c3c7c5485 [SCEV][NFC] Check NoWrap flags before lexicographical comparison of SCEVs
Lexicographical comparison of SCEV trees is potentially expensive for big
expression trees. We can define ordering between them for AddRecs and
N-ary operations by SCEV NoWrap flags to make non-equality check
cheaper.

This change does not prevent grouping eqivalent SCEVs together and is
not supposed to have any meaningful impact on behavior of any transforms.


Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D40645


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 12:44:56 +00:00
Simon Dardis ce85eebf50 [mips] Fix definition of 'bc' instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319888 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 12:42:49 +00:00
Simon Pilgrim 735383658c [X86][AVX512] Tag Mask<->Vector instructions scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319887 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 11:59:05 +00:00
Francis Visoiu Mistrih 1c29733efc [CodeGen] Fix formatting error from r319885
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319886 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 11:57:53 +00:00
Francis Visoiu Mistrih f8f387e25d [CodeGen] Better handling of detached MachineOperands
Basically use getMFIfAvailable to check if we can crawl up to the
function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319885 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 11:55:42 +00:00
Simon Pilgrim 54b4a2e265 [X86][AVX512] Cleanup scalar move scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 11:23:13 +00:00
Mikael Holmen 3371137454 [[Machine]Dominators] Improved printout when verifyDomTree fails [NFC]
Include the function name in the printout.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319882 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 09:27:48 +00:00
Max Kazantsev 3126a95a41 [SCEV][NFC] Share value cache between SCEVs in GroupByComplexity
Current implementation of `compareSCEVComplexity` is being unreasonable with `SCEVUnknown`s:
every time it sees one, it creates a new value cache and tries to prove equality of two values using it.
This cache reallocates and gets lost from SCEV to SCEV.

This patch changes this behavior: now we create one cache for all values and share it between SCEVs.

Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D40597


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319880 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 08:58:16 +00:00
Craig Topper 4fe5c0ae02 [X86] Split 512-bit vector extends from types other than vXi1 out of LowerZERO_EXTEND_AVX512/LowerSIGN_EXTEND_AVX512. NFCI
Most of the code in these routines is for handling extends from vXi1 types. The 512-bit handling for other extends is very much like the AVX2 code. So make the special routines just do vXi1 types and move the other 512-bit handling to the place that handles AVX2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 07:37:20 +00:00
Hans Wennborg d5bd8eeafe Revert r319482 and r319483 "[memcpyopt] Teach memcpyopt to optimize across basic blocks"
This caused PR35519.

> [memcpyopt] Teach memcpyopt to optimize across basic blocks
>
> This teaches memcpyopt to make a non-local memdep query when a local query
> indicates that the dependency is non-local. This notably allows it to
> eliminate many more llvm.memcpy calls in common Rust code, often by 20-30%.
>
> Fixes PR28958.
>
> Differential Revision: https://reviews.llvm.org/D38374
>

> [memcpyopt] Commit file missed in r319482.
>
> This change was meant to be included with r319482 but was accidentally
> omitted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319873 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 01:47:55 +00:00
Derek Schuff f07b02f909 [WebAssembly] Only emit stack pointer delcaration in BinFormatWasm assembly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 01:38:29 +00:00
Vlad Tsyrklevich 1679b1f7f4 Revert "[DAGCombine] Move AND nodes to multiple load leaves"
This reverts commit r319773. It was causing some buildbots to hang, e.g.
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/5589

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319867 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 01:16:08 +00:00
Derek Schuff 6569ecbe34 [WebAssembly] Fix test breakage from r319810
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 01:02:44 +00:00
Zachary Turner 304f979205 Regex out the local hash comparison test.
Since the local hash is a different number of bytes depending
on host architecture, we don't have a consistent value.  I
will need to re-do this test for both x86 and x64.  For now
it accepts any value for the local hash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 00:58:12 +00:00
Zachary Turner b6f5a8c1da Fix error in llvm-pdbutil.
A recent change made this print the wrong value, breaking some
tests.  This is now fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319862 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 00:26:43 +00:00
Craig Topper 0e4bd39365 [X86] Update to getSetCCResultType to be more robust to EVT types.
Attempt to determine what the type will be legalized to and then analyze that to see if we will be able to use a vXi1 compare.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319861 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 00:15:17 +00:00
Zachary Turner 7c192eec2f Teach llvm-pdbutil to dump types from object files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 23:58:18 +00:00
Zachary Turner 0b3e8d4de3 Fix -Wmissing-braces error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319855 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 23:19:33 +00:00
Zachary Turner 381f58e1f7 [CodeView] Add support for content hashing CodeView type records.
Currently nothing uses this, but this at least gets the core
algorithm in, and adds some test to demonstrate correctness.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 23:08:58 +00:00
Craig Topper a2f5d23fa3 [SelectionDAG] Don't promote the condition operand of VSELECT when promoting the result.
The condition operand should be promoted during operand promotion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319853 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 23:08:32 +00:00
Craig Topper 3acab960e9 [SelectionDAG] Don't promote mask operand when widening mstore and mscatter.
If the mask needs to be promoted that should occur by the legalizer detecting the mask operand needs to be promoted not as a side effect of another action.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319852 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 23:08:30 +00:00
Craig Topper 9d01325551 [SelectionDAG] Don't promote mask when splitting mstore.
If the mask needs to be promoted it should be handled by operand promotion after the result is legalized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319851 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 23:08:28 +00:00
Craig Topper e01b61f389 [SelectionDAG] Don't promote mask operands of MGATHER and MLOAD to setcc result type while widening the result. Just widen the mask.
The mask will be promoted if necessary when operands are promoted. It's possible the mask type is legal, but the setcc result type is a different. We shouldn't promote to the setcc result type unless the mask needs to be promoted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319850 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 23:08:27 +00:00
Craig Topper 73a2d50703 [SelectionDAG] Don't call GetWidenedVector for mask operands of MLOAD/MSTORE.
GetWidenedVector does't guarantee the widened elements are zero which would break the intended behavior of the operation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319849 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 23:08:25 +00:00
Lang Hames 8bedc46d5a [Orc] (Hopefully) Fix a missing typedef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319845 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 22:14:35 +00:00
Xinliang David Li 4f7feb41e5 Revert r319794: [PGO] detect infinite loop and form MST properly: memory leak problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319841 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 21:54:01 +00:00
Shoaib Meenai 4a6bb5316a [CMake] Use PRIVATE in target_link_libraries for executables
We currently use target_link_libraries without an explicit scope
specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables.
Dependencies added in this way apply to both the target and its
dependencies, i.e. they become part of the executable's link interface
and are transitive.

Transitive dependencies generally don't make sense for executables,
since you wouldn't normally be linking against an executable. This also
causes issues for generating install export files when using
LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM
library dependencies, which are currently added as interface
dependencies. If clang is in the distribution components but the LLVM
libraries it depends on aren't (which is a perfectly legitimate use case
if the LLVM libraries are being built static and there are therefore no
run-time dependencies on them), CMake will complain about the LLVM
libraries not being in export set when attempting to generate the
install export file for clang. This is reasonable behavior on CMake's
part, and the right thing is for LLVM's build system to explicitly use
PRIVATE dependencies for executables.

Unfortunately, CMake doesn't allow you to mix and match the keyword and
non-keyword target_link_libraries signatures for a single target; i.e.,
if a single call to target_link_libraries for a particular target uses
one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must
also be updated to use those keywords. This means we must do this change
in a single shot. I also fully expect to have missed some instances; I
tested by enabling all the projects in the monorepo (except dragonegg),
and configuring both with and without shared libraries, on both Darwin
and Linux, but I'm planning to rely on the buildbots for other
configurations (since it should be pretty easy to fix those).

Even after this change, we still have a lot of target_link_libraries
calls that don't specify a scope keyword, mostly for shared libraries.
I'm thinking about addressing those in a follow-up, but that's a
separate change IMO.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 21:49:56 +00:00
Lang Hames 96cfeb3474 [Orc] Add a SymbolStringPool data structure for efficient storage and fast
comparison of symbol names.

SymbolStringPool is a thread-safe string pool that will be used in upcoming Orc
APIs to facilitate efficient storage and fast comparison of symbol name strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319839 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 21:44:56 +00:00
Anna Thomas 9f563b480d [SafepointIRVerifier] Allow deriving pointers from unrelocated base
Summary:
This patch allows to use derived pointers (GEPs/bitcasts) of unrelocated
base pointers. We care only about the uses of these derived pointers.

It is acheived by two changes:
1. When we have enough information to say if the pointer is unrelocated at some
point or not, we walk all BBs to remove from their Contributions all valid defs
of unrelocated pointers (GEP with unrelocated base or bitcast of unrelocated
pointer).
2. When it comes to verification we just ignore instructions that were removed
at stage 1.

Patch by Daniil Suchkov!

Reviewers: anna, reames, apilipenko, mkazantsev

Reviewed By: anna, mkazantsev

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319838 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 21:39:37 +00:00
Joel Galenson 555994d8cf [AArch64] Do not abort if overflow check does not use EQ or NE.
As suggested by Eli Friedman, instead of aborting if an overflow check
uses something other than SETEQ or SETNE, simply do not apply the
optimization.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319837 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 21:33:12 +00:00
Simon Pilgrim 6ba130a469 [X86][AVX512] Tag BLENDM instruction scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319833 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 21:05:25 +00:00
Alina Sbirlea 60eb316ba4 [ModRefInfo] Initialize ArgMask to MRI_NoModRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319831 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 20:51:20 +00:00
Simon Pilgrim 668022c80f [X86][AVX512] Tag GATHER/SCATTER instruction scheduler classes
NOTE: At the moment these use the WriteLoad/WriteStore classes, which severely underestimates the costs. This needs to be reviewed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319829 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 20:47:11 +00:00
Paul Robinson 67f873792b [DWARFv5] Emit v5 line table header.
Differential Revision: https://reviews.llvm.org/D40741

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319827 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 20:35:00 +00:00
Matt Arsenault dc79c646e7 AMDGPU: Fix SDWA crash on inline asm
This was only searching for explicit defs,
and asserting for any implicit or variadic
instruction defs, like inline asm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319826 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 20:32:01 +00:00
Hans Wennborg e33d953bea Re-commit r319490 "XOR the frame pointer with the stack cookie when protecting the stack"
The patch originally broke Chromium (crbug.com/791714) due to its failing to
specify that the new pseudo instructions clobber EFLAGS. This commit fixes
that.

> Summary: This strengthens the guard and matches MSVC.
>
> Reviewers: hans, etienneb
>
> Subscribers: hiraditya, JDevlieghere, vlad.tsyrklevich, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D40622

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319824 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 20:22:20 +00:00
Simon Pilgrim aa1ccb63b4 [X86][AVX512] Tag VPSLLDQ/VPSRLDQ instruction scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319822 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 20:16:22 +00:00
Alina Sbirlea a2d30e9740 Modify ModRefInfo values using static inline method abstractions [NFC].
Summary:
The aim is to make ModRefInfo checks and changes more intuitive
and less error prone using inline methods that abstract the bit operations.

Ideally ModRefInfo would become an enum class, but that change will require
a wider set of changes into FunctionModRefBehavior.

Reviewers: sanjoy, george.burgess.iv, dberlin, hfinkel

Subscribers: nlopes, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319821 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 20:12:23 +00:00
Ulrich Weigand b7cbf75ecd [SystemZ] Validate shifted compare value in adjustForTestUnderMask
When folding a shift into a test-under-mask comparison, make sure that
there is no loss of precision when creating the shifted comparison
value.  This usually never happens, except for certain always-true
comparisons in unoptimized code.

Fixes PR35529.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319818 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 19:42:07 +00:00
Simon Pilgrim 952471eaa5 [X86][AVX512] Tag VPTRUNC/VPMOVSX/VPMOVZX instruction scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319815 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 19:21:28 +00:00
Dan Gohman ca99fdb493 [WebAssembly] Make stack-pointer imports mutable.
This is not currently valid by the wasm spec, however:
 - It replaces doing set_global on an immutable global, which is also
   not valid.
 - It's expected be valid in the near future:
   https://github.com/WebAssembly/threads/blob/master/proposals/threads/Globals.md
 - This only occurs before linking, so a fully linked object will be
   valid.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319810 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 18:29:48 +00:00
Rafael Espindola ec5581ccd5 Simplify test.
It can use attrib instead of icacls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319809 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 18:26:23 +00:00
Matt Arsenault 30bcf2f789 AMDGPU: Fix infinite loop with dbg_value
Surprisingly SIOptimizeExecMaskingPreRA can infinite loop
in some case with DBG_VALUE. Most tests using dbg_value are
run at -O0, so don't run this pass. This seems to only
happen when the value argument is undef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319808 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 18:23:17 +00:00
Joel Galenson 2bfaf4d2f2 [CVP] Remove some {s|u}sub.with.overflow checks.
This uses ConstantRange::makeGuaranteedNoWrapRegion's newly-added handling for subtraction to allow CVP to remove some subtraction overflow checks.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319807 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 18:14:24 +00:00
Joel Galenson 0e19a2ac5c [ConstantRange] Support subtraction in makeGuaranteedNoWrapRegion.
Previously ConstantRange::makeGuaranteedNoWrapRegion only handled addition.  This adds support for subtraction.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319806 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 18:14:23 +00:00
Simon Pilgrim 05c71a9ebe [X86][X87] Tag FCMOV instruction scheduler classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319804 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 18:01:26 +00:00
Joel Galenson 0e002d4cd0 Test commit.
I removed a space at the end of a comment.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319803 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 17:59:07 +00:00
Craig Topper 394c6e8c3c [SelectionDAG] Remove the code that handles SETCC with a scalar result type from vector widening.
There's no such thing as a setcc with vector operands and scalar result. And if we're trying to widen the result we would have to already be looking at a vector result type.

So this patch renames the VSETCC function as the SETCC function and delete the original SETCC function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319799 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 17:37:19 +00:00
Craig Topper b0c5aec965 [SelectionDAG] Remove unused method declaration.
The method implementation was removed in r318982.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319798 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 17:37:17 +00:00
Dan Gohman f07a1d491b [WebAssembly] Implement WASM_STACK_POINTER.
Use the .stack_pointer directive to implement WASM_STACK_POINTER for
specifying a global variable to be the stack pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319797 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 17:23:43 +00:00