[PATCH] D42216: Use New Module Metadata String "AvoidPLT" to avoid calls via PLT
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 29 14:15:27 PST 2018
Sriraman Tallam via Phabricator <reviews at reviews.llvm.org> writes:
> ===================================================================
> --- test/CodeGen/X86/no-plt.ll
> +++ test/CodeGen/X86/no-plt.ll
> @@ -3,28 +3,41 @@
> ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnu \
> ; RUN: | FileCheck -check-prefix=X64 %s
>
> -define i32 @main() #0 {
> -; X64: callq *_Z3foov at GOTPCREL(%rip)
> -; X64: callq _Z3barv
> -; X64: callq _Z3bazv
> +; Function Attrs: noinline nounwind uwtable
> +define void @memset_call(i8* nocapture %a, i8 %c, i32 %n) local_unnamed_addr #0 {
> +; X64: callq *memset at GOTPCREL(%rip)
> +entry:
> + call void @llvm.memset.p0i8.i32(i8* %a, i8 %c, i32 %n, i1 false)
> + ret void
> +}
> +
> +; Function Attrs: noinline nounwind uwtable
> +define void @memcpy_call(i8* nocapture %a, i8* nocapture readonly %b, i64 %n) local_unnamed_addr #0 {
> +; X64: callq *memcpy at GOTPCREL(%rip)
> +entry:
> + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* %b, i64 %n, i32 1, i1 false)
> + ret void
> +}
> +
> +define i32 @main() #1 {
> +; X64: callq *foo at GOTPCREL(%rip)
> +; X64: callq bar
> +; X64: callq baz
>
> entry:
> %retval = alloca i32, align 4
> store i32 0, i32* %retval, align 4
> - %call1 = call i32 @_Z3foov()
> - %call2 = call i32 @_Z3barv()
> - %call3 = call i32 @_Z3bazv()
> + %call1 = call i32 @foo()
> + %call2 = call i32 @bar()
> + %call3 = call i32 @baz()
> ret i32 0
Looks like you based the patch on an old revision. Please upload a patch
based on r323680 or newer.
Cheers,
Rafael
More information about the llvm-commits
mailing list