diff options
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 74de034777d..9aee3894b64 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1160,8 +1160,10 @@ bool TargetLowering::isConstTrueVal(const SDNode *N) const { IsVec = true; bool HasUndefElements; CN = BV->getConstantSplatNode(HasUndefElements); - if (HasUndefElements) - return false; // Can't blindly collapse the undef values. + // Only interested in constant splats, and we don't try to handle undef + // elements in identifying boolean constants. + if (!CN || HasUndefElements) + return false; } switch (getBooleanContents(IsVec)) { @@ -1190,8 +1192,10 @@ bool TargetLowering::isConstFalseVal(const SDNode *N) const { IsVec = true; bool HasUndefElements; CN = BV->getConstantSplatNode(HasUndefElements); - if (HasUndefElements) - return false; // Can't blindly collapse the undef values. + // Only interested in constant splats, and we don't try to handle undef + // elements in identifying boolean constants. + if (!CN || HasUndefElements) + return false; } if (getBooleanContents(IsVec) == UndefinedBooleanContent) |

