[llvm] b257acd - [test][GlobalOpt] Update precommitted test
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 23 09:57:09 PDT 2022
Author: Arthur Eubanks
Date: 2022-06-23T09:56:31-07:00
New Revision: b257acd2660ccacab4c1543f0d18697e45565fca
URL: https://github.com/llvm/llvm-project/commit/b257acd2660ccacab4c1543f0d18697e45565fca
DIFF: https://github.com/llvm/llvm-project/commit/b257acd2660ccacab4c1543f0d18697e45565fca.diff
LOG: [test][GlobalOpt] Update precommitted test
Added:
Modified:
llvm/test/Transforms/GlobalOpt/stored-once-forward-value.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/GlobalOpt/stored-once-forward-value.ll b/llvm/test/Transforms/GlobalOpt/stored-once-forward-value.ll
index b043a03608a7c..ed396337553fe 100644
--- a/llvm/test/Transforms/GlobalOpt/stored-once-forward-value.ll
+++ b/llvm/test/Transforms/GlobalOpt/stored-once-forward-value.ll
@@ -7,6 +7,9 @@
@g4 = internal unnamed_addr global i32 0
@g5 = internal unnamed_addr global i32 0
@g6 = internal unnamed_addr global i32 0
+ at g7 = internal unnamed_addr global i32 0
+ at g8 = internal unnamed_addr global ptr null
+ at tl = internal thread_local unnamed_addr global i32 0
declare void @b()
@@ -36,16 +39,29 @@ define i32 @dom_arg(i32 %a) {
ret i32 %r
}
+define ptr @dom_thread_local_global() {
+; CHECK-LABEL: @dom_thread_local_global(
+; CHECK-NEXT: store ptr @tl, ptr @g3, align 8
+; CHECK-NEXT: call void @b()
+; CHECK-NEXT: [[R:%.*]] = load ptr, ptr @g3, align 8
+; CHECK-NEXT: ret ptr [[R]]
+;
+ store ptr @tl, ptr @g3
+ call void @b()
+ %r = load ptr, ptr @g3
+ ret ptr %r
+}
+
define i32 @dom_
diff erent_types() {
; CHECK-LABEL: @dom_
diff erent_types(
-; CHECK-NEXT: store i1 true, ptr @g3, align 1
+; CHECK-NEXT: store i1 true, ptr @g4, align 1
; CHECK-NEXT: call void @b()
-; CHECK-NEXT: [[R:%.*]] = load i32, ptr @g3, align 4
+; CHECK-NEXT: [[R:%.*]] = load i32, ptr @g4, align 4
; CHECK-NEXT: ret i32 [[R]]
;
- store i1 true, ptr @g3
+ store i1 true, ptr @g4
call void @b()
- %r = load i32, ptr @g3
+ %r = load i32, ptr @g4
ret i32 %r
}
@@ -53,57 +69,71 @@ define i1 @no_dom(i1 %i) {
; CHECK-LABEL: @no_dom(
; CHECK-NEXT: br i1 [[I:%.*]], label [[BB1:%.*]], label [[END:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: store i1 true, ptr @g4, align 1
+; CHECK-NEXT: store i1 true, ptr @g5, align 1
; CHECK-NEXT: br label [[END]]
; CHECK: end:
; CHECK-NEXT: call void @b()
-; CHECK-NEXT: [[R:%.*]] = load i1, ptr @g4, align 1
+; CHECK-NEXT: [[R:%.*]] = load i1, ptr @g5, align 1
; CHECK-NEXT: ret i1 [[R]]
;
br i1 %i, label %bb1, label %end
bb1:
- store i1 true, ptr @g4
+ store i1 true, ptr @g5
br label %end
end:
call void @b()
- %r = load i1, ptr @g4
+ %r = load i1, ptr @g5
ret i1 %r
}
define i1 @dom_multiple_function_loads() {
; CHECK-LABEL: @dom_multiple_function_loads(
-; CHECK-NEXT: store i1 true, ptr @g5, align 1
+; CHECK-NEXT: store i1 true, ptr @g6, align 1
; CHECK-NEXT: call void @b()
-; CHECK-NEXT: [[R:%.*]] = load i1, ptr @g5, align 1
+; CHECK-NEXT: [[R:%.*]] = load i1, ptr @g6, align 1
; CHECK-NEXT: ret i1 [[R]]
;
- store i1 true, ptr @g5
+ store i1 true, ptr @g6
call void @b()
- %r = load i1, ptr @g5
+ %r = load i1, ptr @g6
ret i1 %r
}
define i1 @other() {
; CHECK-LABEL: @other(
; CHECK-NEXT: call void @b()
-; CHECK-NEXT: [[R:%.*]] = load i1, ptr @g5, align 1
+; CHECK-NEXT: [[R:%.*]] = load i1, ptr @g6, align 1
; CHECK-NEXT: ret i1 [[R]]
;
call void @b()
- %r = load i1, ptr @g5
+ %r = load i1, ptr @g6
ret i1 %r
}
define i1 @dom_volatile() {
; CHECK-LABEL: @dom_volatile(
-; CHECK-NEXT: store i1 true, ptr @g6, align 1
+; CHECK-NEXT: store i1 true, ptr @g7, align 1
; CHECK-NEXT: call void @b()
-; CHECK-NEXT: [[R:%.*]] = load volatile i1, ptr @g6, align 1
+; CHECK-NEXT: [[R:%.*]] = load volatile i1, ptr @g7, align 1
; CHECK-NEXT: ret i1 [[R]]
;
- store i1 true, ptr @g6
+ store i1 true, ptr @g7
call void @b()
- %r = load volatile i1, ptr @g6
+ %r = load volatile i1, ptr @g7
ret i1 %r
}
+define i1 @dom_store_const_and_initializer() {
+; CHECK-LABEL: @dom_store_const_and_initializer(
+; CHECK-NEXT: store i1 true, ptr @g8, align 1
+; CHECK-NEXT: store i1 false, ptr @g8, align 1
+; CHECK-NEXT: call void @b()
+; CHECK-NEXT: [[R:%.*]] = load i1, ptr @g8, align 1
+; CHECK-NEXT: ret i1 [[R]]
+;
+ store i1 true, ptr @g8
+ store i1 false, ptr @g8
+ call void @b()
+ %r = load i1, ptr @g8
+ ret i1 %r
+}
More information about the llvm-commits
mailing list