1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
Commit Graph

137879 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith
2a55cf5af8 ADT: Add sentinel tracking and custom tags to ilists
This adds two declarative configuration options for intrusive lists
(available for simple_ilist, iplist, and ilist).  Both of these options
affect ilist_node interoperability and need to be passed both to the
node and the list.  Instead of adding a new traits class, they're
specified as optional template parameters (in any order).

The two options:

 1. Pass ilist_sentinel_tracking<true> or ilist_sentinel_tracking<false>
    to control whether there's a bit on ilist_node "prev" pointer
    indicating whether it's the sentinel.  The default behaviour is to
    use a bit if and only if LLVM_ENABLE_ABI_BREAKING_CHECKS.

 2. Pass ilist_tag<TagA> and ilist_tag<TagB> to allow insertion of a
    single node into two different lists (simultaneously).

I have an immediate use-case for (1) ilist_sentinel_tracking: fixing the
validation semantics of MachineBasicBlock::reverse_iterator to match
ilist::reverse_iterator (ala r280032: see the comments at the end of the
commit message there).  I'm adding (2) ilist_tag in the same commit to
validate that the options framework supports expansion.  Justin Bogner
mentioned this might enable a possible cleanup in SelectionDAG, but I'll
leave this to others to explore.  In the meantime, the unit tests and
the comments for simple_ilist and ilist_node have usage examples.

Note that there's a layer of indirection to support optional,
out-of-order, template paramaters.  Internal classes are templated on an
instantiation of the non-variadic ilist_detail::node_options.
User-facing classes use ilist_detail::compute_node_options to compute
the correct instantiation of ilist_detail::node_options.

The comments for ilist_detail::is_valid_option describe how to add new
options (e.g., ilist_packed_int<int NumBits>).

llvm-svn: 281167
2016-09-11 16:20:53 +00:00
Igor Breger
ceb721fec8 [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

llvm-svn: 281164
2016-09-11 12:38:46 +00:00
James Molloy
34cb1bea15 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.

llvm-svn: 281163
2016-09-11 09:13:32 +00:00
James Molloy
594231af66 [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).

llvm-svn: 281162
2016-09-11 09:00:03 +00:00
James Molloy
fd13fd8906 [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.

llvm-svn: 281161
2016-09-11 08:24:04 +00:00
James Molloy
2629049216 [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.

llvm-svn: 281160
2016-09-11 08:07:30 +00:00
Craig Topper
b329ac0116 [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.
llvm-svn: 281158
2016-09-11 06:00:15 +00:00
Craig Topper
9976008bed [AVX-512] Add test cases to demonstrate opportunities for commuting vpternlog. Commuting will be added in a future commit.
llvm-svn: 281157
2016-09-11 05:33:43 +00:00
Craig Topper
2c2cdf8b5b [AVX-512] Add VPTERNLOG to load folding tables.
llvm-svn: 281156
2016-09-11 05:33:40 +00:00
Craig Topper
13f517955f [X86] Side effecting asm in AVX512 integer stack folding test should return 2 x i64 not 8 x i64.
llvm-svn: 281155
2016-09-11 05:33:38 +00:00
Craig Topper
5a5860d7da [X86] Make a helper method into a static function local to the cpp file.
llvm-svn: 281154
2016-09-11 05:33:35 +00:00
Justin Lebar
2c71fc8bb7 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

llvm-svn: 281153
2016-09-11 01:39:08 +00:00
Justin Lebar
1c4f697044 [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

llvm-svn: 281152
2016-09-11 01:39:04 +00:00
Justin Lebar
4da986389b [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

llvm-svn: 281151
2016-09-11 01:38:58 +00:00
Sjoerd Meijer
54586e3681 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.

llvm-svn: 281149
2016-09-10 20:54:19 +00:00
Arnold Schwaighofer
7d4fb4b444 It should also be legal to pass a swifterror parameter to a call as a swifterror
argument.

rdar://28233388

llvm-svn: 281147
2016-09-10 19:42:53 +00:00
Vedant Kumar
4bbe59f1bf [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.

llvm-svn: 281146
2016-09-10 19:37:26 +00:00
Vedant Kumar
af0bdcc9ae [llvm-cov] Minor visual tweaks for html reports
- Change the location of the 'Region Coverage' column.
  - Use less css and text for some labels.

llvm-svn: 281145
2016-09-10 19:37:20 +00:00
Arnold Schwaighofer
3f1847d944 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

llvm-svn: 281144
2016-09-10 18:14:57 +00:00
Arnold Schwaighofer
8781da1527 Add an isSwiftError predicate to Value
llvm-svn: 281143
2016-09-10 18:14:54 +00:00
Duncan P. N. Exon Smith
997810cad7 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.

llvm-svn: 281142
2016-09-10 16:55:06 +00:00
Duncan P. N. Exon Smith
8080a7d548 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.

llvm-svn: 281141
2016-09-10 16:28:52 +00:00
Sanjay Patel
62efe46df3 [InstCombine] clean up foldICmpBinOpEqualityWithConstant / foldICmpIntrinsicWithConstant ; NFC
1. Rename variables to be consistent with related/preceding code (may want to reorganize).
2. Fix comments/formatting.

llvm-svn: 281140
2016-09-10 15:33:39 +00:00
Sanjay Patel
442c03406f [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. 

llvm-svn: 281139
2016-09-10 15:03:44 +00:00
Arnold Schwaighofer
6c2abdd13e We also need to pass swifterror in R12 under swiftcc not only under ccc
rdar://28190687

llvm-svn: 281138
2016-09-10 14:16:55 +00:00
Valery Pykhtin
6c39a922ef [AMDGPU] Refactor MUBUF/MTBUF instructions
Differential revision: https://reviews.llvm.org/D24295

llvm-svn: 281137
2016-09-10 13:09:16 +00:00
Teresa Johnson
ba1250b754 [gold/LTO] Add test case for r281134
Add test case that was supposed to go in with r281134.

llvm-svn: 281135
2016-09-10 06:18:17 +00:00
Teresa Johnson
420dade831 [LTO] Handle null GV in Symbol object
Similar to other Symbol methods, have Symbol::getComdat handle
a null GV gracefully.

Fixes PR30326.

llvm-svn: 281134
2016-09-10 06:15:26 +00:00
Heejin Ahn
28d3201799 [WebAssembly] Fix typos in comments
llvm-svn: 281131
2016-09-10 02:33:47 +00:00
Kostya Serebryany
25c312c38e [libFuzzer] print a failed-merge warning only in the merge mode
llvm-svn: 281130
2016-09-10 02:17:22 +00:00
Matt Arsenault
e16ffe6fc0 AMDGPU: Implement is{LoadFrom|StoreTo}FrameIndex
llvm-svn: 281128
2016-09-10 01:20:33 +00:00
Matt Arsenault
05929eb705 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.

llvm-svn: 281127
2016-09-10 01:20:28 +00:00
Vitaly Buka
a4466b6459 [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

llvm-svn: 281126
2016-09-10 01:06:11 +00:00
Justin Lebar
92b88c51c6 [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

llvm-svn: 281125
2016-09-10 01:03:20 +00:00
Kostya Serebryany
6727e0c36f [libFuzzer] don't print help for internal flags
llvm-svn: 281124
2016-09-10 00:35:30 +00:00
Kostya Serebryany
6b8560d5a5 [libFuzzer] print a visible message if merge fails due to a crash
llvm-svn: 281122
2016-09-10 00:15:41 +00:00
Vedant Kumar
26dd41655c 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

llvm-svn: 281120
2016-09-10 00:05:19 +00:00
Matt Arsenault
33e593fd71 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.

llvm-svn: 281117
2016-09-09 23:32:53 +00:00
Arnold Schwaighofer
5e10e55c23 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

llvm-svn: 281114
2016-09-09 22:40:27 +00:00
Hans Wennborg
154bdaabd9 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

llvm-svn: 281113
2016-09-09 22:37:27 +00:00
Matt Arsenault
a2689a506d AMDGPU: Run LoadStoreVectorizer pass by default
llvm-svn: 281112
2016-09-09 22:29:28 +00:00
Kostya Serebryany
afd27e1acc [libFuzzer] use sizeof() in tests instead of 4 and 8
llvm-svn: 281111
2016-09-09 22:21:16 +00:00
Matt Arsenault
e90cd7a703 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.

llvm-svn: 281110
2016-09-09 22:20:14 +00:00
Davide Italiano
7a01c4cc95 [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

llvm-svn: 281109
2016-09-09 22:14:57 +00:00
Sanjay Patel
7ac4d9da2f [InstCombine] use m_APInt to allow icmp ult X, C folds for splat constant vectors
llvm-svn: 281107
2016-09-09 21:59:37 +00:00
Kostya Serebryany
f3e050c251 [libFuzzer] one more puzzle for value profile
llvm-svn: 281106
2016-09-09 21:58:42 +00:00
Simon Pilgrim
9062fe6d1d [X86][XOP] Fix VPERMIL2PD mask creation on 32-bit targets
Use getConstVector helper to correctly create v2i64/v4i64 constants on 32-bit targets

llvm-svn: 281105
2016-09-09 21:47:21 +00:00
Krzysztof Parzyszek
1f843c813e [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.

llvm-svn: 281104
2016-09-09 21:45:00 +00:00
Michael Kuperstein
5c9c400510 [X86] Regenerate test. NFC.
llvm-svn: 281099
2016-09-09 21:36:17 +00:00
Justin Lebar
5fc80062d7 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

llvm-svn: 281097
2016-09-09 21:34:12 +00:00