[clang] af44d87 - [clang][SME] Remove folding of `__arm_in_streaming_mode()` (NFC) (#150917)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 29 02:42:48 PDT 2025


Author: Benjamin Maxwell
Date: 2025-07-29T10:42:45+01:00
New Revision: af44d87e0d80cda78451d8de723c974bf58ccac0

URL: https://github.com/llvm/llvm-project/commit/af44d87e0d80cda78451d8de723c974bf58ccac0
DIFF: https://github.com/llvm/llvm-project/commit/af44d87e0d80cda78451d8de723c974bf58ccac0.diff

LOG: [clang][SME] Remove folding of `__arm_in_streaming_mode()` (NFC) (#150917)

This is handled by the instcombine added in #147930; there is no need
for any clang-specific folding. NFC as all clang tests for
`__arm_in_streaming_mode()` used -O1, which applies the LLVM
instcombines.

Added: 
    

Modified: 
    clang/lib/CodeGen/TargetBuiltins/ARM.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/TargetBuiltins/ARM.cpp b/clang/lib/CodeGen/TargetBuiltins/ARM.cpp
index 2e6b4b3eb10f1..980f7eb714bbf 100644
--- a/clang/lib/CodeGen/TargetBuiltins/ARM.cpp
+++ b/clang/lib/CodeGen/TargetBuiltins/ARM.cpp
@@ -4922,19 +4922,6 @@ 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
-    const auto *FD = cast<FunctionDecl>(CurFuncDecl);
-    if (const auto *FPT = FD->getType()->getAs<FunctionProtoType>()) {
-      unsigned SMEAttrs = FPT->getAArch64SMEAttributes();
-      if (!(SMEAttrs & FunctionType::SME_PStateSMCompatibleMask)) {
-        bool IsStreaming = SMEAttrs & FunctionType::SME_PStateSMEnabledMask;
-        return ConstantInt::getBool(Builder.getContext(), IsStreaming);
-      }
-    }
-  }
-
   // Predicates must match the main datatype.
   for (Value *&Op : Ops)
     if (auto PredTy = dyn_cast<llvm::VectorType>(Op->getType()))


        


More information about the cfe-commits mailing list