[clang] [AArch64][SME] Remove immediate argument restriction for svldr and svstr (PR #68908)

Sander de Smalen via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 17 02:32:35 PDT 2023


================
@@ -9716,13 +9711,17 @@ Value *CodeGenFunction::EmitSMELdrStr(const SVETypeFlags &TypeFlags,
   if (Ops.size() == 3) {
     Function *Cntsb = CGM.getIntrinsic(Intrinsic::aarch64_sme_cntsb);
     llvm::Value *CntsbCall = Builder.CreateCall(Cntsb, {}, "svlb");
-    llvm::Value *MulVL = Builder.CreateMul(
-        CntsbCall,
-        Builder.getInt64(cast<llvm::ConstantInt>(Ops[2])->getZExtValue()),
-        "mulvl");
+
+    llvm::Value *VecNum = Ops[2];
+    if (auto *C = dyn_cast<ConstantInt>(VecNum))
+      VecNum = Builder.getInt64(C->getZExtValue());
----------------
sdesmalen-arm wrote:

If `VecNum` is already a `ConstantInt` of type `int64_t` then this isn't necessary?

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


More information about the cfe-commits mailing list