[PATCH] D154868: [DAGCombiner] Extend `combineFMulOrFDivWithIntPow2` to work for non-splat float vecs

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 21 09:48:38 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:3132
+  /// Same as above to with wrapper only accepting ConstantSDNode or nullptr.
+  inline bool matchUnaryPredicate(SDValue Op,
+                                  std::function<bool(ConstantSDNode *)> Match,
----------------
RKSimon wrote:
> RKSimon wrote:
> > Why not just add a matchUnaryFpPredicate variant?
> I meant just copy the existing matchUnaryPredicate implementation - the template wrapper + matchUnaryPredicateAnyNode look over complicated tbh (and a similar amount of code to maintain as just copying the original).
Really? Seems to me to be simpler to do node -> wrapper -> final. At this point adding any new constant type is just adding a new wrapper + adding isa type in anynode.

Imo cleaner like this but if you feel strongly Ill change.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154868/new/

https://reviews.llvm.org/D154868



More information about the llvm-commits mailing list