[PATCH] D55565: [X86] Don't emit MULX by default with BMI2

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 11 09:45:17 PST 2018


craig.topper created this revision.
craig.topper added reviewers: andreadb, RKSimon, spatel.

MULX has somewhat improved register allocation constraints compared to the legacy MUL instruction. Both output registers are encoded instead of fixed to EAX/EDX, but EDX is used as input. It also doesn't touch flags. Unfortunately, the encoding is longer.

Prefering it whenever BMI2 is enabled is probably not optimal. Choosing it should somehow be a function of register allocation constraints like converting adds to three address. gcc and icc definitely don't pick MULX by default. Not sure what if any rules they have for using it.


https://reviews.llvm.org/D55565

Files:
  lib/Target/X86/X86ISelDAGToDAG.cpp
  test/CodeGen/X86/bmi2-x86_64.ll
  test/CodeGen/X86/bmi2.ll
  test/CodeGen/X86/i128-mul.ll
  test/CodeGen/X86/mulx32.ll
  test/CodeGen/X86/mulx64.ll
  test/CodeGen/X86/pr35636.ll
  test/CodeGen/X86/stack-folding-bmi2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55565.177735.patch
Type: text/x-patch
Size: 30431 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181211/84e093b5/attachment-0001.bin>


More information about the llvm-commits mailing list