[llvm-dev] Missing Opportunity in Machine-CSE

Haicheng Wu via llvm-dev llvm-dev at lists.llvm.org
Fri Oct 23 13:43:15 PDT 2015


Hi,

 

I find a case that Machine-CSE could but does not perform the optimization

 

bb.1

    %24 = MOVi32imm 1

    %23 = COPY %24

.

bb.3

    %38 = MOVi32imm 1

%37 = COPY %38

.

bb.5

%7 = PHI %23, %bb.1,  %37, %bb.3, .

 

The second MOVi32imm instruction could be eliminated by the CSE, but two
COPYs in bb.1 and bb.3 prevent the problem.  CSE thinks extending %24 to %37
increases the register pressure.  Machine-CSE already supports
TrivialCopyPropagation.  It seems running this  propogation before
machine-cse can simply fix this problem.  Is there any other advice?

 

Best,

 

Haicheng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151023/8531c221/attachment.html>


More information about the llvm-dev mailing list