[PATCH] D143014: Add constant combines for `(urem/srem (mul X, Y), (mul X, Z))`
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 20 13:29:53 PST 2023
nikic added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp:1705
+ ConstantInt *ConstY = GetOperandAsConstantInt(Y);
+ ConstantInt *ConstZ = GetOperandAsConstantInt(Z);
+
----------------
Why doesn't this use `match(Y, m_APInt(APIntY))` etc? As far as I can tell you don't use the ConstantInt itself, and m_APInt already handles splats.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp:1716
+ BinaryOperator *BO0 = cast<BinaryOperator>(Op0);
+ BinaryOperator *BO1 = cast<BinaryOperator>(Op1);
+
----------------
BinaryOperator -> OverflowingBinaryOperator to avoid constant expression crash.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143014/new/
https://reviews.llvm.org/D143014
More information about the llvm-commits
mailing list