[LegalizeTypes] When promoting BITREVERSE/BSWAP don't take the shift amount into...
authorCraig Topper <craig.topper@gmail.com>
Sun, 27 Oct 2019 18:49:24 +0000 (11:49 -0700)
committerCraig Topper <craig.topper@gmail.com>
Sun, 27 Oct 2019 19:20:35 +0000 (12:20 -0700)
commitf067dd839eca3103e8afc49c6e0a74d944f25fdd
tree28ce9eaeeda7359717709ac56732f26e629c7f3f
parent73f255b83ad77f6d10bc319592f04bbd8461bbcf
[LegalizeTypes] When promoting BITREVERSE/BSWAP don't take the shift amount into account when determining the shift amount VT.

If the target's preferred shift amount VT can't hold any shift
amount for the promoted VT, we should use i32. The specific shift
amount shouldn't matter. The type will be adjusted later when the
shift itself is type legalized. This avoids an assert in getNode.

Fixes PR43820.
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/test/CodeGen/X86/pr43820.ll [new file with mode: 0644]