[X86] Restore selection of MULX on BMI2 targets.
authorCraig Topper <craig.topper@gmail.com>
Wed, 27 May 2020 18:12:05 +0000 (11:12 -0700)
committerCraig Topper <craig.topper@gmail.com>
Wed, 27 May 2020 19:01:18 +0000 (12:01 -0700)
commit8e7e6a8d6bae19c5a18e0d0daa0614272b85598c
tree8aa7b004479833d737745726bf1b087a6e346552
parentfa3b587196dbc04e445257ae38e7906e5c0c4888
[X86] Restore selection of MULX on BMI2 targets.

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.

Differential Revision: https://reviews.llvm.org/D80498
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