[DAG] SimplifyDemandedBits - correctly adjust truncated shift amount type
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 21 Jan 2021 12:24:35 +0000 (12:24 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 21 Jan 2021 12:38:36 +0000 (12:38 +0000)
commit935bacd3a7244f04b7f39818e3fc589529474d13
tree15397a51db57113bc513ae94bc1f304760c9323d
parented2853d2c82d7286ba510c8f65049d6f649017f0
[DAG] SimplifyDemandedBits - correctly adjust truncated shift amount type

As noticed on D56387, for vectors we must always correctly adjust the shift amount type during truncation (not just after legalization). We were getting away with it as we currently only accepted scalars via the dyn_cast<ConstantSDNode>.
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp