[clang] [Clang][AArch64] Diagnose invalid FPM scale arguments (PR #227722)

Paul Walker via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 6 03:39:59 PDT 2026


================
@@ -4922,6 +4922,39 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
     MTEIntrinsicID = Intrinsic::aarch64_subp; break;
   }
 
+  if (BuiltinID == clang::AArch64::BI__arm_set_fpm_lscale) {
+    Value *FPM = EmitScalarExpr(E->getArg(0));
+    Value *Scale = EmitScalarExpr(E->getArg(1));
+
+    Scale = Builder.CreateZExtOrTrunc(Scale, FPM->getType());
----------------
paulwalker-arm wrote:

It's fine to error on clearly invalid use cases. The masking is purely to limit the fallout for the cases we cannot verify.

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


More information about the cfe-commits mailing list