diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2009-01-25 03:53:59 +0000 | 
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2009-01-25 03:53:59 +0000 | 
| commit | abda665f5f6b3f569ef28dba660234eee00a5168 (patch) | |
| tree | c27a72a88b5e0a0b0f6e1335ec039a3f9235559f /llvm/lib/Analysis | |
| parent | 8bad1c59031f218d523346a67d94ab0625a08023 (diff) | |
| download | bcm5719-llvm-abda665f5f6b3f569ef28dba660234eee00a5168.tar.gz bcm5719-llvm-abda665f5f6b3f569ef28dba660234eee00a5168.zip | |
Teach 2addr pass to be do more commuting. If both uses of a two-address instruction are killed, but the first operand has a use before and after the def, commute if the second operand does not suffer from the same issue.
%reg1028<def> = EXTRACT_SUBREG %reg1027<kill>, 1                                                                                                                                     
%reg1029<def> = MOV8rr %reg1028                                                                                                                                                      
%reg1029<def> = SHR8ri %reg1029, 7, %EFLAGS<imp-def,dead>                                                                                                                            
insert => %reg1030<def> = MOV8rr %reg1028                                                                                                                                            
%reg1030<def> = ADD8rr %reg1028<kill>, %reg1029<kill>, %EFLAGS<imp-def,dead>                                                                                                         
In this case, it might not be possible to coalesce the second MOV8rr                                                                                                                 
instruction if the first one is coalesced. So it would be profitable to                                                                                                              
commute it:                                                                                                                                                                          
%reg1028<def> = EXTRACT_SUBREG %reg1027<kill>, 1                                                                                                                                     
%reg1029<def> = MOV8rr %reg1028                                                                                                                                                      
%reg1029<def> = SHR8ri %reg1029, 7, %EFLAGS<imp-def,dead>                                                                                                                            
insert => %reg1030<def> = MOV8rr %reg1029                                                                                                                                            
%reg1030<def> = ADD8rr %reg1029<kill>, %reg1028<kill>, %EFLAGS<imp-def,dead>
llvm-svn: 62954
Diffstat (limited to 'llvm/lib/Analysis')
0 files changed, 0 insertions, 0 deletions

