Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flang/test/Integration/OpenMP/atomic-capture-complex.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
!CHECK: %[[VAL_1:.*]] = alloca { float, float }, i64 1, align 8
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Add new test(s) to reproduce the bug fixed by the PR once the reviewers agree with the taken approach.

!CHECK: %[[ORIG_VAL:.*]] = alloca { float, float }, i64 1, align 8
!CHECK: store { float, float } { float 2.000000e+00, float 2.000000e+00 }, ptr %[[ORIG_VAL]], align 4
!CHECK: br label %entry
!CHECK: br label %[[ENTRY:.*]]

!CHECK: entry:
!CHECK: [[ENTRY]]:
!CHECK: %[[ATOMIC_TEMP_LOAD:.*]] = alloca { float, float }, align 8
!CHECK: call void @__atomic_load(i64 8, ptr %[[ORIG_VAL]], ptr %[[ATOMIC_TEMP_LOAD]], i32 0)
!CHECK: %[[PHI_NODE_ENTRY_1:.*]] = load { float, float }, ptr %[[ATOMIC_TEMP_LOAD]], align 8
!CHECK: br label %.atomic.cont

!CHECK: .atomic.cont
!CHECK: %[[VAL_4:.*]] = phi { float, float } [ %[[PHI_NODE_ENTRY_1]], %entry ], [ %{{.*}}, %.atomic.cont ]
!CHECK: %[[VAL_4:.*]] = phi { float, float } [ %[[PHI_NODE_ENTRY_1]], %[[ENTRY]] ], [ %{{.*}}, %.atomic.cont ]
!CHECK: %[[VAL_5:.*]] = extractvalue { float, float } %[[VAL_4]], 0
!CHECK: %[[VAL_6:.*]] = extractvalue { float, float } %[[VAL_4]], 1
!CHECK: %[[VAL_7:.*]] = fadd contract float %[[VAL_5]], 1.000000e+00
Expand Down
61 changes: 37 additions & 24 deletions mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,31 +345,37 @@ findAllocaInsertPoint(llvm::IRBuilderBase &builder,
allocaInsertPoint = frame.allocaInsertPoint;
return WalkResult::interrupt();
});
if (walkResult.wasInterrupted())
return allocaInsertPoint;

// Otherwise, insert to the entry block of the surrounding function.
// If the current IRBuilder InsertPoint is the function's entry, it cannot
// also be used for alloca insertion which would result in insertion order
// confusion. Create a new BasicBlock for the Builder and use the entry block
// for the allocs.
if (!walkResult.wasInterrupted()) {
llvm::BasicBlock &funcEntryBlock =
builder.GetInsertBlock()->getParent()->getEntryBlock();
allocaInsertPoint = llvm::OpenMPIRBuilder::InsertPointTy(
&funcEntryBlock, funcEntryBlock.getFirstInsertionPt());
}

// If the current IRBuilder insertion block is the same as the alloca
// insertion block, it cannot also be used for alloca insertion which would
// result in insertion order confusion. Create a new BasicBlock for the
// Builder and use the entry block for the allocs.
Comment on lines +357 to +360
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be okay so long as the allocas land at the start of the block (as they should be anyway)?

//
// TODO: Create a dedicated alloca BasicBlock at function creation such that
// we do not need to move the current InertPoint here.
if (builder.GetInsertBlock() ==
&builder.GetInsertBlock()->getParent()->getEntryBlock()) {
if (builder.GetInsertBlock() == allocaInsertPoint.getBlock()) {
assert(builder.GetInsertPoint() == builder.GetInsertBlock()->end() &&
"Assuming end of basic block");
llvm::BasicBlock *entryBB = llvm::BasicBlock::Create(
builder.getContext(), "entry", builder.GetInsertBlock()->getParent(),
builder.GetInsertBlock()->getNextNode());
builder.CreateBr(entryBB);
builder.SetInsertPoint(entryBB);
auto *insertCont = splitBB(
llvm::OpenMPIRBuilder::InsertPointTy(
allocaInsertPoint.getBlock(), allocaInsertPoint.getBlock()->end()),
true, "insert.cont");
builder.SetInsertPoint(insertCont, insertCont->end());
}

llvm::BasicBlock &funcEntryBlock =
builder.GetInsertBlock()->getParent()->getEntryBlock();
return llvm::OpenMPIRBuilder::InsertPointTy(
&funcEntryBlock, funcEntryBlock.getFirstInsertionPt());
allocaInsertPoint.getBlock(),
allocaInsertPoint.getPoint() != allocaInsertPoint.getBlock()->end()
? allocaInsertPoint.getPoint()
: allocaInsertPoint.getBlock()->getFirstInsertionPt());
Comment on lines +376 to +378
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not unconditionally put the alloca at the start of the block?

}

/// Converts the given region that appears within an OpenMP dialect operation to
Expand All @@ -380,7 +386,8 @@ findAllocaInsertPoint(llvm::IRBuilderBase &builder,
static llvm::Expected<llvm::BasicBlock *> convertOmpOpRegions(
Region &region, StringRef blockName, llvm::IRBuilderBase &builder,
LLVM::ModuleTranslation &moduleTranslation,
SmallVectorImpl<llvm::PHINode *> *continuationBlockPHIs = nullptr) {
SmallVectorImpl<llvm::PHINode *> *continuationBlockPHIs = nullptr,
bool saveFirstBlockForAlloca = false) {
llvm::BasicBlock *continuationBlock =
splitBB(builder, true, "omp.region.cont");
llvm::BasicBlock *sourceBlock = builder.GetInsertBlock();
Expand Down Expand Up @@ -441,6 +448,14 @@ static llvm::Expected<llvm::BasicBlock *> convertOmpOpRegions(
// Convert blocks one by one in topological order to ensure
// defs are converted before uses.
SetVector<Block *> blocks = getBlocksSortedByDominance(region);
llvm::BasicBlock *firstLLVMBB = moduleTranslation.lookupBlock(blocks.front());
std::optional<LLVM::ModuleTranslation::SaveStack<OpenMPAllocaStackFrame>>
frame;

if (saveFirstBlockForAlloca)
frame.emplace(moduleTranslation, llvm::OpenMPIRBuilder::InsertPointTy(
firstLLVMBB, firstLLVMBB->end()));

for (Block *bb : blocks) {
llvm::BasicBlock *llvmBB = moduleTranslation.lookupBlock(bb);
// Retarget the branch of the entry block to the entry block of the
Expand Down Expand Up @@ -2093,15 +2108,11 @@ convertOmpParallel(omp::ParallelOp opInst, llvm::IRBuilderBase &builder,
LLVM::ModuleTranslation::SaveStack<OpenMPVarMappingStackFrame> mappingGuard(
moduleTranslation, reductionVariableMap);

// Save the alloca insertion point on ModuleTranslation stack for use in
// nested regions.
LLVM::ModuleTranslation::SaveStack<OpenMPAllocaStackFrame> frame(
moduleTranslation, allocaIP);

// ParallelOp has only one region associated with it.
builder.restoreIP(codeGenIP);
llvm::Expected<llvm::BasicBlock *> regionBlock = convertOmpOpRegions(
opInst.getRegion(), "omp.par.region", builder, moduleTranslation);
opInst.getRegion(), "omp.par.region", builder, moduleTranslation,
/*continuationBlockPHIs=*/nullptr, /*saveFirstBlockForAlloca=*/true);
if (!regionBlock)
return regionBlock.takeError();

Expand Down Expand Up @@ -2186,6 +2197,7 @@ convertOmpParallel(omp::ParallelOp opInst, llvm::IRBuilderBase &builder,

llvm::OpenMPIRBuilder::InsertPointTy allocaIP =
findAllocaInsertPoint(builder, moduleTranslation);

llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder);

llvm::OpenMPIRBuilder::InsertPointOrErrorTy afterIP =
Expand Down Expand Up @@ -4022,7 +4034,8 @@ convertOmpTarget(Operation &opInst, llvm::IRBuilderBase &builder,

builder.restoreIP(codeGenIP);
llvm::Expected<llvm::BasicBlock *> exitBlock = convertOmpOpRegions(
targetRegion, "omp.target", builder, moduleTranslation);
targetRegion, "omp.target", builder, moduleTranslation,
/*continuationBlockPHIs=*/nullptr, /*saveFirstBlockForAlloca=*/true);

if (!exitBlock)
return exitBlock.takeError();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module attributes {omp.is_target_device = false, omp.target_triples = ["amdgcn-a
// CHECK: define void @_QQmain() {
// CHECK: %[[BYCOPY_ALLOCA:.*]] = alloca ptr, align 8

// CHECK: entry: ; preds = %0
// CHECK: {{.*}}: ; preds = %0
// CHECK: %[[LOAD_VAL:.*]] = load i32, ptr @_QFEi, align 4
// CHECK: store i32 %[[LOAD_VAL]], ptr %[[BYCOPY_ALLOCA]], align 4
// CHECK: %[[BYCOPY_LOAD:.*]] = load ptr, ptr %[[BYCOPY_ALLOCA]], align 8
Expand Down
16 changes: 8 additions & 8 deletions mlir/test/Target/LLVMIR/omptarget-llvm.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ llvm.func @_QPopenmp_target_data() {
// CHECK: %[[VAL_2:.*]] = alloca [1 x ptr], align 8
// CHECK: %[[VAL_3:.*]] = alloca i32, i64 1, align 4
// CHECK: br label %[[VAL_4:.*]]
// CHECK: entry: ; preds = %[[VAL_5:.*]]
// CHECK: [[VAL_4]]: ; preds = %[[VAL_5:.*]]
// CHECK: %[[VAL_6:.*]] = getelementptr inbounds [1 x ptr], ptr %[[VAL_0]], i32 0, i32 0
// CHECK: store ptr %[[VAL_3]], ptr %[[VAL_6]], align 8
// CHECK: %[[VAL_7:.*]] = getelementptr inbounds [1 x ptr], ptr %[[VAL_1]], i32 0, i32 0
Expand Down Expand Up @@ -65,7 +65,7 @@ llvm.func @_QPopenmp_target_data_region(%0 : !llvm.ptr) {
// CHECK: %[[VAL_1:.*]] = alloca [1 x ptr], align 8
// CHECK: %[[VAL_2:.*]] = alloca [1 x ptr], align 8
// CHECK: br label %[[VAL_3:.*]]
// CHECK: entry: ; preds = %[[VAL_4:.*]]
// CHECK: [[VAL_3]]: ; preds = %[[VAL_4:.*]]
// CHECK: %[[ARR_OFFSET:.*]] = getelementptr inbounds [1024 x i32], ptr %[[ARR_DATA:.*]], i64 0, i64 0
// CHECK: %[[VAL_5:.*]] = getelementptr inbounds [1 x ptr], ptr %[[VAL_0]], i32 0, i32 0
// CHECK: store ptr %[[ARR_DATA]], ptr %[[VAL_5]], align 8
Expand Down Expand Up @@ -151,7 +151,7 @@ llvm.func @_QPomp_target_enter_exit(%1 : !llvm.ptr, %3 : !llvm.ptr) {
// CHECK: %[[VAL_9:.*]] = icmp slt i32 %[[VAL_8]], 10
// CHECK: %[[VAL_10:.*]] = load i32, ptr %[[VAL_6]], align 4
// CHECK: br label %[[VAL_11:.*]]
// CHECK: entry: ; preds = %[[VAL_12:.*]]
// CHECK: [[VAL_11]]: ; preds = %[[VAL_12:.*]]
// CHECK: br i1 %[[VAL_9]], label %[[VAL_13:.*]], label %[[VAL_14:.*]]
// CHECK: omp_if.then: ; preds = %[[VAL_11]]
// CHECK: %[[ARR_OFFSET1:.*]] = getelementptr inbounds [1024 x i32], ptr %[[VAL_16:.*]], i64 0, i64 0
Expand Down Expand Up @@ -228,7 +228,7 @@ llvm.func @_QPopenmp_target_use_dev_ptr() {
// CHECK: %[[VAL_3:.*]] = alloca ptr, align 8
// CHECK: %[[VAL_4:.*]] = alloca ptr, i64 1, align 8
// CHECK: br label %[[VAL_5:.*]]
// CHECK: entry: ; preds = %[[VAL_6:.*]]
// CHECK: [[VAL_5]]: ; preds = %[[VAL_6:.*]]
// CHECK: %[[VAL_7:.*]] = getelementptr inbounds [1 x ptr], ptr %[[VAL_0]], i32 0, i32 0
// CHECK: store ptr %[[VAL_4]], ptr %[[VAL_7]], align 8
// CHECK: %[[VAL_8:.*]] = getelementptr inbounds [1 x ptr], ptr %[[VAL_1]], i32 0, i32 0
Expand Down Expand Up @@ -271,7 +271,7 @@ llvm.func @_QPopenmp_target_use_dev_addr() {
// CHECK: %[[VAL_2:.*]] = alloca [1 x ptr], align 8
// CHECK: %[[VAL_3:.*]] = alloca ptr, i64 1, align 8
// CHECK: br label %[[VAL_4:.*]]
// CHECK: entry: ; preds = %[[VAL_5:.*]]
// CHECK: [[VAL_4]]: ; preds = %[[VAL_5:.*]]
// CHECK: %[[VAL_6:.*]] = getelementptr inbounds [1 x ptr], ptr %[[VAL_0]], i32 0, i32 0
// CHECK: store ptr %[[VAL_3]], ptr %[[VAL_6]], align 8
// CHECK: %[[VAL_7:.*]] = getelementptr inbounds [1 x ptr], ptr %[[VAL_1]], i32 0, i32 0
Expand Down Expand Up @@ -312,7 +312,7 @@ llvm.func @_QPopenmp_target_use_dev_addr_no_ptr() {
// CHECK: %[[VAL_2:.*]] = alloca [1 x ptr], align 8
// CHECK: %[[VAL_3:.*]] = alloca i32, i64 1, align 4
// CHECK: br label %[[VAL_4:.*]]
// CHECK: entry: ; preds = %[[VAL_5:.*]]
// CHECK: [[VAL_4]]: ; preds = %[[VAL_5:.*]]
// CHECK: %[[VAL_6:.*]] = getelementptr inbounds [1 x ptr], ptr %[[VAL_0]], i32 0, i32 0
// CHECK: store ptr %[[VAL_3]], ptr %[[VAL_6]], align 8
// CHECK: %[[VAL_7:.*]] = getelementptr inbounds [1 x ptr], ptr %[[VAL_1]], i32 0, i32 0
Expand Down Expand Up @@ -359,7 +359,7 @@ llvm.func @_QPopenmp_target_use_dev_addr_nomap() {
// CHECK: %[[VAL_3:.*]] = alloca ptr, i64 1, align 8
// CHECK: %[[VAL_4:.*]] = alloca ptr, i64 1, align 8
// CHECK: br label %[[VAL_5:.*]]
// CHECK: entry: ; preds = %[[VAL_6:.*]]
// CHECK: [[VAL_5]]: ; preds = %[[VAL_6:.*]]
// CHECK: %[[VAL_7:.*]] = getelementptr inbounds [2 x ptr], ptr %[[VAL_0]], i32 0, i32 0
// CHECK: store ptr %[[VAL_4]], ptr %[[VAL_7]], align 8
// CHECK: %[[VAL_8:.*]] = getelementptr inbounds [2 x ptr], ptr %[[VAL_1]], i32 0, i32 0
Expand Down Expand Up @@ -418,7 +418,7 @@ llvm.func @_QPopenmp_target_use_dev_both() {
// CHECK: %[[VAL_4:.*]] = alloca ptr, i64 1, align 8
// CHECK: %[[VAL_5:.*]] = alloca ptr, i64 1, align 8
// CHECK: br label %[[VAL_6:.*]]
// CHECK: entry: ; preds = %[[VAL_7:.*]]
// CHECK: [[VAL_6]]: ; preds = %[[VAL_7:.*]]
// CHECK: %[[VAL_8:.*]] = getelementptr inbounds [2 x ptr], ptr %[[VAL_0]], i32 0, i32 0
// CHECK: store ptr %[[VAL_4]], ptr %[[VAL_8]], align 8
// CHECK: %[[VAL_9:.*]] = getelementptr inbounds [2 x ptr], ptr %[[VAL_1]], i32 0, i32 0
Expand Down
4 changes: 2 additions & 2 deletions mlir/test/Target/LLVMIR/omptarget-parallel-llvm.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memo
// CHECK: define weak_odr protected amdgpu_kernel void @[[FUNC0:.*]](
// CHECK-SAME: ptr %[[TMP:.*]], ptr %[[TMP0:.*]]) {
// CHECK: %[[TMP1:.*]] = alloca [1 x ptr], align 8, addrspace(5)
// CHECK: %[[TMP2:.*]] = addrspacecast ptr addrspace(5) %[[TMP1]] to ptr
// CHECK: %[[STRUCTARG:.*]] = alloca { ptr }, align 8, addrspace(5)
// CHECK: %[[STRUCTARG_ASCAST:.*]] = addrspacecast ptr addrspace(5) %[[STRUCTARG]] to ptr
// CHECK: %[[TMP3:.*]] = alloca ptr, align 8, addrspace(5)
// CHECK: %[[TMP4:.*]] = addrspacecast ptr addrspace(5) %[[TMP3]] to ptr
// CHECK: store ptr %[[TMP0]], ptr %[[TMP4]], align 8
// CHECK: %[[TMP5:.*]] = call i32 @__kmpc_target_init(ptr addrspacecast (ptr addrspace(1) @{{.*}} to ptr), ptr %[[TMP]])
// CHECK: %[[EXEC_USER_CODE:.*]] = icmp eq i32 %[[TMP5]], -1
// CHECK: br i1 %[[EXEC_USER_CODE]], label %[[USER_CODE_ENTRY:.*]], label %[[WORKER_EXIT:.*]]
// CHECK: %[[TMP6:.*]] = load ptr, ptr %[[TMP4]], align 8
// CHECK: %[[TMP2:.*]] = addrspacecast ptr addrspace(5) %[[TMP1]] to ptr
// CHECK: %[[STRUCTARG_ASCAST:.*]] = addrspacecast ptr addrspace(5) %[[STRUCTARG]] to ptr
// CHECK: %[[OMP_GLOBAL_THREAD_NUM:.*]] = call i32 @__kmpc_global_thread_num(ptr addrspacecast (ptr addrspace(1) @[[GLOB1:[0-9]+]] to ptr))
// CHECK: %[[GEP_:.*]] = getelementptr { ptr }, ptr addrspace(5) %[[STRUCTARG]], i32 0, i32 0
// CHECK: store ptr %[[TMP6]], ptr addrspace(5) %[[GEP_]], align 8
Expand Down
20 changes: 10 additions & 10 deletions mlir/test/Target/LLVMIR/openmp-llvm.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -1415,16 +1415,16 @@ llvm.func @omp_atomic_update(%x:!llvm.ptr, %expr: i32, %xbool: !llvm.ptr, %exprb
//CHECK: {{.*}} = alloca { float, float }, i64 1, align 8
//CHECK: %[[ORIG_VAL:.*]] = alloca { float, float }, i64 1, align 8

//CHECK: br label %entry
//CHECK: br label %[[ENTRY:.*]]

//CHECK: entry:
//CHECK: [[ENTRY]]:
//CHECK: %[[ATOMIC_TEMP_LOAD:.*]] = alloca { float, float }, align 8
//CHECK: call void @__atomic_load(i64 8, ptr %[[ORIG_VAL]], ptr %[[ATOMIC_TEMP_LOAD]], i32 0)
//CHECK: %[[PHI_NODE_ENTRY_1:.*]] = load { float, float }, ptr %[[ATOMIC_TEMP_LOAD]], align 8
//CHECK: br label %.atomic.cont

//CHECK: .atomic.cont
//CHECK: %[[VAL_4:.*]] = phi { float, float } [ %[[PHI_NODE_ENTRY_1]], %entry ], [ %{{.*}}, %.atomic.cont ]
//CHECK: %[[VAL_4:.*]] = phi { float, float } [ %[[PHI_NODE_ENTRY_1]], %{{.*}} ], [ %{{.*}}, %.atomic.cont ]
//CHECK: %[[VAL_5:.*]] = extractvalue { float, float } %[[VAL_4]], 0
//CHECK: %[[VAL_6:.*]] = extractvalue { float, float } %[[VAL_4]], 1
//CHECK: %[[VAL_7:.*]] = fadd contract float %[[VAL_5]], 1.000000e+00
Expand Down Expand Up @@ -1467,16 +1467,16 @@ llvm.func @_QPomp_atomic_update_complex() {
//CHECK: %[[VAL_1:.*]] = alloca { float, float }, i64 1, align 8
//CHECK: %[[ORIG_VAL:.*]] = alloca { float, float }, i64 1, align 8
//CHECK: store { float, float } { float 2.000000e+00, float 2.000000e+00 }, ptr %[[ORIG_VAL]], align 4
//CHECK: br label %entry
//CHECK: br label %[[ENTRY:.*]]

//CHECK: entry: ; preds = %0
//CHECK: [[ENTRY]]: ; preds = %0
//CHECK: %[[ATOMIC_TEMP_LOAD:.*]] = alloca { float, float }, align 8
//CHECK: call void @__atomic_load(i64 8, ptr %[[ORIG_VAL]], ptr %[[ATOMIC_TEMP_LOAD]], i32 0)
//CHECK: %[[PHI_NODE_ENTRY_1:.*]] = load { float, float }, ptr %[[ATOMIC_TEMP_LOAD]], align 8
//CHECK: br label %.atomic.cont

//CHECK: .atomic.cont
//CHECK: %[[VAL_4:.*]] = phi { float, float } [ %[[PHI_NODE_ENTRY_1]], %entry ], [ %{{.*}}, %.atomic.cont ]
//CHECK: %[[VAL_4:.*]] = phi { float, float } [ %[[PHI_NODE_ENTRY_1]], %{{.*}} ], [ %{{.*}}, %.atomic.cont ]
//CHECK: %[[VAL_5:.*]] = extractvalue { float, float } %[[VAL_4]], 0
//CHECK: %[[VAL_6:.*]] = extractvalue { float, float } %[[VAL_4]], 1
//CHECK: %[[VAL_7:.*]] = fadd contract float %[[VAL_5]], 1.000000e+00
Expand Down Expand Up @@ -1613,7 +1613,7 @@ llvm.func @omp_atomic_update_intrinsic(%x:!llvm.ptr, %expr: i32) {
// CHECK-LABEL: @atomic_update_cmpxchg
// CHECK-SAME: (ptr %[[X:.*]], ptr %[[EXPR:.*]]) {
// CHECK: %[[AT_LOAD_VAL:.*]] = load atomic i32, ptr %[[X]] monotonic, align 4
// CHECK: %[[LOAD_VAL_PHI:.*]] = phi i32 [ %[[AT_LOAD_VAL]], %entry ], [ %[[LOAD_VAL:.*]], %.atomic.cont ]
// CHECK: %[[LOAD_VAL_PHI:.*]] = phi i32 [ %[[AT_LOAD_VAL]], %{{.*}} ], [ %[[LOAD_VAL:.*]], %.atomic.cont ]
// CHECK: %[[VAL_SUCCESS:.*]] = cmpxchg ptr %[[X]], i32 %[[LOAD_VAL_PHI]], i32 %{{.*}} monotonic monotonic, align 4
// CHECK: %[[LOAD_VAL]] = extractvalue { i32, i1 } %[[VAL_SUCCESS]], 0
// CHECK: br i1 %{{.*}}, label %.atomic.exit, label %.atomic.cont
Expand Down Expand Up @@ -2216,8 +2216,8 @@ llvm.func @omp_sections_empty() -> () {
omp.sections {
omp.terminator
}
// CHECK-NEXT: br label %entry
// CHECK: entry:
// CHECK-NEXT: br label %[[ENTRY:.*]]
// CHECK: [[ENTRY]]:
// CHECK-NEXT: ret void
llvm.return
}
Expand Down Expand Up @@ -3093,7 +3093,7 @@ llvm.func @omp_task_final(%boolexpr: i1) {
// CHECK: br label %[[entry:[^,]+]]
// CHECK: [[entry]]:
// CHECK: br label %[[codeRepl:[^,]+]]
// CHECK: [[codeRepl]]: ; preds = %entry
// CHECK: [[codeRepl]]:
// CHECK: %[[omp_global_thread_num:.+]] = call i32 @__kmpc_global_thread_num(ptr @{{.+}})
// CHECK: %[[final_flag:.+]] = select i1 %[[boolexpr]], i32 2, i32 0
// CHECK: %[[task_flags:.+]] = or i32 %[[final_flag]], 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ llvm.func @missordered_blocks_(%arg0: !llvm.ptr {fir.bindc_name = "x"}, %arg1: !

// CHECK: %[[VAL_0:.*]] = alloca { ptr, ptr }, align 8
// CHECK: br label %[[VAL_1:.*]]
// CHECK: entry: ; preds = %[[VAL_2:.*]]
// CHECK: [[VAL_1]]: ; preds = %[[VAL_2:.*]]
// CHECK: %[[VAL_3:.*]] = call i32 @__kmpc_global_thread_num(ptr @1)
// CHECK: br label %[[VAL_4:.*]]
// CHECK: omp_parallel: ; preds = %[[VAL_1]]
Expand Down
Loading
Loading