[LLVMdev] TableGen syntax for matching a constant load

Jakob Stoklund Olesen stoklund at 2pi.dk
Sat Feb 26 13:07:39 PST 2011


On Feb 25, 2011, at 7:27 PM, Joerg Sonnenberger wrote:

> I'm trying to add a X86 pattern to turn
> 	movl $-1, %eax
> into
> 	orl $-1, $eax

Please make sure to measure the performance impact of doing this. You are creating a false dependency on the last instruction to write %eax, and the CPU won't be able to execute the following instructions in parallel.

You may want to consider using xorl+decl instead. It is also three bytes, and there are no false dependencies. The xor idiom is recognized by processors as old as Pentium 4 as having no dependencies.

/jakob





More information about the llvm-dev mailing list