[ScopBuilder] Revise statement naming when there are multiple statements per BB.
authorMichael Kruse <llvm@meinersbur.de>
Thu, 18 Jan 2018 15:15:50 +0000 (15:15 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Thu, 18 Jan 2018 15:15:50 +0000 (15:15 +0000)
commit9cfb0ac223adf29a09c26ff9a67074b768025385
tree3975bce436fba059ef19e4a4a14bc6ed34a1b1dc
parentd6e2208671c779f9b55ab888c18d803090ea08b7
[ScopBuilder] Revise statement naming when there are multiple statements per BB.

The goal is to have -polly-stmt-granularity=bb and
-polly-stmt-granularity=scalar-indep to have the same names if there is
just one statement per basic block.

This fixes a fluke when Polybench's jacobi-2d is optimized differently
depending on the -polly-stmt-granularity option, although both options
create the same SCoP, just with different statement names.

The new naming scheme is:

With -polly-use-llvm-names=0:
Stmt<BBIdx as decimal><Idx within BB as letter>

With -polly-use-llvm-names=1:
Stmt_BBName_<Idx within BB as letter>

The <Idx within BB> suffix is omitted for the main statement of a BB. The
main statement is either the one containing the first store or call
(those cannot be removed by the simplifyer), or if there is no such
instruction, the first. If after simplification there is just a single
statement left, it should be the main statement and have the same names as
with -polly-stmt-granularity=bb.

Differential Revision: https://reviews.llvm.org/D42136

llvm-svn: 322852
12 files changed:
polly/lib/Analysis/ScopBuilder.cpp
polly/test/ScopInfo/granularity_same_name.ll [new file with mode: 0644]
polly/test/ScopInfo/granularity_scalar-indep.ll
polly/test/ScopInfo/granularity_scalar-indep_epilogue.ll
polly/test/ScopInfo/stmt_split_exit_of_region_stmt.ll
polly/test/ScopInfo/stmt_split_no_dependence.ll
polly/test/ScopInfo/stmt_split_on_store.ll
polly/test/ScopInfo/stmt_split_on_synthesizable.ll
polly/test/ScopInfo/stmt_split_phi_in_beginning_bb.ll
polly/test/ScopInfo/stmt_split_phi_in_stmt.ll
polly/test/ScopInfo/stmt_split_scalar_dependence.ll
polly/test/ScopInfo/stmt_split_within_loop.ll