[PATCH] D24822: [SelectionDAG] Expand MULHU and enable division-by-constant for wide types

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 23 03:45:18 PDT 2016


nhaehnle added a comment.

In https://reviews.llvm.org/D24822#550503, @nhaehnle wrote:

> In part I get the impression that the LegalizeAction just doesn't contain enough information. If a target sets UMUL_LOHI to Expand, should that be a sequence of multiplies of the half-sized integer type, or should it be a single multiply in a larger type? Perhaps Promote should be used to indicate the second option?


It's even worse because at least AMDGPU would want to legalize UMUL_LOHI on MVT::i32 to MUL + MULHU. So there are at least three plausible ways of handling a non-legal UMUL_LOHI. Perhaps this should be made explicit with an enum that the TargetLowering can choose from.


https://reviews.llvm.org/D24822





More information about the llvm-commits mailing list