[PATCH] D80498: [X86] Restore selection of MULX on BMI2 targets.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 24 15:59:37 PDT 2020


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel, andreadb.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

Looking back over gcc and icc behavior it looks like icc does
use mulx32 on 32-bit targets and mulx64 on 64-bit targets. It's
also used when dividing i32 by constant on 32-bit targets and
i64 by constant on 64-bit targets.

gcc uses it multiplies producing a 64 bit result on 32-bit targets
and 128-bit results on a 64-bit target. gcc does not appear to use
it for division by constant.

After this patch clang is closer to the icc behavior. This
basically reverts d1c61861ddc94457b08a5a653d3908b7b38ebb22, but
there were no strong feelings at the time.

Fixes PR45518.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80498

Files:
  llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
  llvm/test/CodeGen/X86/atomic-unordered.ll
  llvm/test/CodeGen/X86/bmi2-x86_64.ll
  llvm/test/CodeGen/X86/bmi2.ll
  llvm/test/CodeGen/X86/hoist-invariant-load.ll
  llvm/test/CodeGen/X86/i128-mul.ll
  llvm/test/CodeGen/X86/mulx32.ll
  llvm/test/CodeGen/X86/mulx64.ll
  llvm/test/CodeGen/X86/pr35636.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80498.265950.patch
Type: text/x-patch
Size: 33442 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200524/2b345b6f/attachment-0001.bin>


More information about the llvm-commits mailing list