Skip to content

Commit

Permalink
[PowerPC] Fix for PR33636
Browse files Browse the repository at this point in the history
Remove casts to a constant when a node can be an undef.

Differential Revision: https://reviews.llvm.org/D34808

llvm-svn: 307120
  • Loading branch information
nemanjai committed Jul 5, 2017
1 parent 5749559 commit 845a796
Show file tree
Hide file tree
Showing 2 changed files with 706 additions and 2 deletions.
6 changes: 4 additions & 2 deletions llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4034,11 +4034,13 @@ void PPCDAGToDAGISel::foldBoolExts(SDValue &Res, SDNode *&N) {
O0.getNode(), O1.getNode());
};

// FIXME: When the semantics of the interaction between select and undef
// are clearly defined, it may turn out to be unnecessary to break here.
SDValue TrueRes = TryFold(ConstTrue);
if (!TrueRes)
if (!TrueRes || TrueRes.isUndef())
break;
SDValue FalseRes = TryFold(ConstFalse);
if (!FalseRes)
if (!FalseRes || FalseRes.isUndef())
break;

// For us to materialize these using one instruction, we must be able to
Expand Down
Loading

0 comments on commit 845a796

Please sign in to comment.