summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/SCCP.cpp
Commit message (Collapse)AuthorAgeFilesLines
* remove some dead code.Chris Lattner2010-08-181-3/+2
| | | | llvm-svn: 111344
* fix PR7876: If ipsccp decides that a function's address is takenChris Lattner2010-08-121-4/+15
| | | | | | before it rewrites the code, we need to use that in the post-rewrite pass. llvm-svn: 110962
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-2/+2
| | | | llvm-svn: 110460
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-2/+2
| | | | llvm-svn: 110410
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-2/+2
| | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
* simplify by using CallSite constructors; virtually eliminates CallSite::get ↵Gabor Greif2010-07-281-2/+2
| | | | | | from the tree llvm-svn: 109687
* Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson2010-07-211-4/+5
| | | | llvm-svn: 109045
* fix PR6940: sitofp(undef) folds to 0.0, not undef.Chris Lattner2010-04-261-0/+2
| | | | llvm-svn: 102358
* fix a SCCP miscompilation that could happen when aChris Lattner2010-04-091-3/+10
| | | | | | | | | forced constant is changed to a constant, we would end up adding the instruction to the wrong worklist, preventing it from being properly revisited. This fixes rdar://7832370 llvm-svn: 100837
* fix a really nasty bug that Evan was tracking in SCCP. When resolvingChris Lattner2010-04-051-29/+32
| | | | | | | | | | | | | | | | | | undefs in branches/switches, we have two cases: a branch on a literal undef or a branch on a symbolic value which is undef. If we have a literal undef, the code was correct: forcing it to a constant is the right thing to do. If we have a branch on a symbolic value that is undef, we should force the symbolic value to a constant, which then makes the successor block live. Forcing the condition of the branch to being a constant isn't safe if later paths become live and the value becomes overdefined. This is the case that 'forcedconstant' is designed to handle, so just use it. This fixes rdar://7765019 but there is no good testcase for this, the one I have is too insane to be useful in the future. llvm-svn: 100478
* Introduce ImmutableCallSite, useful for contexts where no mutationGabor Greif2010-04-011-1/+1
| | | | | | | | | is necessary. Inherits from new templated baseclass CallSiteBase<> which is highly customizable. Base CallSite on it too, in a configuration that allows full mutation. Adapt some call sites in analyses to employ ImmutableCallSite. llvm-svn: 100100
* rename use_const_iterator to const_use_iterator for consistency's sakeGabor Greif2010-03-251-1/+1
| | | | llvm-svn: 99564
* Finally land the InvokeInst operand reordering.Gabor Greif2010-03-241-1/+2
| | | | | | | | | | | | I have audited all getOperandNo calls now, fixing hidden assumptions. CallSite related uglyness will be eliminated successively. Note this patch has a long and griveous history, for all the back-and-forths have a look at CallSite.h's log. llvm-svn: 99399
* increase const goodness and remove pointless getUser() callsGabor Greif2010-03-241-7/+9
| | | | llvm-svn: 99395
* fix grammaro's pointed out by danielChris Lattner2010-02-271-2/+2
| | | | llvm-svn: 97313
* fix PR6414, a nondeterminism issue in IPSCCP which was becauseChris Lattner2010-02-271-1/+15
| | | | | | of a subtle interation in a loop operating in densemap order. llvm-svn: 97288
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-21/+21
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Change errs() to dbgs().David Greene2010-01-051-21/+21
| | | | llvm-svn: 92612
* Fix a use of an invalidated iterator in the case where there are multipleDan Gohman2009-11-231-1/+5
| | | | | | adjacent uses of a dead basic block from the same user. This fixes PR5596. llvm-svn: 89658
* Fix IPSCCP's code for deleting dead blocks to tolerate outstandingDan Gohman2009-11-201-2/+6
| | | | | | blockaddress users. This fixes PR5569. llvm-svn: 89483
* fix a crash in SCCP handling extractvalue of an array, pointed out andChris Lattner2009-11-101-3/+8
| | | | | | tracked down by Stephan Reiter! llvm-svn: 86726
* Do map insert+find in one step. TODO -= 2.Benjamin Kramer2009-11-051-15/+15
| | | | llvm-svn: 86133
* Fix an iterator invalidation bug that happens when a hashtableChris Lattner2009-11-041-3/+4
| | | | | | resizes in IPSCCP. This fixes PR5394. llvm-svn: 86036
* reimplement multiple return value handling in IPSCCP, making it Chris Lattner2009-11-031-125/+205
| | | | | | | more aggressive an correct. This survives building llvm in 64-bit mode with optimizations and the built llvm passes make check. llvm-svn: 85973
* finish half thunk thoughtChris Lattner2009-11-031-1/+3
| | | | llvm-svn: 85937
* fix an IPSCCP bug I introduced when I changed IPSCCP to start working on Chris Lattner2009-11-031-19/+31
| | | | | | | | | | 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. llvm-svn: 85923
* fix a subtle bug I introduced when refactoring SCCP. TestcaseChris Lattner2009-11-031-1/+1
| | | | | | to follow. llvm-svn: 85903
* turn IPSCCP back on now that the iterator invalidation bug is fixed.Chris Lattner2009-11-031-36/+50
| | | | llvm-svn: 85858
* fix a nasty iterator invalidation bug from my conversion fromChris Lattner2009-11-021-3/+2
| | | | | | std::map to DenseMap, exposed on release llvm-gcc bootstrap. llvm-svn: 85840
* revert r8579[56], which are causing unhappiness in buildbot land.Chris Lattner2009-11-021-50/+36
| | | | llvm-svn: 85818
* disable IPSCCP support for multiple return values, it is buggy, so justChris Lattner2009-11-021-1/+2
| | | | | | disable it until I can fix it. llvm-svn: 85810
* improve IPSCCP to be able to propagate the result of "!mayBeOverridden"Chris Lattner2009-11-021-36/+49
| | | | | | | | | 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. llvm-svn: 85795
* don't mark the arguments of prototype overdefined, they will never be queried.Chris Lattner2009-11-021-3/+6
| | | | llvm-svn: 85793
* restore some code I removed in r85788, refactor it intoChris Lattner2009-11-021-4/+18
| | | | | | a shared place instead of duplicating it 4 times. llvm-svn: 85792
* remove some confused code that dates from when we hadChris Lattner2009-11-021-10/+2
| | | | | | "multiple return values" but not "first class aggregates" llvm-svn: 85791
* avoid redundant lookups in BBExecutable, and make it a SmallPtrSet.Chris Lattner2009-11-021-14/+16
| | | | llvm-svn: 85790
* Use the libanalysis 'ConstantFoldLoadFromConstPtr' functionChris Lattner2009-11-021-18/+11
| | | | | | | instead of reinventing SCCP-specific logic. This gives us new powers. llvm-svn: 85789
* switch the main 'ValueState' map from being an std::map to beingChris Lattner2009-11-021-311/+281
| | | | | | | | | | | 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. llvm-svn: 85788
* only IPSCCP incoming arguments if the function is executable, this fixesChris Lattner2009-11-021-15/+17
| | | | | | an assertion on the buildbot. llvm-svn: 85784
* add a new ValueState::getConstantInt() helper, use it to Chris Lattner2009-11-021-52/+53
| | | | | | simplify some code. llvm-svn: 85783
* tidy up some more: remove some extraneous inline specifiers, return harder.Chris Lattner2009-11-021-126/+95
| | | | llvm-svn: 85780
* eliminate the SCCPSolver::getValueMapping method.Chris Lattner2009-11-021-25/+23
| | | | llvm-svn: 85778
* fix failures introduced in r85774Chris Lattner2009-11-021-1/+2
| | | | llvm-svn: 85777
* factor duplicated code into a new DeleteInstructionInBlockChris Lattner2009-11-021-92/+80
| | | | | | function, eliminate temporary (and pointless) smallvector. llvm-svn: 85776
* Chris used to use '...' instead of proper grammar.Chris Lattner2009-11-021-30/+32
| | | | llvm-svn: 85775
* remove some extraneous llvmcontext stuff.Chris Lattner2009-11-021-31/+26
| | | | llvm-svn: 85774
* change LatticeVal to use PointerIntPair to save some space.Chris Lattner2009-11-021-49/+52
| | | | llvm-svn: 85773
* teach ipsccp and ipconstprop that a blockaddress doesn't 'take the address' ↵Chris Lattner2009-11-011-2/+4
| | | | | | | | | 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. llvm-svn: 85709
* teach various passes about blockaddress. We no longerChris Lattner2009-10-291-24/+48
| | | | | | crash on any clang tests. llvm-svn: 85465
* Rename MallocFreeHelper as MemoryBuiltinsVictor Hernandez2009-10-271-1/+1
| | | | llvm-svn: 85286
OpenPOWER on IntegriCloud