summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-04-19 21:23:09 +0000
committerSanjay Patel <spatel@rotateright.com>2017-04-19 21:23:09 +0000
commitae382bb6af2c8ac70d0c24ee32418f0980d7f2c8 (patch)
tree770daacf8a282c27f3442381da5561d469213c43 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
parentada0888a111750ff4caec49208d11de4e29bfb61 (diff)
downloadbcm5719-llvm-ae382bb6af2c8ac70d0c24ee32418f0980d7f2c8.tar.gz
bcm5719-llvm-ae382bb6af2c8ac70d0c24ee32418f0980d7f2c8.zip
[DAG] add splat vector support for 'xor' in SimplifyDemandedBits
This allows forming more 'not' ops, so we get improvements for ISAs that have and-not. Follow-up to: https://reviews.llvm.org/rL300725 llvm-svn: 300763
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index c9b438edabf..91230b93423 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -715,7 +715,7 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op,
// If the RHS is a constant, see if we can simplify it.
// for XOR, we prefer to force bits to 1 if they will make a -1.
// If we can't force bits, try to shrink the constant.
- if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
+ if (ConstantSDNode *C = isConstOrConstSplat(Op.getOperand(1))) {
APInt Expanded = C->getAPIntValue() | (~NewMask);
// If we can expand it to have all bits set, do it.
if (Expanded.isAllOnesValue()) {
OpenPOWER on IntegriCloud