145228 Commits

Author SHA1 Message Date
Sanjay Patel
e581944506 [InstCombine] add tests for trunc(shuffle X, C, M); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295513 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 23:16:54 +00:00
Matthias Braun
92e3dc4c50 AArch64LoadStoreOptimizer: Correctly clear kill flags
When promoting the Load of a Store-Load pair to a COPY all kill flags
between the store and the load need to be cleared.

rdar://30402435

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295512 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 23:15:03 +00:00
Simon Pilgrim
6bd44f2375 [X86] Add MOVBE targets to load combine tests
Test folded endian swap tests with MOVBE instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295508 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 23:00:21 +00:00
Guozhi Wei
4d5bc87951 [PPC] Give unaligned memory access lower cost on processor that supports it
Newer ppc supports unaligned memory access, it reduces the cost of unaligned memory access significantly. This patch handles this case in PPCTTIImpl::getMemoryOpCost.

This patch fixes pr31492.

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

This is resubmit of r292680, which was reverted by r293092. The internal application failures were actually caused by a source code bug.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295506 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 22:29:39 +00:00
Eugene Zelenko
06332794af [CodeGen] Revert changes in LowLevelType to pre-r295499 to fix broken buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295505 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 22:23:34 +00:00
Krzysztof Parzyszek
eee70a1f65 [Hexagon] Start using regmasks on calls
Reapply r295371 with a fix for the Windows bot failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295504 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 22:14:51 +00:00
Davide Italiano
4022d8a46d [NewGVN] isOnlyReachableViaThisEdge() is dead now. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295503 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 22:12:30 +00:00
Simon Pilgrim
4231bd0a9d [X86] Simplify by pulling out valuetype. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295502 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 22:10:10 +00:00
Eugene Zelenko
dc5aad66ca [CodeGen] Attempt to fix buildbots broken in r295499.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295501 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 22:07:26 +00:00
Davide Italiano
24976e5c1c [NewGVN] createVariableOrConstant is not required anymore. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295500 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 21:55:47 +00:00
Eugene Zelenko
ad3a5404cb [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295499 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 21:43:25 +00:00
Simon Pilgrim
fcd878d181 [X86] Add subborrow stack folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295496 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 21:16:24 +00:00
Sanjay Patel
69382f1737 [x86] add tests for sext (not bool); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295495 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 21:10:40 +00:00
Matthew Simpson
b82f5b8ba8 [LAA] Remove unused code (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295493 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 20:46:52 +00:00
Simon Pilgrim
d1ecc080dc [X86][SSE] Add (V)MOVD folding pattern with zextloadi64i32 load node.
Fixes PRPR31309

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295492 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 20:43:32 +00:00
Adrian Prantl
75f00d80fb Fix windows bots by locking down the target triple on this testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295490 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 20:02:26 +00:00
Matt Arsenault
0f6af2352e AMDGPU: Fix crashes on invalid icmp/fcmp intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295489 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 19:49:10 +00:00
Peter Collingbourne
063d4cbbef WholeProgramDevirt: For VCP use a 32-bit ConstantInt for the byte offset.
A future change will cause this byte offset to be inttoptr'd and then exported
via an absolute symbol. On the importing end we will expect the symbol to be
in range [0,2^32) so that it will fit into a 32-bit relocation. The problem
is that on 64-bit architectures if the offset is negative it will not be in
the correct range once we inttoptr it.

This change causes us to use a 32-bit integer so that it can be inttoptr'd
(which zero extends) into the correct range.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295487 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 19:43:45 +00:00
Adrian Prantl
7e8d980564 Debug Info: Sort frame index expressions before emitting them.
This fixes PR31381, which caused an assertion and/or invalid debug info.

This affects debug variables that have multiple fragments in the MMI
side (i.e.: in the stack frame) table.
rdar://problem/30571676

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295486 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 19:42:32 +00:00
Petr Hosek
8cea2afdc7 [CMake] Support externalizing debug info on non-Darwin platforms
On other platorms, we use objcopy to export the debug info.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295481 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 19:29:12 +00:00
Simon Pilgrim
b8890befb4 [X86][SHA] Add SHA stack folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295479 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 19:24:55 +00:00
Artyom Skrobov
b44e58377d In Thumb1 mode, the custom lowering for ARMISD::CMPZ could never emit tADDi3
Reviewers: jmolloy, t.p.northover

Reviewed By: t.p.northover

Subscribers: t.p.northover, aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295478 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 18:59:16 +00:00
Simon Pilgrim
2b1fc31e42 [X86][TBM] Add TBM stack folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295477 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 18:51:53 +00:00
Tim Northover
dc88467192 GlobalISel: verify that generic loads & stores have a mem operand.
The mem operand is used by GlobalISel to convey atomic constraints so dropping
it is invalid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295476 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 18:50:15 +00:00
Joel Jones
9053922e7e [AArch64] Add Cavium ThunderX support
This set of patches adds support for Cavium ThunderX ARM64 processors:

  * ThunderX
  * ThunderX T81
  * ThunderX T83
  * ThunderX T88

Patch by Stefan Teleman
Differential Revision: https://reviews.llvm.org/D28891


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295475 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 18:34:24 +00:00
Peter Collingbourne
72258b42b0 WholeProgramDevirt: Examine the function body when deciding whether functions are readnone.
The goal is to get an analysis result even for de-refineable functions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295472 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 18:17:04 +00:00
Simon Pilgrim
c60bc7e2e2 [X86][BMI] Add BMI2 stack folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295470 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 18:00:43 +00:00
Peter Collingbourne
4f50278f40 opt: Rename -default-data-layout flag to -data-layout and make it always override the layout.
There isn't much point in a flag that only works if the data layout is empty.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295468 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 17:36:52 +00:00
Justin Bogner
67d9e19554 OptDiag: Rename DiagnosticInfoWithDebugLoc to WithLocation. NFC
This generalizes the name in preparation for decoupling the concept
from DebugLoc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295465 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 17:34:37 +00:00
Rui Ueyama
a24db2314e MC/COFF: Do not emit forward associative section referenceds.
MSVC link.exe cannot handle associative sections that refer later
sections in the section header. Technically, such COFF object doesn't
violate the Microsoft COFF spec, as the spec doesn't say anything
about that, but still we should avoid doing that to make it compatible
with MS tools.

This patch assigns smaller section numbers to non-associative sections
and larger numbers to associative sections. This should resolve the
compatibility issue.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295464 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 17:32:54 +00:00
Sanjay Patel
ad529eb8da [DAGCombiner] split i1 select-of-constants from non-i1 case; NFCI
I can't find any tests of the non-i1 code path, so it may be unnecessary at this point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295463 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 17:13:27 +00:00
Simon Pilgrim
d7ab0f5278 [X86][BMI] Add BMI stack folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295462 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 17:11:00 +00:00
Sanjay Patel
b2823d3d6d [PowerPC] add tests for select-of-constants; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295460 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 16:43:43 +00:00
Sanjay Patel
879db07ab4 [ARM] add tests for select-of-constants; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295459 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 16:34:13 +00:00
Matthew Simpson
132a62ceff [LV] Remove constant restriction for vector phi creation
We previously only created a vector phi node for an induction variable if its
step had a constant integer type. However, the step actually only needs to be
loop-invariant. We only handle inductions having loop-invariant steps, so this
patch should enable vector phi node creation for all integer induction
variables that will be vectorized.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295456 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 16:09:07 +00:00
Simon Pilgrim
c00b7d61ca Fix signed/unsigned comparison warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295453 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 16:01:16 +00:00
Sam Parker
50a37dcbc4 [ARM] Replace HasT2ExtractPack with HasDSP
Removed the HasT2ExtractPack feature and replaced its references
with HasDSP. This then allows the Thumb2 extend instructions to be
selected for ARMv8M +dsp. These instruction descriptions have also
been refactored and more target tests have been added for their isel.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295452 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 15:42:44 +00:00
Simon Pilgrim
2566cbcc53 [DAGCombine] Recognise any_extend_vector_inreg and truncation style shuffle masks
During legalization we are often creating shuffles (via a build_vector scalarization stage) that are "any_extend_vector_inreg" style masks, and also other masks that are the equivalent of "truncate_vector_inreg" (if we had such a thing).

This patch is an attempt to match these cases to help undo the effects of just leaving shuffle lowering to handle it - which typically means we lose track of the undefined elements of the shuffles resulting in an unnecessary extension+truncation stage for widened illegal types.

The 2011-10-21-widen-cmp.ll regression will be fixed by making SIGN_EXTEND_VECTOR_IN_REG legal in SSE instead of lowering them to X86ISD::VSEXT (PR31712).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295451 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 15:14:48 +00:00
Sanjay Patel
0ccd702d61 [DAGCombiner] improve readability; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295447 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 14:21:59 +00:00
Diana Picus
35af78a713 [ARM] GlobalISel: Clean up some helpers
Return invalid opcodes when some of the helpers in the instruction selection
pass can't handle a given combination.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295446 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 13:44:19 +00:00
Diana Picus
02bf0b05c5 [ARM] GlobalISel: Check mappings used by reg bank select
Add some asserts to make sure we're using the mappings that we think we're
using. This is to keep us from accidentally breaking functionality while moving
to TableGen'erated mappings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295441 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 13:14:25 +00:00
Diana Picus
404e2a5ae0 [ARM] GlobalISel: Use Subtarget in Legalizer
Start using the Subtarget to make decisions about what's legal. In particular,
we only mark floating point operations as legal if we have VFP2, which is
something we should've done from the very start.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295439 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 11:25:17 +00:00
Diana Picus
44c483f838 [ARM] GlobalISel: Add end-to-end tests for double
Test some really basic functionality through the whole GlobalISel pipeline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295438 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 11:25:11 +00:00
Ismail Donmez
f93e288abc Update Bugzilla URLs in docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295432 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 08:26:11 +00:00
Eugene Leviant
6684504281 InstCombine: fix extraction when performing vector/array punning
Differential revision: https://reviews.llvm.org/D29491


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295429 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 07:36:03 +00:00
Craig Topper
ff64e4651d [IR][X86] Simplify some AutoUpgrade code slightly. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295426 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 07:07:24 +00:00
Craig Topper
33dd89087d [IR][X86] Rename an AutoUpgrade helper function to more accurately match what intrinsics it handles. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295425 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 07:07:21 +00:00
Craig Topper
aace5e8709 [IR][X86] Move X86 specific portions of UpgradeIntrinsicFunction1 to a couple helper functions. NFC
This enables some early outs to avoid repeatedly using IsX86 check to qualify. I hope to continue to improve this to shorten the lengths of some of the string comparisons.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295424 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 07:07:19 +00:00
Andrew Wilkins
733bbece62 Go binding: Add methods for missing PassManagerBuilder C APIs
Patch by Ryuichi Hayashida!

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295420 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 05:41:05 +00:00
Sanjoy Das
56ccc1cdbf [JumpThreading] Re-enable JumpThreading for guards
Summary:
JumpThreading for guards feature has been reverted at https://reviews.llvm.org/rL295200
due to the following problem: the feature used the following algorithm for detection of
diamond patters:

1. Find a block with 2 predecessors;
2. Check that these blocks have a common single parent;
3. Check that the parent's terminator is a branch instruction.

The problem is that these checks are insufficient. They may pass for a non-diamond
construction in case if those two predecessors are actually the same block. This may
happen if parent's terminator is a br (either conditional or unconditional) to a block
that ends with "switch" instruction with exactly two branches going to one block.

This patch re-enables the JumpThreading for guards and fixes this issue by adding the
check that those found predecessors are actually different blocks. This guarantees that
parent's terminator is a conditional branch with exactly 2 different successors, which
is now ensured by assertions. It also adds two more tests for this situation (with parent's
terminator being a conditional and an unconditional branch).

Patch by Max Kazantsev!

Reviewers: anna, sanjoy, reames

Reviewed By: sanjoy

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295410 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 04:21:14 +00:00