[PATCH] D130517: [GlobalISel] Add sdiv exact (X, constant) -> mul combine.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 01:45:04 PDT 2022


foad added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:5037
+
+  // Shift the value upfront if it is even, so the LSB is one.
+  if (UseSRA)
----------------
Comment is misleading. You're shifting the dividend based on trailing zeros in the divisor, so we don't know that the value is even before shifting, and we don't know the LSB is one after shifting.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130517



More information about the llvm-commits mailing list