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.
Details
- Reviewers
Meinersbur grosser
Diff Detail
Event Timeline
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)