[LLVMdev] Testing Target Optimization via ASM Injection

Renato Golin rengolin at systemcall.org
Mon Dec 10 03:50:32 PST 2012


On 10 December 2012 03:00, Isaac Asay <iasay at calpoly.edu> wrote:
> I've also tried using asm() C calls to force a
> specific assembly pattern, but LLVM appears to treat the asm() call like a
> single atomic block that does not have the optimizer run on its member
> instructions.

Hi Isaac,

AFAIK, inline assembly is only exported at the end and it's generally
kept intact, since the compiler has no way to know whether you wanted
all the side effects of your hand-coded assembly or not.

Also, most LLVM optimizations run on IR, not assembly, so by writing
it ASM, you lose most of the power of LLVM. Even if there is a way to
enable the compiler to change your inline ASM, the improvements would
be very limited.


--
cheers,
--renato

http://systemcall.org/



More information about the llvm-dev mailing list