[llvm-commits] [llvm] r164138 - in /llvm/trunk: lib/Target/PowerPC/PPCISelLowering.cpp test/CodeGen/PowerPC/ppc64-calls.ll
Adhemerval Zanella
azanella at linux.vnet.ibm.com
Tue Sep 18 11:26:43 PDT 2012
On 09/18/2012 03:17 PM, Eli Friedman wrote:
> On Tue, Sep 18, 2012 at 9:47 AM, Roman Divacky <rdivacky at freebsd.org> wrote:
>> Author: rdivacky
>> Date: Tue Sep 18 11:47:58 2012
>> New Revision: 164138
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=164138&view=rev
>> Log:
>> Optimize local func calls to not emit nop for TOC restoration.
>>
>> Patch by Adhemerval Zanella.
>>
>> Added:
>> llvm/trunk/test/CodeGen/PowerPC/ppc64-calls.ll
>> Modified:
>> llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
>>
>> Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=164138&r1=164137&r2=164138&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
>> +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Tue Sep 18 11:47:58 2012
>> @@ -2808,6 +2808,14 @@
>> return CallOpc;
>> }
>>
>> +static
>> +bool isLocalCall(const SDValue &Callee)
>> +{
>> + if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
>> + return !G->getGlobal()->isDeclaration();
>> + return false;
>> +}
> I think you also need to check "G->getGlobal()->isWeakForLinker()";
> just because we have a definition doesn't mean it'll get used.
>
> -Eli
>
Indeed you are right, thanks. Roman also pointed out he saw an error related to it.
Let me craft one testcase to catch issues like this one.
--
Adhemerval Zanella Netto
Software Engineer
Linux Technology Center Brazil
Toolchain / GLIBC on Power Architecture
azanella at linux.vnet.ibm.com / azanella at br.ibm.com
+55 61 8642-9890
More information about the llvm-commits
mailing list