diff options
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index ad91d4a87c1..74de034777d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1158,7 +1158,10 @@ bool TargetLowering::isConstTrueVal(const SDNode *N) const { return false; IsVec = true; - CN = BV->getConstantSplatValue(); + bool HasUndefElements; + CN = BV->getConstantSplatNode(HasUndefElements); + if (HasUndefElements) + return false; // Can't blindly collapse the undef values. } switch (getBooleanContents(IsVec)) { @@ -1185,7 +1188,10 @@ bool TargetLowering::isConstFalseVal(const SDNode *N) const { return false; IsVec = true; - CN = BV->getConstantSplatValue(); + bool HasUndefElements; + CN = BV->getConstantSplatNode(HasUndefElements); + if (HasUndefElements) + return false; // Can't blindly collapse the undef values. } if (getBooleanContents(IsVec) == UndefinedBooleanContent) |

