[llvm] [NFC][RISCV] Keep AVLReg define instr inside VSETVLInfo (PR #89180)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 00:34:33 PDT 2024


================
@@ -495,24 +495,29 @@ class VSETVLIInfo {
   void setAVLIgnored() { State = AVLIsIgnored; }
 
   bool hasAVLImm() const { return State == AVLIsImm; }
-  bool hasAVLReg() const { return State == AVLIsReg; }
+  bool hasAVLDefMI() const { return State == AVLIsDefMI; }
   bool hasAVLVLMAX() const { return State == AVLIsVLMAX; }
   bool hasAVLIgnored() const { return State == AVLIsIgnored; }
   Register getAVLReg() const {
-    assert(hasAVLReg());
-    return AVLReg;
+    assert(hasAVLDefMI());
+    return AVLDefMI->getOperand(0).getReg();
----------------
lukel97 wrote:

It would be nice to use std::pair here but it has a non-trivial copy constructor unfortunately

https://github.com/llvm/llvm-project/pull/89180


More information about the llvm-commits mailing list