[all-commits] [llvm/llvm-project] cb06b6: [IndVars][NFC] Remove redundant param in optimizeL...

Max Kazantsev via All-commits all-commits at lists.llvm.org
Mon Dec 12 01:28:35 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cb06b6ab0018d9aa07bf9fec0052a9f8c921a593
      https://github.com/llvm/llvm-project/commit/cb06b6ab0018d9aa07bf9fec0052a9f8c921a593
  Author: Max Kazantsev <mkazantsev at azul.com>
  Date:   2022-12-12 (Mon, 12 Dec 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/IndVarSimplify.cpp

  Log Message:
  -----------
  [IndVars][NFC] Remove redundant param in optimizeLoopExitWithUnknownExitCount

There was a crippled version of this transform for Inverted predicate, so the same
query was done twice. Advanced version of this transform wasn't implemented for
inverted condition. Thus, the code was hard to read. The only real purpose of the
Inverted param was to make a simple isKnownPredicateAt query.

Instead if this, use evaluatePredicateAt to solve the task for both inverted and
non-inverted predicate. This slightly changes the order of queries, but effectively
it should save some time by avoiding duplicating queries, and simplifies the code a lot.

I also could not find any evidence that we ever eliminate anything with Inverted = true,
but conservatively preserved the current behavior. Maybe we can remove it and save
some compile time.

Differential Revision: https://reviews.llvm.org/D139814
Reviewed By: nikic




More information about the All-commits mailing list