Commit c3cbd27
[AMDGPU] Calc IsVALU correctly during UADDO/USUBO selection (#159814)
Fix two bugs. The first bug hid the second bug.
1. Calculate IsVALU correctly during UADDO/USUBO selection. IsVALU
should be false if the carryout users are UADDO_CARRY/USUBO_CARRY.
However instruction selection visits uses before defs, so the
UADDO_CARRY/USUBO_CARRY nodes are normally (probably always) already
converted to S_ADD_CO_PSEUDO/S_SUB_CO_PSEUDO. Fix to check for these
machine opcodes.
2. Without this fix, UADDO/USUBO selection will always select the VALU
instructions V_ADD_CO__U32_e64/V_SUB_CO_U32_e64.
S_UADDO_PSEUDO/S_USUBO_PSEUDO were never selected in the CodeGen/AMDGPU
tests. Thus, S_UADDO_PSEUDO/S_USUBO_PSEUDO cases were never hit in
EmitInstrWithCustomInserter. The code generation for
S_UADDO_PSEUDO/S_USUBO_PSEUDO had a bug where it could not handle code
generation for 32-bit $scc_out.
---------
Signed-off-by: John Lu <[email protected]>
Co-authored-by: Matt Arsenault <[email protected]>1 parent 62660e5 commit c3cbd27
File tree
12 files changed
+5753
-5136
lines changed- llvm
- lib/Target/AMDGPU
- test/CodeGen/AMDGPU
12 files changed
+5753
-5136
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1089 | 1089 | | |
1090 | 1090 | | |
1091 | 1091 | | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
1096 | 1103 | | |
1097 | 1104 | | |
1098 | 1105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5970 | 5970 | | |
5971 | 5971 | | |
5972 | 5972 | | |
5973 | | - | |
5974 | | - | |
5975 | | - | |
| 5973 | + | |
| 5974 | + | |
| 5975 | + | |
5976 | 5976 | | |
5977 | 5977 | | |
5978 | 5978 | | |
| |||
0 commit comments