summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Added InstCombine for "select cond, ~cond, x" type patternsPete Cooper2011-12-151-0/+7
| | | | | | These can be reduced to "~cond & x" or "~cond | x" llvm-svn: 146624
* Make loop preheader insertion in LoopSimplify handle the case where the loop ↵Eli Friedman2011-12-151-16/+34
| | | | | | header is a landing pad correctly (by splitting the landingpad out of the loop header). Make some adjustments to the rest of LoopSimplify to make it clear that the rest of LoopSimplify isn't making bad assumptions about the presence of landing pads. PR11575. llvm-svn: 146621
* Move Instruction::isSafeToSpeculativelyExecute out of VMCore andDan Gohman2011-12-143-4/+6
| | | | | | | | | into Analysis as a standalone function, since there's no need for it to be in VMCore. Also, update it to use isKnownNonZero and other goodies available in Analysis, making it more precise, enabling more aggressive optimization. llvm-svn: 146610
* Fix for bug #11429: Wrong behaviour for switches. Small improvement for code ↵Stepan Dyatkovskiy2011-12-141-11/+82
| | | | | | size heuristics. llvm-svn: 146578
* It turns out that clang does use pointer-to-function types toDan Gohman2011-12-141-2/+6
| | | | | | point to ARC-managed pointers sometimes. This fixes rdar://10551239. llvm-svn: 146577
* [asan] remove .preinit_array from the compiler module (it breaks .so ↵Kostya Serebryany2011-12-141-16/+0
| | | | | | builds). This should be done in the run-time. llvm-svn: 146527
* [asan] report an error if blacklist file contains a malformed regex. fixes ↵Kostya Serebryany2011-12-131-5/+13
| | | | | | asan issue 17 llvm-svn: 146503
* Cleanup. Clarify LSRInstance public methods.Andrew Trick2011-12-131-1/+1
| | | | llvm-svn: 146459
* Indvars: guard against exponential behavior in isHighCostExpansion.Andrew Trick2011-12-121-2/+7
| | | | | | | | This should always be done as a matter of principal. I don't have a case that exposes the problem. I just noticed this recently while scanning the code and realized I meant to fix it long ago. llvm-svn: 146438
* LLVMBuild: Introduce a common section which currently has a list of theDaniel Dunbar2011-12-121-0/+3
| | | | | | | | | | | subdirectories to traverse into. - Originally I wanted to avoid this and just autoscan, but this has one key flaw in that new subdirectories can not automatically trigger a rerun of the llvm-build tool. This is particularly a pain when switching back and forth between trees where one has added a subdirectory, as the dependencies will tend to be wrong. This will also eliminates FIXME implicitly. llvm-svn: 146436
* Only replace fwrite with fputc, if the return value is unused.Joerg Sonnenberger2011-12-121-1/+2
| | | | llvm-svn: 146411
* LLVMBuild: Remove trailing newline, which irked me.Daniel Dunbar2011-12-126-6/+0
| | | | llvm-svn: 146409
* When computing reverse-CFG reverse-post-order, skip backedges, asDan Gohman2011-12-121-38/+94
| | | | | | | | | | | | | detected in the forward-CFG DFS. This prevents the reverse-CFG from visiting blocks inside loops after blocks that dominate them in the case where loops have multiple exits. No testcase, because this fixes a bug which in practice only shows up in a full optimizer run, due to the use-list order. This fixes rdar://10422791 and others. llvm-svn: 146408
* Add a TODO comment.Dan Gohman2011-12-121-0/+1
| | | | llvm-svn: 146389
* Fix a copy+pasto in a comment.Dan Gohman2011-12-121-1/+1
| | | | llvm-svn: 146385
* Use getArgOperand instead of getOperand on a call.Dan Gohman2011-12-121-1/+1
| | | | llvm-svn: 146384
* Inline SetSeqToRelease into its only caller, since it's more clear that way.Dan Gohman2011-12-121-11/+4
| | | | llvm-svn: 146383
* Fix omitted break statements in a switch.Dan Gohman2011-12-121-0/+2
| | | | llvm-svn: 146380
* [asan] use .preinit_array only on linuxKostya Serebryany2011-12-121-2/+3
| | | | llvm-svn: 146379
* Switch llvm.cttz and llvm.ctlz to accept a second i1 parameter whichChandler Carruth2011-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | indicates whether the intrinsic has a defined result for a first argument equal to zero. This will eventually allow these intrinsics to accurately model the semantics of GCC's __builtin_ctz and __builtin_clz and the X86 instructions (prior to AVX) which implement them. This patch merely sets the stage by extending the signature of these intrinsics and establishing auto-upgrade logic so that the old spelling still works both in IR and in bitcode. The upgrade logic preserves the existing (inefficient) semantics. This patch should not change any behavior. CodeGen isn't updated because it can use the existing semantics regardless of the flag's value. Note that this will be followed by API updates to Clang and DragonEgg. Reviewed by Nick Lewycky! llvm-svn: 146357
* LSR: ignore strides in outer loops.Andrew Trick2011-12-101-1/+2
| | | | | | | | Since we're not rewriting IVs in other loops, there's not much reason to consider their stride when generating formulae. This should reduce the number of useless formulas considered by LSR. llvm-svn: 146302
* [asan] call __asan_init from .preinit_array. This simplifies __asan_init vs ↵Kostya Serebryany2011-12-091-0/+15
| | | | | | malloc chicken-and-egg situation on Android and probably on other flavours of Linux. Patch by eugenis@google.com. llvm-svn: 146284
* SplitBlockPredecessors uses ArrayRef instead of Data and Size.Jakub Staszak2011-12-096-29/+16
| | | | llvm-svn: 146277
* Add -unroll-runtime for unrolling loops with run-time trip counts.Andrew Trick2011-12-094-14/+426
| | | | | | | | | | | | | Patch by Brendon Cahoon! This extends the existing LoopUnroll and LoopUnrollPass. Brendon measured no regressions in the llvm test suite with -unroll-runtime enabled. This implementation works by using the existing loop unrolling code to unroll the loop by a power-of-two (default 8). It generates an if-then-else sequence of code prior to the loop to execute the extra iterations before entering the unrolled loop. llvm-svn: 146245
* Fix infinite loop in DSE when deleting a free in a reachable loop that's alsoNick Lewycky2011-12-081-1/+1
| | | | | | trivially infinite. llvm-svn: 146197
* Remove unused include.Duncan Sands2011-12-071-1/+0
| | | | llvm-svn: 146037
* Simplify common predecessor finding.Benjamin Kramer2011-12-061-24/+10
| | | | | | | | | | | | - Walking over pred_begin/pred_end is an expensive operation. - PHINodes contain a value for each predecessor anyway. - While it may look like we used to save a few iterations with the set, be aware that getIncomingValueForBlock does a linear search on the values of the phi node. - Another -5% on ARMDisassembler.cpp (Release build). This was the last entry in the profile that was obviously wasting time. llvm-svn: 145937
* Push StringRefs through the metadata interface.Benjamin Kramer2011-12-061-1/+1
| | | | llvm-svn: 145934
* LSR: prune undesirable formulae early.Andrew Trick2011-12-061-46/+85
| | | | | | | | | It's always good to prune early, but formulae that are unsatisfactory in their own right need to be removed before running any other pruning heuristics. We easily avoid generating such formulae, but we need them as an intermediate basis for forming other good formulae. llvm-svn: 145906
* Expose a switch for the new gcov format.Nick Lewycky2011-12-061-2/+3
| | | | llvm-svn: 145880
* Update comment.Chad Rosier2011-12-051-1/+1
| | | | llvm-svn: 145866
* Make the MemCpyOptimizer a bit more aggressive. I can't think of a scenerioChad Rosier2011-12-051-1/+1
| | | | | | | | where this would be bad as the backend shouldn't have a problem inlining small memcpys. rdar://10510150 llvm-svn: 145865
* Add a little heuristic to Value::isUsedInBasicBlock to speed it up for small ↵Benjamin Kramer2011-12-051-8/+1
| | | | | | | | | | basic blocks. - Calling getUser in a loop is much more expensive than iterating over a few instructions. - Use it instead of the open-coded loop in AddrModeMatcher. - 5% speedup on ARMDisassembler.cpp Release builds. llvm-svn: 145810
* Add support for vectors of pointers.Nadav Rotem2011-12-054-2/+16
| | | | llvm-svn: 145801
* Fixed deadstoreelimination bug where negative indices were incorrectly ↵Pete Cooper2011-12-031-1/+1
| | | | | | | | | | causing the optimisation to occur Turns out long long + unsigned long long is unsigned. Doh! Fixes http://llvm.org/bugs/show_bug.cgi?id=11455 llvm-svn: 145731
* Fix quadratic behavior in InlineFunction by fetching the personality ↵Benjamin Kramer2011-12-021-29/+33
| | | | | | | | | | function of the callee once and not for every invoke in the caller. The callee is usually smaller than the caller, too. This reduces the compile time of ARMDisassembler.cpp by 32% (Release build). It still takes ages to compile though. llvm-svn: 145690
* Fix a few more places where TargetData/TargetLibraryInfo is not being passed.Chad Rosier2011-12-028-21/+45
| | | | | | Add FIXMEs to places that are non-trivial to fix. llvm-svn: 145661
* Last bit of TargetLibraryInfo propagation. Also fixed a case for TargetDataChad Rosier2011-12-016-30/+66
| | | | | | | where it appeared beneficial to pass. More of rdar://10500969 llvm-svn: 145630
* Improved fix for abs(val) != 0 to check other similar case. Also fixed ↵Pete Cooper2011-12-011-6/+10
| | | | | | style issues and confusing comment llvm-svn: 145618
* [asan] two minor fixes: use UnreachableInst after the neverreturn function ↵Kostya Serebryany2011-12-011-2/+3
| | | | | | call; use report_fatal_error when blacklist file can not be found llvm-svn: 145611
* Added instcombine pattern to spot comparing -val or val against 0.Pete Cooper2011-12-011-0/+14
| | | | | | | | (val != 0) == (-val != 0) so "abs(val) != 0" becomes "val != 0" Fixes <rdar://problem/10482509> llvm-svn: 145563
* Propagate TargetLibraryInfo throughout ConstantFolding.cpp and Chad Rosier2011-12-018-13/+40
| | | | | | | InstructionSimplify.cpp. Other fixups as needed. Part of rdar://10500969 llvm-svn: 145559
* make asan work at -O0, llvm part. Patch by glider@google.comKostya Serebryany2011-11-301-1/+1
| | | | llvm-svn: 145530
* Make GlobalMerge honor the preferred alignment on globals without an ↵Eli Friedman2011-11-301-1/+1
| | | | | | | | explicitly specified alignment. <rdar://problem/10497732>. llvm-svn: 145523
* Whitespace.Chad Rosier2011-11-301-3/+1
| | | | llvm-svn: 145470
* Add support for sqrt, sqrtl, and sqrtf in TargetLibraryInfo. Disable Chad Rosier2011-11-292-3/+6
| | | | | | | | (fptrunc (sqrt (fpext x))) -> (sqrtf x) transformation if -fno-builtin is specified. rdar://10466410 llvm-svn: 145460
* Potential bug in RewriteLoopBodyWithConditionConstant: use iterator should ↵Stepan Dyatkovskiy2011-11-291-1/+5
| | | | | | not be changed inside the uses enumeration loop. llvm-svn: 145432
* build/CMake: Finish removal of add_llvm_library_dependencies.Daniel Dunbar2011-11-295-43/+0
| | | | llvm-svn: 145420
* Fix a theoretical problem (not seen in the wild): if different instances of aDuncan Sands2011-11-291-0/+4
| | | | | | | | | | | | | | | weak variable are compiled by different compilers, such as GCC and LLVM, while LLVM may increase the alignment to the preferred alignment there is no reason to think that GCC will use anything more than the ABI alignment. Since it is the GCC version that might end up in the final program (as the linkage is weak), it is wrong to increase the alignment of loads from the global up to the preferred alignment as the alignment might only be the ABI alignment. Increasing alignment up to the ABI alignment might be OK, but I'm not totally convinced that it is. It seems better to just leave the alignment of weak globals alone. llvm-svn: 145413
* SCEV fix. In general, Add/Mul expressions should not inherit NSW/NUW.Andrew Trick2011-11-291-2/+6
| | | | | | | This reverts r139450, fixes r139453, and adds much needed comments and a unit test. llvm-svn: 145367
OpenPOWER on IntegriCloud