summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-09-04 21:17:14 +0000
committerSanjay Patel <spatel@rotateright.com>2018-09-04 21:17:14 +0000
commit0f70f86ce08f2535cb1cd9bffe159c55171f531d (patch)
treefb425ff77974844b993728289683799e99207bd1 /llvm/lib
parentf4ad2cb24f87ab4774d0df86d446a1735304f08e (diff)
downloadbcm5719-llvm-0f70f86ce08f2535cb1cd9bffe159c55171f531d.tar.gz
bcm5719-llvm-0f70f86ce08f2535cb1cd9bffe159c55171f531d.zip
[InstCombine] make ((X & C) ^ C) form consistent for vectors
It would be better to create a 'not' here, but that's not possible yet. llvm-svn: 341410
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index 19322dd6f5b..202ec074e58 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -2784,12 +2784,10 @@ Instruction *InstCombiner::visitXor(BinaryOperator &I) {
return BinaryOperator::CreateAnd(Op0, Builder.CreateNot(X));
// (X & Y) ^ Y --> ~X & Y
// (Y & X) ^ Y --> ~X & Y
- // Canonical form with a non-splat constant is (X & C) ^ C; don't touch that.
- // TODO: Why do we treat arbitrary vector constants differently?
+ // Canonical form is (X & C) ^ C; don't touch that.
// TODO: A 'not' op is better for analysis and codegen, but demanded bits must
// be fixed to prefer that (otherwise we get infinite looping).
- const APInt *Unused;
- if (!match(Op1, m_APInt(Unused)) &&
+ if (!match(Op1, m_Constant()) &&
match(Op0, m_OneUse(m_c_And(m_Value(X), m_Specific(Op1)))))
return BinaryOperator::CreateAnd(Op1, Builder.CreateNot(X));
OpenPOWER on IntegriCloud