[ScopBuilder] Revise statement naming when there are multiple statements per BB.
commit4e3a89821c6b42a9028be2b826fce961eacbda4d
authorMichael Kruse <llvm@meinersbur.de>
Thu, 18 Jan 2018 15:15:50 +0000 (18 15:15 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Thu, 18 Jan 2018 15:15:50 +0000 (18 15:15 +0000)
tree4c44068b3c5909633ccb43f18657accf47ebcd85
parentcb771fc5146275f9bba7e446895f6e8b322fd3cd
[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

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@322852 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
lib/Analysis/ScopBuilder.cpp
test/ScopInfo/granularity_same_name.ll [new file with mode: 0644]
test/ScopInfo/granularity_scalar-indep.ll
test/ScopInfo/granularity_scalar-indep_epilogue.ll
test/ScopInfo/stmt_split_exit_of_region_stmt.ll
test/ScopInfo/stmt_split_no_dependence.ll
test/ScopInfo/stmt_split_on_store.ll
test/ScopInfo/stmt_split_on_synthesizable.ll
test/ScopInfo/stmt_split_phi_in_beginning_bb.ll
test/ScopInfo/stmt_split_phi_in_stmt.ll
test/ScopInfo/stmt_split_scalar_dependence.ll
test/ScopInfo/stmt_split_within_loop.ll