Simplification of libcall like printf->puts must check for RtLibUseGOT metadata.
authorSriraman Tallam <tmsriram@google.com>
Tue, 10 Apr 2018 23:32:36 +0000 (23:32 +0000)
committerSriraman Tallam <tmsriram@google.com>
Tue, 10 Apr 2018 23:32:36 +0000 (23:32 +0000)
commit182f2df7c5f691ef0f65adf6643411714fe33138
treeb651d79295d0ceaf623695e4f39656cd692e928f
parenteb820c3aaca964ca016c539d5d918e17bc8b04ad
Simplification of libcall like printf->puts must check for RtLibUseGOT metadata.

With -fno-plt, for example, calls to printf when getting converted to puts
still use the PLT. This patch checks for the metadata "RtLibUseGOT" and
annotates the declaration with the right attributes.

Differential Revision: https://reviews.llvm.org/D45180

llvm-svn: 329768
llvm/lib/Transforms/Utils/BuildLibCalls.cpp
llvm/test/CodeGen/X86/no-plt-libcalls.ll [new file with mode: 0644]