[PATCH] D34369: [Polly][ScopBuilder] Pass ScopStmts around instead of BasicBlocks. NFC.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 19 15:16:30 PDT 2017


Meinersbur created this revision.
Herald added a reviewer: bollu.

During the construction of MemoryAccesses in ScopBuilder, BasicBlocks were used in function parameters, assuming that the ScopStmt an be directly derived from it. This won't be true anymore once we split BasicBlocks into multiple ScopStmt. As a preparation for such a change in the future, we instead pass the ScopStmt and avoid the use of getStmtFor().

There are three occasions where a kind of mapping from BasicBlock to ScopStmt is still required.

1. Initial enumeration all statements to create their MemoryAccesses. This uses `getStmtsFor` which returns a list of statement or getStmtFor for regions statements.

Using this could be avoided by just iterating linearly over all ScopStmts. This unfortunately changes the order of MemoryAccesses, which in turn would require changing a lot of regression tests.

2. Get the statement representing the incoming block of a `PHINode` using `getLastStmtOf`.

3. One statement is required to write a scalar to be readable by those which need it. This is most often the statement which contains its definition, which we get using `getStmtFor(Instruction*)`.


https://reviews.llvm.org/D34369

Files:
  include/polly/ScopBuilder.h
  include/polly/ScopInfo.h
  lib/Analysis/ScopBuilder.cpp
  lib/Analysis/ScopInfo.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34369.103112.patch
Type: text/x-patch
Size: 24463 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170619/f7cafe8d/attachment.bin>


More information about the llvm-commits mailing list