Skip to content

Commit 22dab21

Browse files
ecneliseszmodem
authored andcommitted
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. (cherry picked from commit e166984)
1 parent 791b7e9 commit 22dab21

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
@@ -5751,10 +5751,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue Op, SelectionDAG &DAG,
57515751

57525752
// If we already have the use of the negated floating constant, it is free
57535753
// to negate it even it has multiple uses.
5754-
if (!Op.hasOneUse() && CFP.use_empty()) {
5755-
RemoveDeadNode(CFP);
5754+
if (!Op.hasOneUse() && CFP.use_empty())
57565755
break;
5757-
}
57585756
Cost = NegatibleCost::Neutral;
57595757
return CFP;
57605758
}

llvm/test/CodeGen/X86/pr47517.ll

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

0 commit comments

Comments
 (0)