[PATCH] D43931: [LoopUnroll] Ignore ephemeral values when checking full unroll profitability.

Andrei Elovikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 1 01:59:10 PST 2018


a.elovikov created this revision.
a.elovikov added reviewers: mzolotukhin, evstupac, sanjoy.

Before this patch call graph is like this in the LoopUnrollPass:

tryToUnrollLoop

  ApproximateLoopSize
    collectEphemeralValues
    /* Use collected ephemeral values */
  computeUnrollCount
    analyzeLoopUnrollCost
      /* Bail out from the analysis if loop contains CallInst */

This patch moves collection of the ephemeral values to the tryToUnrollLoop
function and passes the collected values into both ApproximateLoopsize (as
before) and additionally starts using them in analyzeLoopUnrollCost:

tryToUnrollLoop

  collectEphemeralValues
  ApproximateLoopSize(EphValues)
    /* Use EphValues */
  computeUnrollCount(EphValues)
    analyzeLoopUnrollCost(EphValues)
      /* Ignore ephemeral values - they don't contribute to the final cost */
      /* Bail out from the analysis if loop contains CallInst */


Repository:
  rL LLVM

https://reviews.llvm.org/D43931

Files:
  lib/Transforms/Scalar/LoopUnrollPass.cpp
  test/Transforms/LoopUnroll/complete_unroll_profitability_with_assume.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43931.136479.patch
Type: text/x-patch
Size: 11222 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180301/7e7d4768/attachment-0001.bin>


More information about the llvm-commits mailing list