modifying llc asm output


I am trying to modify the llc in that way:

subf 3, 5, 3 subf 3, 5, 3

stw 3, 44(1) stw 3, 44(1)

InlineAsm Start

→ isync

InlineAsm End

lwz 3, 44(1) lwz 3, 44(1)

cmpwi 0, 3, -1 cmpwi 0, 3, -1

I would like to insert Code (like the isync) in the asm output of the llc. What is the best way, or easiest to do this.

llc –filetype=asm –march=ppc32 -o=test.s test.bc

With best regards,

  • Michael

Well, inlined assembly, of course. :slight_smile: Make sure to mark it as "volatile".


Ok :slight_smile: und how can I add inlined assembly to the output?

- Michael

If you're compiling this from C source code, use the "__asm__
__volatile__ ("isync");" syntax. If you're generating straight LLVM
IR, then I'm not entirely sure. You'll have to create some type of
CallInst instruction. See TreeToLLVM::EmitASM_EXPR() in the LLVM-GCC
gcc/llvm-convert.cpp file for an example of how it generates one of