[PATCH] X86: rework expansion of atomic instructions

Eric Christopher echristo at gmail.com
Mon Jun 30 17:19:09 PDT 2014


On Mon, Jun 30, 2014 at 5:13 PM, Eric Christopher <echristo at gmail.com> wrote:
> On Mon, Jun 30, 2014 at 10:54 AM, Tim Northover <t.p.northover at gmail.com> wrote:
>> Hi Eric,
>>
>>> +bool X86AtomicExpandPass::needsCmpXchgNb(llvm::Type *MemType) {
>>> +  const X86Subtarget &Subtarget = TM->getSubtarget<X86Subtarget>();
>>> +  if (!Subtarget.hasCmpxchg16b())
>>> ----------------
>>> Is there any way to get this information from TTI instead? Relying on the subtarget here is going to go badly soon.
>>
>> Should be fairly trivial, as long as a TTI can query the subtarget.
>> I'm fairly sure they can at the moment, but is that planned to go away
>> too? I'll get on it anyway.
>>
>
> Yeah, I'll have to rewrite it to do so. For now if you add something
> that's queried it should be OK. That said, the particular thing looks
> pretty target specific So perhaps we can just leave it and I'll clean
> it up once I get queries by function wired up.
>

To make this vague set of statements more concrete:

Enh, nevermind, but thanks for the offer of cleaning it up. I'll just
get to it when I get the caching done.

As far as the actual atomic code I'll try to look shortly. It's been a
while since I've looked at that, but your changes appear really
mechanical which should make it easier.

-eric



More information about the llvm-commits mailing list