Skip to content

Commit 714bac2

Browse files
committed
handle review comments
1 parent 1c8a6b6 commit 714bac2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "llvm/ADT/TypeSwitch.h"
3030
#include "llvm/Frontend/OpenMP/OMPConstants.h"
3131
#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"
32+
#include "llvm/IR/Constants.h"
3233
#include "llvm/IR/DebugInfoMetadata.h"
3334
#include "llvm/IR/DerivedTypes.h"
3435
#include "llvm/IR/IRBuilder.h"
@@ -5336,9 +5337,9 @@ convertTargetOpsInNest(Operation *op, llvm::IRBuilderBase &builder,
53365337
assert(builder.GetInsertBlock() &&
53375338
"No insert block is set for the builder");
53385339
for (auto iv : loopNest.getIVs()) {
5339-
// Create fake allocas just to maintain IR validity.
5340+
// Map iv to an undefined value just to keep the IR validity.
53405341
moduleTranslation.mapValue(
5341-
iv, builder.CreateAlloca(
5342+
iv, llvm::PoisonValue::get(
53425343
moduleTranslation.convertType(iv.getType())));
53435344
}
53445345
}

mlir/test/Target/LLVMIR/openmp-target-nesting-in-host-ops.mlir

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_gpu = true,
5151
// CHECK-NEXT: %{{.*}} = alloca i32, i64 1, align 4
5252
// CHECK-NEXT: br label %omp.wsloop.fake.region
5353
// CHECK: omp.wsloop.fake.region:
54-
// CHECK-NEXT: %{{.*}} = alloca i32, align 4
5554
// CHECK-NEXT: br label %omp.loop_nest.fake.region
5655
// CHECK: omp.loop_nest.fake.region:
57-
// CHECK-NEXT: store ptr %3, ptr %2, align 8
56+
// CHECK-NEXT: store i32 poison, ptr %{{.*}}
5857
// CHECK-NEXT: br label %omp.region.cont1
5958
// CHECK: omp.region.cont1:
6059
// CHECK-NEXT: br label %omp.region.cont

0 commit comments

Comments
 (0)