Skip to content

Instantly share code, notes, and snippets.

@tomaka
Created February 15, 2016 12:25
Show Gist options
  • Select an option

  • Save tomaka/5ba11ddc612bb7d430a5 to your computer and use it in GitHub Desktop.

Select an option

Save tomaka/5ba11ddc612bb7d430a5 to your computer and use it in GitHub Desktop.
*** IR Dump After Expand out variables with struct types ***
; Function Attrs: noinline uwtable
define internal fastcc i8* @_ZN5hello20h950a00b68330e9b8haaE() unnamed_addr #0 {
entry-block:
%0 = alloca i8, i32 8, align 16
%.bc = bitcast i8* %0 to { i8*, i32 }*
call void @_ZN3get20h05af50f9733c2d54haaE({ i8*, i32 }* %.bc)
%.sreg.index = getelementptr { i8*, i32 }, { i8*, i32 }* %.bc, i32 0, i32 0
%.sreg.field = load i8*, i8** %.sreg.index, align 16
%.sreg.index1 = getelementptr { i8*, i32 }, { i8*, i32 }* %.bc, i32 0, i32 1
%.sreg.field2 = load i32, i32* %.sreg.index1, align 4
ret i8* %.sreg.field
}
*** IR Dump After Dead Code Elimination ***
; Function Attrs: noinline uwtable
define internal fastcc i8* @_ZN5hello20h950a00b68330e9b8haaE() unnamed_addr #0 {
entry-block:
%0 = alloca i8, i32 8, align 16
%.bc = bitcast i8* %0 to { i8*, i32 }*
%.sreg.index = getelementptr { i8*, i32 }, { i8*, i32 }* %.bc, i32 0, i32 0
%.sreg.field = load i8*, i8** %.sreg.index, align 16
ret i8* %.sreg.field
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment