[llvm-dev] [MC] Target-Independent Small Data Section Handling

Jack Andersen via llvm-dev llvm-dev at lists.llvm.org
Tue Nov 8 15:23:39 PST 2016


On second thought, a third arg will add a burdensome caller constraint in several areas. 

The GlobalObject itself has isConstant(), so that should be sufficient for rejecting ReadOnly cases (Hexagon does it already). 

> On 8 Nov 2016, at 12:33, Jack Andersen <jackoalan at gmail.com> wrote:
> 
> Oh, one thing I forgot to mention:
> 
> ReadOnly objects are also counted as small data globals on PPC (on top of BSS, Data, Common). That's what the r2 base is for (.sdata2, defined to be constant data). 32-bit immediate loads take 2 ops minimum on PPC, so even constant loading benefits from small data.
> 
> It'd be handy to add a third argument containing what kind would normally be returned:
> isGlobalInSmallSectionKind(GO, TM, <nominal-kind-expr>)
> 
> If a ReadOnly global is better emitted as instruction immediates, then the target can return `false` right then and there.
> 
>> On Nov 8, 2016, at 07:21, Simon Dardis <Simon.Dardis at imgtec.com> wrote:
>> 
>> isGlobalInSmallSectionKind



More information about the llvm-dev mailing list