summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/SCCP.cpp
Commit message (Collapse)AuthorAge
* Change errs() to dbgs().David Greene2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92612 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a use of an invalidated iterator in the case where there are multipleDan Gohman2009-11-23
| | | | | | | adjacent uses of a dead basic block from the same user. This fixes PR5596. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89658 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix IPSCCP's code for deleting dead blocks to tolerate outstandingDan Gohman2009-11-20
| | | | | | | blockaddress users. This fixes PR5569. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89483 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a crash in SCCP handling extractvalue of an array, pointed out andChris Lattner2009-11-10
| | | | | | | tracked down by Stephan Reiter! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86726 91177308-0d34-0410-b5e6-96231b3b80d8
* Do map insert+find in one step. TODO -= 2.Benjamin Kramer2009-11-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86133 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an iterator invalidation bug that happens when a hashtableChris Lattner2009-11-04
| | | | | | | resizes in IPSCCP. This fixes PR5394. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86036 91177308-0d34-0410-b5e6-96231b3b80d8
* reimplement multiple return value handling in IPSCCP, making it Chris Lattner2009-11-03
| | | | | | | | more aggressive an correct. This survives building llvm in 64-bit mode with optimizations and the built llvm passes make check. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85973 91177308-0d34-0410-b5e6-96231b3b80d8
* finish half thunk thoughtChris Lattner2009-11-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85937 91177308-0d34-0410-b5e6-96231b3b80d8
* fix an IPSCCP bug I introduced when I changed IPSCCP to start working on Chris Lattner2009-11-03
| | | | | | | | | | | functions that don't have local linkage. Basically, we need to be more careful about propagating argument information to functions whose results we aren't tracking. This fixes a miscompilation of LLVMCConfigurationEmitter.cpp when built with an llvm-gcc that has ipsccp enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85923 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a subtle bug I introduced when refactoring SCCP. TestcaseChris Lattner2009-11-03
| | | | | | | to follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85903 91177308-0d34-0410-b5e6-96231b3b80d8
* turn IPSCCP back on now that the iterator invalidation bug is fixed.Chris Lattner2009-11-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85858 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a nasty iterator invalidation bug from my conversion fromChris Lattner2009-11-02
| | | | | | | std::map to DenseMap, exposed on release llvm-gcc bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85840 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r8579[56], which are causing unhappiness in buildbot land.Chris Lattner2009-11-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85818 91177308-0d34-0410-b5e6-96231b3b80d8
* disable IPSCCP support for multiple return values, it is buggy, so justChris Lattner2009-11-02
| | | | | | | disable it until I can fix it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85810 91177308-0d34-0410-b5e6-96231b3b80d8
* improve IPSCCP to be able to propagate the result of "!mayBeOverridden"Chris Lattner2009-11-02
| | | | | | | | | | function to calls of that function, regardless of whether it has local linkage or has its address taken. Not escaping should only affect whether we make an aggressive assumption about the arguments to a function, not whether we can track the result of it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85795 91177308-0d34-0410-b5e6-96231b3b80d8
* don't mark the arguments of prototype overdefined, they will never be queried.Chris Lattner2009-11-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85793 91177308-0d34-0410-b5e6-96231b3b80d8
* restore some code I removed in r85788, refactor it intoChris Lattner2009-11-02
| | | | | | | a shared place instead of duplicating it 4 times. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85792 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some confused code that dates from when we hadChris Lattner2009-11-02
| | | | | | | "multiple return values" but not "first class aggregates" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85791 91177308-0d34-0410-b5e6-96231b3b80d8
* avoid redundant lookups in BBExecutable, and make it a SmallPtrSet.Chris Lattner2009-11-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85790 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the libanalysis 'ConstantFoldLoadFromConstPtr' functionChris Lattner2009-11-02
| | | | | | | | instead of reinventing SCCP-specific logic. This gives us new powers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85789 91177308-0d34-0410-b5e6-96231b3b80d8
* switch the main 'ValueState' map from being an std::map to beingChris Lattner2009-11-02
| | | | | | | | | | | | | a DenseMap. Doing this required being aware of subtle iterator invalidation issues, but it provides a big speedup. In a release-asserts build, this sped up optimizing 403.gcc from 1.34s -> 0.79s (IPSCCP) and 1.11s -> 0.44s (SCCP). This commit also conflates in a bunch of general cleanups, sorry. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85788 91177308-0d34-0410-b5e6-96231b3b80d8
* only IPSCCP incoming arguments if the function is executable, this fixesChris Lattner2009-11-02
| | | | | | | an assertion on the buildbot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85784 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new ValueState::getConstantInt() helper, use it to Chris Lattner2009-11-02
| | | | | | | simplify some code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85783 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy up some more: remove some extraneous inline specifiers, return harder.Chris Lattner2009-11-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85780 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the SCCPSolver::getValueMapping method.Chris Lattner2009-11-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85778 91177308-0d34-0410-b5e6-96231b3b80d8
* fix failures introduced in r85774Chris Lattner2009-11-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85777 91177308-0d34-0410-b5e6-96231b3b80d8
* factor duplicated code into a new DeleteInstructionInBlockChris Lattner2009-11-02
| | | | | | | function, eliminate temporary (and pointless) smallvector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85776 91177308-0d34-0410-b5e6-96231b3b80d8
* Chris used to use '...' instead of proper grammar.Chris Lattner2009-11-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85775 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some extraneous llvmcontext stuff.Chris Lattner2009-11-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85774 91177308-0d34-0410-b5e6-96231b3b80d8
* change LatticeVal to use PointerIntPair to save some space.Chris Lattner2009-11-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85773 91177308-0d34-0410-b5e6-96231b3b80d8
* teach ipsccp and ipconstprop that a blockaddress doesn't 'take the address' ↵Chris Lattner2009-11-01
| | | | | | | | | | of a function in a way that should prevent ip constprop. This allows clang/test/CodeGen/indirect-goto.c to pass with the new indirect goto lowering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85709 91177308-0d34-0410-b5e6-96231b3b80d8
* teach various passes about blockaddress. We no longerChris Lattner2009-10-29
| | | | | | | crash on any clang tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85465 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename MallocFreeHelper as MemoryBuiltinsVictor Hernandez2009-10-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85286 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename MallocHelper as MallocFreeHelper, since it now also identifies calls ↵Victor Hernandez2009-10-26
| | | | | | to free() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85181 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove FreeInst.Victor Hernandez2009-10-26
| | | | | | | | | Remove LowerAllocations pass. Update some more passes to treate free calls just like they were treating FreeInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85176 91177308-0d34-0410-b5e6-96231b3b80d8
* Auto-upgrade free instructions to calls to the builtin free function.Victor Hernandez2009-10-24
| | | | | | | | | Update all analysis passes and transforms to treat free calls just like FreeInst. Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84987 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove AllocationInst. Since MallocInst went away, AllocaInst is the only ↵Victor Hernandez2009-10-23
| | | | | | 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
* Fix PR4313: IPSCCP was not setting the lattice value for the invoke instructionTorok Edwin2009-10-20
| | | | | | | | | | | when the invoke had multiple return values: it set the lattice value only on the extractvalue. This caused the invoke's lattice value to remain the default (undefined), and later propagated to extractvalue's operand, which incorrectly introduces undefined behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84637 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unnnecessary LLVMContext argument inDan Gohman2009-10-05
| | | | | | | ConstantFoldLoadThroughGEPConstantExpr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83311 91177308-0d34-0410-b5e6-96231b3b80d8
* strength reduce a ton of type equality tests to check the typeid (ThroughChris Lattner2009-10-05
| | | | | | | | | the new predicates I added) instead of going through a context and doing a pointer comparison. Besides being cheaper, this allows a smart compiler to turn the if sequence into a switch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83297 91177308-0d34-0410-b5e6-96231b3b80d8
* calls to external functions are already marked overdefined, special casingChris Lattner2009-09-27
| | | | | | | malloc isn't needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82932 91177308-0d34-0410-b5e6-96231b3b80d8
* Constant propagating byval pointer is safe if function is readonly.Torok Edwin2009-09-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82700 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't constant propagate byval pointers, since they are not really pointers, butTorok Edwin2009-09-24
| | | | | | | | rather structs passed by value. This fixes PR5038. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82689 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance transform passes so that they apply the same tranforms to malloc ↵Victor Hernandez2009-09-18
| | | | | | | | | | calls as to MallocInst. Reviewed by Dan Gohman. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82300 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861Chris Lattner2009-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80766 91177308-0d34-0410-b5e6-96231b3b80d8
* add getPointerAddressSpace() to GEP instruction, use the methodChris Lattner2009-08-30
| | | | | | | in a few scalar xforms to simplify things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80506 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the "Value" printing methods that print to a std::ostream.Chris Lattner2009-08-23
| | | | | | | This required converting a bunch of stuff off DOUT and other cleanups. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79819 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix debug output to include a newline after printing a Value, nowDan Gohman2009-08-17
| | | | | | | that Value's operator<< doesn't include one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79240 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-31
| | | | | | | | | 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