[DAG] Fix shift amount limit in SimplifyDemandedBits trunc(shift(x,c)) to truncated...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 13 Feb 2021 11:59:52 +0000 (11:59 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 13 Feb 2021 12:00:08 +0000 (12:00 +0000)
commit7ad0c573bd4a68dc81886037457d47daa3d6aa24
treed1ea74199027c5bcb1dbf6a4b59e7af57c054623
parent35f5f797a616c0eb8d6ae23ca24e3b80d3e3efdf
[DAG] Fix shift amount limit in SimplifyDemandedBits trunc(shift(x,c)) to truncated bitwidth

We lost this in D56387/rG69bc0990a9181e6eb86228276d2f59435a7fae67 - where I got the src/dst bitwidths mixed up and assumed getValidShiftAmountConstant would catch it.

Patch by @craig.topper - confirmed by @Carrot that it fixes PR49162
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/test/CodeGen/X86/pr49162.ll