OSDN Git Service

[DAGCombiner] Support (shl (ext (shl x, c1)), c2) -> 0 non-uniform folds.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 19 Jun 2019 12:25:29 +0000 (12:25 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 19 Jun 2019 12:25:29 +0000 (12:25 +0000)
commitc69190afafc22ac1c8ced5b42987f308d2e6c9f1
treedec1212e1b4852ebc377558e620bab22d063741f
parent454d3bbd012c445e1a97e3d6b0325b45775e170c
[DAGCombiner] Support (shl (ext (shl x, c1)), c2) -> 0 non-uniform folds.

Use matchBinaryPredicate instead of isConstOrConstSplat to let us handle non-uniform shift cases.

This requires us to tweak matchBinaryPredicate to allow it to (optionally) handle constants with different type widths.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363792 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/SelectionDAGNodes.h
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
test/CodeGen/X86/combine-shl.ll