[PATCH] D153750: [mlir][ArmSME] Fix crash on func decls in 'arm_za' legality checks
Cullen Rhodes via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 26 03:01:40 PDT 2023
c-rhodes created this revision.
c-rhodes added a reviewer: awarzynski.
c-rhodes added a project: MLIR.
Herald added subscribers: gysit, Dinistro, bviyer, Moerafaat, zero9178, bzcheeseman, sdasgup3, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, antiagainst, shauheen, rriddle, mehdi_amini, kristof.beyls.
Herald added a reviewer: ftynse.
Herald added a reviewer: dcaballe.
Herald added a project: All.
c-rhodes requested review of this revision.
Herald added a reviewer: nicolasvasilache.
Herald added subscribers: stephenneuendorffer, nicolasvasilache.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D153750
Files:
mlir/lib/Dialect/ArmSME/Transforms/LegalizeForLLVMExport.cpp
mlir/test/Dialect/ArmSME/enable-arm-za.mlir
Index: mlir/test/Dialect/ArmSME/enable-arm-za.mlir
===================================================================
--- mlir/test/Dialect/ArmSME/enable-arm-za.mlir
+++ mlir/test/Dialect/ArmSME/enable-arm-za.mlir
@@ -2,6 +2,9 @@
// RUN: mlir-opt %s -enable-arm-streaming -convert-vector-to-llvm="enable-arm-sme" | FileCheck %s -check-prefix=DISABLE-ZA
// RUN: mlir-opt %s -convert-vector-to-llvm="enable-arm-sme" | FileCheck %s -check-prefix=NO-ARM-STREAMING
+// CHECK-LABEL: @declaration
+func.func private @declaration()
+
// CHECK-LABEL: @arm_za
func.func @arm_za() {
// ENABLE-ZA: arm_sme.intr.za.enable
Index: mlir/lib/Dialect/ArmSME/Transforms/LegalizeForLLVMExport.cpp
===================================================================
--- mlir/lib/Dialect/ArmSME/Transforms/LegalizeForLLVMExport.cpp
+++ mlir/lib/Dialect/ArmSME/Transforms/LegalizeForLLVMExport.cpp
@@ -59,6 +59,8 @@
// 2. the 'arm_za' function attribute is present and the first op in the
// function is an 'arm_sme::aarch64_sme_za_enable' intrinsic.
target.addDynamicallyLegalOp<func::FuncOp>([&](func::FuncOp funcOp) {
+ if (funcOp.isDeclaration())
+ return true;
auto firstOp = funcOp.getBody().front().begin();
return !funcOp->hasAttr("arm_za") ||
isa<arm_sme::aarch64_sme_za_enable>(firstOp);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153750.534479.patch
Type: text/x-patch
Size: 1331 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230626/17fa82a4/attachment.bin>
More information about the llvm-commits
mailing list