[MachineCopyPropagation] Eliminate spillage copies that might be caused by eviction...
authorKai Luo <lkail@cn.ibm.com>
Wed, 8 Feb 2023 02:14:24 +0000 (02:14 +0000)
committerKai Luo <lkail@cn.ibm.com>
Wed, 8 Feb 2023 03:34:25 +0000 (03:34 +0000)
commit96aaebd12e734610fe0ef61329f99fdac253ef9f
tree59d0c353f71e216574d18aea983c3b2c3e9917c7
parent472393eff45002f60826f04fcc9261eeaa9f8691
[MachineCopyPropagation] Eliminate spillage copies that might be caused by eviction chain

Remove spill-reload like copy chains. For example
```
r0 = COPY r1
r1 = COPY r2
r2 = COPY r3
r3 = COPY r4
<def-use r4>
r4 = COPY r3
r3 = COPY r2
r2 = COPY r1
r1 = COPY r0
```
will be folded into
```
r0 = COPY r1
r1 = COPY r4
<def-use r4>
r4 = COPY r1
r1 = COPY r0
```

Reviewed By: qcolombet

Differential Revision: https://reviews.llvm.org/D122118
llvm/include/llvm/CodeGen/TargetSubtargetInfo.h
llvm/lib/CodeGen/MachineCopyPropagation.cpp
llvm/lib/Target/PowerPC/PPCSubtarget.h
llvm/test/CodeGen/PowerPC/mcp-elim-eviction-chain.mir [new file with mode: 0644]