[InstCombine] add one-use check to shift-shift transform
authorSanjay Patel <spatel@rotateright.com>
Wed, 22 Sep 2021 20:16:49 +0000 (16:16 -0400)
committerSanjay Patel <spatel@rotateright.com>
Wed, 22 Sep 2021 20:31:12 +0000 (16:31 -0400)
commit1cd6b44f267b256051e6106d9cf665f3bae2fd22
tree09bd04b8b2078845eca9eac0389a91ed074114e1
parent55aa4e92f7374f01ef8d3c2f793a8666a1b13dca
[InstCombine] add one-use check to shift-shift transform

We don't want to create extra instructions, and this
could infinite loop with the proposed transform in D110170.
llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
llvm/test/Transforms/InstCombine/shift-amount-reassociation-with-truncation-shl.ll