summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* [Transforms] Propagate new-format TBAA tags on simplification of ↵Ivan A. Kosarev2018-02-191-0/+53
| | | | | | | | | | | | | | memory-transfer intrinsics With this patch in place, when a new-format TBAA tag is available for a memory-transfer intrinsic call, we prefer propagating that new-format tag. Otherwise, we fallback to the old approach where we try to construct a proper TBAA access tag from 'tbaa.struct' metadata. Differential Revision: https://reviews.llvm.org/D41543 llvm-svn: 325488
* [PatternMatch, InstSimplify] enhance m_AllOnes() to ignore undef elements in ↵Sanjay Patel2018-02-182-4/+2
| | | | | | | | | | | | | | | | | | | vectors Loosening the matcher definition reveals a subtle bug in InstSimplify (we should not assume that because an operand constant matches that it's safe to return it as a result). So I'm making that change here too (that diff could be independent, but I'm not sure how to reveal it before the matcher change). This also seems like a good reason to *not* include matchers that capture the value. We don't want to encourage the potential misstep of propagating undef values when it's not allowed/intended. I didn't include the capture variant option here or in the related rL325437 (m_One), but it already exists for other constant matchers. llvm-svn: 325466
* [InstSimplify] add tests with vector undef elts; NFCSanjay Patel2018-02-182-7/+18
| | | | llvm-svn: 325465
* [PatternMatch] enhance m_One() to ignore undef elements in vectorsSanjay Patel2018-02-173-9/+7
| | | | llvm-svn: 325437
* [InstSimplify, InstCombine] add tests with vector undef elts; NFCSanjay Patel2018-02-172-6/+43
| | | | | | These would fold if the m_One pattern matcher accounted for undef elts. llvm-svn: 325436
* [InstSimplify] add vector select tests with undef elts in condition; NFCSanjay Patel2018-02-171-0/+20
| | | | llvm-svn: 325419
* [InstCombine] add FMF to better show current fdiv fold behavior; NFCSanjay Patel2018-02-161-4/+4
| | | | llvm-svn: 325365
* [ThinLTO] Fix data race in test #2Eugene Leviant2018-02-161-1/+1
| | | | | | Switched to the right option (-thinlto-threads) llvm-svn: 325362
* [ThinLTO] Fix data race in testEugene Leviant2018-02-161-1/+1
| | | | llvm-svn: 325361
* [JumpThreading] PR36133 enable/disable DominatorTree for LVI analysisBrian M. Rzycki2018-02-161-0/+44
| | | | | | | | | | | | | | | | | | | | | | Summary: The LazyValueInfo pass caches a copy of the DominatorTree when available. Whenever there are pending DominatorTree updates within JumpThreading's DeferredDominance object we cannot use the cached DT for LVI analysis. This commit adds the new methods enableDT() and disableDT() to LVI. JumpThreading also sets the appropriate usage model before calling LVI analysis methods. Fixes https://bugs.llvm.org/show_bug.cgi?id=36133 Reviewers: sebpop, dberlin, kuhar Reviewed by: sebpop, kuhar Subscribers: uabelho, llvm-commits, aprantl, hiraditya, a.elovikov Differential Revision: https://reviews.llvm.org/D42717 llvm-svn: 325356
* [Transforms] Propagate TBAA info in SROAIvan A. Kosarev2018-02-161-151/+274
| | | | | | | | | | | | | | | Now that we have the new TBAA metadata format that is capable of representing accesses to aggregates, we can propagate TBAA access tags from memory setting and transferring intrinsics to load and store instructions and vice versa. Since SROA produces lots of new loads and stores on optimized builds, this change significantly decreases the share of undecorated memory accesses on such builds. Differential Revision: https://reviews.llvm.org/D41563 llvm-svn: 325329
* [ThinLTO] Import global variablesEugene Leviant2018-02-161-2/+11
| | | | | | Differential revision: https://reviews.llvm.org/D43077 llvm-svn: 325320
* Remove brittle check lines from a test, NFCVedant Kumar2018-02-161-41/+0
| | | | llvm-svn: 325310
* [GVN] Partially revert debug info salvage change (r325063)Vedant Kumar2018-02-161-1/+1
| | | | | | | | | | | | | In r325063, we salvaged debug values from dying instructions in GVN::processBlock() and GVN::performScalarPRE(). The change in performScalarPRE(), while correct, is unhelpful. It introduced a call to salvageDebugInfo() which was immediately followed by a RAUW, meaning it prevented the RAUW from efficiently updating dbg.value intrinsics. This commit reverts the mistake and tightens up the affected test case. llvm-svn: 325308
* [DCE] Salvage debug info from dead instsVedant Kumar2018-02-151-4/+8
| | | | | | | This results in small increases in the size of the .debug_loc section and the number of unique source variables in a stage2 build of opt. llvm-svn: 325301
* [Coroutines] Don't move stores for allocator argsBrian Gesiak2018-02-151-0/+64
| | | | | | | | | | | | | | | | | | | | | Summary: The behavior described in Coroutines TS `[dcl.fct.def.coroutine]/7` allows coroutine parameters to be passed into allocator functions. The instructions to store values into the alloca'd parameters must not be moved past the frame allocation, otherwise uninitialized values are passed to the allocator. Test Plan: `check-llvm` Reviewers: rsmith, GorNishanov, eric_niebler Reviewed By: GorNishanov Subscribers: compnerd, EricWF, llvm-commits Differential Revision: https://reviews.llvm.org/D43000 llvm-svn: 325285
* [SCCP] Test that constant propagation updates debug info, NFCVedant Kumar2018-02-151-5/+17
| | | | | | | This extends an existing test to check that SCCP updates the operands of relevant dbg.value instructions as it does its work. llvm-svn: 325281
* [SLP] Fix the test for the reversed stores, NFC.Alexey Bataev2018-02-151-18/+11
| | | | llvm-svn: 325268
* [SLP] Added test for reversed stores, NFC.Alexey Bataev2018-02-151-1/+64
| | | | llvm-svn: 325265
* [InstCombine] test fdiv folds better; NFCSanjay Patel2018-02-152-33/+43
| | | | | | | We had redundant tests, but no tests for extra uses or vectors. 'fast' is an overly conservative requirement for these folds. llvm-svn: 325262
* [InstCombine] allow sin/cos transforms with 'reassoc'Sanjay Patel2018-02-152-83/+83
| | | | | | | | | | | | | | | | The variable name 'AllowReassociate' is a lie at this point because it's set to 'isFast()' which is more than the 'reassoc' FMF after rL317488. In D41286, we showed that this transform may be valid even with strict math by brute force checking every 32-bit float result. There's a potential problem here because we're replacing with a tan() libcall rather than a hypothetical LLVM tan intrinsic. So we might set errno when we should be guaranteed not to do that. But that's independent of this change. llvm-svn: 325247
* [InstCombine] allow X / C -> X * (1.0/C) for vector splat FP constantsSanjay Patel2018-02-151-3/+14
| | | | llvm-svn: 325237
* [NFC] Fix metadata placement in testMax Kazantsev2018-02-151-3/+1
| | | | llvm-svn: 325215
* [SCEV] Favor isKnownViaSimpleReasoning over constant ranges checkMax Kazantsev2018-02-151-0/+32
| | | | | | | | | | | | | | | | | | | | | There is a more powerful but still simple function `isKnownViaSimpleReasoning ` that does constant range check and few more additional checks. We use it some places (e.g. when proving implications) and in some other places we only check constant ranges. Currently, indvar simplifier fails to remove the check in following loop: int inc = ...; for (int i = inc, j = inc - 1; i < 200; ++i, ++j) if (i > j) { ... } This patch replaces all usages of `isKnownPredicateViaConstantRanges` with `isKnownViaSimpleReasoning` to have smarter proofs. In particular, it fixes the case above. Reviewed-By: sanjoy Differential Revision: https://reviews.llvm.org/D43175 llvm-svn: 325214
* [InstCombine] add tests and comments for fdiv X, C; NFCSanjay Patel2018-02-141-10/+77
| | | | llvm-svn: 325161
* [InstCombine] Don't fold select(C, Z, binop(select(C, X, Y), W)) -> ↵Craig Topper2018-02-141-0/+17
| | | | | | | | | | | | select(C, Z, binop(Y, W)) if the binop is rem or div. The select may have been preventing a division by zero or INT_MIN/-1 so removing it might not be safe. Fixes PR36362. Differential Revision: https://reviews.llvm.org/D43276 llvm-svn: 325148
* [InstCombine] regenerate checks; NFCSanjay Patel2018-02-141-227/+352
| | | | llvm-svn: 325144
* [SLP] Allow vectorization of reversed loads.Alexey Bataev2018-02-141-6/+6
| | | | | | | | | | | | | | Summary: Reversed loads are handled as gathering. But we can just reshuffle these values. Patch adds support for vectorization of reversed loads. Reviewers: RKSimon, spatel, mkuper, hfinkel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D43022 llvm-svn: 325134
* Recommit r325001: [CallSiteSplitting] Support splitting of blocks with ↵Florian Hahn2018-02-145-128/+351
| | | | | | | | | | | | | | | | | | | | instrs before call. For basic blocks with instructions between the beginning of the block and a call we have to duplicate the instructions before the call in all split blocks and add PHI nodes for uses of the duplicated instructions after the call. Currently, the threshold for the number of instructions before a call is quite low, to keep the impact on binary size low. Reviewers: junbuml, mcrosier, davidxl, davide Reviewed By: junbuml Differential Revision: https://reviews.llvm.org/D41860 llvm-svn: 325126
* [LoopInterchange] Incrementally update the dominator tree.Florian Hahn2018-02-1411-11/+11
| | | | | | | | | | | | | We can use incremental dominator tree updates to avoid re-calculating the dominator tree after interchanging 2 loops. Reviewers: dmgreen, kuhar Reviewed By: kuhar Differential Revision: https://reviews.llvm.org/D43176 llvm-svn: 325122
* [Utils] Salvage the debug info of DCE'ed 'and' instructionsPetar Jovanovic2018-02-141-0/+10
| | | | | | | | | | Preserve debug info from a dead 'and' instruction with a constant. Patch by Djordje Todorovic. Differential Revision: https://reviews.llvm.org/D43163 llvm-svn: 325119
* Adding a width of the GEP index to the Data Layout.Elena Demikhovsky2018-02-146-0/+1419
| | | | | | | | | | | | | | | | | | Making a width of GEP Index, which is used for address calculation, to be one of the pointer properties in the Data Layout. p[address space]:size:memory_size:alignment:pref_alignment:index_size_in_bits. The index size parameter is optional, if not specified, it is equal to the pointer size. Till now, the InstCombiner normalized GEPs and extended the Index operand to the pointer width. It works fine if you can convert pointer to integer for address calculation and all registered targets do this. But some ISAs have very restricted instruction set for the pointer calculation. During discussions were desided to retrieve information for GEP index from the Data Layout. http://lists.llvm.org/pipermail/llvm-dev/2018-January/120416.html I added an interface to the Data Layout and I changed the InstCombiner and some other passes to take the Index width into account. This change does not affect any in-tree target. I added tests to cover data layouts with explicitly specified index size. Differential Revision: https://reviews.llvm.org/D42123 llvm-svn: 325102
* [InstCombine] put tests of mul with neg operand(s) together; NFCSanjay Patel2018-02-134-58/+64
| | | | llvm-svn: 325066
* [GVN] Salvage debug info from dead instsVedant Kumar2018-02-132-2/+11
| | | | | | | | | | This preserves an additional 581 unique source variables in a stage2 build of clang (according to `llvm-dwarfdump --statistics`). It increases the size of the .debug_loc section by 0.1% (or 87139 bytes). Differential Revision: https://reviews.llvm.org/D43255 llvm-svn: 325063
* [InstCombine] (lshr X, 31) * Y --> (ashr X, 31) & YSanjay Patel2018-02-131-4/+4
| | | | | | | | | | | This replaces the bit-tracking based fold that did the same thing, but it only worked for scalars and not directly. There is no evidence in existing regression tests that the greater power of bit-tracking was needed here, but we should be aware of this potential loss of optimization. llvm-svn: 325062
* [InstCombine] add vector tests, fix comments; NFCSanjay Patel2018-02-131-8/+53
| | | | | | | | The scalar folds are done indirectly and use potentially expensive value tracking calls. That can be improved along with the enhancement to support vector types. llvm-svn: 325051
* [InstCombine] (bool X) * Y --> X ? Y : 0Sanjay Patel2018-02-131-3/+12
| | | | | | | | | This is both a functional improvement for vectors and an efficiency improvement for scalars. The existing code below the new folds does the same thing for scalars, but in an indirect and expensive way. llvm-svn: 325048
* [InstCombine] fix test comment and add vector test; NFCSanjay Patel2018-02-131-9/+22
| | | | llvm-svn: 325039
* [InstCombine, InstSimplify] (re)move tests, regenerate checks; NFCSanjay Patel2018-02-133-236/+283
| | | | | | | | The InstCombine integer mul test file had tests that belong in InstSimplify (including fmul tests). Move things to where they belong and auto-generate complete checks for everything. llvm-svn: 325037
* [DeadStoreElimination] Salvage debug info from dead instsVedant Kumar2018-02-131-0/+40
| | | | | | | | | | According to `llvm-dwarfdump --statistics` this salvages 43 additional unique source variables in a stage2 build of clang. It increases the size of the .debug_loc section by 0.002% (or 2864 bytes). Differential Revision: https://reviews.llvm.org/D43220 llvm-svn: 325035
* [AMDGPU] Change constant addr space to 4Yaxun Liu2018-02-131-32/+32
| | | | | | Differential Revision: https://reviews.llvm.org/D43170 llvm-svn: 325030
* Revert r325001: [CallSiteSplitting] Support splitting of blocks with instrs ↵Florian Hahn2018-02-135-351/+128
| | | | | | | | before call. Due to memsan not being happy with the array of ValueToValue maps. llvm-svn: 325009
* [IR] Fix creating mutable versions of TBAA access tagsIvan A. Kosarev2018-02-131-10/+14
| | | | | | | | | | Due to a typo in D41565, mutable TBAA tags created with createMutableTBAAAccessTag() lose their base types. This patch fixes that typo and updates tests respectively. Differential Revision: https://reviews.llvm.org/D42364 llvm-svn: 325008
* [CallSiteSplitting] Support splitting of blocks with instrs before call.Florian Hahn2018-02-135-128/+351
| | | | | | | | | | | | | | | | | | For basic blocks with instructions between the beginning of the block and a call we have to duplicate the instructions before the call in all split blocks and add PHI nodes for uses of the duplicated instructions after the call. Currently, the threshold for the number of instructions before a call is quite low, to keep the impact on binary size low. Reviewers: junbuml, mcrosier, davidxl, davide Reviewed By: junbuml Differential Revision: https://reviews.llvm.org/D41860 llvm-svn: 325001
* [LoopInterchange] Check number of latch successors before accessing them.Florian Hahn2018-02-131-0/+40
| | | | | | | | | | | | | | | | In cases where the OuterMostLoopLatchBI only has a single successor, accessing the second successor will fail. This fixes a failure when building the test-suite with loop-interchange enabled. Reviewers: mcrosier, karthikthecool, davide Reviewed by: karthikthecool Differential Revision: https://reviews.llvm.org/D42906 llvm-svn: 324994
* [Utils] Salvage debug info from all no-op castsVedant Kumar2018-02-131-0/+10
| | | | | | | | | | | We already try to salvage debug values from no-op bitcasts and inttoptr instructions: we should handle ptrtoint instructions as well. This saves an additional 24,444 debug values in a stage2 build of clang, and (according to llvm-dwarfdump --statistics) provides an additional 289 unique source variables. llvm-svn: 324982
* [Utils] Salvage debug info of DCE'ed mul/sdiv/srem instructionsVedant Kumar2018-02-131-0/+30
| | | | | | | | | | | | | Here are the number of additional debug values salvaged in a stage2 build of clang: 63 SALVAGE: MUL 1250 SALVAGE: SDIV (No values were salvaged from `srem` instructions in this experiment, but it's a simple case to handle so we might as well.) llvm-svn: 324976
* [Utils] Salvage debug info of DCE'ed shl/lhsr/ashr instructionsVedant Kumar2018-02-131-0/+30
| | | | | | | | | | | Here are the number of additional debug values salvaged in a stage2 build of clang: 1912 SALVAGE: ASHR 405 SALVAGE: LSHR 249 SALVAGE: SHL llvm-svn: 324975
* [Utils] Salvage the debug info of DCE'ed 'sub' instructionsVedant Kumar2018-02-131-0/+20
| | | | | | This salvages 14 debug values in a stage2 build of clang. llvm-svn: 324974
* [Utils] Salvage the debug info of DCE'ed 'xor' instructionsVedant Kumar2018-02-131-0/+10
| | | | | | | | This salvages 259 debug values in a stage2 build of clang. Differential Revision: https://reviews.llvm.org/D43207 llvm-svn: 324973
OpenPOWER on IntegriCloud