[llvm] [DAGCombiner] Honor rewrite semantics of fast-math flags in fdiv combine (PR #167595)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 2 03:17:17 PDT 2026
================
@@ -19223,26 +19224,32 @@ SDValue DAGCombiner::visitFDIV(SDNode *N) {
DAG.getConstantFP(Recip, DL, VT));
}
- if (Flags.hasAllowReciprocal()) {
+ // Rewriting 1 / sqrt(Y) to rsqrt(Y) requires contract
+ if (sd_match(N, m_Flags<SDNodeFlags::AllowReciprocal |
+ SDNodeFlags::AllowContract>())) {
----------------
arsenm wrote:
m_Flags shouldn't allow 0 operands. It should require binding the source value like every other pattern. For the freestanding flag match, what was here before was fine
https://github.com/llvm/llvm-project/pull/167595
More information about the llvm-commits
mailing list