Commit Graph

138280 Commits

Author SHA1 Message Date
Igor Breger
990fea5450 [AVX512] Fix pattern for vgetmantsd and all other instructions that use same class. Fix memory operand size, remove unnecessary pattern.
Differential Revision: http://reviews.llvm.org/D24443

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281164 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-11 12:38:46 +00:00
James Molloy
d6506897fb Fixup failing debuginfo test for change in SimplifyCFG.
This reverts this test back to its original pre-r280364 behaviour as we don't sink allocas any more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-11 09:13:32 +00:00
James Molloy
05bbcbdafe [SimplifyCFG] Be even more conservative in SinkThenElseCodeToEnd
This should *actually* fix PR30244. This cranks up the workaround for PR30188 so that we never sink loads or stores of allocas.

The idea is that these should be removed by SROA/Mem2Reg, and any movement of them may well confuse SROA or just cause unwanted code churn. It's not ideal that the midend should be crippled like this, but that unwanted churn can really cause significant regressions in important workloads (tsan).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281162 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-11 09:00:03 +00:00
James Molloy
16d9e13298 [AArch64] Fixup test after r281160
How I missed this locally is beyond me. I suspect llc didn't recompile. This is just changing the CHECK line back to what it was before r280364.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-11 08:24:04 +00:00
James Molloy
3daf6c830e [SimplifyCFG] Harden up the profitability heuristic for block splitting during sinking
Exposed by PR30244, we will split a block currently if we think we can sink at least one instruction. However this isn't right - the reason we split predecessors is so that we can sink instructions that otherwise couldn't be sunk because it isn't safe to do so - stores, for example.

So, change the heuristic to only split if it thinks it can sink at least one non-speculatable instruction.

Should fix PR30244.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281160 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-11 08:07:30 +00:00
Craig Topper
2628aff566 [CodeGen] Make the TwoAddressInstructionPass check if the instruction is commutable before calling findCommutedOpIndices for every operand. Also make sure the operand is a register before each call to save some work on commutable instructions that might have an operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281158 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-11 06:00:15 +00:00
Craig Topper
d3eebe7daf [AVX-512] Add test cases to demonstrate opportunities for commuting vpternlog. Commuting will be added in a future commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-11 05:33:43 +00:00
Craig Topper
3679bfe301 [AVX-512] Add VPTERNLOG to load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281156 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-11 05:33:40 +00:00
Craig Topper
88c0b88fbf [X86] Side effecting asm in AVX512 integer stack folding test should return 2 x i64 not 8 x i64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281155 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-11 05:33:38 +00:00
Craig Topper
a3215a2e29 [X86] Make a helper method into a static function local to the cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281154 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-11 05:33:35 +00:00
Justin Lebar
362611f381 Add handling of !invariant.load to PropagateMetadata.
Summary:
This will let e.g. the load/store vectorizer propagate this metadata
appropriately.

Reviewers: arsenm

Subscribers: tra, jholewinski, hfinkel, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281153 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-11 01:39:08 +00:00
Justin Lebar
877859e49f [NVPTX] Use ldg for explicitly invariant loads.
Summary:
With this change (plus some changes to prevent !invariant from being
clobbered within llvm), clang will be able to model the __ldg CUDA
builtin as an invariant load, rather than as a target-specific llvm
intrinsic.  This will let the optimizer play with these loads --
specifically, we should be able to vectorize them in the load-store
vectorizer.

Reviewers: tra

Subscribers: jholewinski, hfinkel, llvm-commits, chandlerc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-11 01:39:04 +00:00
Justin Lebar
c71d5b41ef [CodeGen] Split out the notions of MI invariance and MI dereferenceability.
Summary:
An IR load can be invariant, dereferenceable, neither, or both.  But
currently, MI's notion of invariance is IR-invariant &&
IR-dereferenceable.

This patch splits up the notions of invariance and dereferenceability at
the MI level.  It's NFC, so adds some probably-unnecessary
"is-dereferenceable" checks, which we can remove later if desired.

Reviewers: chandlerc, tstellarAMD

Subscribers: jholewinski, arsenm, nemanjai, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281151 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-11 01:38:58 +00:00
Sjoerd Meijer
d9a1d02b59 MCInstrDesc: Flags (uint64_t) was checked using (1 << MCID::XYZ), but this
should have been (1ULL << MCID::XYZ). Currently this works because enum Flag
has 31 values, but extending it will result in a compile warnings/errors.
This was part of the accepted patch in https://reviews.llvm.org/D23601, but
it was suggested to apply this first as a separate patch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 20:54:19 +00:00
Arnold Schwaighofer
10c97f029a It should also be legal to pass a swifterror parameter to a call as a swifterror
argument.

rdar://28233388

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 19:42:53 +00:00
Vedant Kumar
a8edd76b0e [llvm-cov] Move the 'jump to first unexecuted line' link
Having it in the same row as the source name is jarring. Move it next to
the "Source" column label.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281146 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 19:37:26 +00:00
Vedant Kumar
ce19c1cc95 [llvm-cov] Minor visual tweaks for html reports
- Change the location of the 'Region Coverage' column.
  - Use less css and text for some labels.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 19:37:20 +00:00
Arnold Schwaighofer
17648b37ae InstCombine: Don't combine loads/stores from swifterror to a new type
This generates invalid IR: the only users of swifterror can be call
arguments, loads, and stores.

rdar://28242257

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281144 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 18:14:57 +00:00
Arnold Schwaighofer
df708a504e Add an isSwiftError predicate to Value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 18:14:54 +00:00
Duncan P. N. Exon Smith
2b4de8077f ADT: Move ilist_node_access to ilist_detail::NodeAccess...
... and make a few ilist-internal API changes, in preparation for
changing how ilist_node is templated.  The only effect for ilist users
should be changing the friend target from llvm::ilist_node_access to
llvm::ilist_detail::NodeAccess (which is only necessary when they
inherit privately from ilist_node).
- Split out SpecificNodeAccess, which has overloads of getNodePtr and
  getValuePtr that are untemplated.
- Use more typedefs to prevent more changes later.
- Force inheritance to use *NodeAccess (to emphasize that ilist *users*
  shouldn't be doing this).

There should be no functionality change here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281142 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 16:55:06 +00:00
Duncan P. N. Exon Smith
631d14e644 ADT: Use typedefs for ilist_base and ilist_node_base, NFC
This is a prep commit to minimize changes in a follow-up that is adding
a template parameter to ilist_node_base and ilist_base.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281141 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 16:28:52 +00:00
Sanjay Patel
e117e50653 [InstCombine] clean up foldICmpBinOpEqualityWithConstant / foldICmpIntrinsicWithConstant ; NFC
1. Rename variables to be consistent with related/preceding code (may want to reorganize).
2. Fix comments/formatting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281140 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 15:33:39 +00:00
Sanjay Patel
792a8eaf8c [InstCombine] rename and reorganize some icmp folding functions; NFC
Everything under foldICmpInstWithConstant() should now be working for
splat vectors via m_APInt matchers. Ie, I've removed all of the FIXMEs
that I added while cleaning that section up. Note that not all of the
associated FIXMEs in the regression tests are gone though, because some
of the tests require earlier folds that are still scalar-only. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281139 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 15:03:44 +00:00
Arnold Schwaighofer
14e6992bf4 We also need to pass swifterror in R12 under swiftcc not only under ccc
rdar://28190687

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281138 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 14:16:55 +00:00
Valery Pykhtin
c220fde748 [AMDGPU] Refactor MUBUF/MTBUF instructions
Differential revision: https://reviews.llvm.org/D24295

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281137 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 13:09:16 +00:00
Teresa Johnson
68d7a57aba [gold/LTO] Add test case for r281134
Add test case that was supposed to go in with r281134.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281135 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 06:18:17 +00:00
Teresa Johnson
2752a28acf [LTO] Handle null GV in Symbol object
Similar to other Symbol methods, have Symbol::getComdat handle
a null GV gracefully.

Fixes PR30326.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281134 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 06:15:26 +00:00
Heejin Ahn
b7ef2005d1 [WebAssembly] Fix typos in comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 02:33:47 +00:00
Kostya Serebryany
05082bd46a [libFuzzer] print a failed-merge warning only in the merge mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 02:17:22 +00:00
Matt Arsenault
10eb5d500c AMDGPU: Implement is{LoadFrom|StoreTo}FrameIndex
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281128 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 01:20:33 +00:00
Matt Arsenault
da28e63a74 AMDGPU: Fix scheduling info for spill pseudos
These defaulted to Write32Bit. I don't think this actually matters
since these don't exist during scheduling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281127 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 01:20:28 +00:00
Vitaly Buka
c4644d2241 [asan] Add flag to allow lifetime analysis of problematic allocas
Summary:
Could be useful for comparison when we suspect that alloca was skipped
because of this.

Reviewers: eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281126 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 01:06:11 +00:00
Justin Lebar
e7555f0b3e [CodeGen] Rename MachineInstr::isInvariantLoad to isDereferenceableInvariantLoad. NFC
Summary:
I want to separate out the notions of invariance and dereferenceability
at the MI level, so that they correspond to the equivalent concepts at
the IR level.  (Currently an MI load is MI-invariant iff it's
IR-invariant and IR-dereferenceable.)

First step is renaming this function.

Reviewers: chandlerc

Subscribers: MatzeB, jfb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281125 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 01:03:20 +00:00
Kostya Serebryany
74ad0cfa1d [libFuzzer] don't print help for internal flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281124 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 00:35:30 +00:00
Kostya Serebryany
7942244fd1 [libFuzzer] print a visible message if merge fails due to a crash
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281122 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 00:15:41 +00:00
Vedant Kumar
1c3a1e2e3a Remove dead code in the SelectionDAG headers (NFC)
I tested this with "ninja check-llvm-codegen" on a Release build with
all architectures enabled, and again with a Debug build on x86.

Found with llvm-cov.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281120 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 00:05:19 +00:00
Matt Arsenault
3843a1382e AMDGPU: Fix immediate folding logic when shrinking instructions
If the literal is being folded into src0, it doesn't matter
if it's an SGPR because it's being replaced with the literal.

Also fixes initially selecting 32-bit versions of some instructions
which also confused commuting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281117 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 23:32:53 +00:00
Arnold Schwaighofer
8ad92ff220 Inliner: Don't mark swifterror allocas with lifetime markers
This would create a bitcast use which fails the verifier: swifterror values may
only be used by loads, stores, and as function arguments.

rdar://28233244

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281114 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 22:40:27 +00:00
Hans Wennborg
b6bf353d37 X86: Fold tail calls into conditional branches also for 64-bit (PR26302)
This extends the optimization in r280832 to also work for 64-bit. The only
quirk is that we can't do this for 64-bit Windows (yet).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281113 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 22:37:27 +00:00
Matt Arsenault
d5a5e9043a AMDGPU: Run LoadStoreVectorizer pass by default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281112 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 22:29:28 +00:00
Kostya Serebryany
2c9e9a6439 [libFuzzer] use sizeof() in tests instead of 4 and 8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281111 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 22:21:16 +00:00
Matt Arsenault
7474f828e2 LSV: Fix incorrectly increasing alignment
If the unaligned access has a dynamic offset, it may be odd which
would make the adjusted alignment incorrect to use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281110 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 22:20:14 +00:00
Davide Italiano
586b77778c [gold] Test that we handle invalid directory correctly.
I had this test sitting around for a while but always forgot to
commit. Rafael reviewed it a while ago.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281109 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 22:14:57 +00:00
Sanjay Patel
1a60ab87dc [InstCombine] use m_APInt to allow icmp ult X, C folds for splat constant vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281107 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 21:59:37 +00:00
Kostya Serebryany
fb49dafc05 [libFuzzer] one more puzzle for value profile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281106 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 21:58:42 +00:00
Simon Pilgrim
6bca1ae005 [X86][XOP] Fix VPERMIL2PD mask creation on 32-bit targets
Use getConstVector helper to correctly create v2i64/v4i64 constants on 32-bit targets

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281105 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 21:47:21 +00:00
Krzysztof Parzyszek
60719d620c [Hexagon] Fix disassembler crash after r279255
When p0 was added as an explicit operand to the duplex subinstructions,
the disassembler was not updated to reflect this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281104 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 21:45:00 +00:00
Michael Kuperstein
b0cab112ed [X86] Regenerate test. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281099 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 21:36:17 +00:00
Justin Lebar
d9c5bfba17 Enable in-tree builds of parallel-libs.
Summary:
parallel-libs needs its own changes to make this work; these are just
the LLVM changes.

Reviewers: jhen

Subscribers: llvm-commits, beanz, jprice

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281097 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 21:34:12 +00:00
Arnold Schwaighofer
65ddbeccd7 Create phi nodes for swifterror values at the end of the phi instructions list
ISel makes assumption about the order of phi nodes.

rdar://28190150

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281095 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 21:18:47 +00:00