[PATCH] Add HLE target feature

Jeffrey Yasskin jyasskin at googlers.com
Wed Feb 27 16:01:14 PST 2013


On Wed, Feb 27, 2013 at 3:50 PM, Krzysztof Parzyszek
<kparzysz at codeaurora.org> wrote:
> On 2/27/2013 5:09 PM, Michael Liao wrote:
>>
>>
>> "LLVM Atomic Instructions and Concurrency Guide" puts more details on
>> why atomic instructions are added in LLVM IR and optimizations around
>> it. For HLE support, you could treat an enhancement on atomic
>> instruction by taking advantage of hardware support or TM support, the
>> current approach is to add hint in atomic instructions already existed
>> in LLVM IR to help backend generate proper code.
>
>
> This sort of thing belongs in the X86 backend, not LLVM IR.  The IR already
> contains atomic instructions, and the decision of how to best implement them
> on a particular platform is best left to the individual backends.

This is why we need the langref patch before looking into the
implementation. These annotations are something like the !nontemporal
metadata on loads, in that they hint to the implementation that
certain properties will hold on a particular use of the existing
atomic instructions, and certain targets can take advantage of that to
emit better code. On uses where those properties don't hold, the
existing code is better.

But it's hard to say that convincingly when the spec is just "this
does <Magic Keyword>".



More information about the llvm-commits mailing list