OSDN Git Service

[DAGCombine] (shl (or x, c1), c2) -> (or (shl x, c2), c1 << c2)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 14 Sep 2017 10:38:30 +0000 (10:38 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 14 Sep 2017 10:38:30 +0000 (10:38 +0000)
commitc3fc1550b7ee02fc3b3ec0498134cecbe9374b9e
treeccb99f08c616fecf1733f0fc67fe79f7ceaef0d5
parent2e42fb210e0c9ef819b242617b20df42b2083213
[DAGCombine] (shl (or x, c1), c2) -> (or (shl x, c2), c1 << c2)

We already have a combine for this pattern when the input to shl is add, so we just need to enable the transformation when the input is or.

Original patch by @tstellar

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313251 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/AMDGPU/fneg-fabs.f16.ll
test/CodeGen/AMDGPU/llvm.amdgcn.ds.bpermute.ll
test/CodeGen/AMDGPU/shl.ll
test/CodeGen/X86/combine-shl.ll