Make sure expressions only have one use before emitting them into a place that is conditionally executed

llvm-svn: 22960
This commit is contained in:
Chris Lattner 2005-08-22 00:47:28 +00:00
parent c5292ec9de
commit b676e5a666
1 changed files with 4 additions and 3 deletions

View File

@ -1670,9 +1670,10 @@ unsigned ISel::SelectExpr(SDOperand N, bool Recording) {
// If the false value is simple enough, evaluate it inline in the false // If the false value is simple enough, evaluate it inline in the false
// block. // block.
if (isa<ConstantSDNode>(N.getOperand(3)) || if (N.getOperand(3).Val->hasOneUse() &&
isa<ConstantFPSDNode>(N.getOperand(3)) || (isa<ConstantSDNode>(N.getOperand(3)) ||
isa<GlobalAddressSDNode>(N.getOperand(3))) isa<ConstantFPSDNode>(N.getOperand(3)) ||
isa<GlobalAddressSDNode>(N.getOperand(3))))
FalseValue = 0; FalseValue = 0;
else else
FalseValue = SelectExpr(N.getOperand(3)); FalseValue = SelectExpr(N.getOperand(3));