]> granicus.if.org Git - llvm/commit
[DAGCombiner] add operation legality checks before creating shift ops (PR43542)
authorSanjay Patel <spatel@rotateright.com>
Thu, 3 Oct 2019 21:34:04 +0000 (21:34 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 3 Oct 2019 21:34:04 +0000 (21:34 +0000)
commitf03d2d8516df4560c9ade883bd2f46b8671cf6ae
tree5c347a527014192d1ff0d643f7cfcb1be216ee25
parent091533bd66ca1546ccc5cad546512ea428f55431
[DAGCombiner] add operation legality checks before creating shift ops (PR43542)

As discussed on llvm-dev and:
https://bugs.llvm.org/show_bug.cgi?id=43542
...we have transforms that assume shift operations are legal and transforms to
use them are profitable, but that may not hold for simple targets.

In this case, the MSP430 target custom lowers shifts by repeating (many)
simpler/fixed ops. That can be avoided by keeping this code as setcc/select.

Differential Revision: https://reviews.llvm.org/D68397

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373666 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/MSP430/selectcc.ll