[clang] [llvm] [clang][llvm][aarch64] Add aarch64_sme_in_streaming_mode intrinsic (PR #120265)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 18 12:46:20 PST 2024


================
@@ -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>()) {
----------------
sdesmalen-arm wrote:

```suggestion
    if (const auto *FPT = F->getType()->getAs<FunctionProtoType>()) {
```

https://github.com/llvm/llvm-project/pull/120265


More information about the llvm-commits mailing list