OSDN Git Service

[SelectionDAG] Provide default expansion for rotates
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Tue, 12 Jun 2018 12:49:36 +0000 (12:49 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Tue, 12 Jun 2018 12:49:36 +0000 (12:49 +0000)
commit77ce0e565d784065c8b3b588a02fa6bd7a985e97
tree7a3de0f8702dda91c31ad5e2524ff9944d14f8ce
parentb2621b34b756cfd6f4005856c36cffd4eb9157fa
[SelectionDAG] Provide default expansion for rotates

Implement default legalization of rotates: either in terms of the rotation
in the opposite direction (if legal), or in terms of shifts and ors.

Implement generating of rotate instructions for Hexagon. Hexagon only
supports rotates by an immediate value, so implement custom lowering of
ROTL/ROTR on Hexagon. If a rotate is not legal, use the default expansion.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334497 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/Target/Hexagon/HexagonISelLowering.cpp
lib/Target/Hexagon/HexagonISelLowering.h
lib/Target/Hexagon/HexagonPatterns.td
test/CodeGen/Hexagon/rotate.ll [new file with mode: 0644]
test/CodeGen/Hexagon/rotl-i64.ll