Commit 8bc7c0a
committed
[X86] Fix failures on EXPENSIVE_CHECKS builds
Error message
```
*** Bad machine code: Illegal virtual register for instruction ***
- function: test__blsi_u32
- basic block: %bb.0 (0x7a61208)
- instruction: %5:gr32 = MOV32r0 implicit-def $eflags
- operand 0: %5:gr32
Expected a GR32_NOREX2 register, but got a GR32 register
```
Reported by RKSimon in #77433
The failure is b/c compiler emits a MOV32r0 with operand GR32 when
fast-isel is enabled.
```
// X86FastISel.cpp
Register SrcReg = fastEmitInst_(X86::MOV32r0, &X86::GR32RegClass)
```
However, before this patch, compiler only allows GR32_NOREX operand
b/c MOV32r0 is a pseudo instruction. In this patch, we relax the
register class of the operand to GR32 b/c MOV32r0 is always expanded
to XOR32rr, which can use EGPR.
The bug was not introduced by #77433 but caught by it.1 parent 3044d75 commit 8bc7c0a
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1260 | 1260 | | |
1261 | 1261 | | |
1262 | 1262 | | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
1263 | 1267 | | |
1264 | 1268 | | |
1265 | 1269 | | |
| |||
1268 | 1272 | | |
1269 | 1273 | | |
1270 | 1274 | | |
1271 | | - | |
1272 | 1275 | | |
1273 | 1276 | | |
1274 | 1277 | | |
| |||
0 commit comments