llvm-project/llvm/test/Transforms/Scalarizer
Michael Kruse 978ba61536 Introduce llvm.loop.parallel_accesses and llvm.access.group metadata.
The current llvm.mem.parallel_loop_access metadata has a problem in that
it uses LoopIDs. LoopID unfortunately is not loop identifier. It is
neither unique (there's even a regression test assigning the some LoopID
to multiple loops; can otherwise happen if passes such as LoopVersioning
make copies of entire loops) nor persistent (every time a property is
removed/added from a LoopID's MDNode, it will also receive a new LoopID;
this happens e.g. when calling Loop::setLoopAlreadyUnrolled()).
Since most loop transformation passes change the loop attributes (even
if it just to mark that a loop should not be processed again as
llvm.loop.isvectorized does, for the versioned and unversioned loop),
the parallel access information is lost for any subsequent pass.

This patch unlinks LoopIDs and parallel accesses.
llvm.mem.parallel_loop_access metadata on instruction is replaced by
llvm.access.group metadata. llvm.access.group points to a distinct
MDNode with no operands (avoiding the problem to ever need to add/remove
operands), called "access group". Alternatively, it can point to a list
of access groups. The LoopID then has an attribute
llvm.loop.parallel_accesses with all the access groups that are parallel
(no dependencies carries by this loop).

This intentionally avoid any kind of "ID". Loops that are clones/have
their attributes modifies retain the llvm.loop.parallel_accesses
attribute. Access instructions that a cloned point to the same access
group. It is not necessary for each access to have it's own "ID" MDNode,
but those memory access instructions with the same behavior can be
grouped together.

The behavior of llvm.mem.parallel_loop_access is not changed by this
patch, but should be considered deprecated.

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

llvm-svn: 349725
2018-12-20 04:58:07 +00:00
..
basic.ll Introduce llvm.loop.parallel_accesses and llvm.access.group metadata. 2018-12-20 04:58:07 +00:00
cache-bug.ll [PM] Port Scalarizer to the new pass manager. 2018-11-21 14:00:17 +00:00
crash-bug.ll [PM] Port Scalarizer to the new pass manager. 2018-11-21 14:00:17 +00:00
dbginfo.ll [PM] Port Scalarizer to the new pass manager. 2018-11-21 14:00:17 +00:00
dbgloc-bug.ll [PM] Port Scalarizer to the new pass manager. 2018-11-21 14:00:17 +00:00
intrinsics.ll [PM] Port Scalarizer to the new pass manager. 2018-11-21 14:00:17 +00:00
order-bug.ll [PM] Port Scalarizer to the new pass manager. 2018-11-21 14:00:17 +00:00
phi-bug.ll [PM] Port Scalarizer to the new pass manager. 2018-11-21 14:00:17 +00:00
store-bug.ll [PM] Port Scalarizer to the new pass manager. 2018-11-21 14:00:17 +00:00
vector-gep.ll [PM] Port Scalarizer to the new pass manager. 2018-11-21 14:00:17 +00:00