[PATCH] D156558: [mlir][ArmSME] Remove "pure" side-effect from 'get_tile_id' op to prevent CSE
Cullen Rhodes via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 1 01:12:03 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG31850318f778: [mlir][ArmSME] Remove "pure" side-effect from 'get_tile_id' op to prevent CSE (authored by c-rhodes).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156558/new/
https://reviews.llvm.org/D156558
Files:
mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.td
mlir/test/Dialect/ArmSME/cse.mlir
Index: mlir/test/Dialect/ArmSME/cse.mlir
===================================================================
--- /dev/null
+++ mlir/test/Dialect/ArmSME/cse.mlir
@@ -0,0 +1,16 @@
+// RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline='builtin.module(func.func(cse))' | FileCheck %s
+
+// This test is checking that CSE does not remove 'arm_sme.get_tile_id' ops as
+// duplicates.
+// CHECK-LABEL: @get_tile_id
+// CHECK: %[[TILE_ID_0:.*]] = arm_sme.get_tile_id : i32
+// CHECK: %[[TILE_ID_1:.*]] = arm_sme.get_tile_id : i32
+// CHECK: "prevent.dce"(%[[TILE_ID_0]]) : (i32) -> ()
+// CHECK: "prevent.dce"(%[[TILE_ID_1]]) : (i32) -> ()
+func.func @get_tile_id() {
+ %tile_id_1 = arm_sme.get_tile_id : i32
+ %tile_id_2 = arm_sme.get_tile_id : i32
+ "prevent.dce"(%tile_id_1) : (i32) -> ()
+ "prevent.dce"(%tile_id_2) : (i32) -> ()
+ return
+}
Index: mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.td
===================================================================
--- mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.td
+++ mlir/include/mlir/Dialect/ArmSME/IR/ArmSME.td
@@ -162,7 +162,7 @@
let hasCanonicalizeMethod = 1;
}
-def GetTileID : ArmSME_Op<"get_tile_id", [Pure]> {
+def GetTileID : ArmSME_Op<"get_tile_id"> {
let summary = "Returns an SME \"virtual tile\" id";
let description = [{
A `get_tile_id` operation returns a scalar integer representing an SME
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156558.545954.patch
Type: text/x-patch
Size: 1384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230801/1b699875/attachment.bin>
More information about the llvm-commits
mailing list