summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[ThinLTO] Emit individual index files for distributed backends"Vitaly Buka2016-05-051-27/+0
| | | | | | | | | MemorySanitizer: use-of-uninitialized-value in lib/Bitcode/Writer/BitcodeWriter.cpp:364:70 http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/12544/steps/check-llvm%20msan/logs/stdio This reverts commit 0c4a898ea550699d1b2f4fe3767251c8f9a48d52. llvm-svn: 268660
* Remove dead include. NFC.Chad Rosier2016-05-051-1/+0
| | | | llvm-svn: 268655
* Remove dead include. NFC.Chad Rosier2016-05-051-1/+0
| | | | llvm-svn: 268654
* Fix unused variable warning after r268632Silviu Baranga2016-05-051-1/+0
| | | | llvm-svn: 268634
* [LV] Identify more induction PHIs by coercing expressions to AddRecExprsSilviu Baranga2016-05-052-10/+45
| | | | | | | | | | | | | | | | | | Summary: Some PHIs can have expressions that are not AddRecExprs due to the presence of sext/zext instructions. In order to prevent the Loop Vectorizer from bailing out when encountering these PHIs, we now coerce the SCEV expressions to AddRecExprs using SCEV predicates (when possible). We only do this when the alternative would be to not vectorize. Reviewers: mzolotukhin, anemet Subscribers: mssimpso, sanjoy, mzolotukhin, llvm-commits Differential Revision: http://reviews.llvm.org/D17153 llvm-svn: 268633
* [LV] Refactor the validation of PHI inductions. NFCSilviu Baranga2016-05-051-29/+48
| | | | | | | | This moves the validation of PHI inductions into a separate method, making it easier to reuse this logic. llvm-svn: 268632
* [ThinLTO] Emit individual index files for distributed backendsTeresa Johnson2016-05-051-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When launching ThinLTO backends in a distributed build (currently supported in gold via the thinlto-index-only plugin option), emit an individual index file for each backend process as described here: http://lists.llvm.org/pipermail/llvm-dev/2016-April/098272.html The individual index file encodes the summary and module information required for implementing the importing/exporting decisions made for a given module in the thin link step. This is in place of the current mechanism that uses the combined index to make importing decisions in each back end independently. It is an enabler for doing global summary based optimizations in the thin link step (which will be recorded in the individual index files), and reduces the size of the index that must be sent to each backend process, and the amount of work to scan it in the backends. Rather than create entirely new ModuleSummaryIndex structures (and all the included unique_ptrs) for each backend index file, a map is created to record all of the GUID and summary pointers needed for a particular index file. The IndexBitcodeWriter walks this map instead of the full index (hiding the details of managing the appropriate summary iteration in a new iterator subclass). This is more efficient than walking the entire combined index and filtering out just the needed summaries during each backend bitcode index write. Depends on D19481. Reviewers: joker.eph Subscribers: llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D19556 llvm-svn: 268627
* [PM] Port EliminateAvailableExternally pass to the new pass manager.Davide Italiano2016-05-052-29/+37
| | | | llvm-svn: 268599
* Revert "[asan] add option to set shadow mapping offset"Ryan Govostes2016-05-051-9/+2
| | | | | | This reverts commit ba89768f97b1d4326acb5e33c14eb23a05c7bea7. llvm-svn: 268588
* [asan] add option to set shadow mapping offsetRyan Govostes2016-05-051-2/+9
| | | | | | | | Allowing overriding the default ASAN shadow mapping offset with the -asan-shadow-offset option, and allow zero to be specified for both offset and scale. llvm-svn: 268586
* clang-format some files in preparation of coming patch reviews.Dehao Chen2016-05-053-755/+715
| | | | llvm-svn: 268583
* [PM] Port ConstantMerge to the new pass manager.Davide Italiano2016-05-052-27/+35
| | | | llvm-svn: 268582
* [LoopDataPrefetch] Add optimization remarkAdam Nemet2016-05-051-1/+6
| | | | | | | With -Rpass=loop-data-prefetch, show the memory access that got prefetched. llvm-svn: 268578
* Revert "[SimplifyCFG] propagate branch metadata when creating select"Vitaly Buka2016-05-041-28/+14
| | | | | | | | | | | | MemorySanitizer: use-of-uninitialized-value 0x4910e47 in count /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/Support/MathExtras.h:159:12 0x4910e47 in countLeadingZeros<unsigned long> /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/Support/MathExtras.h:183 0x4910e47 in FitWeights /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:855 0x4910e47 in SimplifyCondBranchToCondBranch /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:2895 This reverts commit 609f4dd4bf3bc735c8c047a4d4b0a8e9e4d202e2. llvm-svn: 268577
* Revert "[SCCP] Throw away dead code. NFC."Davide Italiano2016-05-041-0/+3
| | | | | | This reverts commit r268568, as it broke the bots. llvm-svn: 268570
* [SCCP] Throw away dead code. NFC.Davide Italiano2016-05-041-3/+0
| | | | llvm-svn: 268568
* "Reapply r268521 "[InstCombine] Canonicalize icmp instructions based on ↵Balaram Makam2016-05-041-0/+45
| | | | | | | | | dominating conditions."" This reapplies commit r268521, that was reverted in r268530 due to a test failure in select-implied.ll Modified the test case to reflect the new change. llvm-svn: 268557
* [SimplifyCFG] propagate branch metadata when creating selectSanjay Patel2016-05-041-14/+28
| | | | | | | | | Unlike earlier similar fixes, we need to recalculate the branch weights in this case. Differential Revision: http://reviews.llvm.org/D19674 llvm-svn: 268550
* Revert "[InstCombine] Canonicalize icmp instructions based on dominating ↵Balaram Makam2016-05-041-45/+0
| | | | | | | | conditions." This reverts commit 573a40f79b35cf3e71db331bb00f6a84f03b835d. llvm-svn: 268530
* [InstCombine] Canonicalize icmp instructions based on dominating conditions.Balaram Makam2016-05-041-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch canonicalizes conditions based on the constant range information of the dominating branch condition. For example: %cmp = icmp slt i64 %a, 0 br i1 %cmp, label %land.lhs.true, label %lor.rhs lor.rhs: %cmp2 = icmp sgt i64 %a, 0 Would now be canonicalized into: %cmp = icmp slt i64 %a, 0 br i1 %cmp, label %land.lhs.true, label %lor.rhs lor.rhs: %cmp2 = icmp ne i64 %a, 0 Reviewers: mcrosier, gberry, t.p.northover, llvm-commits, reames, hfinkel, sanjoy, majnemer Subscribers: MatzeB, majnemer, mcrosier Differential Revision: http://reviews.llvm.org/D18841 llvm-svn: 268521
* [SimplifyCFG] isSafeToSpeculateStore now ignores debug infoHans Wennborg2016-05-041-2/+6
| | | | | | | | | | | | | | | This patch fixes PR27615. @llvm.dbg.value instructions no longer count towards the maximum number of instructions to look back at in the instruction list when searching for a store instruction. This should make the output consistent between debug and non-debug build. Patch by Henric Karlsson <henric.karlsson@ericsson.com>! Differential Revision: http://reviews.llvm.org/D19912 llvm-svn: 268512
* Use a uniform name for the load combine pass. NFC.Chad Rosier2016-05-041-6/+5
| | | | llvm-svn: 268507
* [RS4GC] Use SetVector/MapVector instead of DenseSet/DenseMap to guarantee ↵Igor Laevsky2016-05-041-99/+34
| | | | | | | | | | | | | | | stable ordering Goal of this change is to guarantee stable ordering of the statepoint arguments and other newly inserted values such as gc.relocates. Previously we had explicit sorting in a couple of places. However for unnamed values ordering was partial and overall we didn't have any strong invariant regarding it. This change switches all data structures to use SetVector's and MapVector's which provide possibility for deterministic iteration over them. Explicit sorting is now redundant and was removed. Differential Revision: http://reviews.llvm.org/D19669 llvm-svn: 268502
* [IPO/ConstantMerge] Convert to static function, to facilitate transition to ↵Davide Italiano2016-05-041-6/+1
| | | | | | the new PM. llvm-svn: 268476
* [GlobalDCE, Misc] Don't remove functions referenced by ifuncsDavid Majnemer2016-05-042-5/+33
| | | | | | | | | | | | We forgot to consider the target of ifuncs when considering if a function was alive or dead. N.B. Also update a few auxiliary tools like bugpoint and verify-uselistorder. This fixes PR27593. llvm-svn: 268468
* Add opt-bisect support to additional passes that can be skippedAndrew Kaylor2016-05-0311-5/+28
| | | | | | Differential Revision: http://reviews.llvm.org/D19882 llvm-svn: 268457
* PM: Port LoopRotation to the new loop pass managerJustin Bogner2016-05-032-9/+34
| | | | llvm-svn: 268452
* PM: Port LoopSimplifyCFG to the new pass managerJustin Bogner2016-05-032-43/+56
| | | | llvm-svn: 268446
* [IPO/ConstantMerge] Garbage collect dead code. NFC.Davide Italiano2016-05-031-3/+0
| | | | llvm-svn: 268442
* [IPO/IPCP] Convert to use static functions. NFC.Davide Italiano2016-05-031-35/+32
| | | | | | In preparation for porting this pass to the new PM. llvm-svn: 268429
* [IPO/GlobalDCE] Port to the new pass manager.Davide Italiano2016-05-032-28/+29
| | | | | | Differential Revision: http://reviews.llvm.org/D19782 llvm-svn: 268425
* [SROA] Function canConvertValue needs to check whether both NewTy and OldTy ↵Jack Liu2016-05-031-2/+4
| | | | | | | | | | | pointers are pointing to the same addr space. This can prevent SROA from creating a bitcast between pointers with different addr spaces. Differential Revision: http://reviews.llvm.org/D19697 llvm-svn: 268424
* Revert 268409 due to missing comment.Jack Liu2016-05-031-4/+2
| | | | llvm-svn: 268421
* (no commit message)Jack Liu2016-05-031-2/+4
| | | | llvm-svn: 268409
* [LICM] Kill SCEV loop dispositions if neededSanjoy Das2016-05-031-0/+4
| | | | | | | | SCEV caches whether SCEV expressions are loop invariant, variant or computable. LICM breaks this cache, almost by definition; so clear the SCEV disposition cache if LICM changed anything. llvm-svn: 268408
* Use all_of instead of a raw loop; NFCSanjoy Das2016-05-031-6/+4
| | | | | | | Added some tests despite being NFC, since it looks like nothing was exercising the "all incoming values to exit PHIs are same" logic. llvm-svn: 268407
* [LoopDeletion] Clear SCEV loop dispositionsSanjoy Das2016-05-031-11/+27
| | | | | | | | | | | `Loop::makeLoopInvariant` can hoist instructions out of loops, so loop dispositions for the loop it operated on may need to be cleared. We can be smarter here (especially around how `forgetLoopDispositions` is implemented), but let's be correct first. Fixes PR27570. llvm-svn: 268406
* [ProfileData] Add error codes for compression failuresVedant Kumar2016-05-031-2/+4
| | | | | | | | | | Be more specific in describing compression failures. Also, check for this kind of error in emitNameData(). This is part of a series of patches to transition ProfileData over to the stricter Error/Expected interface. llvm-svn: 268400
* Move "Eliminate Available Externally" immediately after the inlinerMehdi Amini2016-05-031-12/+13
| | | | | | | | | | | This pass is supposed to reduce the size of the IR for compile time purpose. We should run it ASAP, except when we prepare for LTO or ThinLTO, and we want to keep them available for link-time inline. Differential Revision: http://reviews.llvm.org/D19813 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 268394
* Mark that SpeculativeExecution preserves Globals Alias Analysis.Kristof Beyls2016-05-031-0/+2
| | | | | | | | | | | | | | | | | | | | A few benchmarks with lots of accesses to global variables in the hot loops regressed a lot since r266399, which added the SpeculativeExecution pass to the default pipeline. The problem is that this pass doesn't mark Globals Alias Analysis as preserved. Globals Alias Analysis is computed in a module pass, whereas SpeculativeExecution is a function pass, and a lot of passes dependent on the Globals Alias Analysis to optimize these benchmarks are also function passes. As such, the Globals Alias Analysis information cannot be recomputed between SpeculativeExecution and the following function passes needing that information. SpeculativeExecution doesn't invalidate Globals Alias Analysis, so mark it as such to fix those performance regressions. Differential Revision: http://reviews.llvm.org/D19806 llvm-svn: 268370
* [LoopUnroll] Unroll loops which have exit blocks to EH padsDavid Majnemer2016-05-031-0/+5
| | | | | | | | | | | | | We were overly cautious in our analysis of loops which have invokes which unwind to EH pads. The loop unroll transform is safe because it only clones blocks in the loop body, it does not try to split critical edges involving EH pads. Instead, move the necessary safety check to LoopUnswitch. N.B. The safety check for loop unswitch is covered by an existing test which fails without it. llvm-svn: 268357
* ThinLTO: do not import function whose linkage prevents inlining.Mehdi Amini2016-05-031-2/+2
| | | | | | | | | | | There is not point in importing a "weak" or a "linkonce" function since we won't be able to inline it anyway. We already had a targeted check for WeakAny, this is using the same check on GlobalValue as the inline, i.e. isMayBeOverriddenLinkage() From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 268341
* Revert "ThinLTO: do not import function whose linkage prevents inlining."Mehdi Amini2016-05-021-2/+2
| | | | | | | This reverts commit r268315, the tests are not passing. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 268317
* ThinLTO: do not import function whose linkage prevents inlining.Mehdi Amini2016-05-021-2/+2
| | | | | | | | | | | There is not point in importing a "weak" or a "linkonce" function since we won't be able to inline it anyway. We already had a targeted check for WeakAny, this is using the same check on GlobalValue as the inline, i.e. isMayBeOverriddenLinkage() From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 268315
* Code refactoring -- preparation for new PM porting /NFCXinliang David Li2016-05-021-9/+19
| | | | llvm-svn: 268301
* Revert "[SimplifyCFG] Extend TryToSimplifyUncondBranchFromEmptyBlock for ↵Reid Kleckner2016-05-022-153/+59
| | | | | | | | | | | empty block including lifetime intrinsics" This reverts commit r268254. This change causes assertion failures while building Chromium. Reduced test case coming soon. llvm-svn: 268288
* Typo. NFC.Chad Rosier2016-05-021-1/+1
| | | | llvm-svn: 268280
* Use false rather than 0 for a boolean value. NFC.Chad Rosier2016-05-021-1/+1
| | | | llvm-svn: 268279
* ReversePostOrderFunctionAttrs is not modifying the call graph, let's ↵Mehdi Amini2016-05-021-0/+1
| | | | | | | | | | preserve it. When running cc1 with -flto=thin, it is followed by GlobalOpt, which requires the callgraph. This saves rebuilding one. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 268266
* [SimplifyCFG] Extend TryToSimplifyUncondBranchFromEmptyBlock for empty block ↵Hans Wennborg2016-05-022-59/+153
| | | | | | | | | | | | | | | | | | including lifetime intrinsics Make it possible that TryToSimplifyUncondBranchFromEmptyBlock merges empty basic block including lifetime intrinsics as well as phi nodes and unconditional branch into its successor or predecessor(s). If successor of empty block has single predecessor, all contents including lifetime intrinsics are sinked into the successor. Otherwise, they are hoisted into its predecessor(s) and then merged into the predecessor(s). Patch by Josh Yoon <josh.yoon@samsung.com>! Differential Revision: http://reviews.llvm.org/D19257 llvm-svn: 268254
OpenPOWER on IntegriCloud