HomePhabricator

[X86] Use MVT::i8 instead of MVT::i64 for shift amount in BuildSDIVPow2

Authored by craig.topper on Feb 6 2020, 1:10 PM.

Description

[X86] Use MVT::i8 instead of MVT::i64 for shift amount in BuildSDIVPow2

X86 uses i8 for shift amounts. This code can fail on a 32-bit target
if it runs after type legalization.

This code was copied from AArch64 and modified for X86, but the
shift amount wasn't changed to the correct type for X86.

Fixes PR44812

Details