llvm-project/llvm/unittests/Frontend
Michael Kruse 616f77172f [OpenMPIRBuilder] Detect and fix ambiguous InsertPoints for createParallel.
When a Builder methods accepts multiple InsertPoints, when both point to
the same position, inserting instructions at one position will "move" the
other after the inserted position since the InsertPoint is pegged to the
instruction following the intended InsertPoint. For instance, when
creating a parallel region at Loc and passing the same position as AllocaIP,
creating instructions at Loc will "move" the AllocIP behind the Loc
position.

To avoid this ambiguity, add an assertion checking this condition and
fix the unittests.

In case of AllocaIP, an alternative solution could be to implicitly
split BasicBlock at InsertPoint, using the first as AllocaIP, the second
for inserting the instructions themselves. However, this solution is
specific to AllocaIP since AllocaIP will always have to be first. Hence,
this is an argument to generally handling ambiguous InsertPoints as API
sage error.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D117226
2022-01-20 10:13:44 -06:00
..
CMakeLists.txt [LLVMFrontend][openacc] Add basic unit tests for functions in LLVMFrontendOpenACC 2020-12-03 11:27:18 -05:00
OpenACCTest.cpp [LLVMFrontend][openacc] Add basic unit tests for functions in LLVMFrontendOpenACC 2020-12-03 11:27:18 -05:00
OpenMPContextTest.cpp [OpenMP] Allow traits for the OpenMP context selector `isa` 2020-07-29 10:22:27 -05:00
OpenMPIRBuilderTest.cpp [OpenMPIRBuilder] Detect and fix ambiguous InsertPoints for createParallel. 2022-01-20 10:13:44 -06:00
OpenMPParsingTest.cpp [MLIR][OpenMP] Fixed the missing inclusive clause in omp.wsloop and fix order clause 2021-10-28 14:18:05 +05:30