[all-commits] [llvm/llvm-project] c431c4: [InstCombine] Improve infinite loop detection

Jakub Kuderski via All-commits all-commits at lists.llvm.org
Fri Dec 20 13:17:15 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c431c407ebcbbb526f4af93a549fa5b260a9b193
      https://github.com/llvm/llvm-project/commit/c431c407ebcbbb526f4af93a549fa5b260a9b193
  Author: Jakub Kuderski <kubak at google.com>
  Date:   2019-12-20 (Fri, 20 Dec 2019)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/test/Transforms/InstCombine/limit-max-iterations.ll

  Log Message:
  -----------
  [InstCombine] Improve infinite loop detection

Summary:
This patch limits the default number of iterations performed by InstCombine. It also exposes a new option that allows to specify how many iterations is considered getting stuck in an infinite loop.

Based on experiments performed on real-world C++ programs, InstCombine seems to perform at most ~8-20 iterations, so treating 1000 iterations as an infinite loop seems like a safe choice. See D71145 for details.

The two limits can be specified via command line options.

Reviewers: spatel, lebedev.ri, nikic, xbolva00, grosser

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71673




More information about the All-commits mailing list