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

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 9 10:43:40 PST 2019


kuhar marked an inline comment as done.
kuhar added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:125
 
+static constexpr unsigned InstCombineDefaultMaxIterations = 1000;
+
----------------
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.


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