================ @@ -11285,6 +11285,21 @@ Value *CodeGenFunction::EmitAArch64SMEBuiltinExpr(unsigned BuiltinID, if (Builtin->LLVMIntrinsic == 0) return nullptr; + if (BuiltinID == SME::BI__builtin_sme___arm_in_streaming_mode) { + // If we already know the streaming mode, don't bother with the intrinsic + // and emit a constant instead + auto FD = cast<FunctionDecl>(CurFuncDecl); + if (const Type *Ty = FD->getType().getTypePtrOrNull()) + if (const auto *FPT = Ty->getAs<FunctionProtoType>()) { + unsigned SMEAttrs = FPT->getAArch64SMEAttributes(); + if (!(SMEAttrs & FunctionType::SME_PStateSMCompatibleMask)) { + bool IsStreamingMode = ---------------- sdesmalen-arm wrote:
nit: ```suggestion bool IsStreaming = ``` https://github.com/llvm/llvm-project/pull/120265 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits