[PATCH] D71145: [InstCombine] Allow to limit the max number of iterations

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 9 10:52:48 PST 2019


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:125
 
+static constexpr unsigned InstCombineDefaultMaxIterations = 1000;
+
----------------
kuhar wrote:
> lebedev.ri wrote:
> > I think it should be
> > ```
> > static constexpr unsigned InstCombineDefaultMaxIterations = std::numeric_limits<unsigned>::max - 1;
> > ```
> > if the goal is to catch infinite loops while avoiding unintentional capping of iteration limit.
> UINT_MAX is about 4*10^9. I don't think we will ever reach that number of iterations on any reasonable-sized input bitcode.
Yes, that is kind-of the point, i'm not confident we won't reach `1000` in normal situations.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71145





More information about the llvm-commits mailing list