Created
April 18, 2019 22:10
-
-
Save nlw0/eb50a88845eba90b6b859154d2f2383d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; ModuleID = 'vectest.c' | |
source_filename = "vectest.c" | |
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-pc-linux-gnu" | |
; Function Attrs: noinline nounwind uwtable | |
define float @myfun(i32, float*) #0 { | |
%3 = alloca i32, align 4 | |
%4 = alloca float*, align 8 | |
%5 = alloca float, align 4 | |
%6 = alloca i32, align 4 | |
%7 = alloca float, align 4 | |
store i32 %0, i32* %3, align 4 | |
store float* %1, float** %4, align 8 | |
%8 = load float*, float** %4, align 8 | |
%9 = getelementptr inbounds float, float* %8, i64 0 | |
%10 = load float, float* %9, align 4 | |
store float %10, float* %5, align 4 | |
store i32 1, i32* %6, align 4 | |
br label %11 | |
; <label>:11: ; preds = %30, %2 | |
%12 = load i32, i32* %6, align 4 | |
%13 = load i32, i32* %3, align 4 | |
%14 = icmp slt i32 %12, %13 | |
br i1 %14, label %15, label %33 | |
; <label>:15: ; preds = %11 | |
%16 = load float*, float** %4, align 8 | |
%17 = load i32, i32* %6, align 4 | |
%18 = sext i32 %17 to i64 | |
%19 = getelementptr inbounds float, float* %16, i64 %18 | |
%20 = load float, float* %19, align 4 | |
store float %20, float* %7, align 4 | |
%21 = load float, float* %5, align 4 | |
%22 = load float, float* %7, align 4 | |
%23 = fcmp olt float %21, %22 | |
br i1 %23, label %24, label %26 | |
; <label>:24: ; preds = %15 | |
%25 = load float, float* %5, align 4 | |
br label %28 | |
; <label>:26: ; preds = %15 | |
%27 = load float, float* %7, align 4 | |
br label %28 | |
; <label>:28: ; preds = %26, %24 | |
%29 = phi float [ %25, %24 ], [ %27, %26 ] | |
store float %29, float* %5, align 4 | |
br label %30 | |
; <label>:30: ; preds = %28 | |
%31 = load i32, i32* %6, align 4 | |
%32 = add nsw i32 %31, 1 | |
store i32 %32, i32* %6, align 4 | |
br label %11 | |
; <label>:33: ; preds = %11 | |
%34 = load float, float* %5, align 4 | |
ret float %34 | |
} | |
attributes #0 = { noinline nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "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" } | |
!llvm.ident = !{!0} | |
!0 = !{!"clang version 4.0.1-6 (tags/RELEASE_401/final)"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; ModuleID = 'vectest.c' | |
source_filename = "vectest.c" | |
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-pc-linux-gnu" | |
; Function Attrs: noinline nounwind uwtable | |
define i32 @myfun(i32*) #0 { | |
%2 = alloca i32*, align 8 | |
%3 = alloca i32, align 4 | |
%4 = alloca i32, align 4 | |
%5 = alloca i32, align 4 | |
store i32* %0, i32** %2, align 8 | |
%6 = load i32*, i32** %2, align 8 | |
%7 = getelementptr inbounds i32, i32* %6, i64 0 | |
%8 = load i32, i32* %7, align 4 | |
store i32 %8, i32* %3, align 4 | |
store i32 1, i32* %4, align 4 | |
br label %9 | |
; <label>:9: ; preds = %27, %1 | |
%10 = load i32, i32* %4, align 4 | |
%11 = icmp slt i32 %10, 65536 | |
br i1 %11, label %12, label %30 | |
; <label>:12: ; preds = %9 | |
%13 = load i32*, i32** %2, align 8 | |
%14 = load i32, i32* %4, align 4 | |
%15 = sext i32 %14 to i64 | |
%16 = getelementptr inbounds i32, i32* %13, i64 %15 | |
%17 = load i32, i32* %16, align 4 | |
store i32 %17, i32* %5, align 4 | |
%18 = load i32, i32* %3, align 4 | |
%19 = load i32, i32* %5, align 4 | |
%20 = icmp slt i32 %18, %19 | |
br i1 %20, label %21, label %23 | |
; <label>:21: ; preds = %12 | |
%22 = load i32, i32* %3, align 4 | |
br label %25 | |
; <label>:23: ; preds = %12 | |
%24 = load i32, i32* %5, align 4 | |
br label %25 | |
; <label>:25: ; preds = %23, %21 | |
%26 = phi i32 [ %22, %21 ], [ %24, %23 ] | |
store i32 %26, i32* %3, align 4 | |
br label %27 | |
; <label>:27: ; preds = %25 | |
%28 = load i32, i32* %4, align 4 | |
%29 = add nsw i32 %28, 1 | |
store i32 %29, i32* %4, align 4 | |
br label %9 | |
; <label>:30: ; preds = %9 | |
%31 = load i32, i32* %3, align 4 | |
ret i32 %31 | |
} | |
attributes #0 = { noinline nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "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" } | |
!llvm.ident = !{!0} | |
!0 = !{!"clang version 4.0.1-6 (tags/RELEASE_401/final)"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment