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
b94afb778c
fix instcombine to only do store sinking when the alignments
...
of the two loads agree. Propagate that onto the new store.
llvm-svn: 85772
2009-11-02 02:06:37 +00:00
Chris Lattner
f3c2039dde
when merging two loads, make sure to take the min of their alignment,
...
not the max. This didn't matter until the previous patch because
instcombine would refuse to sink loads with differenting alignments.
llvm-svn: 85738
2009-11-01 20:07:07 +00:00
Chris Lattner
e7b1e067e9
split load sinking out to its own function, like gep sinking.
...
llvm-svn: 85737
2009-11-01 20:04:24 +00:00
Chris Lattner
b3fe1009a5
fix a bug noticed by inspection: when instcombine sinks loads through
...
phis, it didn't preserve the alignment of the load. This is a missed
optimization of the alignment is high and a miscompilation when the
alignment is low.
llvm-svn: 85736
2009-11-01 19:50:13 +00:00
Chris Lattner
888d78216f
cleanups, switch GlobalDCE to SmallPtrSet instead of std::set
...
llvm-svn: 85730
2009-11-01 19:03:42 +00:00
Chris Lattner
ad2926bbb4
remove a bunch of locking from LLVMContextImpl. Since only one thread
...
can be banging on a context at a time, this isn't needed. Owen, please
review.
llvm-svn: 85728
2009-11-01 18:42:03 +00:00
Chris Lattner
02e43b65d1
improve comment.
...
llvm-svn: 85725
2009-11-01 18:17:37 +00:00
Douglas Gregor
16c6819959
Reverting 85714, 85715, 85716, which are breaking the build
...
llvm-svn: 85717
2009-11-01 16:42:53 +00:00
Dan Gohman
1d0b06c139
Remove the #include of Pass.h from PassManager.h. This breaks a significant
...
#include dependency, as frontends commonly pull in PassManager.h.
llvm-svn: 85714
2009-11-01 15:20:19 +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
c340ce422d
change llvm::MergeBlockIntoPredecessor to not merge two blocks BB1->BB2
...
when BB2 has its address taken. Since it ends up doing BB2->rauw(BB1),
this can cause the address of the entry block to be taken. Since it is
generally undesirable to nuke blocks whose address is taken, even when
we can, just unconditionally stop this xform.
llvm-svn: 85708
2009-11-01 04:57:33 +00:00
Chris Lattner
746b4c0b20
strengthen an assumption: RevectorBlockTo knows that PredBB
...
ended in an uncond branch because the pass requires BreakCriticalEdges.
However, BCE doesn't eliminate critical adges from indbrs.
llvm-svn: 85707
2009-11-01 04:23:20 +00:00
Chris Lattner
0ee6bbbeb1
if CostMetrics says to never duplicate some code, don't unswitch a loop.
...
This prevents unswitching from duplicating indbr's.
llvm-svn: 85705
2009-11-01 03:42:55 +00:00
Chris Lattner
e7dc33941b
constant fold indirectbr(blockaddress(%bb)) -> br label %bb.
...
llvm-svn: 85704
2009-11-01 03:40:38 +00:00
Chris Lattner
2bbe57b2b8
Revert 85678/85680. The decision is to stay with the current form of
...
indirectbr, thus we don't need "blockaddr(@func, null)". Eliminate it
for simplicity.
llvm-svn: 85699
2009-11-01 01:27:45 +00:00
Chris Lattner
1f101c7a1a
Make sure PRE doesn't split crit edges from indirectbr.
...
llvm-svn: 85692
2009-10-31 22:11:15 +00:00
Chris Lattner
43591a021a
llvm::SplitEdge should refuse to split an edge from an indirectbr.
...
Fix CodeGenPrepare to not try to split edges from indirectbr.
llvm-svn: 85690
2009-10-31 22:04:43 +00:00
Chris Lattner
ea1bebaa65
update the comment above llvm::SplitCriticalEdge, and make
...
it abort on IndirectBrInst as describe in the comment.
llvm-svn: 85688
2009-10-31 21:51:10 +00:00
Chris Lattner
48de74645e
adjust a couple xforms to work with null bb's in BlockAddress.
...
llvm-svn: 85680
2009-10-31 20:13:24 +00:00
Chris Lattner
0be6fcef18
add a comment.
...
llvm-svn: 85671
2009-10-31 17:48:31 +00:00
Dan Gohman
61e806613f
Revert r85667. LoopUnroll currently can't call utility functions which
...
auto-update the DominatorTree because it doesn't keep the DominatorTree
current while it works.
llvm-svn: 85670
2009-10-31 17:33:01 +00:00
Dan Gohman
cb32fa9e90
Remove redundant code.
...
llvm-svn: 85668
2009-10-31 16:16:41 +00:00
Dan Gohman
40cec16be1
Merge the enhancements from LoopUnroll's FoldBlockIntoPredecessor into
...
MergeBlockIntoPredecessor. This makes SimplifyCFG slightly more aggressive,
and makes it unnecessary for LoopUnroll to have its own copy of this code.
llvm-svn: 85667
2009-10-31 16:08:00 +00:00
Dan Gohman
0079f87732
Rename forgetLoopBackedgeTakenCount to forgetLoop, because it
...
clears out more information than just the stored backedge taken count.
llvm-svn: 85664
2009-10-31 15:04:55 +00:00
Dan Gohman
de593b49b6
Replace LoopUnrollPass.cpp's custom code-size estimation code using
...
the new common CodeMetrics code.
llvm-svn: 85663
2009-10-31 14:54:17 +00:00
Dan Gohman
14d0be4693
Simplify this code.
...
llvm-svn: 85662
2009-10-31 14:46:50 +00:00
Dan Gohman
0f8d034e2f
Remove an unnecessary #include.
...
llvm-svn: 85661
2009-10-31 14:39:43 +00:00
Dan Gohman
793119ef88
Update CMakeLists for recent renames.
...
llvm-svn: 85660
2009-10-31 14:38:25 +00:00
Dan Gohman
0186fd092a
Rename UnrollLoop.cpp to LoopUnroll.cpp, and LoopUnroll.cpp to
...
LoopUnrollPass.cpp, for consistency with other passes which are
similarly split.
llvm-svn: 85659
2009-10-31 14:37:31 +00:00
Dan Gohman
04c536dff6
Remove CodeGenLICM. It's largely obsoleted by MachineLICM's new ability
...
to unfold loop-invariant loads.
llvm-svn: 85657
2009-10-31 14:35:41 +00:00
Dan Gohman
25091aa227
Reapply r85634, with the bug fixed.
...
llvm-svn: 85655
2009-10-31 14:22:52 +00:00
Evan Cheng
a0457853b2
Revert 85634. It's breaking consumer-typeset (and others).
...
llvm-svn: 85641
2009-10-31 01:28:06 +00:00
Dan Gohman
c8a5a5ece2
Add a comment about a missed opportunity.
...
llvm-svn: 85635
2009-10-30 23:15:43 +00:00
Dan Gohman
a532f755f7
Optimize around the fact that pred_iterator is slow: instead of sorting
...
PHI operands by the predecessor order, sort them by the order used by the
first PHI in the block. This is still suffucient to expose duplicates.
llvm-svn: 85634
2009-10-30 23:15:21 +00:00
Dan Gohman
48f3169c77
Teach SimplifyCFG how to eliminate duplicate PHI nodes within a block.
...
This reduces codesize on a variety of codes by 1-2% on x86-64. It also
helps clean up after SSAUpdater.
llvm-svn: 85626
2009-10-30 22:39:04 +00:00
Dan Gohman
82139ffc65
Sort the incoming values in PHI nodes to match the predecessor order.
...
This helps expose duplicate PHIs, which will make it easier for them
to be eliminated.
llvm-svn: 85623
2009-10-30 22:22:22 +00:00
Evan Cheng
8db8f72185
Add option to createGVNPass to disable PRE.
...
llvm-svn: 85609
2009-10-30 20:12:24 +00:00
Nick Lewycky
5207d16c05
Apply some cleanups. No functionality changes.
...
llvm-svn: 85498
2009-10-29 07:35:15 +00:00
Chris Lattner
e83554145a
just for the hell of it, allow globalopt to statically evaluate
...
static constructors with indirect gotos :)
llvm-svn: 85495
2009-10-29 05:51:50 +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
Chris Lattner
0a782eec94
teach ValueMapper about BlockAddress', making bugpoint a lot more useful.
...
llvm-svn: 85458
2009-10-29 00:31:02 +00:00
Chris Lattner
8f70e602d3
unindent massive blocks, no functionality change.
...
llvm-svn: 85457
2009-10-29 00:28:30 +00:00
Victor Hernandez
917cf94b22
Extend getMallocArraySize() to determine the array size if the malloc argument is:
...
ArraySize * ElementSize
ElementSize * ArraySize
ArraySize << log2(ElementSize)
ElementSize << log2(ArraySize)
Refactor isArrayMallocHelper and delete isSafeToGetMallocArraySize, so that there is only 1 copy of the malloc array determining logic.
Update users of getMallocArraySize() to not bother calling isArrayMalloc() as well.
llvm-svn: 85421
2009-10-28 20:18:55 +00:00
Devang Patel
de81397884
llvm.dbg.global_variables do not exist anymore.
...
llvm-svn: 85402
2009-10-28 16:51:52 +00:00
Edward O'Callaghan
fbe911a40e
No newline at end of file.
...
llvm-svn: 85390
2009-10-28 15:04:53 +00:00