Skip to content

Instantly share code, notes, and snippets.

@minjang
Created November 29, 2016 03:17
Show Gist options
  • Save minjang/e777d7fba3ae113592807acb9506bb42 to your computer and use it in GitHub Desktop.
Save minjang/e777d7fba3ae113592807acb9506bb42 to your computer and use it in GitHub Desktop.
After mem2reg, inline, and mem2reg optimizations
define i32 @_Z4testv() #0 {
entry:
%call = call i32 @_Z3getv() ; a = get();
%call1 = call i32 @_Z3getv() ; b = get();
; temp_swap(a, b)는 사라짐
%xor.i = xor i32 %call1, %call ; xor_swap(a, b)가 xor_swap(b, a)로 바뀜
%xor1.i = xor i32 %call, %xor.i
%xor2.i = xor i32 %xor.i, %xor1.i
%call2 = call i32 @_Z7processii(i32 %xor2.i, i32 %xor1.i)
ret i32 %call2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment