llvm-project
495d3ea9 - [MachineSink][RISCV] Only call isConstantPhysReg or isIgnorableUse for uses. (#99363)

Commit
1 year ago
[MachineSink][RISCV] Only call isConstantPhysReg or isIgnorableUse for uses. (#99363) The included test case contains X0 as a def register. X0 is considered a constant register when it is a use. When its a def, it means to throw away the result value. If we treat it as a constant register here, we will execute the continue and not assign `DefReg` to any register. This will cause a crash when trying to get the register class for `DefReg` after the loop. By only checking isConstantPhysReg for uses, we will reach the `return false` a little further down and stop processing this instruction.
Author
Parents
Loading