Skip to content

Instantly share code, notes, and snippets.

@Aatch
Created February 21, 2017 08:29
Show Gist options
  • Save Aatch/fe555f251de910d7e765a11cbb5d78d4 to your computer and use it in GitHub Desktop.
Save Aatch/fe555f251de910d7e765a11cbb5d78d4 to your computer and use it in GitHub Desktop.
define void @test(%"Wrapper<Foo>"* nonnull, void (i8*)** noalias nocapture nonnull readonly) unnamed_addr #0 {
entry-block:
%2 = getelementptr inbounds void (i8*)*, void (i8*)** %1, i64 2
%3 = bitcast void (i8*)** %2 to i64*
%4 = load i64, i64* %3, align 8, !invariant.load !0
%5 = add i64 %4, 15
%6 = sub i64 0, %4
%7 = and i64 %5, %6
%8 = bitcast %"Wrapper<Foo>"* %0 to i8*
%9 = getelementptr i8, i8* %8, i64 %7
%10 = getelementptr inbounds void (i8*)*, void (i8*)** %1, i64 3
%11 = load void (i8*)*, void (i8*)** %10, align 8, !invariant.load !0, !nonnull !0
tail call void %11(i8* nonnull %9)
tail call void %11(i8* nonnull %9)
ret void
}
define void @test(%"Wrapper<Foo>"* nonnull, void (i8*)** nocapture nonnull readonly) unnamed_addr #0 {
entry-block:
%2 = getelementptr inbounds void (i8*)*, void (i8*)** %1, i64 2
%3 = bitcast void (i8*)** %2 to i64*
%4 = load i64, i64* %3, align 8
%5 = add i64 %4, 15
%6 = sub i64 0, %4
%7 = and i64 %5, %6
%8 = bitcast %"Wrapper<Foo>"* %0 to i8*
%9 = getelementptr i8, i8* %8, i64 %7
%10 = getelementptr inbounds void (i8*)*, void (i8*)** %1, i64 3
%11 = load void (i8*)*, void (i8*)** %10, align 8
tail call void %11(i8* nonnull %9)
%12 = load i64, i64* %3, align 8
%13 = add i64 %12, 15
%14 = sub i64 0, %12
%15 = and i64 %13, %14
%16 = getelementptr i8, i8* %8, i64 %15
%17 = load void (i8*)*, void (i8*)** %10, align 8
tail call void %17(i8* nonnull %16)
ret void
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment