[llvm] 833557a - DCE: Update tests to use opaque pointers
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 28 05:55:12 PST 2022
Author: Matt Arsenault
Date: 2022-11-28T08:42:06-05:00
New Revision: 833557a6e4e015bbd49ef918b73887288d16dd2e
URL: https://github.com/llvm/llvm-project/commit/833557a6e4e015bbd49ef918b73887288d16dd2e
DIFF: https://github.com/llvm/llvm-project/commit/833557a6e4e015bbd49ef918b73887288d16dd2e.diff
LOG: DCE: Update tests to use opaque pointers
basic.ll:test_lifetime_bitcast is a strange case. The comment says
it's trying to keep the lifetime intrinsics for bitcasts. Leave a
dummy bitcast for now to keep it happy.
Added:
Modified:
llvm/test/Transforms/DCE/basic.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/DCE/basic.ll b/llvm/test/Transforms/DCE/basic.ll
index ea5755d56b20b..1d97cda754a1c 100644
--- a/llvm/test/Transforms/DCE/basic.ll
+++ b/llvm/test/Transforms/DCE/basic.ll
@@ -53,18 +53,18 @@ define i32 @test_lifetime_global() {
}
; CHECK-LABEL: @test_lifetime_bitcast
-define i32 @test_lifetime_bitcast(ptr) {
+define i32 @test_lifetime_bitcast(ptr %arg) {
; Check that lifetime intrinsics are NOT removed when the pointer is a bitcast.
; It's not uncommon for two bitcasts to be made: one for lifetime, one for use.
; TODO: Support the above case.
; CHECK-NEXT: bitcast
; CHECK-NEXT: llvm.dbg.value
-; CHECK-NEXT: llvm.lifetime.start
-; CHECK-NEXT: llvm.lifetime.end
+; CHECK-NEXT: llvm.lifetime.start.p0(i64 -1, ptr %cast)
+; CHECK-NEXT: llvm.lifetime.end.p0(i64 -1, ptr %cast)
; CHECK-NEXT: ret i32 0
- %2 = bitcast ptr %0 to ptr
- call void @llvm.lifetime.start.p0(i64 -1, ptr %2)
- call void @llvm.lifetime.end.p0(i64 -1, ptr %2)
+ %cast = bitcast ptr %arg to ptr
+ call void @llvm.lifetime.start.p0(i64 -1, ptr %cast)
+ call void @llvm.lifetime.end.p0(i64 -1, ptr %cast)
ret i32 0
}
More information about the llvm-commits
mailing list