[llvm] [RISCV][VLOPT] Allow propagation even when VL isn't VLMAX (PR #112228)

Pengcheng Wang via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 20:53:44 PDT 2024


================
@@ -31,6 +31,44 @@ using namespace llvm;
 
 namespace {
 
+struct VLInfo {
+  VLInfo(const MachineOperand &VLOp) {
+    IsImm = VLOp.isImm();
+    if (IsImm)
+      Imm = VLOp.getImm();
+    else
+      Reg = VLOp.getReg();
+  }
+
+  Register Reg;
----------------
wangpc-pp wrote:

Is it possible to use `std::variant` here?

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


More information about the llvm-commits mailing list