1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

30 Commits

Author SHA1 Message Date
Owen Anderson
f2fea95f2f Reapply r110396, with fixes to appease the Linux buildbot gods.
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson
aadd8a89ca Revert r110396 to fix buildbots.
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
b9762c07cb Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.

llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Dan Gohman
e3963f3cdd Add some basic debug output.
llvm-svn: 105561
2010-06-07 22:32:10 +00:00
Dan Gohman
34b5cb7deb Make CodePlacementOpt detect special EH control flow by
checking whether AnalyzeBranch disagrees with the CFG
directly, rather than looking for EH_LABEL instructions.
EH_LABEL instructions aren't always at the end of the
block, due to FP_REG_KILL and other things. This fixes
an infinite loop compiling MultiSource/Benchmarks/Bullet.

llvm-svn: 96611
2010-02-18 21:25:53 +00:00
Dan Gohman
efb42fa7c7 Fix several comments which had previously been "the the" where a
different word was intended.

llvm-svn: 95795
2010-02-10 20:04:19 +00:00
Dan Gohman
92b6122204 Fix "the the" and similar typos.
llvm-svn: 95781
2010-02-10 16:03:48 +00:00
Chris Lattner
7acf9be6c4 move target-independent opcodes out of TargetInstrInfo
into TargetOpcodes.h.  #include the new TargetOpcodes.h
into MachineInstr.  Add new inline accessors (like isPHI())
to MachineInstr, and start using them throughout the 
codebase.

llvm-svn: 95687
2010-02-09 19:54:29 +00:00
Bill Wendling
736d9ee6b8 Remove dead store.
llvm-svn: 92157
2009-12-25 13:39:58 +00:00
Chris Lattner
9ce833945e improve portability to avoid conflicting with std::next in c++'0x.
Patch by Howard Hinnant!

llvm-svn: 90365
2009-12-03 00:50:42 +00:00
Jim Grosbach
f373f8c459 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
Dan Gohman
b1528d73d1 Re-apply r84295, with fixes to how the loop "top" and "bottom" blocks are
tracked. Instead of trying to manually keep track of these locations
while doing complex modifications, just recompute them when they're needed.
This fixes a bug in which the TopMBB and BotMBB were not correctly updated,
leading to invalid transformations.

llvm-svn: 84598
2009-10-20 04:50:37 +00:00
Anton Korobeynikov
26ed697cf2 Revert r84295, this unbreaks llvm-gcc bootstrap on x86-64/linux
llvm-svn: 84516
2009-10-19 18:21:09 +00:00
Daniel Dunbar
54427e4a2d Fix my -Asserts warning fix.
llvm-svn: 84372
2009-10-17 23:15:04 +00:00
Daniel Dunbar
4d0f5fa69b Suppress -Asserts warning.
llvm-svn: 84327
2009-10-17 09:33:00 +00:00
Dan Gohman
f5225573b7 Enhance CodePlacementOpt's unconditional intra-loop branch elimination logic
to be more general and understand more varieties of loops.

Teach CodePlacementOpt to reorganize the basic blocks of a loop so that
they are contiguous. This also includes a fair amount of logic for preserving
fall-through edges while doing so. This fixes a BranchFolding-ism where blocks
which can't be made to use a fall-through edge and don't conveniently fit
anywhere nearby get tossed out to the end of the function.

llvm-svn: 84295
2009-10-17 00:32:43 +00:00
Dan Gohman
27c126770a Make CodePlacementOpt align loops, rather than loop headers. The
header is just the entry block to the loop, and it needn't be at
the top of the loop in the code layout.

Remove the code that suppressed loop alignment for outer loops,
so that outer loops are aligned.

llvm-svn: 84158
2009-10-15 00:36:22 +00:00
Dan Gohman
564b5f75ac Fix this comment. The loop header is the loop entry point.
llvm-svn: 83437
2009-10-07 00:33:10 +00:00
Bob Wilson
cc8d63fdef Fix CodePlacementOpt::OptimizeIntraLoopEdges so that its return value
correctly indicates whether it changed the code.

llvm-svn: 72038
2009-05-18 21:02:18 +00:00
Evan Cheng
9bd08f0cde Run code placement optimization for targets that want it (arm and x86 for now).
llvm-svn: 71726
2009-05-13 21:42:09 +00:00
Evan Cheng
e43bfc153e If header of inner loop is aligned, do not align the outer loop header. We don't want to add nops in the outer loop for the sake of aligning the inner loop.
llvm-svn: 71609
2009-05-12 23:58:14 +00:00
Bob Wilson
16f684a429 Fix pr4195: When iterating through predecessor blocks, break out of the loop
after finding the (unique) layout predecessor.  Sometimes a block may be listed
more than once, and processing it more than once in this loop can lead to
inconsistent values for FtTBB/FtFBB, since the AnalyzeBranch method does not
clear these values.  There's no point in continuing the loop regardless.
The testcase for this is reduced from the 2003-05-02-DependentPHI SingleSource
test.

llvm-svn: 71536
2009-05-12 03:48:10 +00:00
Evan Cheng
581641b664 Oops. Don't forget to align single bb loops.
llvm-svn: 71363
2009-05-09 19:18:01 +00:00
Evan Cheng
06b0d3879e Enable loop bb placement optimization.
llvm-svn: 71291
2009-05-08 23:35:49 +00:00
Evan Cheng
aadb8051c0 Don't align loop header unless the loop back edge is below the header.
llvm-svn: 71242
2009-05-08 19:01:44 +00:00
Evan Cheng
10038ab095 Reverse branch condition only when there is a conditional branch.
llvm-svn: 71214
2009-05-08 09:35:53 +00:00
Nick Lewycky
a8f179d44b Add explicit braces to disambiguate nested if/else. Removes a warning.
llvm-svn: 71211
2009-05-08 06:57:41 +00:00
Evan Cheng
2a1d20b0fb Optimize code placement in loop to eliminate unconditional branches or move unconditional branch to the outside of the loop. e.g.
///       A:                                                                                                                                                                 
///       ...                                                                                                                                                                
///       <fallthrough to B>                                                                                                                                                 
///                                                                                                                                                                          
///       B:  --> loop header                                                                                                                                                
///       ...                                                                                                                                                                
///       jcc <cond> C, [exit]                                                                                                                                               
///                                                                                                                                                                          
///       C:                                                                                                                                                                 
///       ...                                                                                                                                                                
///       jmp B                                                                                                                                                              
///                                                                                                                                                                          
/// ==>                                                                                                                                                                      
///                                                                                                                                                                          
///       A:                                                                                                                                                                 
///       ...                                                                                                                                                                
///       jmp B                                                                                                                                                              
///                                                                                                                                                                          
///       C:  --> new loop header                                                                                                                                            
///       ...                                                                                                                                                                
///       <fallthough to B>                                                                                                                                                  
///                                                                                                                                                                          
///       B:                                                                                                                                                                 
///       ...                                                                                                                                                                
///       jcc <cond> C, [exit] 

llvm-svn: 71209
2009-05-08 06:34:09 +00:00
Evan Cheng
ef5794cb99 Code refactoring.
llvm-svn: 71151
2009-05-07 05:49:39 +00:00
Evan Cheng
1b99da6e30 Rename "loop aligner" pass to "code placement optimization" pass.
llvm-svn: 71150
2009-05-07 05:42:24 +00:00