[SDAG] At the suggestion of Hal, switch to an output parameter that

tracks which elements of the build vector are in fact undef.

This should make actually inpsecting them (likely in my next patch)
reasonably pretty. Also makes the output parameter optional as it is
clear now that *most* users are happy with undefs in their splats.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212581 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chandler Carruth
2014-07-09 00:41:34 +00:00
parent bab04b583c
commit d0de9868a6
4 changed files with 42 additions and 25 deletions

View File

@ -1158,11 +1158,11 @@ bool TargetLowering::isConstTrueVal(const SDNode *N) const {
return false;
IsVec = true;
bool HasUndefElements;
CN = BV->getConstantSplatNode(HasUndefElements);
BitVector UndefElements;
CN = BV->getConstantSplatNode(&UndefElements);
// Only interested in constant splats, and we don't try to handle undef
// elements in identifying boolean constants.
if (!CN || HasUndefElements)
if (!CN || UndefElements.none())
return false;
}
@ -1190,11 +1190,11 @@ bool TargetLowering::isConstFalseVal(const SDNode *N) const {
return false;
IsVec = true;
bool HasUndefElements;
CN = BV->getConstantSplatNode(HasUndefElements);
BitVector UndefElements;
CN = BV->getConstantSplatNode(&UndefElements);
// Only interested in constant splats, and we don't try to handle undef
// elements in identifying boolean constants.
if (!CN || HasUndefElements)
if (!CN || UndefElements.none())
return false;
}