summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Prevent library calls from being folded if -fno-builtin has been specified.Chad Rosier2011-12-011-23/+24
| | | | | | rdar://10500969 llvm-svn: 145639
* Last bit of TargetLibraryInfo propagation. Also fixed a case for TargetDataChad Rosier2011-12-011-9/+12
| | | | | | | where it appeared beneficial to pass. More of rdar://10500969 llvm-svn: 145630
* Propagate TargetLibraryInfo throughout ConstantFolding.cpp and Chad Rosier2011-12-015-246/+354
| | | | | | | InstructionSimplify.cpp. Other fixups as needed. Part of rdar://10500969 llvm-svn: 145559
* Make use of "getScalarType()". No functionality change.Nick Lewycky2011-12-011-8/+3
| | | | llvm-svn: 145556
* LSR: handle the expansion of phi operands that use postinc forms of the IV.Andrew Trick2011-11-301-36/+68
| | | | | | Fixes PR11431: SCEVExpander::expandAddRecExprLiterally(const llvm::SCEVAddRecExpr*): Assertion `(!isa<Instruction>(Result) || SE.DT->dominates(cast<Instruction>(Result), Builder.GetInsertPoint())) && "postinc expansion does not dominate use"' failed. llvm-svn: 145482
* build/CMake: Finish removal of add_llvm_library_dependencies.Daniel Dunbar2011-11-292-12/+0
| | | | llvm-svn: 145420
* Fix a theoretical problem (not seen in the wild): if different instances of aDuncan Sands2011-11-291-1/+1
| | | | | | | | | | | | | | | 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-8/+8
| | | | | | | This reverts r139450, fixes r139453, and adds much needed comments and a unit test. llvm-svn: 145367
* Make SCEV print <nsw><nuw> for Add/MulExpr.Andrew Trick2011-11-291-0/+8
| | | | llvm-svn: 145364
* Make SelectionDAG::InferPtrAlignment use llvm::ComputeMaskedBits instead of ↵Eli Friedman2011-11-281-8/+10
| | | | | | duplicating the logic for globals. Make llvm::ComputeMaskedBits handle GlobalVariables slightly more aggressively, to match what InferPtrAlignment knew how to do. llvm-svn: 145304
* Remove the temporary flag -disable-unroll-scev and dead code.Andrew Trick2011-11-281-93/+0
| | | | | | SCEV should now be used for trip count analysis, not LoopInfo. llvm-svn: 145262
* Move code into anonymous namespaces.Benjamin Kramer2011-11-261-1/+1
| | | | llvm-svn: 145154
OpenPOWER on IntegriCloud