[llvm-branch-commits] [llvm] ValueTracking: Improve handling of fadd in computeKnownFPClass. (PR #174123)
Yingwei Zheng via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Jan 1 03:06:46 PST 2026
================
@@ -5619,14 +5619,22 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts,
computeKnownFPClass(Op->getOperand(1), DemandedElts, InterestedSrcs,
KnownRHS, Q, Depth + 1);
+ // Special case fadd x, x, which is the canonical form of fmul x, 2.
+ bool SameOperands = Op->getOperand(0) == Op->getOperand(1);
----------------
dtcxzyw wrote:
Should check that x is not an undef.
Reference: https://github.com/llvm/llvm-project/blob/0b24580a26644c8a44abc6fba97609552ba41d42/llvm/lib/Analysis/ValueTracking.cpp#L550-L553
https://github.com/llvm/llvm-project/pull/174123
More information about the llvm-branch-commits
mailing list