[PATCH] D102506: Discount invariants instructions in full unrolling

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 14 09:10:45 PDT 2021


reames created this revision.
reames added reviewers: samparker, dfukalov, Whitney, anna, skatkov, nikic.
Herald added subscribers: javed.absar, zzheng, hiraditya, mcrosier.
Herald added a reviewer: bollu.
reames requested review of this revision.
Herald added a project: LLVM.

(This is split from D91481 <https://reviews.llvm.org/D91481>, and should hopefully be an easier review.)

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.

The test updates show that the current DCE done by unrolling is deficient.  It's an easy fix, but will be done in a separate pass.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102506

Files:
  llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
  llvm/test/Transforms/LoopUnroll/full-unroll-invariant.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102506.345457.patch
Type: text/x-patch
Size: 4694 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210514/069eccde/attachment.bin>


More information about the llvm-commits mailing list