[PATCH] D13531: [Polly] Treat pointers the same as integers

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 23:41:15 PDT 2015


grosser added a comment.

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.

2. 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.


http://reviews.llvm.org/D13531





More information about the llvm-commits mailing list