Skip to content

Commit afaf447

Browse files
committed
Address nits and update test
1 parent 0eca79f commit afaf447

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11288,16 +11288,15 @@ Value *CodeGenFunction::EmitAArch64SMEBuiltinExpr(unsigned BuiltinID,
1128811288
if (BuiltinID == SME::BI__builtin_sme___arm_in_streaming_mode) {
1128911289
// If we already know the streaming mode, don't bother with the intrinsic
1129011290
// and emit a constant instead
11291-
auto FD = cast<FunctionDecl>(CurFuncDecl);
11292-
if (const Type *Ty = FD->getType().getTypePtrOrNull())
11293-
if (const auto *FPT = Ty->getAs<FunctionProtoType>()) {
11294-
unsigned SMEAttrs = FPT->getAArch64SMEAttributes();
11295-
if (!(SMEAttrs & FunctionType::SME_PStateSMCompatibleMask)) {
11296-
bool IsStreamingMode =
11297-
SMEAttrs & FunctionType::SME_PStateSMEnabledMask;
11298-
return ConstantInt::getBool(Builder.getContext(), IsStreamingMode);
11299-
}
11291+
const auto *FD = cast<FunctionDecl>(CurFuncDecl);
11292+
if (const auto *FPT = FD->getType()->getAs<FunctionProtoType>()) {
11293+
unsigned SMEAttrs = FPT->getAArch64SMEAttributes();
11294+
if (!(SMEAttrs & FunctionType::SME_PStateSMCompatibleMask)) {
11295+
bool IsStreaming =
11296+
SMEAttrs & FunctionType::SME_PStateSMEnabledMask;
11297+
return ConstantInt::getBool(Builder.getContext(), IsStreaming);
1130011298
}
11299+
}
1130111300
}
1130211301

1130311302
// Predicates must match the main datatype.

llvm/test/CodeGen/AArch64/sme-intrinsics-state.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
define i1 @streaming_mode_streaming_compatible() #0 {
6-
; CHECK-LABEL: streaming_mode_st_compatible:
6+
; CHECK-LABEL: streaming_mode_streaming_compatible:
77
; CHECK: // %bb.0:
88
; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
99
; CHECK-NEXT: bl __arm_sme_state

0 commit comments

Comments
 (0)