summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* Move trip count discovery outside of the generic LoopUnroll helper. ThisAndrew Trick2011-07-231-2/+7
| | | | | | removes its dependence on canonical induction variables. llvm-svn: 135829
* whitespaceAndrew Trick2011-07-231-8/+8
| | | | llvm-svn: 135828
* Move the last uses of RetainFunc etc. over to using getRetainCallee() etc.Dan Gohman2011-07-221-23/+35
| | | | | | | so that a declaration for objc_retain is created when needed if it doesn't already exist. rdar://9825114. llvm-svn: 135821
* Fix MergeInVectorType to check for vector types with the same allocDan Gohman2011-07-211-0/+6
| | | | | | | size but different element types, so that it filters out the cases that CreateShuffleVectorCast doesn't handle. This fixes rdar://9786827. llvm-svn: 135721
* Cleanup: make std::pair usage slightly less indecipherable without actually ↵Andrew Trick2011-07-211-7/+8
| | | | | | naming variables! llvm-svn: 135684
* Convert ConstantExpr::getGetElementPtr andJay Foad2011-07-212-4/+4
| | | | | | ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. llvm-svn: 135673
* move tier out of an anonymous namespace, it doesn't make senseChris Lattner2011-07-212-23/+22
| | | | | | | | to for it to be an an anon namespace and be in a header. Eliminate some extraenous uses of tie. llvm-svn: 135669
* LSR, correct fix for rdar://9786536. Silly casting bug.Andrew Trick2011-07-211-2/+2
| | | | llvm-svn: 135654
* LSR must sometimes sign-extend before generating double constants.Andrew Trick2011-07-211-3/+10
| | | | | | rdar://9786536 llvm-svn: 135650
* LSR crashes on an empty IVUsers list.Andrew Trick2011-07-211-0/+3
| | | | | | rdar://9786536 llvm-svn: 135644
* Bring LICM into compliance with the new "Memory Model for Concurrent ↵Eli Friedman2011-07-201-18/+30
| | | | | | Operations" in LangRef. llvm-svn: 135625
* Fix a GCC warning.Jay Foad2011-07-201-2/+2
| | | | llvm-svn: 135581
* indvars: Added getInsertPointForUses to find a valid place to truncate the IV.Andrew Trick2011-07-201-15/+32
| | | | llvm-svn: 135568
* indvars -disable-iv-rewrite: Add NarrowIVDefUse to cache def-useAndrew Trick2011-07-201-54/+61
| | | | | | | info. Holding Use* pointers is bad form even though it happened to work in this case. llvm-svn: 135566
* indvars -disable-iv-rewrite fix: derived GEP IVsAndrew Trick2011-07-201-0/+6
| | | | llvm-svn: 135558
* Convert TargetData::getIndexedOffset to use ArrayRef.Jay Foad2011-07-191-6/+4
| | | | llvm-svn: 135478
* Use ArrayRef in ConstantFoldInstOperands and ConstantFoldCall.Jay Foad2011-07-191-1/+1
| | | | llvm-svn: 135477
* Compiler warning.Andrew Trick2011-07-181-3/+3
| | | | llvm-svn: 135426
* indvars: LinearFunctionTestReplace for non-canonical IVs.Andrew Trick2011-07-181-48/+292
| | | | | | | | | | For -disable-iv-rewrite, perform LFTR without generating a new "canonical" induction variable. Instead find the "best" existing induction variable for use in the loop exit test and compute the final value of that IV for use in the new loop exit test. In short, convert to a simple eq/ne exit test as long as it's cheap to do so. llvm-svn: 135420
* indvars: Added verification that LFTR and other indvars goodness doesAndrew Trick2011-07-181-1/+20
| | | | | | not interfere with BackedgeTakenCount computation. llvm-svn: 135412
* indvars: Added isHighCostExpansion. Avoid generating extra ops in theAndrew Trick2011-07-181-17/+51
| | | | | | | preheader for the sole purpose of LFTR, since LFTR itself is usually not a clear optimization. llvm-svn: 135409
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-1811-230/+230
| | | | llvm-svn: 135375
* indvars: fix a pass-sensitivity issue that would hit the SCEVExpanderAndrew Trick2011-07-161-2/+13
| | | | | | | assertion I added in r135333. Check for the existence of a preheader before expanding a recurrence. llvm-svn: 135335
* indvars: remove ExprToIVMap because it won't be needed by LFTR.Andrew Trick2011-07-161-9/+3
| | | | llvm-svn: 135334
* Disable loop idiom recognition of memset/memcpy if the function being compiledChad Rosier2011-07-151-0/+5
| | | | | | | | | is named after a common idiom (i.e., memset/memcpy). Otherwise, we can run into infinite recursion. Ideally, the user should use the correct -fno-builtin flag, but in case they don't we should play nicely. rdar://9763412 llvm-svn: 135286
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-152-3/+2
| | | | llvm-svn: 135265
* start using the new helper methods a bit.Chris Lattner2011-07-152-2/+2
| | | | llvm-svn: 135251
* Change Intrinsic::getDeclaration and friends to take an ArrayRef.Benjamin Kramer2011-07-142-2/+2
| | | | llvm-svn: 135154
* Second attempt at de-constifying LLVM Types in FunctionType::get(),Jay Foad2011-07-123-18/+18
| | | | | | StructType::get() and TargetData::getIntPtrType(). llvm-svn: 134982
* Revert r134893 and r134888 (and related patches in other trees). It was causingBill Wendling2011-07-123-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an assert on Darwin llvm-gcc builds. Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\ ne 2067. etc. http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354 --- Reverse-merging r134893 into '.': U include/llvm/Target/TargetData.h U include/llvm/DerivedTypes.h U tools/bugpoint/ExtractFunction.cpp U unittests/Support/TypeBuilderTest.cpp U lib/Target/ARM/ARMGlobalMerge.cpp U lib/Target/TargetData.cpp U lib/VMCore/Constants.cpp U lib/VMCore/Type.cpp U lib/VMCore/Core.cpp U lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Instrumentation/ProfilingUtils.cpp U lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/CodeGen/SjLjEHPrepare.cpp --- Reverse-merging r134888 into '.': G include/llvm/DerivedTypes.h U include/llvm/Support/TypeBuilder.h U include/llvm/Intrinsics.h U unittests/Analysis/ScalarEvolutionTest.cpp U unittests/ExecutionEngine/JIT/JITTest.cpp U unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp U unittests/VMCore/PassManagerTest.cpp G unittests/Support/TypeBuilderTest.cpp U lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp U lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp U lib/VMCore/IRBuilder.cpp G lib/VMCore/Type.cpp U lib/VMCore/Function.cpp G lib/VMCore/Core.cpp U lib/VMCore/Module.cpp U lib/AsmParser/LLParser.cpp U lib/Transforms/Utils/CloneFunction.cpp G lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Utils/InlineFunction.cpp U lib/Transforms/Instrumentation/GCOVProfiling.cpp U lib/Transforms/Scalar/ObjCARC.cpp U lib/Transforms/Scalar/SimplifyLibCalls.cpp U lib/Transforms/Scalar/MemCpyOptimizer.cpp G lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/Transforms/IPO/ArgumentPromotion.cpp U lib/Transforms/InstCombine/InstCombineCompares.cpp U lib/Transforms/InstCombine/InstCombineAndOrXor.cpp U lib/Transforms/InstCombine/InstCombineCalls.cpp U lib/CodeGen/DwarfEHPrepare.cpp U lib/CodeGen/IntrinsicLowering.cpp U lib/Bitcode/Reader/BitcodeReader.cpp llvm-svn: 134949
* indvars: Code reorganization in preparation forAndrew Trick2011-07-121-589/+624
| | | | | | | | | | | | | | | | | LinearFunctionTestReplace rewrite. No functionality. I've been wanting to group the indvar subphases into sections and order them by their logical sequence. My next checkin adds functions related to LFTR, and doing the reorg now should help reviewers. Since, most of the code in IndVarSimplify.cpp has recently been replaced or will be replaced soon, obscuring blame should not be an issue. This seems like an ideal time to shuffle the code around. I'm happy to take more suggestions for cleaning up the code. Or if you've been wanting to cleanup anything in this file yourself, now is a good time. llvm-svn: 134941
* De-constify Types in FunctionType::get().Jay Foad2011-07-113-18/+18
| | | | llvm-svn: 134888
* Added recognition for signed add/sub/mul with overflow intrinsics to GVN as ↵Lang Hames2011-07-091-0/+3
| | | | | | per Chris and Frits suggestion. llvm-svn: 134777
* Make GVN look through extractvalues for recognised intrinsics. GVN can then ↵Lang Hames2011-07-081-7/+54
| | | | | | CSE ops that match values produced by the intrinsics. llvm-svn: 134677
* Use DBG_VALUE location while inserting DBG_VALUE during alloca promotion.Devang Patel2011-07-071-2/+2
| | | | llvm-svn: 134568
* Handle cases where multiple dbg.declare and dbg.value intrinsics are tied to ↵Devang Patel2011-07-061-11/+58
| | | | | | one alloca. llvm-svn: 134549
* Simplify. Consolidate dbg.declare handling in AllocaPromoter.Devang Patel2011-07-062-14/+19
| | | | llvm-svn: 134538
* indvars -disable-iv-rewrite: ExprToMap lives in Pass data, so be moreAndrew Trick2011-07-061-1/+2
| | | | | | careful about referencing values. llvm-svn: 134537
* indvars -disable-iv-rewrite: Added SimplifyCongruentIVs.Andrew Trick2011-07-061-1/+58
| | | | llvm-svn: 134530
* LICM: Remove trailing white spacesTobias Grosser2011-07-061-32/+32
| | | | llvm-svn: 134521
* LICM: Do not loose alignment on promotionTobias Grosser2011-07-061-8/+30
| | | | | | | | The promotion code lost any alignment information, when hoisting loads and stores out of the loop. This lead to incorrect aligned memory accesses. We now use the largest alignment we can prove to be correct. llvm-svn: 134520
* Introduce "expect" intrinsic instructions.Jakub Staszak2011-07-061-0/+1
| | | | llvm-svn: 134516
* Preserve debug loc.Devang Patel2011-07-051-1/+1
| | | | llvm-svn: 134441
* indvars -disable-iv-rewrite: avoid multiple IVs in weird cases.Andrew Trick2011-07-051-18/+30
| | | | | | Putting back the helper that I removed on 7/1 to do this right. llvm-svn: 134423
* indvars -disable-iv-rewrite: bug fix involving weird geps and related cleanup.Andrew Trick2011-07-021-46/+51
| | | | llvm-svn: 134306
* Fix likely typo, reduce number of instruction name collisions.Nick Lewycky2011-07-011-1/+1
| | | | llvm-svn: 134235
* indvars -disable-iv-rewrite: handle cloning binary operators that cannot ↵Andrew Trick2011-06-301-3/+7
| | | | | | overflow. llvm-svn: 134177
* indvars -disable-iv-rewrite: handle an edge case involving identity phis.Andrew Trick2011-06-301-3/+8
| | | | llvm-svn: 134124
* indvars -disable-iv-rewrite: insert new trunc instructions carefully.Andrew Trick2011-06-291-13/+21
| | | | llvm-svn: 134112
* indvars -disable-iv-rewrite: just because SCEV ignores casts doesn'tAndrew Trick2011-06-291-0/+1
| | | | | | mean they can be removed. llvm-svn: 134054
OpenPOWER on IntegriCloud