Commit Graph

127992 Commits

Author SHA1 Message Date
Tobias Grosser
bbe882c52c ScalarEvolution: Do not keep temporary PHI values in ValueExprMap
Before this patch simplified SCEV expressions for PHI nodes were only returned
the very first time getSCEV() was called, but later calls to getSCEV always
returned the non-simplified value, which had "temporarily" been stored in the
ValueExprMap, but was never removed and consequently blocked the caching of the
simplified PHI expression.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261485 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 17:42:10 +00:00
Sanjay Patel
fa7c411aab fix inaccurate comment; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261484 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 17:33:31 +00:00
Sanjay Patel
3c1ba0bbaa [InstCombine] add getNegativeIsTrueBoolVec() helper function; NFC
Originally part of:
http://reviews.llvm.org/D17485

We need this when simplifying masked memory ops too.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261483 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 17:29:33 +00:00
Sanjoy Das
1c5b38d20f Fix LLVM's handling and detection of skylake and cannonlake CPUs
Summary:
 - Rename `"skylake"` == SkylakeServerProc to `"skylake-avx512"`
 - Change `"skylake"` to denote SkylakeClientProc
 - Fix the detection of cpu family 6 and model 94 to be
   SkylakeClientProc instead of SkylakeServerProc
 - Remove the `"cnl"` for CannonLake

Reviewers: craig.topper, delena

Subscribers: zansari, echristo, qcolombet, RKSimon, spatel, DavidKreitzer, mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D17090

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261482 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 17:12:03 +00:00
Sanjoy Das
745f68cc1a [LoopDeletion] Add an assert that verifies LCSSA
This is inspired by PR24804 -- had this assert been there before,
isolating the root cause for PR24804 would have been far easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261481 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 17:11:59 +00:00
JF Bastien
31fee5e7e4 WebAssembly: update expected torture test failures
r261457 handles CopyToReg nodes with flag results in LowerCopyToReg, which was causing the SelectionDAGNodes assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261479 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 16:52:00 +00:00
Simon Pilgrim
9d73abc1df [InstCombine] Added SSE41 roundss/roundsd demanded vector elements invec tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261472 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 14:50:27 +00:00
Simon Pilgrim
f8acdf5d5a [InstCombine] Added XOP frczss/vfrczsd demanded vector elements tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261469 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 12:45:36 +00:00
Simon Pilgrim
12144eb2cc [InstCombine] Added SSE41 roundss/roundsd demanded vector elements tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261468 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 12:40:39 +00:00
Dan Gohman
a96dc7d5ad [WebAssembly] Support physical registers in the rewrite-to-discard optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261465 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 03:27:22 +00:00
Duncan P. N. Exon Smith
34cfdde1e9 IR: Add ConstantData, for operand-less Constants
Add a common parent `ConstantData` to the constants that have no
operands.  These are guaranteed to represent abstract data that is in no
way tied to a specific Module.

This is a good cleanup on its own.  It also makes it simpler to disallow
RAUW (and factor away use-lists) on these constants in the future.  (I
have some experimental patches that make RAUW illegal on ConstantData,
and they seem to catch a bunch of bugs...)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261464 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 02:39:49 +00:00
David Majnemer
9f1a234a23 Unbreak non-X86 targets from fallout caused by r261462
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261463 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 01:40:04 +00:00
David Majnemer
36935fd5b1 [X86] Use the correct alignment for COMDAT constant pool entries
COFF doesn't have sections with mergeable contents.  Instead, each
constant pool entry ends up in a COMDAT section.  The linker, when
choosing between COMDAT sections, doesn't choose the max alignment of
the two sections.  You just get whatever alignment was on the section.

If one constant needed a higher alignment in one object file from
another one, then we will get into trouble if the linker chooses the
lower alignment one.

Instead, lets promote the alignment of the constant pool entry to make
sure we don't use an under aligned constant with an instruction which
assumed otherwise.

This fixes PR26680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261462 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 01:30:30 +00:00
Simon Pilgrim
2e17dfddd0 [InstCombine] SSE/SSE2 (u)comiss/(u)comisd comparison intrinsics only use the lowest vector element
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261460 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 23:17:35 +00:00
Dan Gohman
98f8ef3a28 [WebAssembly] Refine a README.txt entry.
The register coloring pass may also need to be involved in order to
optimally sort registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261458 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 23:11:14 +00:00
Dan Gohman
772074148f [WebAssembly] Handle CopyToReg nodes with flag results in LowerCopyToReg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261457 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 23:09:44 +00:00
Simon Pilgrim
b8fb88e6c7 [InstCombine] Added SSE/SSE2 comparison intrinsics demanded vector elements tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261454 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 22:41:31 +00:00
Derek Schuff
545c0902d4 [WebAssembly] Write stack pointer back to memory when FP is used
The stack pointer is bumped when there is a frame pointer or when there
are static-size objects, but was only getting written back when there
were static-size objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261453 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 22:18:47 +00:00
Derek Schuff
37d3f7f35c [WebAssembly] Stackify function prologs and epilogs
The instructions are the same, but fewer locals are used.

Differential Revision: http://reviews.llvm.org/D17428

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 21:46:50 +00:00
Simon Pilgrim
51fba47bbf [InstCombine] Added some SSE/SSE2 demanded vector elements tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261451 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 21:44:48 +00:00
Dan Gohman
a85721f1e0 Don't scan for SSA register operands to update when not in SSA form.
TailDuplicate can run on either on SSA code or non-SSA code, as indicated to
it by MRI->isSSA() ("PreRegAlloc" here). TailDuplicate does extra work to
preserve SSA invariants when it duplicates code. This patch makes it skip
some of this extra work in the case where the code is not in SSA form.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261450 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 21:28:18 +00:00
Nemanja Ivanovic
530622611f Fix the build bot break caused by rL261441.
The patch has a necessary call to a function inside an assert. Which is fine
when you have asserts turned on. Not so much when they're off. Sorry about
the regression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261447 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 20:45:37 +00:00
Simon Pilgrim
0c3c1630db [X86][AVX] Added test case for PR22359
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261444 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 19:21:20 +00:00
Nemanja Ivanovic
3cf0c95d5c Fix for PR 26500
This patch corresponds to review:
http://reviews.llvm.org/D17294

It ensures that whatever block we are emitting the prologue/epilogue into, we
have the necessary scratch registers. It takes away the hard-coded register
numbers for use as scratch registers as registers that are guaranteed to be
available in the function prologue/epilogue are not guaranteed to be available
within the function body. Since we shrink-wrap, the prologue/epilogue may end
up in the function body.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261441 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 18:16:25 +00:00
Simon Pilgrim
2dd3aab7f2 [X86] Regenerated pr16360.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261440 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 17:56:45 +00:00
Simon Pilgrim
4bf4c0ce89 [X86][SSE41] More fast-isel intrinsics tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261439 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 17:30:37 +00:00
Simon Pilgrim
ab724ed2c7 [X86][SSE41] Added fast-isel intrinsics tests
As discussed on PR24580, this patch adds some (more to come) initial fast-isel codegen tests to match the IR generated in clang/test/CodeGen/sse41-builtins.c

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261438 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 17:11:32 +00:00
Simon Pilgrim
01ad432bbe [DAGCombiner] Use getBitcast helper when possible. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261437 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 15:05:29 +00:00
Simon Pilgrim
69aa7569c3 [X86][SSE] Fixed issue with commutation of 'faux unary' target shuffles (PR26667)
Fixed a bug introduced by D16683 when a binary shuffle is simplified to a unary shuffle (with undef/zero sentinel mask indices) - if this resulted in only the second input being used combineX86ShuffleChain failed to take this into account and still referenced the first input.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261434 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 14:39:45 +00:00
Simon Pilgrim
8ec0e3a580 [X86][SSE] Move all undef/zero cases before target shuffle combining.
First small step towards fixing PR26667 - we need to ensure that combineX86ShuffleChain only gets called with a valid shuffle input node (a similar issue was found in D17041).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261433 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 12:57:32 +00:00
Joerg Sonnenberger
e1ac460951 When MemoryDependenceAnalysis hits a CFG with many transparent blocks,
the algorithm easily degrades into quadratic memory and time complexity.
The easiest example is a long chain of BBs that don't otherwise use a
location. The caching will add an entry for every intermediate block and
limiting the number of results doesn't help as no results are produced
until a definition is found.

Introduce a limit similar to the existing instructions-per-block limit.
This limit counts the total number of blocks checked. If the limit is
reached, entries are considered unknown. The initial value is 1000,
which avoids regressions for normal sized functions while still
limiting edge cases to reasnable memory consumption and execution time.

Differential Revision: http://reviews.llvm.org/D16123


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 11:24:44 +00:00
Andrey Turetskiy
0f386b5a21 [X86] Enable the LEA optimization pass by default.
Differential Revision: http://reviews.llvm.org/D16877



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261429 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 11:11:55 +00:00
Andrey Turetskiy
40de4f189a [X86] PR26575: Fix LEA optimization pass (Part 2).
Handle address displacement operands of a type other than Immediate or Global in LEAs and load/stores.

Ref: https://llvm.org/bugs/show_bug.cgi?id=26575

Differential Revision: http://reviews.llvm.org/D17374



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261428 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 10:58:28 +00:00
Benjamin Kramer
660d7ba525 [SimplifyCFG] Use pointer identity to simplify predicate.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261427 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 10:40:42 +00:00
Benjamin Kramer
c377b3ca43 [LVI] Move ConstantRanges instead of copying.
No functional change intended. Copying small (<= 64 bits) APInts isn't
expensive but bloats code by generating the slow path everywhere. Moving
doesn't care about the size of the value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261426 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 10:40:34 +00:00
David Majnemer
92a8732c27 Move some code from doInitialization to runOnFunction
This has no observable behavior change, it just makes the state
insertion pass look a little more like normal passes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261420 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 07:34:21 +00:00
Craig Topper
f150810c18 [X86] Remove some unused encoding checks from the disassembler table building.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 06:20:21 +00:00
Craig Topper
b9e9ffa3b0 [X86] Add some missing reversed forms of XOP instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261417 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 06:20:17 +00:00
Chandler Carruth
3b19409119 [PM/AA] Wire up TBAA to the new pass manager's registry and test it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261411 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 04:04:52 +00:00
Chandler Carruth
580e466253 [PM/AA] Wire up the scoped-no-alias AA to the new pass manager's
registry and test it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261410 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 04:03:06 +00:00
Chandler Carruth
10ab5d9cac [PM/AA] Wire up SCEVAA to the new pass manager's registry and test it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261409 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 04:01:45 +00:00
Matthias Braun
3883deb9ef MachineCopyPropagation: Introduce Reg2MIMap typedef; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261408 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 03:56:41 +00:00
Matthias Braun
4f08db2396 MachineCopyPropagation: Move variables from function to pass
This avoids unnecessarily passing them around when calling helper
functions. It may also be slightly faster to call clear() on the
datastructures instead of freshly initializing them for each block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261407 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 03:56:39 +00:00
Matthias Braun
4d44c95a15 MachineCopyPropagation: Use ranged for, cleanup; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261406 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 03:56:36 +00:00
Matthias Braun
7975e02298 MachineCopyPropagation: Use assert() instead of if{report_error()} for 'impossible' condition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261405 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 03:56:33 +00:00
Chandler Carruth
10d9c2cec2 [PM/AA] Wire up CFLAA to the new pass manager fully, and port one of its
tests over to exercise this code.

This uncovered a few missing bits here and there in the analysis, but
nothing interesting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261404 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 03:52:02 +00:00
Chandler Carruth
89a08aa76a [PM/AA] Port alias analysis evaluator to the new pass manager, and use
it to actually test the new pass manager AA wiring.

This patch was extracted from the (somewhat too large) D12357 and
rebosed on top of the slightly different design of the new pass manager
AA wiring that I just landed. With this we can start testing the AA in
a thorough way with the new pass manager.

Some minor cleanups to the code in the pass was necessitated here, but
otherwise it is a very minimal change.

Differential Revision: http://reviews.llvm.org/D17372

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261403 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 03:46:03 +00:00
Mike Aizatsky
6e95686683 fixing msvc warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261396 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 02:11:49 +00:00
Sanjoy Das
3deef964da [SCEV] Don't spell SCEV * variables as Scev; NFC
I missed a spot in rL261393.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261395 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 01:59:15 +00:00
Sanjoy Das
2ed41bce79 [SCEV] Don't spell SCEV * variables as Scev; NFC
It reads odd since most other places name a `SCEV *` as `S`.  Pure
renaming change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261393 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 01:44:10 +00:00