[all-commits] [llvm/llvm-project] c608b4: [SCEV] Tweak the algorithm for figuring out if fla...

Philip Reames via All-commits all-commits at lists.llvm.org
Tue Oct 5 11:21:03 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c608b49d67e0c22cc3537569f76af500097cd3b4
      https://github.com/llvm/llvm-project/commit/c608b49d67e0c22cc3537569f76af500097cd3b4
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2021-10-05 (Tue, 05 Oct 2021)

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

  Log Message:
  -----------
  [SCEV] Tweak the algorithm for figuring out if flags must apply to a SCEV [mostly-NFC]

Behavior wise, this patch should be mostly NFC.  The only behavior difference known is that on the isSCEVExprNeverPoison path we'll consider a bound imposed by the SCEVable operands (if any).

Algorithmically, it's an invert of the existing code.  Previously, we checked for each operand if we could find a bound, then checked for must-execute given that bound.  With the patch, we use dominance to refine the innermost bound, then check must execute once.  The interesting case is when we have multiple unknowns within a single basic block.  While both dominance and must-execute are worst-case linear walks within the block, only dominance is cached.  As such, refining based on dominance should be more efficient.




More information about the All-commits mailing list