aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
AgeCommit message (Collapse)Author
2011-12-20Unweaken vtables as per ↵David Blaikie
http://llvm.org/docs/CodingStandards.html#ll_virtual_anch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146960 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-18- Use getExitingBlock instead of getExitingBlocks.Jakub Staszak
- Remove trailing spaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146854 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17Revert r146822 at Pete Cooper's request as it broke clang self hosting.Kevin Enderby
Hope I did this correctly :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146834 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17SimplifyCFG now predicts some conditional branches to true or false ↵Pete Cooper
depending on previous branch on same comparison operands. For example, if (a == b) { if (a > b) // this is false Fixes some of the issues on <rdar://problem/10554090> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146822 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17Refactor code used in InstCombine::FoldAndOfICmps to new file.Pete Cooper
This will be used by SimplifyCfg in a later commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146803 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17The powers that be have decided that LLVM IR should now support 16-bitDan Gohman
"half precision" floating-point with a first-class type. This patch adds basic IR support (but not codegen support). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146786 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16Avoid a confusing assert for silly options: -unroll-runtime -unroll-count=1.Andrew Trick
No need for an explicit test case for an unsupported combination of options. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146721 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15[asan] add the name of the module to the description of a global variable. ↵Kostya Serebryany
This improves the readability of global-buffer-overflow reports. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146698 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15[asan] fix a bug (issue 19) where dlclose and the following mmap caused a ↵Kostya Serebryany
false positive. compiler part. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146688 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15Added InstCombine for "select cond, ~cond, x" type patternsPete Cooper
These can be reduced to "~cond & x" or "~cond | x" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146624 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15Make loop preheader insertion in LoopSimplify handle the case where the loop ↵Eli Friedman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146621 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14Move Instruction::isSafeToSpeculativelyExecute out of VMCore andDan Gohman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146610 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14Fix for bug #11429: Wrong behaviour for switches. Small improvement for code ↵Stepan Dyatkovskiy
size heuristics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146578 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14It turns out that clang does use pointer-to-function types toDan Gohman
point to ARC-managed pointers sometimes. This fixes rdar://10551239. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146577 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-14[asan] remove .preinit_array from the compiler module (it breaks .so ↵Kostya Serebryany
builds). This should be done in the run-time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146527 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13[asan] report an error if blacklist file contains a malformed regex. fixes ↵Kostya Serebryany
asan issue 17 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146503 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-13Cleanup. Clarify LSRInstance public methods.Andrew Trick
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146459 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12Indvars: guard against exponential behavior in isHighCostExpansion.Andrew Trick
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146438 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12LLVMBuild: Introduce a common section which currently has a list of theDaniel Dunbar
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146436 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12Only replace fwrite with fputc, if the return value is unused.Joerg Sonnenberger
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146411 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12LLVMBuild: Remove trailing newline, which irked me.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146409 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12When computing reverse-CFG reverse-post-order, skip backedges, asDan Gohman
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146408 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12Add a TODO comment.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146389 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12Fix a copy+pasto in a comment.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146385 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12Use getArgOperand instead of getOperand on a call.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146384 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12Inline SetSeqToRelease into its only caller, since it's more clear that way.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146383 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12Fix omitted break statements in a switch.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146380 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12[asan] use .preinit_array only on linuxKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146379 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12Switch llvm.cttz and llvm.ctlz to accept a second i1 parameter whichChandler Carruth
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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146357 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-10LSR: ignore strides in outer loops.Andrew Trick
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146302 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09[asan] call __asan_init from .preinit_array. This simplifies __asan_init vs ↵Kostya Serebryany
malloc chicken-and-egg situation on Android and probably on other flavours of Linux. Patch by eugenis@google.com. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146284 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09SplitBlockPredecessors uses ArrayRef instead of Data and Size.Jakub Staszak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146277 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09Add -unroll-runtime for unrolling loops with run-time trip counts.Andrew Trick
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146245 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08Fix infinite loop in DSE when deleting a free in a reachable loop that's alsoNick Lewycky
trivially infinite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146197 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07Remove unused include.Duncan Sands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146037 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-06Simplify common predecessor finding.Benjamin Kramer
- 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145937 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-06Push StringRefs through the metadata interface.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145934 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-06LSR: prune undesirable formulae early.Andrew Trick
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145906 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-06Expose a switch for the new gcov format.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145880 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05Update comment.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145866 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05Make the MemCpyOptimizer a bit more aggressive. I can't think of a scenerioChad Rosier
where this would be bad as the backend shouldn't have a problem inlining small memcpys. rdar://10510150 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145865 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05Add a little heuristic to Value::isUsedInBasicBlock to speed it up for small ↵Benjamin Kramer
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145810 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05Add support for vectors of pointers.Nadav Rotem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145801 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-03Fixed deadstoreelimination bug where negative indices were incorrectly ↵Pete Cooper
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145731 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02Fix quadratic behavior in InlineFunction by fetching the personality ↵Benjamin Kramer
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145690 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02Fix a few more places where TargetData/TargetLibraryInfo is not being passed.Chad Rosier
Add FIXMEs to places that are non-trivial to fix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145661 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01Last bit of TargetLibraryInfo propagation. Also fixed a case for TargetDataChad Rosier
where it appeared beneficial to pass. More of rdar://10500969 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145630 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01Improved fix for abs(val) != 0 to check other similar case. Also fixed ↵Pete Cooper
style issues and confusing comment git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145618 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01[asan] two minor fixes: use UnreachableInst after the neverreturn function ↵Kostya Serebryany
call; use report_fatal_error when blacklist file can not be found git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145611 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01Added instcombine pattern to spot comparing -val or val against 0.Pete Cooper
(val != 0) == (-val != 0) so "abs(val) != 0" becomes "val != 0" Fixes <rdar://problem/10482509> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145563 91177308-0d34-0410-b5e6-96231b3b80d8