Skip to content

Instantly share code, notes, and snippets.

@carlokok
Created January 13, 2020 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlokok/3d4a357bd820c773e1c9c2668d36f04d to your computer and use it in GitHub Desktop.
Save carlokok/3d4a357bd820c773e1c9c2668d36f04d to your computer and use it in GitHub Desktop.
; ModuleID = 'test.bc'
source_filename = "testin.c"
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.24.28314"
; Function Attrs: noinline nounwind optnone uwtable
define dso_local i32 @Max(i32 %a, i32 %b) #0 {
entry:
%b.addr = alloca i32, align 4
%a.addr = alloca i32, align 4
%res = alloca i32, align 4
store i32 %b, i32* %b.addr, align 4
store i32 %a, i32* %a.addr, align 4
%0 = load i32, i32* %a.addr, align 4
%1 = load i32, i32* %b.addr, align 4
%cmp = icmp sge i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%2 = load i32, i32* %a.addr, align 4
store i32 %2, i32* %res, align 4
br label %if.end
if.else: ; preds = %entry
%3 = load i32, i32* %b.addr, align 4
store i32 %3, i32* %res, align 4
br label %if.end
if.end: ; preds = %if.else, %if.then
%4 = load i32, i32* %res, align 4
ret i32 %4
}
attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "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"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.module.flags = !{!0, !1}
!llvm.ident = !{!2}
!0 = !{i32 1, !"wchar_size", i32 2}
!1 = !{i32 7, !"PIC Level", i32 2}
!2 = !{!"clang version 10.0.0 "}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment