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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22960 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2005-08-22 00:47:28 +00:00
parent 9944b76cfe
commit b30ee6a41a

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));