Home | History | Annotate | Download | only in GVNHoist
      1 ; RUN: opt -S -gvn-hoist < %s
      2 
      3 define void @_Z3fn2v() #0 {
      4 entry:
      5   %a = alloca i8*, align 8
      6   %b = alloca i32, align 4
      7   %0 = load i8*, i8** %a, align 8
      8   store i8 0, i8* %0, align 1
      9   %1 = load i32, i32* %b, align 4
     10   %tobool = icmp ne i32 %1, 0
     11   br i1 %tobool, label %if.then, label %if.end
     12 
     13 if.then:                                          ; preds = %entry
     14   %call = call i64 @_Z3fn1v() #2
     15   %conv = trunc i64 %call to i32
     16   store i32 %conv, i32* %b, align 4
     17   br label %if.end
     18 
     19 if.end:                                           ; preds = %if.then, %entry
     20   %2 = load i8*, i8** %a, align 8
     21   store i8 0, i8* %2, align 1
     22   ret void
     23 }
     24 
     25 ; Function Attrs: nounwind readonly
     26 declare i64 @_Z3fn1v() #1
     27 
     28 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" }
     29 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" }
     30 attributes #2 = { nounwind readonly }
     31