summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* [InstSimplify] add tests for fcmp with known-never-nan operands; NFCSanjay Patel2019-06-061-2/+46
| | | | llvm-svn: 362742
* [InlineCost] Add support for unary fneg.Craig Topper2019-06-061-0/+31
| | | | | | | | | | This adds support for unary fneg based on the implementation of BinaryOperator without the soft float FP cost. Previously we would just delegate to visitUnaryInstruction. I think the only real change is that we will pass the FastMath flags to SimplifyFNeg now. Differential Revision: https://reviews.llvm.org/D62699 llvm-svn: 362732
* [LoopPred] Fix a bug in unconditional latch bailout introduced in r362284Philip Reames2019-06-061-0/+26
| | | | | | This is a really silly bug that even a simple test w/an unconditional latch would have caught. I tried to guard against the case, but put it in the wrong if check. Oops. llvm-svn: 362727
* [InstCombine] add tests for loads of bitcasted vector pointer; NFCSanjay Patel2019-06-061-0/+90
| | | | llvm-svn: 362703
* Revert "[SCEV] Use wrap flags in InsertBinop"Benjamin Kramer2019-06-0625-50/+50
| | | | | | This reverts commit r362687. Miscompiles llvm-profdata during selfhost. llvm-svn: 362699
* [SCEV] Use wrap flags in InsertBinopSam Parker2019-06-0625-50/+50
| | | | | | | | | | If the given SCEVExpr has no (un)signed flags attached to it, transfer these to the resulting instruction or use them to find an existing instruction. Differential Revision: https://reviews.llvm.org/D61934 llvm-svn: 362687
* [EarlyCSE] Add tests for negated min/max/abs [NFC]Joseph Tremoulet2019-06-051-0/+102
| | | | | | | | | | | | | | | | | | Summary: I'm planning to update the hashing logic to recognize their equivalence in a subsequent change (D62644). Reviewers: spatel Reviewed By: spatel Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62918 llvm-svn: 362657
* NewGVN: Handle addrspacecastMatt Arsenault2019-06-051-0/+108
| | | | | | | | | | The AllConstant check needs to be moved out of the if/else if chain to avoid a test regression. The "there is no SimplifyZExt" comment puzzles me, since there is SimplifyCastInst. Additionally, the Simplify* calls seem to not see the operand as constant, so this needs to be tried if the simplify failed. llvm-svn: 362653
* InstCombine: correctly change byval type attribute alongside call args.Tim Northover2019-06-051-0/+24
| | | | | | | | When the byval attribute has a type, it must match the pointee type of any parameter; but InstCombine was not updating the attribute when folding casts of various kinds away. llvm-svn: 362643
* [NFC][Reassociate] Fix mistake in 468b2adCameron McInally2019-06-051-10/+8
| | | | | | Missed 2 'fast fsub(0.0,X) -> fneg(X)' changes. llvm-svn: 362631
* [NFC][Reassociate] Add unary fneg tests to fast-basictest.llCameron McInally2019-06-051-0/+69
| | | | llvm-svn: 362630
* [Tests] Add poison inference tests for indvars showing both existing ↵Philip Reames2019-06-051-0/+369
| | | | | | transforms, and some room for improvement llvm-svn: 362628
* [NFC][Reassociate] Regenerate CHECKs for fast-basictest.llCameron McInally2019-06-051-15/+15
| | | | llvm-svn: 362627
* [SLP] Fix regression in broadcasts caused by operand reordering patch D59973.Dinar Temirbulatov2019-06-051-29/+29
| | | | | | | | | | | | This patch fixes a regression caused by the operand reordering refactoring patch https://reviews.llvm.org/D59973 . The fix changes the strategy to Splat instead of Opcode, if broadcast opportunities are found. Please see the lit test for some examples. Committed on behalf of @vporpo (Vasileios Porpodas) Differential Revision: https://reviews.llvm.org/D62427 llvm-svn: 362613
* Resubmit "[CorrelatedValuePropagation] Fix prof branch_weights metadata ↵Yevgeny Rouban2019-06-051-0/+119
| | | | | | | | | | | | | | | | | handling for SwitchInst" This reverts commit 5b32f60ec31ce136edac6f693538aeb6039f4ad0. The fix is in commit 4f9e68148bd0dada2d6997625432385918ac2e2c. This patch fixes the CorrelatedValuePropagation pass to keep prof branch_weights metadata of SwitchInst consistent. It makes use of SwitchInstProfUpdateWrapper. New tests are added. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D62126 llvm-svn: 362583
* [Attributor] Pass infrastructure and fixpoint frameworkJohannes Doerfert2019-06-054-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: Note that no attributes are derived yet. This patch will not go in alone but only with others that derive attributes. The framework is split for review purposes. This commit introduces the Attributor pass infrastructure and fixpoint iteration framework. Further patches will introduce abstract attributes into this framework. In a nutshell, the Attributor will update instances of abstract arguments until a fixpoint, or a "timeout", is reached. Communication between the Attributor and the abstract attributes that are derived is restricted to the AbstractState and AbstractAttribute interfaces. Please see the file comment in Attributor.h for detailed information including design decisions and typical use case. Also consider the class documentation for Attributor, AbstractState, and AbstractAttribute. Reviewers: chandlerc, homerdin, hfinkel, fedor.sergeev, sanjoy, spatel, nlopes, nicholas, reames Subscribers: mehdi_amini, mgorny, hiraditya, bollu, steven_wu, dexonsmith, dang, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59918 llvm-svn: 362578
* [NFC][FnAttrs] Stress tests for attribute deductionJohannes Doerfert2019-06-055-1/+1362
| | | | | | | | | | | | | | | This commit is a preparation of upcoming patches on attribute deduction. It will shorten the diffs and make it clear what we inferred before. Reviewers: chandlerc, homerdin, hfinkel, fedor.sergeev, sanjoy, spatel, nlopes Subscribers: bollu, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59903 llvm-svn: 362577
* Initial support for IBM MASS vector libraryNemanja Ivanovic2019-06-054-0/+1795
| | | | | | | This is the LLVM portion of patch https://reviews.llvm.org/D59881. The clang portion is to follow. llvm-svn: 362568
* [Scalarizer] Add UnaryOperator visitor to scalarization passCameron McInally2019-06-041-0/+62
| | | | | | Differential Revision: https://reviews.llvm.org/D62858 llvm-svn: 362558
* [Tests] Autogen a test so future changes are visiblePhilip Reames2019-06-041-34/+122
| | | | | | Oddly, I had to change a value name from "tmp0" to "bc0" to get the autogened test to pass. I'm putting this down to an oddity of update_test_checks or FileCheck, but don't understand it. llvm-svn: 362532
* [LVI][CVP] Add support for urem, srem and sdivNikita Popov2019-06-041-5/+5
| | | | | | | | | | | | | The underlying ConstantRange functionality has been added in D60952, D61207 and D61238, this just exposes it for LVI. I'm switching the code from using a whitelist to a blacklist, as we're down to one unsupported operation here (xor) and writing it this way seems more obvious :) Differential Revision: https://reviews.llvm.org/D62822 llvm-svn: 362519
* [Tests] Update a test to consistently use new pass manager and FileCheck the ↵Philip Reames2019-06-041-1/+1
| | | | | | result llvm-svn: 362518
* [Tests] Autogen tests so that diffs for a future change are understandablePhilip Reames2019-06-042-29/+119
| | | | llvm-svn: 362516
* [SimplifyCFG] fix last commitShawn Landden2019-06-041-0/+3
| | | | llvm-svn: 362501
* [SimplifyCFG] NFC; remove bogus test caseShawn Landden2019-06-041-26/+0
| | | | | | | | | | Even if one bit is defined, the code is not clear what it is suppose to do. The test wants to assert that some bits are undef, but that's not what the IR does and I don't think it's even possible to do that in any meaningful way. It was added in D12497, so @reames might want to double check. Differential Revision: https://reviews.llvm.org/D60859 llvm-svn: 362499
* [SCCP] Add UnaryOperator visitor to SCCP for unary FNegCameron McInally2019-06-032-0/+41
| | | | | | Differential Revision: https://reviews.llvm.org/D62819 llvm-svn: 362449
* TTI: Improve default costs for addrspacecastMatt Arsenault2019-06-031-0/+77
| | | | | | | | | | For some reason multiple places need to do this, and the variant the loop unroller and inliner use was not handling it. Also, introduce a new wrapper to be slightly more precise, since on AMDGPU some addrspacecasts are free, but not no-ops. llvm-svn: 362436
* Fix a crash when the default of a switch is removedAndrew Kaylor2019-06-031-0/+36
| | | | | | | | This patch fixes a problem that occurs in LowerSwitch when a switch statement has a PHI node as its condition, and the PHI node only has two incoming blocks, and one of those incoming blocks is through an unreachable default in the switch statement. When this condition occurs, LowerSwitch holds a pointer to the condition value, but removes the switch block as a predecessor of the PHI block, causing the PHI node to be replaced. LowerSwitch then tries to use its stale pointer to the original condition value, causing a crash. Differential Revision: https://reviews.llvm.org/D62560 llvm-svn: 362427
* [Tests] Add LFTR tests for multiple exit loops (try 2)Philip Reames2019-06-031-0/+276
| | | | | | | | (Recommit after fixing a keymash in the run line. Sorry for breakage.) This is preparation for D62625 <https://reviews.llvm.org/D62625> llvm-svn: 362426
* Revert "[Tests] Add LFTR tests for multiple exit loops"Dmitri Gribenko2019-06-031-276/+0
| | | | | | This reverts commit r362417. There's a syntax error in the RUN line. llvm-svn: 362418
* [Tests] Add LFTR tests for multiple exit loopsPhilip Reames2019-06-031-0/+276
| | | | | | This is preparation for D62625 llvm-svn: 362417
* [CostModel][X86] Improve masked load/store AVX1/AVX2 costsSimon Pilgrim2019-06-021-532/+890
| | | | | | | | | | | | | | | | | | | | A mixture of internal tests and review of the scheduler models indicates we're overestimating the cost of a masked load, which we're estimating at 4x regular memory ops - more realistic values indicates that its closer to 2x. Masked stores costs are a lot more diverse but 8x is roughly in the middle of the range. e.g. SandyBridge defm : X86WriteRes<WriteFMaskedLoad, [SBPort23,SBPort05], 8, [1,2], 3>; defm : X86WriteRes<WriteFMaskedLoadY, [SBPort23,SBPort05], 9, [1,2], 3>; defm : X86WriteRes<WriteFMaskedStore, [SBPort4,SBPort01,SBPort23], 5, [1,1,1], 3>; defm : X86WriteRes<WriteFMaskedStoreY, [SBPort4,SBPort01,SBPort23], 5, [1,1,1], 3>; e.g. Btver2 defm : X86WriteRes<WriteFMaskedLoad, [JLAGU, JFPU01, JFPX], 6, [1, 2, 2], 1>; defm : X86WriteRes<WriteFMaskedLoadY, [JLAGU, JFPU01, JFPX], 6, [2, 4, 4], 2>; defm : X86WriteRes<WriteFMaskedStore, [JSAGU, JFPU01, JFPX], 6, [1, 1, 4], 1>; defm : X86WriteRes<WriteFMaskedStoreY, [JSAGU, JFPU01, JFPX], 6, [2, 2, 4], 2>; Differential Revision: https://reviews.llvm.org/D61257 llvm-svn: 362338
* [IndVarSimplify] Add tests for saturating math on IV; NFCNikita Popov2019-06-021-0/+123
| | | | | | These saturating math ops can be replaced with simple math. llvm-svn: 362320
* [InlineCost] Don't add the soft float function call cost for the fneg idiom, ↵Craig Topper2019-06-011-0/+25
| | | | | | | | | | | | | | | | | | fsub -0.0, %x Summary: Fneg can be implemented with an xor rather than a function call so we don't need to add the function call overhead. This was pointed out in D62699 Reviewers: efriedma, cameron.mcinally Reviewed By: efriedma Subscribers: javed.absar, eraman, hiraditya, haicheng, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62747 llvm-svn: 362304
* [SLPVectorizer][X86] Add other tests described in PR28474Simon Pilgrim2019-06-011-0/+256
| | | | llvm-svn: 362297
* [SLPVectorizer][X86] This test was from PR28474Simon Pilgrim2019-06-011-1/+1
| | | | llvm-svn: 362296
* [IndVarSimplify] Fixup nowrap flags during LFTR (PR31181)Nikita Popov2019-06-011-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Fix for https://bugs.llvm.org/show_bug.cgi?id=31181 and partial fix for LFTR poison handling issues in general. When LFTR moves a condition from pre-inc to post-inc, it may now depend on value that is poison due to nowrap flags. To avoid this, we clear any nowrap flag that SCEV cannot prove for the post-inc addrec. Additionally, LFTR may switch to a different IV that is dynamically dead and as such may be arbitrarily poison. This patch will correct nowrap flags in some but not all cases where this happens. This is related to the adoption of IR nowrap flags for the pre-inc addrec. (See some of the switch_to_different_iv tests, where flags are not dropped or insufficiently dropped.) Finally, there are likely similar issues with the handling of GEP inbounds, but we don't have a test case for this yet. Differential Revision: https://reviews.llvm.org/D60935 llvm-svn: 362292
* [IndVarSimplify] Add additional PR33181 tests; NFCNikita Popov2019-06-011-4/+90
| | | | | | | Two more tests with a switch to a dynamically dead IV, with poison occuring on the first or second iteration. llvm-svn: 362291
* [LoopPred] Handle a subset of NE comparison based latchesPhilip Reames2019-06-011-6/+14
| | | | | | | | | | | | | | | | | | | | | At the moment, LoopPredication completely bails out if it sees a latch of the form: %cmp = icmp ne %iv, %N br i1 %cmp, label %loop, label %exit OR %cmp = icmp ne %iv.next, %NPlus1 br i1 %cmp, label %loop, label %exit This is unfortunate since this is exactly the form that LFTR likes to produce. So, go ahead and recognize simple cases where we can. For pre-increment loops, we leverage the fact that LFTR likes canonical counters (i.e. those starting at zero) and a (presumed) range fact on RHS to discharge the check trivially. For post-increment forms, the key insight is in remembering that LFTR had to insert a (N+1) for the RHS. CVP can hopefully prove that add nsw/nuw (if there's appropriate range on N to start with). This leaves us both with the post-inc IV and the RHS involving an nsw/nuw add, and SCEV can discharge that with no problem. This does still need to be extended to handle non-one steps, or other harder patterns of variable (but range restricted) starting values. That'll come later. Differential Revision: https://reviews.llvm.org/D62748 llvm-svn: 362282
* [SimplifyLibCalls] Fold more fortified functions into non-fortified variantsErik Pilkington2019-05-311-0/+207
| | | | | | | | | | | | When the object size argument is -1, no checking can be done, so calling the _chk variant is unnecessary. We already did this for a bunch of these functions. rdar://50797197 Differential revision: https://reviews.llvm.org/D62358 llvm-svn: 362272
* [Tests] Better represent the postinc form produced by LFTR in LoopPred testsPhilip Reames2019-05-311-8/+12
| | | | llvm-svn: 362270
* Reapply [CVP] Simplify non-overflowing saturating add/subNikita Popov2019-05-311-8/+8
| | | | | | | | | | | | | If we can determine that a saturating add/sub will not overflow based on range analysis, convert it into a simple binary operation. This is a sibling transform to the existing with.overflow handling. Reapplying this with an additional check that the saturating intrinsic has integer type, as LVI currently does not support vector types. Differential Revision: https://reviews.llvm.org/D62703 llvm-svn: 362263
* [CVP] Add vector saturating add test; NFCNikita Popov2019-05-311-0/+10
| | | | | | Extra test for the assertion failure from D62703. llvm-svn: 362262
* [CVP] Fix assertion failure on vector with.overflowNikita Popov2019-05-311-0/+12
| | | | | | | | Noticed on D62703. LVI only handles plain integers, not vectors of integers. This was previously not an issue, because vector support for with.overflow is only a relatively recent addition. llvm-svn: 362261
* [Tests] Add ne icmp tests w/preinc forms for LoopPredicationPhilip Reames2019-05-311-6/+80
| | | | | | Turns out this is substaintially easier to match then the post increment form, so let's start there. llvm-svn: 362260
* [NFC][InstCombine] Add unary FNeg tests to AMDGPU/amdgcn-intrinsics.llCameron McInally2019-05-311-0/+21
| | | | llvm-svn: 362255
* Revert "[CVP] Simplify non-overflowing saturating add/sub"Nikita Popov2019-05-311-8/+8
| | | | | | | | This reverts commit 1e692d1777ae34dcb93524b5798651a29defae09. Causes assertion failure in builtins-wasm.c clang test. llvm-svn: 362254
* [NFC][InstCombine] Add unary FNeg to cos-1.ll cos-2.ll cos-sin-intrinsic.llCameron McInally2019-05-313-0/+242
| | | | llvm-svn: 362253
* [Tests] Add tests for loop predication of loops w/ne latch conditionsPhilip Reames2019-05-311-0/+172
| | | | llvm-svn: 362244
* [CVP] Simplify non-overflowing saturating add/subNikita Popov2019-05-311-8/+8
| | | | | | | | | | If we can determine that a saturating add/sub will not overflow based on range analysis, convert it into a simple binary operation. This is a sibling transform to the existing with.overflow handling. Differential Revision: https://reviews.llvm.org/D62703 llvm-svn: 362242
OpenPOWER on IntegriCloud