summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-11-08 20:29:17 +0000
committerCraig Topper <craig.topper@intel.com>2018-11-08 20:29:17 +0000
commit8cca8bd4aa9a4ade721495f66f9d2bd2afefe452 (patch)
tree8431cbd0c1e2ba436ded5f4a125c4b862d0df309 /llvm/lib/CodeGen
parente61652a38427b65206856f3ddc1cd55b42ad7dfd (diff)
downloadbcm5719-llvm-8cca8bd4aa9a4ade721495f66f9d2bd2afefe452.tar.gz
bcm5719-llvm-8cca8bd4aa9a4ade721495f66f9d2bd2afefe452.zip
[SelectionDAG] Assert on the width of DemandedElts argument to computeKnownBits for all vector typed operations not just build_vector.
Fix AArch64 unit test that fails with the assertion added. llvm-svn: 346437
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index fce14d53c22..7444b5ab0b7 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2195,6 +2195,9 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts,
KnownBits Known2;
unsigned NumElts = DemandedElts.getBitWidth();
+ assert(!Op.getValueType().isVector() ||
+ NumElts == Op.getValueType().getVectorNumElements() &&
+ "Unexpected vector size");
if (!DemandedElts)
return Known; // No demanded elts, better to assume we don't know anything.
@@ -2203,8 +2206,6 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts,
switch (Opcode) {
case ISD::BUILD_VECTOR:
// Collect the known bits that are shared by every demanded vector element.
- assert(NumElts == Op.getValueType().getVectorNumElements() &&
- "Unexpected vector size");
Known.Zero.setAllBits(); Known.One.setAllBits();
for (unsigned i = 0, e = Op.getNumOperands(); i != e; ++i) {
if (!DemandedElts[i])
OpenPOWER on IntegriCloud