[X86] Use MVT::i8 instead of MVT::i64 for shift amount in BuildSDIVPow2
authorCraig Topper <craig.topper@intel.com>
Thu, 6 Feb 2020 21:10:32 +0000 (13:10 -0800)
committerCraig Topper <craig.topper@intel.com>
Thu, 6 Feb 2020 21:32:13 +0000 (13:32 -0800)
commitec9a94af4d5fb3270f2451fcbec5a3a99f4ac03a
treef32923f3d703d880fee1ad6d2f1ea136d75aa94d
parent38fd69995fc5a6f16e0aa132a46e5ccdbc2eebb3
[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
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/pr44812.ll [new file with mode: 0644]