Commit f1479c6
[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 4b1c4f9 commit f1479c6
File tree
2 files changed
+7
-2
lines changed- llvm
- lib/CodeGen
- test/CodeGen/EraVM
2 files changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
846 | 852 | | |
847 | 853 | | |
848 | 854 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | | - | |
| 22 | + | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
0 commit comments