[PATCH] D149529: [SCEV][reland] More precise trip multiples

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 23:26:49 PDT 2023


uabelho added a comment.

Ping @caojoshua



================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:14326
+         (Multiple == 0 || RecomputedMultiple == 0)) &&
+        RecomputedMultiple.urem(Multiple) != 0) {
+      dbgs() << "Incorrect cached computation in ConstantMultipleCache for "
----------------
It's this urem call that crashes in the comment I made yesterday.

Multiple is 0 and doing urem with RHS being 0 hits the assertion since dividing by  0 isn't good.

Are we perhaps missing a negation of the condition
```
(Multiple == 0 || RecomputedMultiple == 0)
```
?
Now we do the urem(Multiple) specifically if Multiple is 0, which we should avoid.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149529



More information about the llvm-commits mailing list