[DAGCombiner] Remove (sra (shl X, C), C) if X has more than C sign bits.
authorCraig Topper <craig.topper@sifive.com>
Wed, 3 Feb 2021 18:16:08 +0000 (10:16 -0800)
committerCraig Topper <craig.topper@sifive.com>
Wed, 3 Feb 2021 18:18:40 +0000 (10:18 -0800)
commit34da12dd1fb327bb56f5003a727a73c78929a98d
tree62b7b2b8aea6e1bf78da6a3a8a5c0398fb187bf2
parentf2879559ac11d88f1f9f043d4c0fec981ac2a9e6
[DAGCombiner] Remove (sra (shl X, C), C) if X has more than C sign bits.

If sext_inreg is supported, we will turn this into sext_inreg. That
will then remove it if there are enough sign bits. But if sext_inreg
isn't supported, we can still remove the shift pair based on sign
bits.

Split from D95890.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/Mips/atomic.ll