Skip to content

Instantly share code, notes, and snippets.

@Sh4rK
Created November 3, 2014 22:12
Show Gist options
  • Save Sh4rK/4ec63273c387f9978799 to your computer and use it in GitHub Desktop.
Save Sh4rK/4ec63273c387f9978799 to your computer and use it in GitHub Desktop.
*** IR Dump Before Interprocedural Sparse Conditional Constant Propagation ***; ModuleID = 'bug.cpp'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-w64-windows-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nounwind uwtable
define void @_Z3fooRd(double* dereferenceable(8) %a) #0 {
ret void
}
; Function Attrs: uwtable
define i32 @main() #1 {
%a = alloca double, align 8
store double 5.000000e-01, double* %a, align 8, !tbaa !1
call void @_Z3fooRd(double* dereferenceable(8) %a)
%1 = load double* %a, align 8, !tbaa !1
%2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i32 0, i32 0), double %1)
%3 = load double* %a, align 8, !tbaa !1
%4 = call double @fabs(double %3) #4
%5 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i32 0, i32 0), double %4)
ret i32 0
}
declare i32 @printf(i8*, ...) #2
; Function Attrs: inlinehint nounwind readnone uwtable
define linkonce_odr double @fabs(double %x) #3 {
%1 = call double @fabs(double %x) #4
ret double %1
}
attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #3 = { inlinehint nounwind readnone uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #4 = { nounwind readnone }
!llvm.ident = !{!0}
!0 = metadata !{metadata !"clang version 3.5.0 (tags/RELEASE_350/final)"}
!1 = metadata !{metadata !2, metadata !2, i64 0}
!2 = metadata !{metadata !"double", metadata !3, i64 0}
!3 = metadata !{metadata !"omnipotent char", metadata !4, i64 0}
!4 = metadata !{metadata !"Simple C/C++ TBAA"}
*** IR Dump After Interprocedural Sparse Conditional Constant Propagation ***; ModuleID = 'bug.cpp'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-w64-windows-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nounwind uwtable
define void @_Z3fooRd(double* dereferenceable(8) %a) #0 {
ret void
}
; Function Attrs: uwtable
define i32 @main() #1 {
%a = alloca double, align 8
store double 5.000000e-01, double* %a, align 8, !tbaa !1
call void @_Z3fooRd(double* dereferenceable(8) %a)
%1 = load double* %a, align 8, !tbaa !1
%2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i32 0, i32 0), double %1)
%3 = load double* %a, align 8, !tbaa !1
%4 = call double @fabs(double %3) #4
%5 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i32 0, i32 0), double undef)
ret i32 0
}
declare i32 @printf(i8*, ...) #2
; Function Attrs: inlinehint nounwind readnone uwtable
define linkonce_odr double @fabs(double %x) #3 {
%1 = call double @fabs(double %x) #4
ret double undef
}
attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #3 = { inlinehint nounwind readnone uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #4 = { nounwind readnone }
!llvm.ident = !{!0}
!0 = metadata !{metadata !"clang version 3.5.0 (tags/RELEASE_350/final)"}
!1 = metadata !{metadata !2, metadata !2, i64 0}
!2 = metadata !{metadata !"double", metadata !3, i64 0}
!3 = metadata !{metadata !"omnipotent char", metadata !4, i64 0}
!4 = metadata !{metadata !"Simple C/C++ TBAA"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment