[all-commits] [llvm/llvm-project] ad57d9: [SCEV] Avoid unnecessary call to getExitingBlock()...

Enna1 via All-commits all-commits at lists.llvm.org
Thu Jun 20 06:27:54 PDT 2024


  Branch: refs/heads/users/Enna1/SCEV-avoid-getExitingBlocks-in-computeExitLimit
  Home:   https://github.com/llvm/llvm-project
  Commit: ad57d93d8ccc8bc1a81f56ce182628f25546d7a7
      https://github.com/llvm/llvm-project/commit/ad57d93d8ccc8bc1a81f56ce182628f25546d7a7
  Author: xumingjie.enna1 <xumingjie.enna1 at bytedance.com>
  Date:   2024-06-20 (Thu, 20 Jun 2024)

  Changed paths:
    M llvm/include/llvm/Analysis/ScalarEvolution.h
    M llvm/lib/Analysis/ScalarEvolution.cpp

  Log Message:
  -----------
  [SCEV] Avoid unnecessary call to getExitingBlock() in computeExitLimit()

In `computeExitLimit()`, we use `getExitingBlock()` to check if loop has exactly
one exiting block.
Since `computeExitLimit()` is only used in `computeBackedgeTakenCount()`,
and `getExitingBlocks()` is called to get all exiting blocks in
`computeBackedgeTakenCount()`, we can simply check if loop has exactly one
exiting block by checking if the number of exiting blocks equals 1 in
`computeBackedgeTakenCount()` and pass it as an argument to `computeExitLimit()`.

This change helps to improve the compile time for files containing large loops.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list