Skip to content

Commit 8e51bb2

Browse files
committed
[ValueTracking] Add a noundef test for D86477; NFC
1 parent b1009ee commit 8e51bb2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

llvm/test/Transforms/InstSimplify/freeze-noundef.ll

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ define {i8, i32} @aggr({i8, i32} noundef %x) {
6969
ret {i8, i32} %y
7070
}
7171

72-
; TODO: should look into extract operations
7372
define i32 @extract({i8, i32} noundef %x) {
7473
; CHECK-LABEL: @extract(
7574
; CHECK-NEXT: [[Y:%.*]] = extractvalue { i8, i32 } [[X:%.*]], 1
@@ -91,3 +90,18 @@ define i32 @extract2({i8, {i8, i32}} noundef %x) {
9190
%w = freeze i32 %z
9291
ret i32 %w
9392
}
93+
94+
declare void @use_i1(i1 noundef)
95+
96+
define i1 @used_by_fncall(i1 %x) {
97+
; CHECK-LABEL: @used_by_fncall(
98+
; CHECK-NEXT: [[Y:%.*]] = add nsw i1 [[X:%.*]], true
99+
; CHECK-NEXT: call void @use_i1(i1 [[Y]])
100+
; CHECK-NEXT: [[F:%.*]] = freeze i1 [[Y]]
101+
; CHECK-NEXT: ret i1 [[F]]
102+
;
103+
%y = add nsw i1 %x, 1
104+
call void @use_i1(i1 %y)
105+
%f = freeze i1 %y
106+
ret i1 %f
107+
}

0 commit comments

Comments
 (0)