diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2014-07-08 07:44:15 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2014-07-08 07:44:15 +0000 |
| commit | efbce587759f70ad651c98b93e9590751b0e3ce9 (patch) | |
| tree | 2e2793557a433eea91bdc74d7c3aa4639eaa0346 /llvm/lib/CodeGen | |
| parent | b844e72e8548a4afc8b69664fef31d2672bae28c (diff) | |
| download | bcm5719-llvm-efbce587759f70ad651c98b93e9590751b0e3ce9.tar.gz bcm5719-llvm-efbce587759f70ad651c98b93e9590751b0e3ce9.zip | |
[SDAG] Actually check for a non-constant splat and clarify comments
around the handling of UNDEF lanes in boolean vector content analysis.
The code before my changes here also failed to check for non-constant
splats in a buildvector. I have no idea how to trigger this, I just
spotted by inspection when trying to understand the code. It seems
extremely unlikely to be worth the trouble to teach the only caller of
this code (DAG combining setcc patterns) how to cleverly handle undef
lanes, so I've just commented more thoroughly that we're giving up
there.
llvm-svn: 212515
Diffstat (limited to 'llvm/lib/CodeGen')
| -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) |

