Skip to content

Instantly share code, notes, and snippets.

@bryant
Created August 24, 2016 11:00
Show Gist options
  • Save bryant/1e1b347660cad82d7ee3a6e870a70859 to your computer and use it in GitHub Desktop.
Save bryant/1e1b347660cad82d7ee3a6e870a70859 to your computer and use it in GitHub Desktop.
%struct.S = type { [65536 x i8] }
; Function Attrs: nounwind uwtable
define void @f(%struct.S* noalias nocapture sret, %struct.S* nocapture readonly, %struct.S* nocapture readonly) local_unnamed_addr #0 {
%4 = alloca %struct.S, align 1
%5 = getelementptr inbounds %struct.S, %struct.S* %4, i64 0, i32 0, i64 0
call void @llvm.lifetime.start(i64 65536, i8* %5) #2
%6 = getelementptr inbounds %struct.S, %struct.S* %1, i64 0, i32 0, i64 0
%7 = load i8, i8* %6, align 1
%8 = getelementptr inbounds %struct.S, %struct.S* %2, i64 0, i32 0, i64 0
%9 = load i8, i8* %8, align 1
%10 = xor i8 %9, %7
store i8 %10, i8* %5, align 1
%11 = getelementptr inbounds %struct.S, %struct.S* %0, i64 0, i32 0, i64 0
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %11, i8* %5, i64 65536, i32 1, i1 false)
call void @llvm.lifetime.end(i64 65536, i8* %5) #2
ret void
}
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.start(i64, i8* nocapture)
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.end(i64, i8* nocapture)
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32, i1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment