[PATCH] D154805: [DAGCombiner] Fold IEEE `fmul`/`fdiv` by Pow2 to `add`/`sub` of exp
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 15 16:44:30 PDT 2023
arsenm added inline comments.
================
Comment at: llvm/include/llvm/CodeGen/TargetLowering.h:822-823
+ SDValue IntPow2) const {
+ // Default to avoiding fdiv which is often very expensive.
+ return N->getOpcode() == ISD::FDIV;
+ }
----------------
I think the fdiv by power of 2 should be generally converted to fmul by inverse power of 2 in the first place
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:16220
+ case ISD::ZERO_EXTEND:
+ case ISD::ANY_EXTEND:
+ V = V.getOperand(0);
----------------
ANY_EXTEND seems dangerous here
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154805/new/
https://reviews.llvm.org/D154805
More information about the llvm-commits
mailing list