Support for HiPE-compatible code emission

Yiannis Tsiouris gtsiour at softlab.ntua.gr
Thu Feb 14 04:43:36 PST 2013


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.

>> A couple of small fixes here, too; they shouldn't be a problem.
>>
>> Is this OK to commit?
> Thanks for the fixes. I'm not the authority for final approvals in
> this region though. Nadav or someone else should give you the green
> light if they're OK with the patch.
>    
If there is no other objection, can someone please commit it for me?

Thanks Eli! ;-)

-- 
Yiannis Tsiouris
Ph.D. student,
Software Engineering Laboratory,
National Technical University of Athens
WWW: http://www.softlab.ntua.gr/~gtsiour

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hipe-prologue-v3.patch
Type: text/x-patch
Size: 11827 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130214/a34c759e/attachment.bin>


More information about the llvm-commits mailing list