[PATCH] D59041: [SDAG][X86] Expand pow2 mulo using shifts
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 11 12:00:01 PDT 2019
efriedma added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:5529
+ // mulo(X, 1 << S) -> { X << S, (X << S) >> S != X }
+ if (C.isPowerOf2() && (!isSigned || C.isNonNegative())) {
+ EVT ShiftAmtTy = getShiftAmountTy(VT, DAG.getDataLayout());
----------------
`(!isSigned || C.isNonNegative())` is specifically supposed to handle `llvm.smul.with.overflow.i32(%x, INT_MIN)`? Can't you just convert that to `llvm.umul.with.overflow.i32(%x, INT_MIN)` and lower it using an unsigned shift?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59041/new/
https://reviews.llvm.org/D59041
More information about the llvm-commits
mailing list