In theory, we should let the PPC target to determine how to lower the TOC Entry for globals. And the PPCTargetLowering require this query to do some optimization for TOC_Entry. I will commit another patch to do that.
Details
Diff Detail
Event Timeline
llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp | ||
---|---|---|
4901 | In this case we don't keep the address of the global in the .toc/.got so the comment is misleading, maybe something more like: // Build the address relative to the TOC-pointer. | |
llvm/lib/Target/PowerPC/PPCISelLowering.cpp | ||
13730 | I believe Non-Lazy-Pointer is strictly a mac-os construct (not sure exactly what it is). I think the comment here would be less confusing if it simply mentions that the NLP flag indicates that a global access has to use an extra indirection. | |
llvm/lib/Target/PowerPC/PPCISelLowering.h | ||
793 | I would prefer to keep consistent with the V2 abi naming and call this 'GotIndirect' instead of TOCIndirect, but don't feel super strongly about it. |
Update the comments.
llvm/lib/Target/PowerPC/PPCISelLowering.h | ||
---|---|---|
793 | I was swing between these two terms. Agree that Got would be more clear. |
In this case we don't keep the address of the global in the .toc/.got so the comment is misleading, maybe something more like: