Support for HiPE-compatible code emission

Eli Bendersky eliben at google.com
Thu Feb 14 09:45:36 PST 2013


On Thu, Feb 14, 2013 at 4:43 AM, Yiannis Tsiouris
<gtsiour at softlab.ntua.gr> wrote:
> On 02/13/2013 09:32 PM, Eli Bendersky wrote:
>>>>
>>>> Tests indicate that you care about the x32 ABI, where sometimes you want
>>>> to
>>>> know the data model and not the platform bitness. This applies to stack
>>>> slot
>>>> size and to registers used for addresses. How does this affect your
>>>> code?
>>>
>>> I'm not sure I get your question here. Let me clarify what I actually
>>> care
>>> about as this misunderstanding might be a result of my abuse of the LLVM
>>> API:
>>>>
>>>> +  const unsigned Guaranteed = HipeLeafWords * SlotSize;
>>>> +  const unsigned CallerStkArity =
>>>> +    std::max<int>(0, MF.getFunction()->arg_size() - CCRegisteredArgs);
>>>> +  unsigned MaxStack =
>>>> +    MFI->getStackSize() + CallerStkArity * SlotSize + SlotSize;
>>>
>>> I 'd like to compute some metrics (such as the above) based on the number
>>> of
>>> *bytes* that are occupied on the stack for some values (e.g., the number
>>> of
>>> bytes that are used on the stack for the arguments of a function). One
>>> way
>>> to do that (that seemed reasonable to me :-)) was to use the pointer-size
>>> (or word-size or slot-size). So, what I only care about is the platform
>>> bitness. Is there a better way to write that? :-)
>>
>> Intel 64-bit CPUs can have a x32 mode in which pointers are 4 bytes
>> long. Therefore, when you want the stack slot size, there's another
>> getter for that now and you should not rely on the identity "stack
>> size == pointer size". See some of the others tests that trigger the
>> x32 ABI in upstream trunk.
>>
>
> Oh, now I see what you mean! :-) I think what I want is
> 'TargetRegisterInfo::getSlotSize()' then. I'm re-attaching the patch with
> that fixed.
>
>

Yes, now it looks OK.

Eli



More information about the llvm-commits mailing list