[PATCH] X86: rework expansion of atomic instructions

Eric Christopher echristo at gmail.com
Mon Jun 30 17:13:04 PDT 2014


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.

-eric



More information about the llvm-commits mailing list