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

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 11:23:08 PST 2024


================
@@ -4008,44 +4008,7 @@ void DAGTypeLegalizer::ExpandIntRes_MUL(SDNode *N,
     LC = RTLIB::MUL_I128;
----------------
PiJoules wrote:

We could, although this would result in different codegen since `ForceExpandMUL` works by doing the multiplication on a wider type and takes 4 arguments (the upper and lower halves of the LHS and RHS which are all size VT). The libcall below just does regular multiplication on the two original operands of size VT, so the top and bottom halves of a wider VT aren't needed.

Perhaps `ForceExpandMUL` is a misleading name since it's meant to do a wide multiplication involving 4 arguments and two halves of a return value, rather than regular multiplication involving two arguments and and one return value of original size VT. Perhaps something like `ForceExpandWideMUL` is more appropriate.

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


More information about the llvm-commits mailing list