[mlir] [llvm] [SelectionDAG] Expand fixed point multiplication into libcall (PR #79352)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 06:15:51 PST 2024


================
@@ -5287,6 +5287,24 @@ class TargetLowering : public TargetLoweringBase {
   bool expandMULO(SDNode *Node, SDValue &Result, SDValue &Overflow,
                   SelectionDAG &DAG) const;
 
+  /// ForceExpandWideMUL - Unconditionally expand a MUL into either a libcall or
+  /// brute force via a wide multiplication. The expansion works by
+  /// attempting to do a multiplication on a wider type twice the size of the
+  /// original operands. LL and LH represent the lower and upper halves of the
+  /// first operand. RL and RH represent the lower and upper halves of the
+  /// second operand. The upper and lower halves of the result are stored in Lo
+  /// and Hi.
+  void ForceExpandWideMUL(SelectionDAG &DAG, const SDLoc &dl, bool Signed,
+                          EVT WideVT, const SDValue LL, const SDValue LH,
+                          const SDValue RL, const SDValue RH, SDValue &Lo,
+                          SDValue &Hi) const;
+
+  /// Same as above, but creates the upper halves of each operand by
+  /// sign/zero-extending the operands.
+  void ForceExpandWideMUL(SelectionDAG &DAG, const SDLoc &dl, bool Signed,
----------------
RKSimon wrote:

(style) camelCase - ForceExpandWideMUL

https://github.com/llvm/llvm-project/pull/79352


More information about the llvm-commits mailing list