summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* Fix CountCodeReductionForAlloca to more accurately represent what SROA can andNick Lewycky2012-01-201-16/+60
| | | | | | | | can't handle. Also don't produce non-zero results for things which won't be transformed by SROA at all just because we saw the loads/stores before we saw the use of the address. llvm-svn: 148536
* SCEVExpander fixes. Affects LSR and indvars.Andrew Trick2012-01-201-115/+114
| | | | | | | | | | | | | | | | LSR has gradually been improved to more aggressively reuse existing code, particularly existing phi cycles. This exposed problems with the SCEVExpander's sloppy treatment of its insertion point. I applied some rigor to the insertion point problem that will hopefully avoid an endless bug cycle in this area. Changes: - Always used properlyDominates to check safe code hoisting. - The insertion point provided to SCEV is now considered a lower bound. This is usually a block terminator or the use itself. Under no cirumstance may SCEVExpander insert below this point. - LSR is reponsible for finding a "canonical" insertion point across expansion of different expressions. - Robust logic to determine whether IV increments are in "expanded" form and/or can be safely hoisted above some insertion point. Fixes PR11783: SCEVExpander assert. llvm-svn: 148535
* Remove dead code.Bill Wendling2012-01-181-45/+0
| | | | llvm-svn: 148384
* Move includes to the .cpp file.Jakub Staszak2012-01-171-0/+2
| | | | llvm-svn: 148342
* Fix a corner case hit by redundant phi elimination running after LSR.Andrew Trick2012-01-141-1/+11
| | | | | | Fixes PR11761: bad IR w/ redundant Phi elim llvm-svn: 148177
* A DenseMap of a std::map isn't a very good idea because the "grow()" method willBill Wendling2012-01-121-2/+2
| | | | | | | need to make a deep copy of each of the std::maps. Use a std::map of the std::map instead. This improves the compile time of sqlite3 by ~2%. llvm-svn: 148003
* Revert r147978. A DenseMap's iterators may become invalidated here.Bill Wendling2012-01-111-1/+2
| | | | llvm-svn: 147980
* Use a DenseMap.Bill Wendling2012-01-111-2/+1
| | | | | | This appears to improve sqlite3's compile time by ~2%. llvm-svn: 147978
* Clarified the SCEV getSmallConstantTripCount interface with in-your-face ↵Andrew Trick2012-01-111-9/+18
| | | | | | | | comments. This interface is misleading and dangerous, but it is actually what we need for unrolling. llvm-svn: 147926
* Don't avoid recursing for pointer types, just reference types. Expand onEric Christopher2012-01-111-3/+4
| | | | | | | | the comment. Fixes constvars.exp on the gdb test builder. llvm-svn: 147897
* Cleanup these asserts to follow common LLVM style and codingChandler Carruth2012-01-101-5/+5
| | | | | | | conventions. Also, clarify the grouping of one of the asserts to silence -Wparentheses. llvm-svn: 147863
* Remove unnecessary default cases in switches that cover all enum values.David Blaikie2012-01-103-7/+0
| | | | llvm-svn: 147855
* Enable LSR IV Chains with sufficient heuristics.Andrew Trick2012-01-101-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | These heuristics are sufficient for enabling IV chains by default. Performance analysis has been done for i386, x86_64, and thumbv7. The optimization is rarely important, but can significantly speed up certain cases by eliminating spill code within the loop. Unrolled loops are prime candidates for IV chains. In many cases, the final code could still be improved with more target specific optimization following LSR. The goal of this feature is for LSR to make the best choice of induction variables. Instruction selection may not completely take advantage of this feature yet. As a result, there could be cases of slight code size increase. Code size can be worse on x86 because it doesn't support postincrement addressing. In fact, when chains are formed, you may see redundant address plus stride addition in the addressing mode. GenerateIVChains tries to compensate for the common cases. On ARM, code size increase can be mitigated by using postincrement addressing, but downstream codegen currently misses some opportunities. llvm-svn: 147826
* Update language check. Do not ignore DW_LANG_Python.Devang Patel2012-01-091-1/+2
| | | | | | Patch by Joe Groff! llvm-svn: 147781
* Cleanup comments and argument types related to my previous ↵Andrew Trick2012-01-071-4/+5
| | | | | | replaceCongruentPhis checkin. llvm-svn: 147709
* Extended replaceCongruentPhis to handle mixed phi types.Andrew Trick2012-01-071-13/+61
| | | | llvm-svn: 147707
* Expose isNonConstantNegative to users of ScalarEvolution.Andrew Trick2012-01-072-20/+20
| | | | llvm-svn: 147700
* Put all IVUsers in the processed set. Allow querying IVUsers with ↵Andrew Trick2012-01-061-3/+6
| | | | | | isIVUserOrOperand. llvm-svn: 147686
* SCEVExpander: hoistStep should check strict dominance.Andrew Trick2012-01-061-1/+1
| | | | llvm-svn: 147683
* Generalize isSafeToSpeculativelyExecute to work on arbitraryDan Gohman2012-01-041-1/+5
| | | | | | | Values, rather than just Instructions, since it's interesting for ConstantExprs too. llvm-svn: 147560
* Fix SCEVExpander to handle loops with no preheader when LSR gives it aAndrew Trick2012-01-021-0/+6
| | | | | | | | "phony" insertion point. Fixes rdar://10619599: "SelectionDAGBuilder shouldn't visit PHI nodes!" assert llvm-svn: 147439
* PatternMatch: Introduce a matcher for instructions with the "exact" bit. Use ↵Benjamin Kramer2012-01-012-19/+10
| | | | | | it to simplify a few matchers. llvm-svn: 147403
* Change CaptureTracking to pass a Use* instead of a Value* when a value isNick Lewycky2011-12-282-7/+8
| | | | | | | | | | | | | | captured. This allows the tracker to look at the specific use, which may be especially interesting for function calls. Use this to fix 'nocapture' deduction in FunctionAttrs. The existing one does not iterate until a fixpoint and does not guarantee that it produces the same result regardless of iteration order. The new implementation builds up a graph of how arguments are passed from function to function, and uses a bottom-up walk on the argument-SCCs to assign nocapture. This gets us nocapture more often, and does so rather efficiently and independent of iteration order. llvm-svn: 147327
* ComputeMaskedBits: Make knownzero computation more aggressive for ctlz with ↵Benjamin Kramer2011-12-241-1/+8
| | | | | | | | | undef zero. unsigned foo(unsigned x) { return 31 - __builtin_clz(x); } now compiles into a single "bsrl" instruction on x86. llvm-svn: 147255
* Make the unreachable probability much much heavier. The previousChandler Carruth2011-12-221-2/+3
| | | | | | | | | | probability wouldn't be considered "hot" in some weird loop structures or other compounding probability patterns. This makes it much harder to confuse, but isn't really a principled fix. I'd actually like it if we could model a zero probability, as it would make this much easier to reason about. Suggestions for how to do this better are welcome. llvm-svn: 147142
* Continue counting intrinsics as instructions (except when they aren't, such asNick Lewycky2011-12-211-3/+17
| | | | | | debug info) and for being vector operations. Fixes regression from r147037. llvm-svn: 147093
* Fix typo and spacing, no functionality change.Nick Lewycky2011-12-211-2/+2
| | | | llvm-svn: 147092
* A call to a function marked 'noinline' is not an inline candidate. The soleNick Lewycky2011-12-211-4/+4
| | | | | | | call site of an intrinsic is also not an inline candidate. While here, make it more obvious that this code ignores all intrinsics. Noticed by inspection! llvm-svn: 147037
* Make some intrinsics safe to speculatively execute.Nick Lewycky2011-12-211-4/+24
| | | | llvm-svn: 147036
* Add some constantness to BranchProbabilityInfo and BlockFrequnencyInfo.Jakub Staszak2011-12-201-1/+1
| | | | llvm-svn: 146986
* Unweaken vtables as per ↵David Blaikie2011-12-202-0/+28
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146960
* LSR: Fix another corner case in expansion of postinc users.Andrew Trick2011-12-201-0/+14
| | | | | | Fixes PR11571: Instruction does not dominate all uses llvm-svn: 146950
* Allow inlining of functions with returns_twice calls, if they have theJoerg Sonnenberger2011-12-181-6/+8
| | | | | | attribute themselve. llvm-svn: 146851
* When recursing for the original size of a type, stop if we are at aEric Christopher2011-12-161-1/+7
| | | | | | | | | pointer or a reference type - we actually just want the size of the pointer then for that. Fixes rdar://10335756 llvm-svn: 146785
* In DICompositeType, referenced to derived type is either metadata or null.Devang Patel2011-12-161-5/+5
| | | | llvm-svn: 146744
* Virtual table holder field is either metadata or null. Devang Patel2011-12-151-1/+1
| | | | llvm-svn: 146665
* Move Instruction::isSafeToSpeculativelyExecute out of VMCore andDan Gohman2011-12-143-4/+67
| | | | | | | | | 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
* LSR: Fold redundant bitcasts on-the-fly.Andrew Trick2011-12-141-3/+8
| | | | llvm-svn: 146597
* Fix a stupid typo in MemDepPrinter.Eli Friedman2011-12-141-1/+1
| | | | llvm-svn: 146549
* 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
* LLVMBuild: Remove trailing newline, which irked me.Daniel Dunbar2011-12-122-2/+0
| | | | llvm-svn: 146409
* Switch llvm.cttz and llvm.ctlz to accept a second i1 parameter whichChandler Carruth2011-12-121-4/+8
| | | | | | | | | | | | | | | | | | | | 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
* Probably not a good idea to convert a single vector load into a memcpy. WeChad Rosier2011-12-061-0/+2
| | | | | | | | don't do this now, but add a test case to prevent this from happening in the future. Additional test for rdar://9892684 llvm-svn: 145879
* Add support for vectors of pointers.Nadav Rotem2011-12-053-7/+13
| | | | llvm-svn: 145801
* Clear the new cache.Benjamin Kramer2011-12-031-0/+1
| | | | llvm-svn: 145771
* Add a "seen blocks" cache to LVI to avoid a linear scan over the whole cache ↵Benjamin Kramer2011-12-031-1/+13
| | | | | | | | | just to remove no blocks from the maps. -15% on ARMDisassembler.cpp (Release build). It's not that great to add another layer of caching to the caching-heavy LVI but I don't see a better way. llvm-svn: 145770
* Add support for constant folding the pow intrinsic.Chad Rosier2011-12-031-3/+6
| | | | | | rdar://10514247 llvm-svn: 145730
* Fix a few more places where TargetData/TargetLibraryInfo is not being passed.Chad Rosier2011-12-023-16/+31
| | | | | | Add FIXMEs to places that are non-trivial to fix. llvm-svn: 145661
* Abuse of mass replace isn't warranted even when the build is failing. ThanksChad Rosier2011-12-011-25/+29
| | | | | | for the suggestion, Eric. llvm-svn: 145643
* Fix build by not assuming TLI is guaranteed. Will have to track down cases whereChad Rosier2011-12-011-24/+23
| | | | | | TLI isn't being passed to ensure we don't miss opportunities to fold calls. llvm-svn: 145641
OpenPOWER on IntegriCloud