summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2016-11-21 14:36:19 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2016-11-21 14:36:19 +0000
commit49d7eda9680b4bd3d22132dd47a63fdab058beb9 (patch)
treeb5b187ce54d325b8003c64e2bd90d2a6ed8eb359 /llvm/lib
parentae66045705bf62ee881848b1bc9b28178b2176c8 (diff)
downloadbcm5719-llvm-49d7eda9680b4bd3d22132dd47a63fdab058beb9.tar.gz
bcm5719-llvm-49d7eda9680b4bd3d22132dd47a63fdab058beb9.zip
[SelectionDAG] Add ComputeNumSignBits support for CONCAT_VECTORS opcode
llvm-svn: 287541
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index ef560ac30bf..c3230726b1e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2874,6 +2874,13 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, unsigned Depth) const {
return ComputeNumSignBits(Op.getOperand(0), Depth+1);
break;
}
+ case ISD::CONCAT_VECTORS:
+ // Determine the minimum number of sign bits across all input vectors.
+ // Early out if the result is already 1.
+ Tmp = ComputeNumSignBits(Op.getOperand(0), Depth + 1);
+ for (unsigned i = 1, e = Op.getNumOperands(); (i < e) && (Tmp > 1); ++i)
+ Tmp = std::min(Tmp, ComputeNumSignBits(Op.getOperand(i), Depth + 1));
+ return Tmp;
}
// If we are looking at the loaded value of the SDNode.
OpenPOWER on IntegriCloud