David Greene
02e79531be
Change errs() to dbgs().
...
llvm-svn: 92612
2010-01-05 01:27:15 +00:00
Dan Gohman
0ef3e7cf76
Fix a use of an invalidated iterator in the case where there are multiple
...
adjacent uses of a dead basic block from the same user. This fixes PR5596.
llvm-svn: 89658
2009-11-23 16:13:39 +00:00
Dan Gohman
94cca19d9d
Fix IPSCCP's code for deleting dead blocks to tolerate outstanding
...
blockaddress users. This fixes PR5569.
llvm-svn: 89483
2009-11-20 20:19:14 +00:00
Chris Lattner
a163be92fc
fix a crash in SCCP handling extractvalue of an array, pointed out and
...
tracked down by Stephan Reiter!
llvm-svn: 86726
2009-11-10 22:02:09 +00:00
Benjamin Kramer
f10e3edefb
Do map insert+find in one step. TODO -= 2.
...
llvm-svn: 86133
2009-11-05 14:33:27 +00:00
Chris Lattner
4864198071
Fix an iterator invalidation bug that happens when a hashtable
...
resizes in IPSCCP. This fixes PR5394.
llvm-svn: 86036
2009-11-04 18:57:42 +00:00
Chris Lattner
b634c6cdb5
reimplement multiple return value handling in IPSCCP, making it
...
more aggressive an correct. This survives building llvm in 64-bit
mode with optimizations and the built llvm passes make check.
llvm-svn: 85973
2009-11-03 23:40:48 +00:00
Chris Lattner
10c341e8fa
finish half thunk thought
...
llvm-svn: 85937
2009-11-03 20:52:57 +00:00
Chris Lattner
2aa5962af6
fix an IPSCCP bug I introduced when I changed IPSCCP to start working on
...
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
2009-11-03 19:24:51 +00:00
Chris Lattner
bfe755788f
fix a subtle bug I introduced when refactoring SCCP. Testcase
...
to follow.
llvm-svn: 85903
2009-11-03 16:50:11 +00:00
Chris Lattner
b1dfdadabd
turn IPSCCP back on now that the iterator invalidation bug is fixed.
...
llvm-svn: 85858
2009-11-03 03:42:51 +00:00
Chris Lattner
00c9eb665d
fix a nasty iterator invalidation bug from my conversion from
...
std::map to DenseMap, exposed on release llvm-gcc bootstrap.
llvm-svn: 85840
2009-11-02 23:25:39 +00:00
Chris Lattner
6f515d4ba8
revert r8579[56], which are causing unhappiness in buildbot land.
...
llvm-svn: 85818
2009-11-02 19:31:10 +00:00
Chris Lattner
a1776913ab
disable IPSCCP support for multiple return values, it is buggy, so just
...
disable it until I can fix it.
llvm-svn: 85810
2009-11-02 18:22:51 +00:00
Chris Lattner
f1afb57935
improve IPSCCP to be able to propagate the result of "!mayBeOverridden"
...
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
2009-11-02 07:33:59 +00:00
Chris Lattner
c9279a9b4d
don't mark the arguments of prototype overdefined, they will never be queried.
...
llvm-svn: 85793
2009-11-02 06:34:04 +00:00
Chris Lattner
9c7e443b07
restore some code I removed in r85788, refactor it into
...
a shared place instead of duplicating it 4 times.
llvm-svn: 85792
2009-11-02 06:28:16 +00:00
Chris Lattner
23f5603692
remove some confused code that dates from when we had
...
"multiple return values" but not "first class aggregates"
llvm-svn: 85791
2009-11-02 06:17:06 +00:00
Chris Lattner
c670f866ce
avoid redundant lookups in BBExecutable, and make it a SmallPtrSet.
...
llvm-svn: 85790
2009-11-02 06:11:23 +00:00
Chris Lattner
16b825e51f
Use the libanalysis 'ConstantFoldLoadFromConstPtr' function
...
instead of reinventing SCCP-specific logic. This gives us
new powers.
llvm-svn: 85789
2009-11-02 06:06:14 +00:00
Chris Lattner
32acebedf7
switch the main 'ValueState' map from being an std::map to being
...
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
2009-11-02 05:55:40 +00:00
Chris Lattner
7e74831e52
only IPSCCP incoming arguments if the function is executable, this fixes
...
an assertion on the buildbot.
llvm-svn: 85784
2009-11-02 03:25:55 +00:00
Chris Lattner
0a8c553eb2
add a new ValueState::getConstantInt() helper, use it to
...
simplify some code.
llvm-svn: 85783
2009-11-02 03:21:36 +00:00
Chris Lattner
4372b58329
tidy up some more: remove some extraneous inline specifiers, return harder.
...
llvm-svn: 85780
2009-11-02 03:03:42 +00:00
Chris Lattner
1c8cb53667
eliminate the SCCPSolver::getValueMapping method.
...
llvm-svn: 85778
2009-11-02 02:54:24 +00:00
Chris Lattner
f02562df08
fix failures introduced in r85774
...
llvm-svn: 85777
2009-11-02 02:48:17 +00:00
Chris Lattner
d4f286cb0c
factor duplicated code into a new DeleteInstructionInBlock
...
function, eliminate temporary (and pointless) smallvector.
llvm-svn: 85776
2009-11-02 02:47:51 +00:00
Chris Lattner
a806b18c99
Chris used to use '...' instead of proper grammar.
...
llvm-svn: 85775
2009-11-02 02:33:50 +00:00
Chris Lattner
37dc1cb0fb
remove some extraneous llvmcontext stuff.
...
llvm-svn: 85774
2009-11-02 02:30:06 +00:00
Chris Lattner
28db47c45a
change LatticeVal to use PointerIntPair to save some space.
...
llvm-svn: 85773
2009-11-02 02:20:32 +00:00
Chris Lattner
d8f9d01b76
teach ipsccp and ipconstprop that a blockaddress doesn't 'take the address' 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
2009-11-01 06:11:53 +00:00
Chris Lattner
a0e35cae82
teach various passes about blockaddress. We no longer
...
crash on any clang tests.
llvm-svn: 85465
2009-10-29 01:21:20 +00:00
Victor Hernandez
0f662a7acf
Rename MallocFreeHelper as MemoryBuiltins
...
llvm-svn: 85286
2009-10-27 20:05:49 +00:00
Victor Hernandez
6c86b93663
Rename MallocHelper as MallocFreeHelper, since it now also identifies calls to free()
...
llvm-svn: 85181
2009-10-26 23:58:56 +00:00
Victor Hernandez
673c036bc7
Remove FreeInst.
...
Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.
llvm-svn: 85176
2009-10-26 23:43:48 +00:00
Victor Hernandez
e8998896f5
Auto-upgrade free instructions to calls to the builtin free function.
...
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.
llvm-svn: 84987
2009-10-24 04:23:03 +00:00
Victor Hernandez
8428eb5720
Remove AllocationInst. Since MallocInst went away, AllocaInst is the only subclass of AllocationInst, so it no longer is necessary.
...
llvm-svn: 84969
2009-10-23 21:09:37 +00:00
Torok Edwin
3801e755cc
Fix PR4313: IPSCCP was not setting the lattice value for the invoke instruction
...
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.
llvm-svn: 84637
2009-10-20 15:15:09 +00:00
Dan Gohman
176e47a413
Remove an unnnecessary LLVMContext argument in
...
ConstantFoldLoadThroughGEPConstantExpr.
llvm-svn: 83311
2009-10-05 16:36:26 +00:00
Chris Lattner
a3cf123e86
strength reduce a ton of type equality tests to check the typeid (Through
...
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.
llvm-svn: 83297
2009-10-05 05:54:46 +00:00
Chris Lattner
8a77e8b353
calls to external functions are already marked overdefined, special casing
...
malloc isn't needed.
llvm-svn: 82932
2009-09-27 21:35:11 +00:00
Torok Edwin
193d22fa77
Constant propagating byval pointer is safe if function is readonly.
...
llvm-svn: 82700
2009-09-24 18:33:42 +00:00
Torok Edwin
81fe296f15
Don't constant propagate byval pointers, since they are not really pointers, but
...
rather structs passed by value.
This fixes PR5038.
llvm-svn: 82689
2009-09-24 09:47:18 +00:00
Victor Hernandez
fe5347d782
Enhance transform passes so that they apply the same tranforms to malloc calls as to MallocInst.
...
Reviewed by Dan Gohman.
llvm-svn: 82300
2009-09-18 22:35:49 +00:00
Chris Lattner
5f54c5bd1c
eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861
...
llvm-svn: 80766
2009-09-02 06:11:42 +00:00
Chris Lattner
784e8d9177
add getPointerAddressSpace() to GEP instruction, use the method
...
in a few scalar xforms to simplify things.
llvm-svn: 80506
2009-08-30 20:06:40 +00:00
Chris Lattner
01dae858b6
eliminate the "Value" printing methods that print to a std::ostream.
...
This required converting a bunch of stuff off DOUT and other cleanups.
llvm-svn: 79819
2009-08-23 04:37:46 +00:00
Dan Gohman
e8847ebe10
Fix debug output to include a newline after printing a Value, now
...
that Value's operator<< doesn't include one.
llvm-svn: 79240
2009-08-17 15:25:05 +00:00
Owen Anderson
9df206d02d
Push LLVMContexts through the IntegerType APIs.
...
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Owen Anderson
1dc40e205b
Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
...
metadata related, which I'm waiting on to avoid conflicting with Devang.
llvm-svn: 77721
2009-07-31 20:28:14 +00:00