[PATCH] D30181: [X86] Use SHLD with both inputs from the same register to implement rotate on Sandy Bridge and later Intel CPUs

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 20 16:20:13 PST 2017


craig.topper created this revision.

Sandy Bridge and later CPUs have better throughput using a SHLD to implement rotate versus the normal rotate instructions. Additionally it saves one uop and avoids a partial flag update dependency.

This patch implements this change on any Sandy Bridge or later processor without BMI2 instructions. With BMI2 we will use RORX as we currently do.


https://reviews.llvm.org/D30181

Files:
  lib/Target/X86/X86.td
  lib/Target/X86/X86InstrInfo.td
  lib/Target/X86/X86InstrShiftRotate.td
  lib/Target/X86/X86Subtarget.cpp
  lib/Target/X86/X86Subtarget.h
  test/CodeGen/X86/rot32.ll
  test/CodeGen/X86/rot64.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30181.89148.patch
Type: text/x-patch
Size: 6097 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170221/a409afaf/attachment.bin>


More information about the llvm-commits mailing list