A problem that's exposed when machine LICM is enabled. Consider this code:
authorBill Wendling <isanbard@gmail.com>
Mon, 26 May 2008 05:18:34 +0000 (05:18 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 26 May 2008 05:18:34 +0000 (05:18 +0000)
commit48f7f237ea5224c44e9c2782836fb7b60d8b5db1
treed7cd0d8f2c3c13b53745d1e9361bcdb1610ca555
parent505242f9b628a4a9b2dc53346b6f1c43670f44a7
A problem that's exposed when machine LICM is enabled. Consider this code:

LBB1_3:   # bb
...
        xorl    %ebp, %ebp
        subl    (%ebx), %ebp
...
        incl    %ecx
        cmpl    %edi, %ecx
        jl      LBB1_3  # bb

Whe using machine LICM, LLVM converts it into:

        xorl %esi, %esi
LBB1_3: # bb
...
        movl    %esi, %ebp
        subl    (%ebx), %ebp
...
        incl    %ecx
        cmpl    %edi, %ecx
        jl      LBB1_3  # bb

Two address conversion inserts the copy instruction. However, it's cheaper to
rematerialize it, and remat helps reduce register pressure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51562 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/TwoAddressInstructionPass.cpp