[PATCH] D129745: Fix a stack overflow in ScalarEvolution.

Johannes Reifferscheid via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 11:44:37 PDT 2022


jreiffers added a comment.

In D129745#3652395 <https://reviews.llvm.org/D129745#3652395>, @nikic wrote:

> Ah sorry, my wording here was really ambiguous: By "optimization" I was referring to the compile-time optimization of combining operands from multiple add/muls, rather than just creating pairwise expressions. The preservation of nowrap flags via UB reasoning is important, and not something that can be dropped.

I also meant just trying to drop the special-casing of add and mul in getOperandsToCreate. I didn't run the tests myself, but bkramer mentioned that doing this (i.e. always enqueueing LHS and RHS here)  broke some tests.

In D129745#3652383 <https://reviews.llvm.org/D129745#3652383>, @fhahn wrote:

> This seems very surprising. I'd expect the stack overflow to reproduce consistently as each run should produce the same call stack with the same size (at least if the depth is deep enough). There's probably some non-determinism somewhere that should also be fixed.

I agree, it's somewhat weird. However, I was running this on our internal test infrastructure, so the tests may have been running on different architectures/CPUs. Maybe that plays a role.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129745



More information about the llvm-commits mailing list