[all-commits] [llvm/llvm-project] e7ec17: [SCEV] Avoid creating unnecessary SCEVs for Select...

Florian Hahn via All-commits all-commits at lists.llvm.org
Thu Jul 14 09:24:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e7ec1746a632798b3b0fa933ad8a8f264b2ded08
      https://github.com/llvm/llvm-project/commit/e7ec1746a632798b3b0fa933ad8a8f264b2ded08
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2022-07-14 (Thu, 14 Jul 2022)

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

  Log Message:
  -----------
  [SCEV] Avoid creating unnecessary SCEVs for SelectInsts.

After 675080a4533b, we always create SCEVs for all operands of a
SelectInst. This can cause notable compile-time regressions compared to
the recursive algorithm, which only evaluates the operands if the select
is in a form we can create a usable expression.

This approach adds additional logic to getOperandsToCreate to only
queue operands for selects if we will later be able to construct a
usable SCEV.

Unfortunately this introduces a bit of coupling between actual SCEV
construction for selects and getOperandsToCreate, but I am not sure if
there are better alternatives to address the regression mentioned for
675080a4533b.

This doesn't have any notable compile-time impact on CTMark.

Reviewed By: nikic

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




More information about the All-commits mailing list