[llvm] 1ee4a93 - [DSE] Add test with different unreachable block order (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 10 03:13:23 PST 2023
Author: Nikita Popov
Date: 2023-01-10T12:13:15+01:00
New Revision: 1ee4a93b15bb5dee7a1045fd035e1a286bb5d162
URL: https://github.com/llvm/llvm-project/commit/1ee4a93b15bb5dee7a1045fd035e1a286bb5d162
DIFF: https://github.com/llvm/llvm-project/commit/1ee4a93b15bb5dee7a1045fd035e1a286bb5d162.diff
LOG: [DSE] Add test with different unreachable block order (NFC)
Added:
Modified:
llvm/test/Transforms/DeadStoreElimination/captures-before-load.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/DeadStoreElimination/captures-before-load.ll b/llvm/test/Transforms/DeadStoreElimination/captures-before-load.ll
index 3fe1d19fb0e7c..7d827fa2f6996 100644
--- a/llvm/test/Transforms/DeadStoreElimination/captures-before-load.ll
+++ b/llvm/test/Transforms/DeadStoreElimination/captures-before-load.ll
@@ -48,6 +48,36 @@ unreach:
ret i32 0
}
+define i32 @test_not_captured_before_load_same_bb_escape_unreachable_block2(ptr %in.ptr) {
+; CHECK-LABEL: @test_not_captured_before_load_same_bb_escape_unreachable_block2(
+; CHECK-NEXT: br label [[BB:%.*]]
+; CHECK: unreach:
+; CHECK-NEXT: call void @escape_and_clobber(ptr [[A:%.*]])
+; CHECK-NEXT: ret i32 0
+; CHECK: bb:
+; CHECK-NEXT: [[A]] = alloca i32, align 4
+; CHECK-NEXT: [[IN_LV_1:%.*]] = load ptr, ptr [[IN_PTR:%.*]], align 2
+; CHECK-NEXT: [[IN_LV_2:%.*]] = load i32, ptr [[IN_LV_1]], align 2
+; CHECK-NEXT: store i32 99, ptr [[A]], align 4
+; CHECK-NEXT: call void @escape_and_clobber(ptr [[A]])
+; CHECK-NEXT: ret i32 [[IN_LV_2]]
+;
+ br label %bb
+
+unreach:
+ call void @escape_and_clobber(ptr %a)
+ ret i32 0
+
+bb:
+ %a = alloca i32, align 4
+ store i32 55, ptr %a
+ %in.lv.1 = load ptr , ptr %in.ptr, align 2
+ %in.lv.2 = load i32 , ptr %in.lv.1, align 2
+ store i32 99, ptr %a, align 4
+ call void @escape_and_clobber(ptr %a)
+ ret i32 %in.lv.2
+}
+
define i32 @test_captured_and_clobbered_after_load_same_bb_2(ptr %in.ptr) {
; CHECK-LABEL: @test_captured_and_clobbered_after_load_same_bb_2(
; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
More information about the llvm-commits
mailing list