[all-commits] [llvm/llvm-project] 23c93c: Discount invariant instructions in full unrolling

Philip Reames via All-commits all-commits at lists.llvm.org
Fri May 14 11:07:40 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 23c93c255549f440444b10d73d439bedc0d6822d
      https://github.com/llvm/llvm-project/commit/23c93c255549f440444b10d73d439bedc0d6822d
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
    A llvm/test/Transforms/LoopUnroll/full-unroll-invariant.ll

  Log Message:
  -----------
  Discount invariant instructions in full unrolling

This patch updates the cost model for full unrolling to discount the cost of a loop invariant expression on all but one iteration. The reasoning here is that such an expression (as determined by SCEV) will be CSEd or DSEd once the loop is unrolled. Note that SCEVs reasoning will find things which could be invariant, not simply those outside the loop.

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




More information about the All-commits mailing list