[PATCH] D114272: [InstCombine] Add two optimizations for mul-and-icmp patterns

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 19 14:23:18 PST 2021


RKSimon added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:1920
+        !C2->isOne() && (C1->urem(*C2)).isZero()) {
+      const auto NewDiv = C1->udiv(*C2);
+      auto *NewMul =
----------------
(style) Don't use auto - APInt should be enough


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:1934-1935
+      auto ExpectedZero =
+          C2->usub_sat(APInt::getOneBitSet(C2->getBitWidth(), 0));
+
+      auto Check = [&](Value *Xi, Value *Xj) -> Instruction * {
----------------
Don't use auto


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114272



More information about the llvm-commits mailing list