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

Bevin Hansson via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 04:00:58 PST 2024


================
@@ -5287,6 +5287,23 @@ class TargetLowering : public TargetLoweringBase {
   bool expandMULO(SDNode *Node, SDValue &Result, SDValue &Overflow,
                   SelectionDAG &DAG) const;
 
+  /// ForceExpandMUL - Unconditionally expand a MUL into either a libcall or
+  /// brute force involving many multiplications. 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 ForceExpandMUL(SelectionDAG &DAG, SDLoc dl, bool Signed, EVT WideVT,
+                      const SDValue LL, const SDValue LH, const SDValue RL,
+                      const SDValue RH, SDValue &Lo, SDValue &Hi) const;
----------------
bevin-hansson wrote:

If the idea is that we always do the multiplication in a type that's twice as wide, can we not omit WideVT and infer the wider type from the inputs instead?

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


More information about the llvm-commits mailing list