Skip to content

Commit

Permalink
[DSE] Add test for #70547 (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Oct 31, 2023
1 parent c308cb9 commit deb5bd1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions llvm/test/Transforms/DeadStoreElimination/assume.ll
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,25 @@ define void @f2() {
ret void
}

; FIXME: This is a miscompile
define void @pr70547() {
; CHECK-LABEL: @pr70547(
; CHECK-NEXT: [[A:%.*]] = alloca i8, align 1
; CHECK-NEXT: [[CALL:%.*]] = call ptr @quux(ptr [[A]]) #[[ATTR1:[0-9]+]]
; CHECK-NEXT: [[V:%.*]] = load i8, ptr [[CALL]], align 1
; CHECK-NEXT: [[CMP:%.*]] = icmp ne i8 [[V]], 1
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: ret void
;
%a = alloca i8
store i8 0, ptr %a
%call = call ptr @quux(ptr %a) memory(none) nounwind willreturn
%v = load i8, ptr %call
%cmp = icmp ne i8 %v, 1
call void @llvm.assume(i1 %cmp)
ret void
}

declare ptr @_Znwm(i64)

declare void @llvm.assume(i1)
Expand Down

0 comments on commit deb5bd1

Please sign in to comment.