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

Dan Gohman gohman at apple.com
Wed May 27 11:47:55 PDT 2009


On May 27, 2009, at 9:57 AM, Chris Lattner wrote:


>
> On May 27, 2009, at 9:54 AM, Dan Gohman wrote:
>
>
>>
>>
>> On May 26, 2009, at 6:29 PM, Sami Liedes 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.

Dan




More information about the llvm-commits mailing list