Skip to content

Commit e166984

Browse files
committed
Revert "[SelectionDAG] Remove unused FP constant in getNegatedExpression"
2508ef0 doesn't totally fix the issue since we did not handle the case when unused temporary negated result is the same with the result, which is found by address sanitizer.
1 parent 97a23ab commit e166984

File tree

2 files changed

+1
-31
lines changed

2 files changed

+1
-31
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5773,10 +5773,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue Op, SelectionDAG &DAG,
57735773

57745774
// If we already have the use of the negated floating constant, it is free
57755775
// to negate it even it has multiple uses.
5776-
if (!Op.hasOneUse() && CFP.use_empty()) {
5777-
RemoveDeadNode(CFP);
5776+
if (!Op.hasOneUse() && CFP.use_empty())
57785777
break;
5779-
}
57805778
Cost = NegatibleCost::Neutral;
57815779
return CFP;
57825780
}

llvm/test/CodeGen/X86/pr47517.ll

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)