[PATCH] D66380: [SDAG] Fold umul_lohi with 0 or 1 multiplicand
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 18 06:15:40 PDT 2019
nikic marked an inline comment as done.
nikic added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:4292
+ // (umul_lohi N0, 0) -> (0, 0)
+ if (isNullConstant(N->getOperand(1))) {
----------------
RKSimon wrote:
> Do we need a canonicalization of constants to the RHS?
Possibly, but no test case where this would be needed comes to mind. If we start from canonical IR we have constants on the RHS anyway, but even if we start from non-canonical IR, the constant will be moved to the RHS for `ISD::MUL`, before we get here. Possibly it could happen via `UMULO`, though in that case we should probably already canonicalize while it is a `UMULO`.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66380/new/
https://reviews.llvm.org/D66380
More information about the llvm-commits
mailing list