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

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 21 07:00:22 PDT 2023


RKSimon added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:3124
 
-  /// Attempt to match a unary predicate against a scalar/splat constant or
+  /// Attempt to match a unary predicate against an  scalar/splat constant or
   /// every element of a constant BUILD_VECTOR.
----------------
an -> a


================
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:
> 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).


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