Skip to content

Commit 791468d

Browse files
committed
GVN: strip bad TODO, FIXME (NFC)
In impliesEquivalenceIfTrue and impliesEquivalenceIfFalse, note that the optimization is invalid for the no-signed-zeros case: strip the bad FIXME. Also note that, a ConstantVector would be handled by select(fcmp()) pattern in InstCombine, and GVN is not the right place for the optimization: strip the bad TODO. Alive2 proof: https://alive2.llvm.org/ce/z/vEaK8M
1 parent 7fa0d05 commit 791468d

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

llvm/lib/Transforms/Scalar/GVN.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,14 +2003,10 @@ static bool impliesEquivalanceIfTrue(CmpInst* Cmp) {
20032003
Value *RHS = Cmp->getOperand(1);
20042004
// If we can prove either side non-zero, then equality must imply
20052005
// equivalence.
2006-
// FIXME: We should do this optimization if 'no signed zeros' is
2007-
// applicable via an instruction-level fast-math-flag or some other
2008-
// indicator that relaxed FP semantics are being used.
20092006
if (isa<ConstantFP>(LHS) && !cast<ConstantFP>(LHS)->isZero())
20102007
return true;
20112008
if (isa<ConstantFP>(RHS) && !cast<ConstantFP>(RHS)->isZero())
20122009
return true;
2013-
// TODO: Handle vector floating point constants
20142010
}
20152011
return false;
20162012
}
@@ -2029,14 +2025,10 @@ static bool impliesEquivalanceIfFalse(CmpInst* Cmp) {
20292025
Value *RHS = Cmp->getOperand(1);
20302026
// If we can prove either side non-zero, then equality must imply
20312027
// equivalence.
2032-
// FIXME: We should do this optimization if 'no signed zeros' is
2033-
// applicable via an instruction-level fast-math-flag or some other
2034-
// indicator that relaxed FP semantics are being used.
20352028
if (isa<ConstantFP>(LHS) && !cast<ConstantFP>(LHS)->isZero())
20362029
return true;
20372030
if (isa<ConstantFP>(RHS) && !cast<ConstantFP>(RHS)->isZero())
20382031
return true;
2039-
// TODO: Handle vector floating point constants
20402032
}
20412033
return false;
20422034
}

0 commit comments

Comments
 (0)