[PATCH] D38403: [Polly][ScopBuilder] Introduce -polly-stmt-granularity=scalar-indep option.

Siddharth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 17:15:05 PDT 2017


bollu added a comment.

Thanks for the very clean patch :) I really like reviewing your code, it's always really well written.



================
Comment at: lib/Analysis/ScopBuilder.cpp:711
+/// of two such instructions.
+static bool isOrderedInstruction(Instruction *Inst) {
+  return Inst->mayHaveSideEffects() || Inst->mayReadOrWriteMemory();
----------------
Meinersbur wrote:
> bollu wrote:
> > Just to clarify: An Instruction `I` is ordered if there exists an instruction `J` such that `I; J != J; I`, correct?
> Not exactly, but it's the right idea.
> 
> Nit: Equality (`!=`) is not the right relation. If `I;J` is a tuple,  then those are never equal. If it is a set, they are always equal. What you mean is some equivalence relation for semantics, which is difficult to define formally. I also don't intend to guarantee that if this function is true, that such an instruction `J` exists. Interactions with a third instruction `K` between `I` and `J` might also be possible, or depend on the code around. It is more that if it returns false and any permutation of non-ordered instructions have the same semantics in any context.
> 
> I'd stay with a verbal definition.
Thanks for the correction!

Consider adding the explanation you just gave to the comment, in that case?

"An unordered instruction is an instruction, such that a sequence of unordered instructions can be permuted without changing semantics. An ordered instruction is an instruction that is not unordered."


https://reviews.llvm.org/D38403





More information about the llvm-commits mailing list