[DAG] MatchRotate - support rotate-by-constant of illegal types
authorSimon Pilgrim <simon_pilgrim@scee.net>
Fri, 19 Nov 2021 10:37:54 +0000 (10:37 +0000)
committerSimon Pilgrim <simon_pilgrim@scee.net>
Fri, 19 Nov 2021 11:12:04 +0000 (11:12 +0000)
commit812e64ef0c933b402da99a5e5428fc88927bb792
tree1f704524cd36be1e0486c5af97c4b93108c900aa
parentbf55b9f0d0e938def5d24629325b271cbfc3b04a
[DAG] MatchRotate - support rotate-by-constant of illegal types

Patch to fix some of the regressions in D77804.

By folding to rotate/funnel-shift by constant amounts for illegal types, we prevent SimplifyDemandedBits from destroying the patterns prematurely, allowing us to use the rotate/funnel-shift legalization that was added in D112443.

Differential Revision: https://reviews.llvm.org/D113192
13 files changed:
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/ARM/rotate.ll
llvm/test/CodeGen/PowerPC/vector-rotates.ll
llvm/test/CodeGen/RISCV/rv32zbp.ll
llvm/test/CodeGen/RISCV/rv64zbp.ll
llvm/test/CodeGen/RISCV/srem-seteq-illegal-types.ll
llvm/test/CodeGen/X86/rotate-extract-vector.ll
llvm/test/CodeGen/X86/rotate-extract.ll
llvm/test/CodeGen/X86/rotate.ll
llvm/test/CodeGen/X86/rotate2.ll
llvm/test/CodeGen/X86/vector-rotate-128.ll
llvm/test/CodeGen/X86/vector-rotate-256.ll
llvm/test/CodeGen/X86/vector-rotate-512.ll