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:
parent
c5292ec9de
commit
b676e5a666
|
@ -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<ConstantSDNode>(N.getOperand(3)) ||
|
||||||
isa<ConstantFPSDNode>(N.getOperand(3)) ||
|
isa<ConstantFPSDNode>(N.getOperand(3)) ||
|
||||||
isa<GlobalAddressSDNode>(N.getOperand(3)))
|
isa<GlobalAddressSDNode>(N.getOperand(3))))
|
||||||
FalseValue = 0;
|
FalseValue = 0;
|
||||||
else
|
else
|
||||||
FalseValue = SelectExpr(N.getOperand(3));
|
FalseValue = SelectExpr(N.getOperand(3));
|
||||||
|
|
Loading…
Reference in New Issue