[llvm] 86627be - Revert "[OpenMP]Add support for workshare loop modifier in lowering"
Mats Petersson via llvm-commits
llvm-commits at lists.llvm.org
Thu May 27 05:10:07 PDT 2021
Author: Mats Petersson
Date: 2021-05-27T13:09:47+01:00
New Revision: 86627be23312bd227e5afa88c206771a9aaf6589
URL: https://github.com/llvm/llvm-project/commit/86627be23312bd227e5afa88c206771a9aaf6589
DIFF: https://github.com/llvm/llvm-project/commit/86627be23312bd227e5afa88c206771a9aaf6589.diff
LOG: Revert "[OpenMP]Add support for workshare loop modifier in lowering"
This reverts commit ea4c5fb04c6d9618d451fb2d2c360dc95c6d9131.
Added:
Modified:
llvm/include/llvm/Frontend/OpenMP/OMPConstants.h
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h b/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h
index a05aa231eb516..af3f249582de4 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h
@@ -117,12 +117,10 @@ enum class OMPScheduleType {
Runtime = 37,
Auto = 38, // auto
- ModifierMonotonic =
- (1 << 29), // Set if the monotonic schedule modifier was present
ModifierNonmonotonic =
- (1 << 30), // Set if the nonmonotonic schedule modifier was present
- ModifierMask = ModifierMonotonic | ModifierNonmonotonic,
- LLVM_MARK_AS_BITMASK_ENUM(/* LargestValue */ ModifierMask)
+ (1 << 30), /**< Set if the nonmonotonic schedule modifier was present */
+
+ LLVM_MARK_AS_BITMASK_ENUM(/* LargestValue */ ModifierNonmonotonic)
};
} // end namespace omp
diff --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
index 43c6dd9ab9972..74f91e5862e54 100644
--- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
@@ -1431,8 +1431,10 @@ OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::createDynamicWorkshareLoop(
Value *ThreadNum = getOrCreateThreadID(SrcLoc);
+ OMPScheduleType DynamicSchedType =
+ SchedType | OMPScheduleType::ModifierNonmonotonic;
Constant *SchedulingType =
- ConstantInt::get(I32Type, static_cast<int>(SchedType));
+ ConstantInt::get(I32Type, static_cast<int>(DynamicSchedType));
// Call the "init" function.
Builder.CreateCall(DynamicInit,
diff --git a/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp b/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
index c2da3f30e27c0..962dcc235983d 100644
--- a/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+++ b/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
@@ -1721,7 +1721,7 @@ TEST_P(OpenMPIRBuilderTestWithParams, DynamicWorkShareLoop) {
omp::OMPScheduleType SchedType = GetParam();
uint32_t ChunkSize = 1;
- switch (SchedType & ~omp::OMPScheduleType::ModifierMask) {
+ switch (SchedType) {
case omp::OMPScheduleType::DynamicChunked:
case omp::OMPScheduleType::GuidedChunked:
ChunkSize = 7;
@@ -1794,9 +1794,8 @@ TEST_P(OpenMPIRBuilderTestWithParams, DynamicWorkShareLoop) {
EXPECT_EQ(InitCall->getCalledFunction()->getName(),
"__kmpc_dispatch_init_4u");
EXPECT_EQ(InitCall->getNumArgOperands(), 7U);
- EXPECT_EQ(InitCall->getArgOperand(6), ConstantInt::get(LCTy, ChunkSize));
- ConstantInt *SchedVal = cast<ConstantInt>(InitCall->getArgOperand(2));
- EXPECT_EQ(SchedVal->getValue(), static_cast<uint64_t>(SchedType));
+ EXPECT_EQ(InitCall->getArgOperand(6),
+ ConstantInt::get(Type::getInt32Ty(Ctx), ChunkSize));
ConstantInt *OrigLowerBound =
dyn_cast<ConstantInt>(LowerBoundStore->getValueOperand());
@@ -1828,23 +1827,12 @@ TEST_P(OpenMPIRBuilderTestWithParams, DynamicWorkShareLoop) {
EXPECT_FALSE(verifyModule(*M, &errs()));
}
-INSTANTIATE_TEST_CASE_P(
- OpenMPWSLoopSchedulingTypes, OpenMPIRBuilderTestWithParams,
- ::testing::Values(omp::OMPScheduleType::DynamicChunked,
- omp::OMPScheduleType::GuidedChunked,
- omp::OMPScheduleType::Auto, omp::OMPScheduleType::Runtime,
- omp::OMPScheduleType::DynamicChunked |
- omp::OMPScheduleType::ModifierMonotonic,
- omp::OMPScheduleType::DynamicChunked |
- omp::OMPScheduleType::ModifierNonmonotonic,
- omp::OMPScheduleType::GuidedChunked |
- omp::OMPScheduleType::ModifierMonotonic,
- omp::OMPScheduleType::GuidedChunked |
- omp::OMPScheduleType::ModifierNonmonotonic,
- omp::OMPScheduleType::Auto |
- omp::OMPScheduleType::ModifierMonotonic,
- omp::OMPScheduleType::Runtime |
- omp::OMPScheduleType::ModifierMonotonic));
+INSTANTIATE_TEST_SUITE_P(OpenMPWSLoopSchedulingTypes,
+ OpenMPIRBuilderTestWithParams,
+ ::testing::Values(omp::OMPScheduleType::DynamicChunked,
+ omp::OMPScheduleType::GuidedChunked,
+ omp::OMPScheduleType::Auto,
+ omp::OMPScheduleType::Runtime));
TEST_F(OpenMPIRBuilderTest, MasterDirective) {
using InsertPointTy = OpenMPIRBuilder::InsertPointTy;
More information about the llvm-commits
mailing list