This is an archive of the discontinued LLVM Phabricator instance.

[Polly] Data flow reduction detection
AbandonedPublic

Authored by jdoerfert on Sep 4 2014, 5:45 AM.

Details

Summary
This implements a data flow reduction detection on basic block level.
We propagate the used loads and the number of uses, as well as the kind of
binary operation performed until we reach a store. Using this we lift the
"one binary operator" restriction, thus we can detect the following reductions
withouth normalizing the source code:
  sum += A[i];                  // Worked already before
  sum = sum + A[i];             // Worked already before
  sum = A[i] + sum;             // Worked already before
  sum += A[i] + B[i];           // Works now
  sum = A[i] + sum + B[i];      // Works now
  sum = (A[i] + (sum + B[i]));  // Works now

The analysis information is also interesting to recognize additional idioms
later.

+ 7 Test cases to show the potential and limits of this detection.

Diff Detail

Event Timeline

jdoerfert updated this revision to Diff 13253.Sep 4 2014, 5:45 AM
jdoerfert retitled this revision from to [Polly] Data flow reduction detection.
jdoerfert updated this object.
jdoerfert edited the test plan for this revision. (Show Details)
jdoerfert added reviewers: grosser, simbuerg, sebpop.
jdoerfert added subscribers: Restricted Project, Unknown Object (MLST).
grosser edited edge metadata.Sep 7 2014, 11:05 PM

Without reviewing this code already in detail, I think this is very valuable. Specifically, it might allow us to (better) optimize the himeono benchmark (http://accc.riken.jp/2444.htm), which is also available in our test suite: ./SingleSource/Benchmarks/Misc/himenobmtxpa.c

In D5190#4, @grosser wrote:

Without reviewing this code already in detail, I think this is very valuable. Specifically, it might allow us to (better) optimize the himeono benchmark (http://accc.riken.jp/2444.htm), which is also available in our test suite: ./SingleSource/Benchmarks/Misc/himenobmtxpa.c

I looked into the source but I cannot find a "complex reduction like access". Which line/variable did you have in mind?

Hi Johannes,

I am sorry I never got along to properly review this patch. I still think it is very much needed and useful so - depending of priorities - I will put this on my review agenda again.

Unfortunately, at the moment this is blocked by: http://llvm.org/PR26320

grosser requested changes to this revision.Jun 13 2016, 4:14 AM
grosser edited edge metadata.

Set this official to "Request Changes" to clarify that we are blocked here by moving to the reductions to the schedule-tree based data-dependence analysis.

This revision now requires changes to proceed.Jun 13 2016, 4:14 AM
sebpop resigned from this revision.Sep 20 2016, 8:00 AM
sebpop removed a reviewer: sebpop.
jdoerfert abandoned this revision.Jun 4 2019, 10:12 PM