1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/test/Transforms/GVNHoist/pr30499.ll
Sebastian Pop 6c08f40f51 commit back "GVN-hoist: fix store past load dependence analysis (PR30216, PR30499)"
This is with an extra change to avoid calling MemoryLocation::get() on a call instruction.

Differential Revision: https://reviews.llvm.org/D25542

llvm-svn: 284098
2016-10-13 01:39:10 +00:00

31 lines
1.6 KiB
LLVM

; RUN: opt -S -gvn-hoist < %s
define void @_Z3fn2v() #0 {
entry:
%a = alloca i8*, align 8
%b = alloca i32, align 4
%0 = load i8*, i8** %a, align 8
store i8 0, i8* %0, align 1
%1 = load i32, i32* %b, align 4
%tobool = icmp ne i32 %1, 0
br i1 %tobool, label %if.then, label %if.end
if.then: ; preds = %entry
%call = call i64 @_Z3fn1v() #2
%conv = trunc i64 %call to i32
store i32 %conv, i32* %b, align 4
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = load i8*, i8** %a, align 8
store i8 0, i8* %2, align 1
ret void
}
; Function Attrs: nounwind readonly
declare i64 @_Z3fn1v() #1
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readonly "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind readonly }