summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-10-30 18:13:30 +0000
committerSanjay Patel <spatel@rotateright.com>2016-10-30 18:13:30 +0000
commit13aee345cae5ba7016d32c23685910607698c404 (patch)
tree45e5d6064e4f28060c60119820e6222bc15e5b58 /llvm/lib
parent8a5f9810a07077a772c0816e07d7f4b9ee41b99c (diff)
downloadbcm5719-llvm-13aee345cae5ba7016d32c23685910607698c404.tar.gz
bcm5719-llvm-13aee345cae5ba7016d32c23685910607698c404.zip
[DAG] x & x --> x
llvm-svn: 285521
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index f5aeb8cb533..e78a3562a05 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -3134,6 +3134,10 @@ SDValue DAGCombiner::visitAND(SDNode *N) {
SDValue N1 = N->getOperand(1);
EVT VT = N1.getValueType();
+ // x & x --> x
+ if (N0 == N1)
+ return N0;
+
// fold vector ops
if (VT.isVector()) {
if (SDValue FoldedVOp = SimplifyVBinOp(N))
OpenPOWER on IntegriCloud