Commit 08f682e
[MCP] Skip invalidating constant regs during forward propagation
Before this patch, redundant COPY couldn't be removed
for the following case:
%reg1 = COPY %const-reg
... // No use of %reg1 but there is a def/use of %const-reg
%reg2 = COPY killed %reg1
where this can be optimized to:
... // No use of %reg1 but there is a def/use of %const-reg
%reg2 = COPY %const-reg
This patch allows for such optimization by not
invalidating constant registers. This is safe
even where constant registers are defined, as
architectures like AArch64 and RISCV replace a
dead definition of a GPR with a zero constant
register for certain instructions.
Upstream PR:
llvm/llvm-project#111129
Signed-off-by: Vladimir Radosavljevic <[email protected]>1 parent 1859f9a commit 08f682e
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
885 | 885 | | |
886 | 886 | | |
887 | 887 | | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
888 | 894 | | |
889 | 895 | | |
890 | 896 | | |
| |||
0 commit comments