[llvm-commits] patch: Lower glibc's x86 bswap_32() inline asm

Dale Johannesen dalej at apple.com
Wed May 27 11:52:59 PDT 2009


On May 27, 2009, at 11:47 AMPDT, Dan Gohman wrote:
>>>> This patch adds code in X86TargetAsmInfo::ExpandInlineAsm() to
>>>>
>>>> recognize glibc's bswap_32() inline asm for x86 <i486 target and
>>>>
>>>> lower
>>>>
>>>> it to llvm.bswap.i32
>>>>
>>>
>>>
>>> LLVM doesn't currently support x86 < i486.  If you match that  
>>> pattern
>>>
>>> to llvm.bswap.i32, I assume LLVM will emit a 32-bit bswap.  I don't
>>>
>>> think LLVM should try to pattern-match inline asms specific to
>>>
>>> x86 < i486 if it isn't prepared to emit code for such a target.
>>>
>>
>> Doesn't the existing bswap matcher have the same problem?  Why do we
>> care about < i486 at all?  This patch is important, because it
>> unbreaks some JIT (which doesn't support inline asm) use cases on
>> linux.
>
> If llvm-gcc is telling GLIBC that the target is < i486, it would seem
> to be a better approach would be to configure llvm-gcc to not do that.
>
> Offhand I don't know the specific configure options to recommend, but
> it seems to be some combination of --with-arch= and --with-target=
> possibly along with --with-tune=generic. If someone can figure out
> specific values to recommend, we can put them in README.LLVM.

There are values recommended there, but only for Darwin.  I think the  
with-arch and with-tune values should be generally applicable, though.




More information about the llvm-commits mailing list