[OpenMP][MLIR] Fix for nested parallel regions
authorKiran Chandramohan <kiran.chandramohan@arm.com>
Sat, 17 Oct 2020 21:24:27 +0000 (22:24 +0100)
committerKiran Chandramohan <kiran.chandramohan@arm.com>
Mon, 19 Oct 2020 07:45:50 +0000 (08:45 +0100)
commita71a0d6d219a8d460e6aadadc47dbb04955f1375
treeb20bef7d63903965819ad882bd64c389e94c6e38
parent1e32df2f91f1aa1f8cd400ce50a621578fa0534e
[OpenMP][MLIR] Fix for nested parallel regions

Usage of nested parallel regions were not working correctly and leading
to assertion failures. Fix contains the following changes,
1) Don't set the insertion point in the body callback.
2) Save the continuation IP in a stack and set the branch to
continuationIP at the terminator.

Reviewed By: SouraVX, jdoerfert, ftynse

Differential Revision: https://reviews.llvm.org/D88720
mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
mlir/test/Target/openmp-llvm.mlir