Skip to content
Commit df1782c2 authored by pvanhout's avatar pvanhout
Browse files

[MCP] Do not remove redundant copy for COPY from undef

I don't think we can safely remove the second COPY as redundant in such cases.
The first COPY (which has undef src) may be lowered to a KILL instruction instead, resulting in no COPY being emitted at all.

Testcase is X86 so it's in the same place as other testcases for this function, but this was initially spotted on AMDGPU with the following:
```
 renamable $vgpr24 = PRED_COPY undef renamable $vgpr25, implicit $exec
 renamable $vgpr24 = PRED_COPY killed renamable $vgpr25, implicit $exec
```
The second COPY waas removed as redundant, and the first one was lowered to a KILL (= removed too), causing $vgpr24 to not have $vgpr25's value.

Fixes SWDEV-401507

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D152502
parent 90431ca2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment