X86TargetLowering::ExpandInlineAsm patch

Eric Christopher echristo at gmail.com
Mon Nov 4 13:45:23 PST 2013


On Sun, Nov 3, 2013 at 10:40 AM, Chris Smowton <chris at smowton.net> wrote:

>  What should the test case look like? I attach a test C file which, when
> compiled with -O1 using Dragonegg and Clang yields the attached ll files. I
> had to hack out Dragonegg's call to ExpandInlineAsm to get this (Clang
> never attempts to call it until codegen time). -O1 is necessary for GCC
> (4.6) to insert its internal implementation of htons.
>

If dragonegg.ll doesn't generate the bswap intrinsic before and does after
that makes it a great candidate for a testcase :)

Just needs a few things on top of it:

a) some boiler plate. Take a look at test/CodeGen/X86/inline-asm-h.ll
b) a FileCheck line, probably checking for that the resultant #APP/#NOAPP
don't exist in the final output.
c) You can remove the module info etc as well from the top since the
command line from the boiler plate should handle it.

FWIW patches should be made against head as well. Your patch didn't apply
cleanly so in looking at this I've gone ahead and done this stuff and
applied it as r194016. For next time this should give you a guide though.

Thanks!

-eric


>
> Then CodeGenPrepare with a TargetLowering should raise both into
> llvm.bswap intrinsics; however I don't know a more elegant way to observe
> that than passing -print-after-all to llc, as calling opt -codegenprepare
> does so without a TargetLowering.
>
> Both dragonegg.ll and clang.ll are raised into intrinsics with my patch;
> only clang.ll is without it.
>
> Chris
>
>
>
> Compiling test.c (attached) should yield bitcode like
> dragonegg-successful.ll.Looks pretty reasonable, needs a testcase :)
>
>  -eric
>
>
> On Thu, Oct 31, 2013 at 11:49 AM, Chris Smowton <chris at smowton.net> wrote:
>
>> See http://llvm.org/bugs/show_bug.cgi?id=17757 for details; Chris
>> Lattner advised I should cross-post the patch here.
>>
>> Chris
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131104/f91e3073/attachment.html>


More information about the llvm-commits mailing list