Jakob Stoklund Olesen
b92c9347ba
Teach PHIElimination to split critical edges when -split-phi-edges is enabled.
...
Critical edges leading to a PHI node are split when the PHI source variable is
live out from the predecessor block. This help the coalescer eliminate more
PHI joins.
llvm-svn: 86725
2009-11-10 22:01:05 +00:00
Jakob Stoklund Olesen
35918309f2
Refactoring: Extract method PHIElimination::isLiveOut().
...
Clean up some whitespace.
No functional changes.
llvm-svn: 86724
2009-11-10 22:00:56 +00:00
Chris Lattner
f48b199c43
improve comment.
...
llvm-svn: 86723
2009-11-10 21:45:09 +00:00
Chris Lattner
fca84b3dff
Make jump threading eliminate blocks that just contain phi nodes,
...
debug intrinsics, and an unconditional branch when possible. This
reuses the TryToSimplifyUncondBranchFromEmptyBlock function split
out of simplifycfg.
llvm-svn: 86722
2009-11-10 21:40:01 +00:00
Evan Cheng
f5e85bec73
Generalize lsr code that optimize loop to count down towards zero.
...
llvm-svn: 86715
2009-11-10 21:14:05 +00:00
Dan Gohman
d7b00c4c8d
Optimize test more.
...
llvm-svn: 86714
2009-11-10 21:02:18 +00:00
Victor Hernandez
70963992b8
make this handle redefinition of malloc function with different prototype correctly
...
llvm-svn: 86712
2009-11-10 19:53:28 +00:00
Evan Cheng
58fbf886bb
Change Thumb1 address mode printing, instead of
...
[r0, #2 * 4]
Now
[r0, #8 ]
This makes Thumb2 assembly more uniform and frankly the scale doesn't add much.
llvm-svn: 86707
2009-11-10 19:48:13 +00:00
Evan Cheng
2c0fc2e713
Add a comment.
...
llvm-svn: 86706
2009-11-10 19:44:56 +00:00
Duncan Sands
1053bb18c6
Add defensive break.
...
llvm-svn: 86705
2009-11-10 19:36:40 +00:00
Daniel Dunbar
d8e09f2f13
Add a monstrous hack to improve X86ISelDAGToDAG compile time.
...
- Force NDEBUG on in any Release build. This drops the compile time to ~100s
from ~600s, in Release mode.
- This may just be a temporary workaround, I don't know the true nature of the
gcc-4.2 compile time performance problem.
llvm-svn: 86695
2009-11-10 18:24:37 +00:00
Duncan Sands
bfba3451b2
Fix obvious typo.
...
llvm-svn: 86694
2009-11-10 18:21:37 +00:00
Chris Lattner
dc0722e39a
clarify logic.
...
llvm-svn: 86689
2009-11-10 17:00:47 +00:00
Douglas Gregor
852c7d16df
CMake: Add Darwin-specific linker flags for building loadable modules
...
llvm-svn: 86684
2009-11-10 15:30:33 +00:00
Duncan Sands
732a2ed037
Teach DSE to eliminate useless trampolines.
...
llvm-svn: 86683
2009-11-10 13:49:50 +00:00
Duncan Sands
a25c87ef1f
Add brackets to make gcc-4.4 happy.
...
llvm-svn: 86681
2009-11-10 09:32:10 +00:00
Duncan Sands
737962bca6
Codegen support for the llvm.invariant/lifetime.start/end intrinsics:
...
just throw them away.
llvm-svn: 86678
2009-11-10 09:08:09 +00:00
Victor Hernandez
3c98070f2c
Update computeArraySize() to use ComputeMultiple() to determine the array size associated with a malloc; also extend PerformHeapAllocSRoA() to check if the optimized malloc's arg had its highest bit set, so that it is safe for ComputeMultiple() to look through sext instructions while determining the optimized malloc's array size
...
llvm-svn: 86676
2009-11-10 08:32:25 +00:00
Victor Hernandez
89c04dbe2f
Add ComputeMultiple() analysis function that recursively determines if a Value V is a multiple of unsigned Base
...
llvm-svn: 86675
2009-11-10 08:28:35 +00:00
Chris Lattner
3455c2f5c6
optimize test
...
llvm-svn: 86672
2009-11-10 07:44:36 +00:00
Chris Lattner
562cc40dbb
unify the code that determines whether it is a good idea to change the type
...
of a computation. This fixes some infinite loops when dealing with TD that
has no native types.
llvm-svn: 86670
2009-11-10 07:23:37 +00:00
Nick Lewycky
4939d449e1
Simplify.
...
llvm-svn: 86668
2009-11-10 07:00:43 +00:00
Nick Lewycky
f6be02e523
Reapply r86359, "Teach dead store elimination that certain intrinsics write to
...
memory just like a store" with bug fixed (partial-overwrite.ll is the
regression test).
llvm-svn: 86667
2009-11-10 06:46:40 +00:00
Chris Lattner
9428f34d89
refactor TryToSimplifyUncondBranchFromEmptyBlock out of SimplifyCFG.
...
llvm-svn: 86666
2009-11-10 05:59:26 +00:00
Oscar Fuentes
ce417d0ac2
CMake: Support for building llvm loadable modules.
...
llvm-svn: 86656
2009-11-10 02:45:37 +00:00
Daniel Dunbar
9b762e5350
lit: Start documentation testing architecture.
...
llvm-svn: 86655
2009-11-10 02:41:27 +00:00
Daniel Dunbar
fbe1d52c6a
lit: Add ExampleTests, for testing lit and demonstrating test suite features.
...
llvm-svn: 86654
2009-11-10 02:41:17 +00:00
Daniel Dunbar
da307a7868
lit: Fix bug in --show-suites which accidentally override the list of tests.
...
llvm-svn: 86653
2009-11-10 02:40:21 +00:00
Bruno Cardoso Lopes
b662991460
Fix PR5445
...
llvm-svn: 86651
2009-11-10 02:35:13 +00:00
Chris Lattner
04da9d4b33
I misread the parens, not so redundant after all.
...
llvm-svn: 86648
2009-11-10 02:04:54 +00:00
Chris Lattner
f3fc70a936
make jump threading recursively simplify expressions instead of doing it
...
just one level deep. On the testcase we go from getting this:
F1: ; preds = %T2
%F = and i1 true, %cond ; <i1> [#uses=1]
br i1 %F, label %X, label %Y
to a fully threaded:
F1: ; preds = %T2
br label %Y
This changes gets us to the point where we're forming (too many) switch
instructions on doug's strswitch testcase.
llvm-svn: 86646
2009-11-10 01:57:31 +00:00
Chris Lattner
fb540241c8
remove some redundant parens.
...
llvm-svn: 86645
2009-11-10 01:56:04 +00:00
Oscar Fuentes
555721d2c2
CMake: Remove unnecessary `unset' which was not supported by old cmake
...
releases.
llvm-svn: 86644
2009-11-10 01:45:05 +00:00
Dan Gohman
ae83652ce1
Remove an unused variable.
...
llvm-svn: 86642
2009-11-10 01:37:57 +00:00
Dan Gohman
4d8fef974a
Minor code simplification.
...
llvm-svn: 86641
2009-11-10 01:36:20 +00:00
Dan Gohman
b4edfdb842
Trim a bunch of unneeded code from this testcase.
...
llvm-svn: 86640
2009-11-10 01:33:08 +00:00
Chris Lattner
a087a1ca04
don't invalidate PN, rewrite of this code is in progress anyway.
...
llvm-svn: 86639
2009-11-10 01:19:06 +00:00
Chris Lattner
a279728372
add a new SimplifyInstruction API, which is like ConstantFoldInstruction,
...
except that the result may not be a constant. Switch jump threading to
use it so that it gets things like (X & 0) -> 0, which occur when phi preds
are deleted and the remaining phi pred was a zero.
llvm-svn: 86637
2009-11-10 01:08:51 +00:00
Jeffrey Yasskin
23ac706aab
Fix DenseMap iterator constness.
...
This patch forbids implicit conversion of DenseMap::const_iterator to
DenseMap::iterator which was possible because DenseMapIterator inherited
(publicly) from DenseMapConstIterator. Conversion the other way around is now
allowed as one may expect.
The template DenseMapConstIterator is removed and the template parameter
IsConst which specifies whether the iterator is constant is added to
DenseMapIterator.
Actually IsConst parameter is not necessary since the constness can be
determined from KeyT but this is not relevant to the fix and can be addressed
later.
Patch by Victor Zverovich!
llvm-svn: 86636
2009-11-10 01:02:17 +00:00
Chris Lattner
3730cf6fef
factor simplification logic for AND and OR out to InstSimplify from instcombine.
...
llvm-svn: 86635
2009-11-10 00:55:12 +00:00
David Goodwin
93a4f29c67
Fixed to address code review. No functional changes.
...
llvm-svn: 86634
2009-11-10 00:48:55 +00:00
Daniel Dunbar
886e51b5c1
Fix MemoryBuffer::getSTDIN to *not* return null if stdin is empty, this is a lame API.
...
Also, Stringrefify some more MemoryBuffer functions, and add two performance FIXMEs.
llvm-svn: 86630
2009-11-10 00:43:58 +00:00
David Goodwin
538f9c25f8
Allow targets to specify register classes whose member registers should not be renamed to break anti-dependencies.
...
llvm-svn: 86628
2009-11-10 00:15:47 +00:00
Chris Lattner
9941f27797
pull a bunch of logic out of instcombine into instsimplify for compare
...
simplification, this handles the foldable fcmp x,x cases among many others.
llvm-svn: 86627
2009-11-09 23:55:12 +00:00
Dan Gohman
22719d2a1a
Pass the (optional) TargetData object to ConstantFoldInstOperands
...
and ConstantFoldCompareInstOperands.
llvm-svn: 86626
2009-11-09 23:34:17 +00:00
Chris Lattner
9aa69f2205
inline a simple function.
...
llvm-svn: 86625
2009-11-09 23:31:49 +00:00
Chris Lattner
25700676d4
rename SimplifyCompare -> SimplifyCmpInst and split it into
...
Simplify[IF]Cmp pieces. Add some predicates to CmpInst to
determine whether a predicate is fp or int.
llvm-svn: 86624
2009-11-09 23:28:39 +00:00
Jim Grosbach
ed9f847274
Now that the default is 'enabled,' a separate command line option for ARM is
...
not necessary.
llvm-svn: 86621
2009-11-09 23:11:45 +00:00
Mike Stump
ee3ba929d0
Add testcase for recent checkin.
...
llvm-svn: 86620
2009-11-09 23:10:49 +00:00
Chris Lattner
131172dc76
fix ConstantFoldCompareInstOperands to take the LHS/RHS as
...
individual operands instead of taking a temporary array
llvm-svn: 86619
2009-11-09 23:06:58 +00:00