[llvm] [RISCV] Move RISCVInsertVSETVLI to after phi elimination (PR #91440)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Fri May 10 08:07:42 PDT 2024
================
@@ -493,17 +501,17 @@ class VSETVLIInfo {
assert(hasAVLImm());
return AVLImm;
}
- const MachineInstr &getAVLDefMI() const {
- assert(hasAVLReg() && AVLRegDef.DefMI);
- return *AVLRegDef.DefMI;
+ const VNInfo *getAVLVNInfo() const {
+ assert(hasAVLReg());
+ return AVLRegDef.AVLVNInfo;
}
----------------
preames wrote:
It looks like a helper along the lines of:
```
const MachineInstr* getAVLDefMI(const LiveIntervals &LIS) {
return LIS.getInstructionFromIndex(getAVLVNInfo()->def))
}
```
Would be natural, and possibly reduce the diff a bit.
One question I have reading this code is whether the MI computed as above can be null with the VNInfo framing or not. You seem to be writing code which assumes it can.
https://github.com/llvm/llvm-project/pull/91440
More information about the llvm-commits
mailing list