[PATCH] D35210: [LoopInterchange] Change cost function to use bytes in cache line.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 10:30:59 PDT 2017


fhahn created this revision.
Herald added subscribers: kristof.beyls, aemerson.

This patch updates the cost function to use the number of bytes that fit
into cache lines to evaluate if it is beneficial to interchange loops.
Loops are interchanged if more bytes fit into cache lines if we swap the
order.

By operating on the pointer operand of load and store instructions and
only using SCEV, we can also support accesses, where the pointer
calculation is more complex, e.g. for loops like

  for(int i=0;i<n;i++)
    for(int j=1;j<25;j++)
      A[j*25+i] = B[n+i]

This cost function gives a speed up on a few benchmarks (and no noticeable
regressions) from a wide range of benchmarks from the test-suite, SPEC2000,
SPEC2006 and a range of proprietary suites on AArch64.


https://reviews.llvm.org/D35210

Files:
  lib/Transforms/Scalar/LoopInterchange.cpp
  test/Transforms/LoopInterchange/interchange-single-comp.ll
  test/Transforms/LoopInterchange/profitability.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35210.105876.patch
Type: text/x-patch
Size: 12265 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170710/d8dc1f3b/attachment.bin>


More information about the llvm-commits mailing list