[llvm] [GlobalIsel][NFC] Harden MachineIRBuilder (PR #75465)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 14 04:38:19 PST 2023


================
@@ -314,7 +314,10 @@ MachineInstrBuilder MachineIRBuilder::buildConstant(const DstOp &Res,
   assert(EltTy.getScalarSizeInBits() == Val.getBitWidth() &&
          "creating constant with the wrong size");
 
-  if (Ty.isVector()) {
+  assert(!Ty.isScalableVector() &&
+         "unexpected scalable vector in buildConstant");
+
+  if (Ty.isFixedVector()) {
----------------
arsenm wrote:

Changing this part seems redundant with the assert? 

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


More information about the llvm-commits mailing list