[PATCH] D156029: [InstCombine] icmp udiv transform

Maksim Kita via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 22 08:00:20 PDT 2023


kitaisreal added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:4328
+
+  if (!UDiv->hasOneUse())
+    return nullptr;
----------------
We probably can check that if udiv is used only in unsigned comparisons we can optimize it. Example:
```
bool test(uint8_t x, uint8_t y, uint8_t z) {
    return x / y < z && x / y > 5;
}
```


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

https://reviews.llvm.org/D156029



More information about the llvm-commits mailing list