================ @@ -559,31 +559,86 @@ SemaARM::ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD) { return SemaARM::ArmNonStreaming; } -static void checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall, - const FunctionDecl *FD, - SemaARM::ArmStreamingType BuiltinType) { +static bool checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall, + FunctionDecl *FD, + SemaARM::ArmStreamingType BuiltinType, + unsigned BuiltinID) { SemaARM::ArmStreamingType FnType = getArmStreamingFnType(FD); - if (BuiltinType == SemaARM::ArmStreamingOrSVE2p1) { - // Check intrinsics that are available in [sve2p1 or sme/sme2]. - llvm::StringMap<bool> CallerFeatureMap; - S.Context.getFunctionFeatureMap(CallerFeatureMap, FD); - if (Builtin::evaluateRequiredTargetFeatures("sve2p1", CallerFeatureMap)) - BuiltinType = SemaARM::ArmStreamingCompatible; - else + + // Check if the intrinsic is available in the right mode, i.e. + // * When compiling for SME only, the caller must be in streaming mode. + // * When compiling for SVE only, the caller must be in non-streaming mode. + // * When compiling for both SVE and SME, the caller can be in either mode. + if (BuiltinType == SemaARM::VerifyRuntimeMode) { + static llvm::StringMap<bool> CallerFeatureMapWithoutSVE, + CallerFeatureMapWithoutSME; + + // Cache the feature maps, to avoid having to recalculate this for each + // builtin call. + static unsigned CachedODRHash = 0; ---------------- sdesmalen-arm wrote:
Done https://github.com/llvm/llvm-project/pull/93802 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits