This is an archive of the discontinued LLVM Phabricator instance.

[Polly] Treat pointers the same as integers
AbandonedPublic

Authored by jdoerfert on Oct 7 2015, 1:51 PM.

Details

Reviewers
grosser
Summary
As ScalarEvolution will already do the heavy lifting on all pointer
related computations we can just treat them simply as integer expression.

Diff Detail

Event Timeline

jdoerfert updated this revision to Diff 36793.Oct 7 2015, 1:51 PM
jdoerfert retitled this revision from to [Polly] Treat pointers the same as integers.
jdoerfert added a reviewer: grosser.
jdoerfert updated this object.
jdoerfert added a subscriber: Restricted Project.
grosser edited edge metadata.Oct 7 2015, 11:41 PM

Hi Johannes,

thank you very much. I think this approach really allows us to handle pointer type variables correctly.

Two points:

  1. Why do you call ensureIntegerType() on each expression?

I would have expected to call it directly on the leaves of the isl_ast_expr? To my understanding pointer type expressions can _only_ be introduced at IslExprBuilder::createId()'. Would it be sufficient to add the call there instead of on each operation?

it seems the current patch misses createOpSelect and createOpNAry. If we already expand at the leaves, we should not need to add ensureIntegerType() on each operation and probably have a lower risk on missing them now or when later on operations are added.

  1. Under which conditions (if every) will we (or do we need to) convert integers back to pointers?

Some of your test cases introduce inttoptr operations. The patch is silent about if/when they are introduced. Maybe we already do the right thing automatically, but a little comment on top of ensureIntegerType() that describe this would be very helpful for someone who wants to understand the whole idea.

Hi Johannes,

I just started to go through old patches. This is one that I got never feedback on, but I think it is rather easy to review and commit. Is there any reason you never followed up on this patch?

jdoerfert abandoned this revision.Apr 25 2016, 4:54 AM

A simplified version was commited a while ago.