[Mlir-commits] [mlir] [MLIR][LLVM] Add invariant intrinsics (PR #75354)

Christian Ulmann llvmlistbot at llvm.org
Thu Dec 14 02:36:16 PST 2023


================
@@ -170,12 +170,14 @@ llvm.func @direct_promotable_use_is_fine_on_accessor() -> i32 {
   // CHECK: %[[ALLOCA:.*]] = llvm.alloca %[[SIZE]] x i32
   %1 = llvm.alloca %0 x !llvm.struct<"foo", (i32, f64, i32)> {alignment = 8 : i64} : (i32) -> !llvm.ptr
   %2 = llvm.getelementptr %1[0, 2] : (!llvm.ptr) -> !llvm.ptr, !llvm.struct<"foo", (i32, f64, i32)>
+  // This does not provide side-effect info but it can be removed because it implements PromotableOpInterface.
+  %3 = llvm.intr.invariant.start 2, %2 : !llvm.ptr
   // CHECK: %[[RES:.*]] = llvm.load %[[ALLOCA]]
-  %3 = llvm.load %2 : !llvm.ptr -> i32
+  %4 = llvm.load %2 : !llvm.ptr -> i32
   // This does not provide side-effect info but it can be removed because it implements PromotableOpInterface.
-  llvm.intr.lifetime.start 2, %2 : !llvm.ptr
+  llvm.intr.invariant.end %3, 2, %2 : !llvm.ptr
----------------
Dinistro wrote:

Is this related to this PR?

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


More information about the Mlir-commits mailing list