aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/ValueTracking.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove AllocationInst. Since MallocInst went away, AllocaInst is the only ↵Victor Hernandez2009-10-231-1/+1
| | | | | | subclass of AllocationInst, so it no longer is necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84969 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove MallocInst from LLVM Instructions.Victor Hernandez2009-10-171-18/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84299 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle sqrt in CannotBeNegativeZero. absf and abslDale Johannesen2009-09-251-3/+7
| | | | | | | | appear to be misspellings, removed in favor of fabs*. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82796 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ValueTracking how to look through GlobalAliases. GlobalAliases areDan Gohman2009-09-151-0/+12
| | | | | | | | not folded in the constant folder because the constant folder doesn't simplify ConstantExpr operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81864 91177308-0d34-0410-b5e6-96231b3b80d8
* fix ComputeMaskedBits handling of zext/sext/trunc to work with vectors.Chris Lattner2009-09-081-6/+9
| | | | | | | This fixes PR4905 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81174 91177308-0d34-0410-b5e6-96231b3b80d8
* add some comments to describe the invariants.Chris Lattner2009-09-081-0/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81173 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix DbgStopPointInst->getFileName/getDirectory, broken by the MDNodification inTorok Edwin2009-09-021-0/+5
| | | | | | | r80406, and readd a -print-dbginfo test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80778 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle TargetData with const.Dan Gohman2009-08-271-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80262 91177308-0d34-0410-b5e6-96231b3b80d8
* Use hasDefinitiveInitializer() instead of testing the same thingDan Gohman2009-08-191-2/+1
| | | | | | | | by hand, and fix a few places that were using hasInitializer() that appear to depend on the initializer value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79441 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix SimplifyLibcalls and ValueTracking to check mayBeOverriddenDan Gohman2009-08-191-1/+2
| | | | | | | before performing optimizations based on constant string values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79384 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-4/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't assume that external global variables are aligned at their preferredDan Gohman2009-08-111-2/+10
| | | | | | | alignment. Only the minimum alignment guaranteed by the ABI may be assumed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78668 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bunch of namespace pollution.Dan Gohman2009-08-071-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78363 91177308-0d34-0410-b5e6-96231b3b80d8
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-311-1/+1
| | | | | | | | | change back are metadata related, which I'm waiting on to avoid conflicting with Devang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8
* Move more code back to 2.5 APIs.Owen Anderson2009-07-301-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77635 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove Value::getNameLenDaniel Dunbar2009-07-261-9/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77148 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new Operator class, for handling Instructions and ConstantExprsDan Gohman2009-07-171-20/+9
| | | | | | | | | | in a convenient manner, factoring out some common code from InstructionCombining and ValueTracking. Move the contents of BinaryOperators.h into Operator.h and use Operator to generalize them to support ConstantExprs as well as Instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76232 91177308-0d34-0410-b5e6-96231b3b80d8
* "LLVMContext* " --> "LLVMContext *"Owen Anderson2009-07-061-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74878 91177308-0d34-0410-b5e6-96231b3b80d8
* Finish LLVMContext-ing lib/Analysis. This required pushing LLVMContext's ↵Owen Anderson2009-07-061-17/+23
| | | | | | through the ValueTracking API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74873 91177308-0d34-0410-b5e6-96231b3b80d8
* do not try to analyze bitcasts from i64 to <2 x i32> in ComputedMaskedBits. ↵Chris Lattner2009-07-021-1/+4
| | | | | | | | | | While we could do this, doing so requires adjusting the demanded mask and the code isn't doing that yet. This fixes PR4495 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74699 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix llvm::ComputeNumSignBits to handle pointer typesDan Gohman2009-06-221-1/+5
| | | | | | | conservatively correctly, instead of aborting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73908 91177308-0d34-0410-b5e6-96231b3b80d8
* Support vector casts in more places, fixing a variety of assertionDan Gohman2009-06-151-10/+25
| | | | | | | | | | | | | | | | failures. To support this, add some utility functions to Type to help support vector/scalar-independent code. Change ConstantInt::get and ConstantFP::get to support vector types, and add an overload to ConstantInt::get that uses a static IntegerType type, for convenience. Introduce a new getConstant method for ScalarEvolution, to simplify common use cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73431 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the Add, Sub, and Mul instruction opcodes into separateDan Gohman2009-06-041-1/+1
| | | | | | | | | | | | | | | | integer and floating-point opcodes, introducing FAdd, FSub, and FMul. For now, the AsmParser, BitcodeReader, and IRBuilder all preserve backwards compatability, and the Core LLVM APIs preserve backwards compatibility for IR producers. Most front-ends won't need to change immediately. This implements the first step of the plan outlined here: http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72897 91177308-0d34-0410-b5e6-96231b3b80d8
* When the low bits of one operand of an add are zero, that numberDan Gohman2009-05-241-10/+31
| | | | | | | of low bits of the other operand are preserved in the output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72365 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ValueTracking a new way to analyze PHI nodes, and and teachDan Gohman2009-05-211-2/+27
| | | | | | | | | Instcombine to be more aggressive about using SimplifyDemandedBits on shift nodes. This allows a shift to be simplified to zero in the included test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72204 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename PaddedSize to AllocSize, in the hope that thisDuncan Sands2009-05-091-1/+1
| | | | | | | | will make it more obvious what it represents, and stop it being confused with the StoreSize. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71349 91177308-0d34-0410-b5e6-96231b3b80d8
* Oops...I committed too much.Bill Wendling2009-03-131-82/+38
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66867 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily XFAIL this test.Bill Wendling2009-03-131-38/+82
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66866 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a ValueTracking rule: RHS means operand 1, not 0. Add a simpleDan Gohman2009-02-241-1/+1
| | | | | | | | ashr instcombine to help expose this code. And apply the fix to SelectionDAG's copy of this code too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65364 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate use of uint32_t to improve compatibility with cygwinChris Lattner2009-01-201-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62590 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-121-1/+1
| | | | | | | suggested by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62099 91177308-0d34-0410-b5e6-96231b3b80d8
* ValueTracker can't assume that an alloca with no specified alignment Chris Lattner2009-01-081-1/+1
| | | | | | | | | | will get its preferred alignment. It has to be careful and cautiously assume it will just get the ABI alignment. This prevents instcombine from rounding up the alignment of a load/store without adjusting the alignment of the alloca. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61934 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply 55137 with fixes.David Greene2008-10-271-4/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58296 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily reverting r55137. This was causing the bootstrap to go into anBill Wendling2008-08-211-7/+3
| | | | | | | infinite loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55149 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ComputeMaskedBits to handle phis correctly. We need to take theDavid Greene2008-08-211-3/+7
| | | | | | | minimum of the known zeros. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55137 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bogus srem rule - a negative value srem'd by a power-of-2Dan Gohman2008-08-131-5/+3
| | | | | | | | can have a non-negative result; for example, -16%16 is 0. Also, clarify the related comments. This fixes PR2670. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54767 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use ++idx_begin when I actually mean idx_begin + 1, especially since weMatthijs Kooijman2008-07-161-1/+1
| | | | | | | | | | also use *idx_begin in the same expression, giving unpredictable results. This fixes this bug: http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-July/015877.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53670 91177308-0d34-0410-b5e6-96231b3b80d8
* - Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an ↵Evan Cheng2008-06-301-0/+100
| | | | | | | | | empty string for ConstantAggregateZero case which surprises selectiondag. - Correctly handle memcpy from constant string which is zero-initialized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52891 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert (52748 and friends):Anton Korobeynikov2008-06-291-100/+0
| | | | | | | | | | | | Move GetConstantStringInfo to lib/Analysis. Remove string output routine from Constant. Update all callers. Change debug intrinsic api slightly to accomodate move of routine, these now return values instead of strings. This unbreaks llvm-gcc bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52884 91177308-0d34-0410-b5e6-96231b3b80d8
* Add back the capability to include nul characters in strings with Chris Lattner2008-06-281-5/+7
| | | | | | | | GetConstantStringInfo. This will hopefully restore llvm-gcc to happy bootstrap land. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52851 91177308-0d34-0410-b5e6-96231b3b80d8
* Tighten up checking.Chris Lattner2008-06-281-4/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52850 91177308-0d34-0410-b5e6-96231b3b80d8
* fix the regressions from Eric's patch by making GetConstantStringInfoChris Lattner2008-06-271-29/+34
| | | | | | | | tolerate a non-nul-terminated string, and handling a direct global reference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52813 91177308-0d34-0410-b5e6-96231b3b80d8
* Reserve the size we'll need in advance.Owen Anderson2008-06-261-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52763 91177308-0d34-0410-b5e6-96231b3b80d8
* Move GetConstantStringInfo to lib/Analysis. RemoveEric Christopher2008-06-261-0/+86
| | | | | | | | | | string output routine from Constant. Update all callers. Change debug intrinsic api slightly to accomodate move of routine, these now return values instead of strings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52748 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some warnings reported by gcc-4.3. HopefullyDuncan Sands2008-06-191-1/+2
| | | | | | | this still compiles on windows - I can't test! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52488 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a SmallVector instead of an array, since auto_ptr doesn't handle arraysMatthijs Kooijman2008-06-171-11/+8
| | | | | | | properly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52390 91177308-0d34-0410-b5e6-96231b3b80d8
* Make BuildSubAggregate use FindInsertedElement again to prevent it fromMatthijs Kooijman2008-06-161-20/+48
| | | | | | | | | inserting extractvalues. In particular, this prevents the insertion of extractvalues that can't be folded away later. Also add an example of when this stuff is needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52328 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the InsertBefore argument to FindInsertedValue optional, so you can ↵Matthijs Kooijman2008-06-161-3/+8
| | | | | | find an inserted value without modifying the code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52319 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass around Instruction* instead of Instruction& in FindInsertedValue and ↵Matthijs Kooijman2008-06-161-5/+5
| | | | | | friends. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52318 91177308-0d34-0410-b5e6-96231b3b80d8