[PATCH] D65267: [PowerPC][PreEmitPeephole] Remove redundant copies of immediate numbers after TailDup

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 20:03:17 PDT 2019


lkail added a comment.

In D65267#1610661 <https://reviews.llvm.org/D65267#1610661>, @hfinkel wrote:

> Is this something that could be fixed in TailDuplication?


TailDuplication doesn't take specific instructions, such as generating a immediate number, into account. We are able to add code to do such folding in tailduplication, however I think it's beyond taildup's duty.

For the test case, we have such MIR before taildup

  bb.6.land.lhs.true.1:                                                                                                                                                                          
  ; predecessors: %bb.4                                                                                                                                                                          
    successors: %bb.2(0x80000000); %bb.2(100.00%)                                                                                                                                                
                                                                                                                                                                                                 
    renamable $x5 = LI8 0                                                                                                                                                                        
    B %bb.2
  
  
  bb.2.cleanup16:                                                                                                                                                                                
  ; predecessors: %bb.3, %bb.1, %bb.6                                                                                                                                                            
    liveins: $x5                                                                                                                                                                                 
    $x3 = COPY killed renamable $x5                                                                                                                                                              
    BLR8 implicit $lr8, implicit $rm, implicit $x3

So taildup copys `bb.2`s code at the end of `bb.6`.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65267/new/

https://reviews.llvm.org/D65267





More information about the llvm-commits mailing list