Skip to content

Instantly share code, notes, and snippets.

@uzleo
Created February 28, 2019 14:14
Show Gist options
  • Select an option

  • Save uzleo/77ceb02961785bcac7a1e341bfa620e7 to your computer and use it in GitHub Desktop.

Select an option

Save uzleo/77ceb02961785bcac7a1e341bfa620e7 to your computer and use it in GitHub Desktop.
ir for swift
; ModuleID = 'main2.c'
source_filename = "main2.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 optnone uwtable
define dso_local i32 @main() #0 {
%1 = alloca i32, align 4 // &x
// %1_dup = %1
%2 = alloca i32, align 4 // &y
// %2_dup = %2
%3 = alloca i32, align 4 // &z
// %3_dup = %3
// %1==%1_dup??
store i32 1, i32* %1, align 4
// %2==%2_dup??
store i32 2, i32* %2, align 4
// %3==%3_dup??
store i32 3, i32* %3, align 4
%4 = load i32, i32* %1, align 4
// %4_dup = load i32, i32* &1_dup, align 4
%5 = load i32, i32* %2, align 4
// %5_dup = load i32, i32* &2_dup, align 4
%6 = add nsw i32 %4, %5
// %6_dup = add nsw i32 %4_dup, %5_dup
// (%6==%6_dup) AND (%3==%3_dup)
store i32 %6, i32* %3, align 4
%7 = load i32, i32* %3, align 4
// %7_dup = load i32, i32* %3_dup, align 4
// (%7==%7_dup)
store volatile i32 %7, i32* inttoptr (i64 100663296 to i32*), align 4
ret i32 0
}
attributes #0 = { noinline nounwind optnone 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.module.flags = !{!0}
!llvm.ident = !{!1}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{!"clang version 7.0.0-3 (tags/RELEASE_700/final)"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment