This is an archive of the discontinued LLVM Phabricator instance.

Identify and hoist loop invariant loads
AbandonedPublic

Authored by jdoerfert on Aug 22 2015, 4:21 AM.

Details

Summary
As a first step in the direction of assumed invariant loads (loads
that are not written in some context) we now detect and hoist
definitively invariant loads. As hoisting is the goal we will not
detect non-loop carried invariant loads. Invariant loads that are
detected will be preloaded in the code generation and used within
the SCoP. If the load is only conditionally executed the preloaded
version will also only be executed under the same condition, hence
we will never access memory that wouldn't have been accessed
otherwise. This is also the most distinguishing feature to licm.

Diff Detail

Event Timeline

jdoerfert updated this revision to Diff 32902.Aug 22 2015, 4:21 AM
jdoerfert retitled this revision from to Identify and hoist loop invariant loads.
jdoerfert added reviewers: grosser, Meinersbur.
jdoerfert updated this object.
jdoerfert added a subscriber: Restricted Project.
grosser edited edge metadata.Aug 22 2015, 4:49 AM
As a first step in the direction of assumed invariant loads (loads
that are not written in some context) we now detect and hoist
definitively invariant loads. As hoisting is the goal we will not
detect non-loop carried invariant loads. Invariant loads that are
detected will be preloaded in the code generation and used within
the SCoP. If the load is only conditionally executed the preloaded
version will also only be executed under the same condition, hence
we will never access memory that wouldn't have been accessed
otherwise. This is also the most distinguishing feature to licm.

Hi Johannes,

I did not yet look at this patch in detail, but here already one test case that
I wanted to handle and which does not seem to be resolved by your patch (intentionally?).
This test case still fails with SCEV not being able to derive the number of loop
iterations.

Best,
Tobias

I did not yet look at this patch in detail, but here already one test case that
I wanted to handle and which does not seem to be resolved by your patch (intentionally?).

A similar problem is already included as a test case, see http://reviews.llvm.org/D12264#e3d3ea83 .

This test case still fails with SCEV not being able to derive the number of loop
iterations.

That is a different problem not tackled here. Once we have isl based domain construction this should work ;) (if there are nor bugs obviously)

jdoerfert abandoned this revision.Sep 26 2015, 2:18 PM

Opened a new review by accident.