[clang] [clang][SME] Remove folding of `__arm_in_streaming_mode()` (NFC) (PR #150917)
Benjamin Maxwell via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 28 03:10:00 PDT 2025
https://github.com/MacDue created https://github.com/llvm/llvm-project/pull/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.
>From 72454c8c4d4d35dfbc8da99351db7f9aa86c716a Mon Sep 17 00:00:00 2001
From: Benjamin Maxwell <benjamin.maxwell at arm.com>
Date: Mon, 28 Jul 2025 10:04:11 +0000
Subject: [PATCH] [clang][SME] Remove folding of `__arm_in_streaming_mode()`
(NFC)
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.
---
clang/lib/CodeGen/TargetBuiltins/ARM.cpp | 13 -------------
1 file changed, 13 deletions(-)
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