[OpenMPIRBuilder] Implement collapseLoops.
authorMichael Kruse <llvm-project@meinersbur.de>
Wed, 3 Feb 2021 19:44:00 +0000 (13:44 -0600)
committerMichael Kruse <llvm-project@meinersbur.de>
Thu, 4 Feb 2021 01:12:02 +0000 (19:12 -0600)
commit26b5be66f9c540028136f4fb4538c5786104abb9
treef473b14f3f67a603003818c28b7d8ac41f1b276a
parente3bb1c80fe68110f6362af0413c04cd77a05fbac
[OpenMPIRBuilder] Implement collapseLoops.

The collapseLoops method implements a transformations facilitating the implementation of the collapse-clause. It takes a list of loops from a loop nest and reduces it to a single loop that can be used by other methods that are implemented on just a single loop, such as createStaticWorkshareLoop.

This patch shares some changes with D92974 (such as adding some getters to CanonicalLoopNest), used by both patches.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D93268
llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp