This is an archive of the discontinued LLVM Phabricator instance.

[X86] Restore selection of MULX on BMI2 targets.
ClosedPublic

Authored by craig.topper on May 24 2020, 3:34 PM.

Details

Summary

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.

Diff Detail

Event Timeline

craig.topper created this revision.May 24 2020, 3:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2020, 3:34 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
This revision is now accepted and ready to land.May 27 2020, 10:12 AM
This revision was automatically updated to reflect the committed changes.