[PATCH] D35754: [ForwardOpTree] Introduce the -polly-optree pass.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 05:23:58 PDT 2017


Meinersbur added a comment.

In https://reviews.llvm.org/D35754#818516, @nandini12396 wrote:

> Could you please explain what is the meaning of 'forwarding' of operand trees?


Suppose you have two statements:

  StmtA:
    %add = fadd double 21.0,21.0
    bl label %StmtB
  
  StmtB:
    store double %add, double*A

This would induce a scalar dependency from %StmtA to %StmtB. To avoid, we can recompute %add in %StmtB instead:

  StmtA:
    %add = fadd double 21.0,21.0
    bl label %StmtB
  
  StmtB:
    %add_ = fadd double 21.0,21.0
    store double %add_, double*A

This "forwards" %add (and its operand tree/DAG) to StmtB.

I am open to naming it differently. I considered "reverse code motion".



================
Comment at: polly/trunk/include/polly/ScopInfo.h:1595
+  /// Insert an instruction before all other instructions in this statement.
+  void prependInstrunction(Instruction *Inst) {
+    assert(isBlockStmt() && "Only block statements support instruction lists");
----------------
nandini12396 wrote:
> *Instruction
Thanks.


Repository:
  rL LLVM

https://reviews.llvm.org/D35754





More information about the llvm-commits mailing list