[PATCH] D143013: [InstCombine] Add tests for combining (urem/srem (mul/shl X, Y), (mul/shl X, Z)); NFC

Matt Devereau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 03:30:28 PST 2023


MattDevereau added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/urem-mul.ll:32
+
+define i8 @urem_CY_CZ_is_zero(i8 %X) {
+; CHECK-LABEL: @urem_CY_CZ_is_zero(
----------------
This test could be better named, since C is actually %X. The important thing here which lets us simplify this to 0 is that the constant LHS multiplicand >= the constant RHS multiplicand of the rem. Maybe something like `urem_XY_XZ_constY_is_gte_constZ`?


================
Comment at: llvm/test/Transforms/InstCombine/urem-mul.ll:58
+
+define i8 @urem_CY_CZ_is_BO0(i8 %X) {
+; CHECK-LABEL: @urem_CY_CZ_is_BO0(
----------------
This could be called something like `urem_XY_XZ_constY_is_lt_constZ` to reflect why we return BO0


================
Comment at: llvm/test/Transforms/InstCombine/urem-mul.ll:149
+
+define i8 @urem_CX_Y_Z_is_mul_X_RemYZ(i8 %X, i8 %Y, i8 %Z) {
+; CHECK-LABEL: @urem_CX_Y_Z_is_mul_X_RemYZ(
----------------
%X is unused


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143013/new/

https://reviews.llvm.org/D143013



More information about the llvm-commits mailing list