[llvm] 3204f3e - [RISCV] Convert VTYPE operand check to assert in RISCVInsertVSETVLI. NFC

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 19:11:14 PDT 2024


Author: Luke Lau
Date: 2024-04-17T10:11:03+08:00
New Revision: 3204f3e30b8e15ce6e5d10d5d7bfbaa7cf5cd1f4

URL: https://github.com/llvm/llvm-project/commit/3204f3e30b8e15ce6e5d10d5d7bfbaa7cf5cd1f4
DIFF: https://github.com/llvm/llvm-project/commit/3204f3e30b8e15ce6e5d10d5d7bfbaa7cf5cd1f4.diff

LOG: [RISCV] Convert VTYPE operand check to assert in RISCVInsertVSETVLI. NFC

The VTYPE operands of a vsetvli pseudo are always immediates

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
index a14f9a28354737..a54a1148cf28b9 100644
--- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
@@ -1522,9 +1522,7 @@ static bool canMutatePriorConfig(const MachineInstr &PrevMI,
     }
   }
 
-  if (!PrevMI.getOperand(2).isImm() || !MI.getOperand(2).isImm())
-    return false;
-
+  assert(PrevMI.getOperand(2).isImm() && MI.getOperand(2).isImm());
   auto PriorVType = PrevMI.getOperand(2).getImm();
   auto VType = MI.getOperand(2).getImm();
   return areCompatibleVTYPEs(PriorVType, VType, Used);


        


More information about the llvm-commits mailing list