[LLVMdev] Macro-op fusion experiment
Nicolas Capens
nicolas.capens at gmail.com
Fri Apr 8 03:29:42 PDT 2011
Hi all,
x86 processors use macro-op fusion to merge together two instructions and
execute them as one. So it's beneficial for the compiler to emit them as a
pair.
Currently only compare and jump instructions get fused though. And I was
wondering whether it also makes sense to fuse move and arithmetic
instructions together, to form non-destructive instructions (which x86 lacks
for regular instructions). For instance:
8B C3 mov eax, ebx
03 C1 add eax, ecx
becomes
8B C3 03 C1 add eax, ebx, ecx
There's no difference in the binary encoding; it's just considered one
instruction at a logical level and inside the hardware (I'm assuming x86's
RISC internals actually use non-destructive micro-operations).
So my question is, how do I define these fused instructions in LLVM? And how
would I be able to estimate the potential speedup?
Thanks,
Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110408/16421887/attachment.html>
More information about the llvm-dev
mailing list