Skip to content

Commit

Permalink
[ValueTracking] Add a noundef test for D86477; NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
aqjune committed Aug 25, 2020
1 parent b1009ee commit 8e51bb2
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion llvm/test/Transforms/InstSimplify/freeze-noundef.ll
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ define {i8, i32} @aggr({i8, i32} noundef %x) {
ret {i8, i32} %y
}

; TODO: should look into extract operations
define i32 @extract({i8, i32} noundef %x) {
; CHECK-LABEL: @extract(
; CHECK-NEXT: [[Y:%.*]] = extractvalue { i8, i32 } [[X:%.*]], 1
Expand All @@ -91,3 +90,18 @@ define i32 @extract2({i8, {i8, i32}} noundef %x) {
%w = freeze i32 %z
ret i32 %w
}

declare void @use_i1(i1 noundef)

define i1 @used_by_fncall(i1 %x) {
; CHECK-LABEL: @used_by_fncall(
; CHECK-NEXT: [[Y:%.*]] = add nsw i1 [[X:%.*]], true
; CHECK-NEXT: call void @use_i1(i1 [[Y]])
; CHECK-NEXT: [[F:%.*]] = freeze i1 [[Y]]
; CHECK-NEXT: ret i1 [[F]]
;
%y = add nsw i1 %x, 1
call void @use_i1(i1 %y)
%f = freeze i1 %y
ret i1 %f
}

0 comments on commit 8e51bb2

Please sign in to comment.