[PATCH] [X86] Memory folding for commutative instructions.

Simon Pilgrim llvm-dev at redking.me.uk
Thu Oct 9 06:05:00 PDT 2014

Hi nadav, andreadb, spatel,

This patch improves support for commutative instructions in the x86 memory folding implementation by attempting to fold a commuted version of the instruction if the original folding fails - if that folding fails as well the instruction is 're-commuted' back to its original order before returning.

This mainly helps the stack inliner better fold reloads of 3 (or more) operand instructions (VEX encoded SSE etc.) but by performing this in the lowest foldMemoryOperandImpl implementation it also replaces the X86InstrInfo::optimizeLoadInstr version and is now used by FastISel too.

Unlike the X86InstrInfo::optimizeLoadInstr implementation it uses findCommutedOpIndices instead of hard coded commute operand indices.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5701.14650.patch
Type: text/x-patch
Size: 6196 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141009/368257a9/attachment.bin>

More information about the llvm-commits mailing list