1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

147525 Commits

Author SHA1 Message Date
Sanjay Patel
b5aa609c8f [InstCombine] add tests to show missing transforms for vectors; NFC
llvm-svn: 300401
2017-04-15 17:50:45 +00:00
Eric Christopher
e61ac3a6fa Tidy checking for the soft float attribute.
llvm-svn: 300394
2017-04-15 06:14:52 +00:00
Eric Christopher
bdb7a110e3 Cache the DataLayout rather than looking it up frequently.
llvm-svn: 300393
2017-04-15 06:14:50 +00:00
Vedant Kumar
f7f1e6f3b0 [ProfileData] Unify getInstrProf*SectionName helpers
This is a version of D32090 that unifies all of the
`getInstrProf*SectionName` helper functions. (Note: the build failures
which D32090 would have addressed were fixed with r300352.)

We should unify these helper functions because they are hard to use in
their current form. E.g we recently introduced more helpers to fix
section naming for COFF files. This scheme doesn't totally succeed at
hiding low-level details about section naming, so we should switch to an
API that is easier to maintain.

This is not an NFC commit because it fixes llvm-cov's testing support
for COFF files (this falls out of the API change naturally). This is an
area where we lack tests -- I will see about adding one as a follow up.

Testing: check-clang, check-profile, check-llvm.

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

llvm-svn: 300381
2017-04-15 00:09:57 +00:00
Sanjoy Das
0bffb56cbe Generalize SCEV's unit testing helper a bit
llvm-svn: 300379
2017-04-14 23:47:53 +00:00
Craig Topper
cd8117d229 [InstCombine] MakeAnd/Or/Xor handling to reuse previous APInt computations
When checking if we should return a constant, we create some temporary APInts to see if we know all bits. But the exact computations we do are needed in several other locations in the same code.

This patch moves them to named temporaries so we can reuse them.

Ideally we'd write directly to KnownZero/One, but we currently seem to only write those variables after all the simplifications checks and I didn't want to change that with this patch.

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

llvm-svn: 300376
2017-04-14 22:34:14 +00:00
Krzysztof Parzyszek
aed8b27acf [RDF] No longer ignore implicit defs or uses on any instructions
This used to be a Hexagon-specific treatment, but is no longer needed
since it's switched to subregister liveness tracking.

llvm-svn: 300369
2017-04-14 21:19:17 +00:00
Krzysztof Parzyszek
9e9071e73b [RDF] Correctly enumerate reg units for reg masks
llvm-svn: 300368
2017-04-14 21:17:36 +00:00
Reid Kleckner
4559e65607 [IR] Make paramHasAttr to use arg indices instead of attr indices
This avoids the confusing 'CS.paramHasAttr(ArgNo + 1, Foo)' pattern.

Previously we were testing return value attributes with index 0, so I
introduced hasReturnAttr() for that use case.

llvm-svn: 300367
2017-04-14 20:19:02 +00:00
Kostya Serebryany
d5742c5e2f [libFuzzer] more trophies
llvm-svn: 300366
2017-04-14 20:11:16 +00:00
Sam Clegg
c688dd181f [WebAssembly] Improve readobj and nm support for wasm
Now that the libObect support for wasm is better we can
have readobj and nm produce more useful output too.

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

llvm-svn: 300365
2017-04-14 19:50:44 +00:00
Sanjay Patel
0ee9395084 [InstCombine] (X != C1 && X != C2) --> (X | (C1 ^ C2)) != C2
...when C1 differs from C2 by one bit and C1 <u C2:
http://rise4fun.com/Alive/Vuo

And move related folds to a helper function. This reduces code duplication and
will make it easier to remove the scalar-only restriction as a follow-up step.

llvm-svn: 300364
2017-04-14 19:23:50 +00:00
Craig Topper
c7fb97cbfb [InstCombine] Support folding a subtract with a constant LHS into a phi node
We currently only support folding a subtract into a select but not a PHI. This fixes that.

I had to fix an assumption in FoldOpIntoPhi that assumed the PHI node was always in operand 0. Now we pass it in like we do for FoldOpIntoSelect. But we still require some dancing to find the Constant when we create the BinOp or ConstantExpr. This is based code is similar to what we do for selects.

Since I touched all call sites, this also renames FoldOpIntoPhi to foldOpIntoPhi to match coding standards.

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

llvm-svn: 300363
2017-04-14 19:20:12 +00:00
Stanislav Mekhanoshin
88109db935 [AMDGPU] set read_only access qualifier for pointers
If a kernel's pointer argument is known to be readonly
set access qualifier accordingly. This allows RT not to
flush caches before dispatches.

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

llvm-svn: 300362
2017-04-14 19:11:40 +00:00
Sam Clegg
c6336dc89e [Test commit] Cleanup some whitespace in a test file
llvm-svn: 300361
2017-04-14 18:43:57 +00:00
Craig Topper
0d05d07ce6 [InstCombine] Regenerate test checks using script. NFC
llvm-svn: 300360
2017-04-14 18:42:55 +00:00
Sanjay Patel
16a355b82e [InstCombine] add/move tests for and/or-of-icmps equality folds; NFC
llvm-svn: 300357
2017-04-14 18:19:27 +00:00
Craig Topper
9f4fbdf31c [ValueTracking] Avoid undefined behavior in unittest by not making a named ArrayRef from a std::initializer_list
One of the ValueTracking unittests creates a named ArrayRef initialized by a std::initializer_list. The underlying array for an std::initializer_list is only guaranteed to have a lifetime as long as the initializer_list object itself. So this can leave the ArrayRef pointing at an array that no long exists.

This fixes this to just create an explicit array instead of an ArrayRef.

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

llvm-svn: 300354
2017-04-14 17:59:19 +00:00
Craig Topper
db2aa19818 [InstCombine] Refactor SimplifyUsingDistributiveLaws to more explicitly skip code when LHS/RHS aren't BinaryOperators
Currently this code always makes 2 or 3 calls to tryFactorization regardless of whether the LHS/RHS are BinaryOperators. We make 3 calls when both operands are BinaryOperators with the same opcode. Or surprisingly, when neither are BinaryOperators. This is because getBinOpsForFactorization returns Instruction::BinaryOpsEnd when the operand is not a BinaryOperator. If both LHS and RHS are not BinaryOperators then they both have an Opcode of Instruction::BinaryOpsEnd. When this happens we rely on tryFactorization to early out due to A/B/C/D being null. Similar behavior occurs for the other calls, we rely on getBinOpsForFactorization having made A/B or C/D null to get tryFactorization to early out.

We also rely on these null checks to check the result of getIdentityValue and early out for it.

This patches refactors this to pull these checks up to SimplifyUsingDistributiveLaws so we don't rely on BinaryOpsEnd as a sentinel or this A/B/C/D null behavior. I think this makes this code easier to reason about. Should also give a tiny performance improvement for cases where the LHS or RHS isn't a BinaryOperator.

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

llvm-svn: 300353
2017-04-14 17:55:41 +00:00
Xinliang David Li
570e723e27 [Profile] Make host tool aware of object format when quering prof section names
Differential Revision: https://reviews.llvm.org/D32073

llvm-svn: 300352
2017-04-14 17:48:40 +00:00
Alexey Bataev
97ed6e3f71 Update tests for the patch.
llvm-svn: 300351
2017-04-14 17:47:07 +00:00
Sanjoy Das
92b8cc5ba4 Use range-for in a few places
llvm-svn: 300350
2017-04-14 17:42:12 +00:00
Sanjoy Das
1f713d1714 Rewrite SCEV Normalization using SCEVRewriteVisitor; NFC
Removes all of the boilerplate, cache management etc. from
ScalarEvolutionNormalization, and keeps only the interesting bits.

llvm-svn: 300349
2017-04-14 17:42:10 +00:00
Sanjoy Das
4cb94a54f8 Make SCEVRewriteVisitor smarter about when it trys to create SCEVs
This change really saves just one foldingset lookup, but makes
SCEVRewriteVisitor "feature compatible" with the handwritten logic in
ScalarEvolutionNormalization, so that I can change
ScalarEvolutionNormalization to use SCEVRewriteVisitor in a next step.

This is a non-functional change, but _may_ improve performance in some
pathological cases, but that's unlikely.

llvm-svn: 300348
2017-04-14 17:42:08 +00:00
Sanjoy Das
71137cbf95 Add missing #include
Again, caught by the modules build.

llvm-svn: 300346
2017-04-14 17:25:23 +00:00
Krzysztof Parzyszek
c1cf83f198 [RDF] Switch RegisterAggr to a bit vector of register units
This avoids many complications related to the complex register
aliasing schemes.

llvm-svn: 300345
2017-04-14 17:25:13 +00:00
Davide Italiano
8bebf84b80 [FunctionImport] assert(false) -> llvm_unreachable(). NFCI.
llvm-svn: 300344
2017-04-14 17:22:02 +00:00
Sanjoy Das
f09e32fa8e Remove "#if 0"ed out assert
It won't compile after the recent changes I've made, and I think
keeping it in provides very little value.

Instead I've added (in an earlier commit) a C++ unit test to check the
Denormalize(Normalized(X)) == X property for specific instances of X,
which is what the assert was trying to do anyway.

llvm-svn: 300339
2017-04-14 16:47:15 +00:00
Sanjoy Das
b6700ea2a3 Delete some unnecessary boilerplate
The PostIncTransform class was not pulling its weight, so delete it
and use free functions instead.

This also makes the use of `function_ref` more idiomatic.  We were
storing an instance of function_ref in the PostIncTransform class
before, which was fine in that specific case, but the usage after this
change is more obviously okay.

llvm-svn: 300338
2017-04-14 16:47:12 +00:00
Krzysztof Parzyszek
285c2b971f [RDF] Refine propagation of reached uses in liveness computation
llvm-svn: 300337
2017-04-14 16:33:54 +00:00
Sanjoy Das
eb79217a3d Add missing #include for STLExtras
Looks like earlier I was relying on #include ordering in files that
used ScalarEvolutionNormalization.h.

Found thanks to the selfhost modules buildbot!

llvm-svn: 300336
2017-04-14 16:28:12 +00:00
Krzysztof Parzyszek
2e3f24ec68 [Hexagon] Fix a latent problem with interpreting live-in lane masks
A non-zero lane mask on a register with no subregister means that the
whole register is live-in. It is equivalent to a full mask.

llvm-svn: 300335
2017-04-14 16:21:55 +00:00
Sanjoy Das
4291207cc3 Use range for
llvm-svn: 300334
2017-04-14 15:50:19 +00:00
Sanjoy Das
775ce85c07 Simplify PostIncTransform further; NFC
Instead of having two ways to check if an add recurrence needs to be
normalized, just pass in one predicate to decide that.

llvm-svn: 300333
2017-04-14 15:50:07 +00:00
Sanjoy Das
01c58fa721 Add a unit test for SCEV Normalization
llvm-svn: 300332
2017-04-14 15:50:04 +00:00
Sanjoy Das
b2e0a6b244 Tighten the API for ScalarEvolutionNormalization
llvm-svn: 300331
2017-04-14 15:49:59 +00:00
Sanjoy Das
fdafc30cdf Remove NormalizeAutodetect; NFC
It is cleaner to have a callback based system where the logic of
whether an add recurrence is normalized or not lives on IVUsers.

This is one step in a multi-step cleanup.

llvm-svn: 300330
2017-04-14 15:49:53 +00:00
Krzysztof Parzyszek
07bb6fb214 [Hexagon] Make a couple of passes compliant with -opt-bisect-limit
llvm-svn: 300329
2017-04-14 15:26:34 +00:00
Simon Pilgrim
bd37bb219c [Bugpoint] Use boolean AND instead of bitwise AND (PR32660)
llvm-svn: 300327
2017-04-14 15:21:15 +00:00
Simon Pilgrim
b9c453fa71 [X86][SSE] Update MOVNTDQA non-temporal loads to generic implementation (LLVM)
MOVNTDQA non-temporal aligned vector loads can be correctly represented using generic builtin loads, allowing us to remove the existing x86 intrinsics.

Clang companion patch: D31766.

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

llvm-svn: 300325
2017-04-14 15:05:35 +00:00
Nirav Dave
d3933303ce Fix missing virtual destructor to silence build warning.
llvm-svn: 300322
2017-04-14 13:34:33 +00:00
Nirav Dave
47d12567a7 Reorder StoreMergeCandidates to run faster. NFCI.
llvm-svn: 300321
2017-04-14 13:34:30 +00:00
Dmitry Preobrazhensky
9bd8e9fbd7 [AMDGPU][MC] Corrected ds_write_src2_* to require one offset instead of two.
Fixed bug 32551: https://bugs.llvm.org//show_bug.cgi?id=32551

Reviewers: vpykhtin

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

llvm-svn: 300319
2017-04-14 12:28:07 +00:00
Dmitry Preobrazhensky
63a8489fb5 [AMDGPU][MC] Enabled constants for src operands of s_cbranch_g_fork
Fixed bug 32619: https://bugs.llvm.org//show_bug.cgi?id=32619

Reviewers: artem.tamazov, vpykhtin

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

llvm-svn: 300318
2017-04-14 11:52:26 +00:00
Andrew V. Tischenko
b3affaff92 Fix for PR#30562: Selection DAG error: Detected cycle in SelectionDAG.
Patch by Dinar Temirbulatov

llvm-svn: 300314
2017-04-14 09:17:09 +00:00
Alex Denisov
33468a4953 Add more test cases for StringRef::edit_distance
Example strings taken from here: http://www.let.rug.nl/~kleiweg/lev/

llvm-svn: 300312
2017-04-14 08:34:32 +00:00
Andrew V. Tischenko
b1cf1f0925 This patch closes PR#32216: Better testing of schedule model instruction latencies/throughputs.
The details are here: https://reviews.llvm.org/D30941

llvm-svn: 300311
2017-04-14 07:44:23 +00:00
Gil Rapaport
f30248c36d [LV] Remove implicit single basic block assumption
This patch is part of D28975's breakdown - no change in output intended.

LV's code currently assumes the vectorized loop is a single basic block up
until predicateInstructions() is called. This patch removes two manifestations
of this assumption (loop phi incoming values, dominator tree update) by
replacing the use of vectorLoopBody with the vectorized loop's latch/header.

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

llvm-svn: 300310
2017-04-14 07:30:23 +00:00
Craig Topper
52e32986b7 [ValueTracking] Calculate the KnownZeros for Intrinsic::ctpop without using a temporary APInt to count leading zeros on.
The APInt was created from an 'unsigned' and we just wanted to know how many bits the value needed to represent it. We can just use Log2_32 from MathExtras.h to get the info.

llvm-svn: 300309
2017-04-14 06:43:34 +00:00
Craig Topper
638a04cde2 [ValueTracking] Use APInt::isNegative(). NFC
llvm-svn: 300308
2017-04-14 06:43:32 +00:00