Chris Lattner
5f6b8b2bcb
use getPredicateOnEdge to fold comparisons through PHI nodes,
...
which implements GCC PR18046. This also gets us 360 more
jump threads on 176.gcc.
llvm-svn: 86953
2009-11-12 05:24:05 +00:00
Chris Lattner
22db4b5e0c
various fixes to the lattice transfer functions.
...
llvm-svn: 86952
2009-11-12 04:57:13 +00:00
Chris Lattner
c893c4ed10
switch jump threading to use getPredicateOnEdge in one place
...
making the new LVI stuff smart enough to subsume some special
cases in the old code. Disable them when LVI is around, the
testcase still passes.
llvm-svn: 86951
2009-11-12 04:37:50 +00:00
Chris Lattner
565ee2f1bd
Add a new getPredicateOnEdge method which returns more rich information for
...
constant constraints. Improve the LVI lattice to include inequality
constraints.
llvm-svn: 86950
2009-11-12 04:36:58 +00:00
Jim Grosbach
801b33b17c
Move the utility function UpdateTerminator() from CodePlacementOpt() into
...
MachineBasicBlock so other passes can utilize it.
llvm-svn: 86947
2009-11-12 03:55:33 +00:00
Jim Grosbach
6385ea7c4e
Revert 86857. It's causing consumer-typeset to fail, and there's a better way to do it forthcoming anyway.
...
llvm-svn: 86945
2009-11-12 03:28:35 +00:00
Eric Christopher
cb5e227373
Use stubs when we have them, otherwise use code we already have,
...
otherwise create a stub.
Add a test to make sure we don't create extraneous stubs.
llvm-svn: 86941
2009-11-12 03:12:18 +00:00
Daniel Dunbar
11881e2283
Add the braces gcc suggested.
...
llvm-svn: 86933
2009-11-12 02:52:56 +00:00
Nick Lewycky
9f3e73b0f6
Add CreateNUWAdd and CreateNUWSub to complement the existing CreateNSWAdd and
...
CreateNSWSub functions.
llvm-svn: 86930
2009-11-12 02:08:11 +00:00
Chris Lattner
380ccbaeaa
should not commit when distracted.
...
llvm-svn: 86929
2009-11-12 02:04:17 +00:00
Dan Gohman
a9b40a6eb4
Make the BranchFolderPass class local to BranchFolding.cpp.
...
llvm-svn: 86928
2009-11-12 01:59:26 +00:00
Chris Lattner
e2a63f2798
We now thread some impossible condition information with LVI.
...
llvm-svn: 86927
2009-11-12 01:55:20 +00:00
Dan Gohman
b3bf49f67e
Minor code cleanups.
...
llvm-svn: 86926
2009-11-12 01:51:28 +00:00
Chris Lattner
ba45616958
with the new code we can thread non-instruction values. This
...
allows us to handle the test10 testcase.
llvm-svn: 86924
2009-11-12 01:41:34 +00:00
Chris Lattner
3f80d85191
this argument can be an arbitrary value, it doesn't need to be an instruction.
...
llvm-svn: 86923
2009-11-12 01:37:43 +00:00
Chris Lattner
d5e25436a1
expose edge information and switch j-t to use it.
...
llvm-svn: 86920
2009-11-12 01:29:10 +00:00
Lang Hames
bff25cb044
Fixed an iteration condition in PreAllocSplitting. This should fix some miscompilations casued by PreAllocSplitting.
...
llvm-svn: 86919
2009-11-12 01:24:08 +00:00
Chris Lattner
b584d1e456
move some stuff into DEBUG's and turn on lazy-value-info for
...
the basic.ll testcase.
llvm-svn: 86918
2009-11-12 01:22:16 +00:00
Eric Christopher
ebbfbeef7d
Fix typo, cleanup whitespace.
...
llvm-svn: 86917
2009-11-12 01:06:08 +00:00
Devang Patel
862ef782de
Do not use StringRef in DebugInfo interface.
...
This allows StringRef to skip controversial if(str) check in constructor.
Buildbots, wait for corresponding clang and llvm-gcc FE check-ins!
llvm-svn: 86914
2009-11-12 00:50:58 +00:00
Dan Gohman
09478e975d
Tail merge at any size when there are two potentials blocks and one
...
can be made to fall through into the other.
llvm-svn: 86909
2009-11-12 00:39:10 +00:00
Bill Wendling
7a6b11e707
Don't mark a call as potentially throwing if the function it's calling has the
...
"nounwind" attribute.
llvm-svn: 86897
2009-11-11 23:17:02 +00:00
Bruno Cardoso Lopes
626d49f684
A real solution for the first part of PR5445
...
llvm-svn: 86895
2009-11-11 23:09:33 +00:00
Chris Lattner
19019eaf00
make LazyValueInfo actually to some stuff. This isn't very tested but improves
...
strswitch.
llvm-svn: 86889
2009-11-11 22:48:44 +00:00
Chris Lattner
67146695b6
pass TD into a SimplifyCmpInst call. Add another case that
...
uses LVI info when -enable-jump-threading-lvi is passed.
llvm-svn: 86886
2009-11-11 22:31:38 +00:00
Dan Gohman
02b155427e
Promote MergePotentialsElt and SameTailElt to be regular classes
...
instead of typedefs for std::pair. This simplifies the type of
SameTails, which previously was std::vector<std::pair<std::vector<std::pair<unsigned, MachineBasicBlock *> >::iterator, MachineBasicBlock::iterator>
llvm-svn: 86885
2009-11-11 21:57:02 +00:00
Kenneth Uildriks
9f34406a90
x86 users can now return arbitrary sized structs. Structs too large to fit in return registers will be returned through a hidden sret parameter introduced during SelectionDAG construction.
...
llvm-svn: 86876
2009-11-11 19:59:24 +00:00
Dan Gohman
71782d59c7
Revert this line of 86871.
...
llvm-svn: 86875
2009-11-11 19:56:05 +00:00
Devang Patel
d41f119dac
If doesSupportDebugInformation() is false then do not try to emit dwarf debug info.
...
llvm-svn: 86874
2009-11-11 19:55:08 +00:00
Dan Gohman
34eeb4e983
Check in the changes to this file too.
...
llvm-svn: 86873
2009-11-11 19:49:34 +00:00
Dan Gohman
64b5d0f468
Add support for tail duplication to BranchFolding, and extend
...
tail merging support to handle more cases.
- Recognize several cases where tail merging is beneficial even when
the tail size is smaller than the generic threshold.
- Make use of MachineInstrDesc::isBarrier to help detect
non-fallthrough blocks.
- Check for and avoid disrupting fall-through edges in more cases.
llvm-svn: 86871
2009-11-11 19:48:59 +00:00
Jakob Stoklund Olesen
4f7fd3baeb
Fix liveness calculation when splitting critical edges during PHI elimination.
...
- Edges are split before any phis are eliminated, so the code is SSA.
- Create a proper IR BasicBlock for the split edges.
- LiveVariables::addNewBlock now has same syntax as
MachineDominatorTree::addNewBlock. Algorithm calculates predecessor live-out
set rather than successor live-in set.
This feature still causes some miscompilations.
llvm-svn: 86867
2009-11-11 19:31:31 +00:00
Devang Patel
addf8b1ac6
Reenable StackTracke.cpp test.
...
llvm-svn: 86861
2009-11-11 19:08:42 +00:00
Devang Patel
717b246b19
Add SetDebugLocation() variant to
...
add debug info location to an instruction.
llvm-svn: 86859
2009-11-11 19:06:06 +00:00
Evan Cheng
3d3c24a82c
Add TargetLowering::isLegalICmpImmediate. It tells LSR what immediate can be folded into target icmp instructions.
...
llvm-svn: 86858
2009-11-11 19:05:52 +00:00
Jim Grosbach
d576d66d91
Do jump table adjustment before constant island allocation
...
llvm-svn: 86857
2009-11-11 19:04:24 +00:00
Dan Gohman
16cfb9106e
Fix indentation level.
...
llvm-svn: 86856
2009-11-11 18:42:28 +00:00
Dan Gohman
c86b5a15f5
Whitespace cleanups.
...
llvm-svn: 86855
2009-11-11 18:38:14 +00:00
Dan Gohman
84bb28fc84
Prefix MBB numbers with "BB#" in debug output to make it clear what
...
the numbers mean.
llvm-svn: 86854
2009-11-11 18:23:17 +00:00
Dan Gohman
f4141f1dda
Minor code simplification.
...
llvm-svn: 86853
2009-11-11 18:18:34 +00:00
Dan Gohman
acc57b2446
Fix a copy+pasto in a comment.
...
llvm-svn: 86852
2009-11-11 18:14:02 +00:00
Dan Gohman
9fd22f68f2
Set isBarrier = 1 on return instructions, as they are control barriers.
...
llvm-svn: 86851
2009-11-11 18:11:07 +00:00
Dan Gohman
d2a0f80ede
Use a tab in INT3's asm string, for consistency.
...
llvm-svn: 86850
2009-11-11 18:07:16 +00:00
Chris Lattner
7a09964e81
another const prop failure.
...
llvm-svn: 86848
2009-11-11 17:54:02 +00:00
Chris Lattner
539bdf0487
add a note
...
llvm-svn: 86847
2009-11-11 17:51:27 +00:00
Chris Lattner
7eb84155a5
Reject duplicate case values in a switch, PR5450.
...
llvm-svn: 86846
2009-11-11 17:37:02 +00:00
Duncan Sands
ba61fed5d3
Don't trivially delete unused calls to llvm.invariant.start. This allows
...
llvm.invariant.start to be used without necessarily being paired with a call
to llvm.invariant.end. If you run the entire optimization pipeline then such
calls are in fact deleted (adce does it), but that's actually a good thing since
we probably do want them to be zapped late in the game. There should really be
an integration test that checks that the llvm.invariant.start call lasts long
enough that all passes that do interesting things with it get to do their stuff
before it is deleted. But since no passes do anything interesting with it yet
this will have to wait for later.
llvm-svn: 86840
2009-11-11 15:34:13 +00:00
Evan Cheng
7e5e40c75e
Add nounwind.
...
llvm-svn: 86814
2009-11-11 07:11:02 +00:00
Chris Lattner
852f2653c4
remove the now dead condprop pass, PR3906.
...
llvm-svn: 86810
2009-11-11 05:56:35 +00:00
Jeffrey Yasskin
e822c99eaa
Fix JITTest.ModuleDeletion in -Asserts mode (which turns off JITEmitDebugInfo
...
by default).
llvm-svn: 86807
2009-11-11 05:30:02 +00:00