Changeset View
Changeset View
Standalone View
Standalone View
mlir/test/Target/LLVMIR/openmp-llvm.mlir
Show First 20 Lines • Show All 706 Lines • ▼ Show 20 Lines | |||||
// ----- | // ----- | ||||
// CHECK-LABEL: @simdloop_simple_multiple | // CHECK-LABEL: @simdloop_simple_multiple | ||||
llvm.func @simdloop_simple_multiple(%lb1 : i64, %ub1 : i64, %step1 : i64, %lb2 : i64, %ub2 : i64, %step2 : i64, %arg0: !llvm.ptr<f32>, %arg1: !llvm.ptr<f32>) { | llvm.func @simdloop_simple_multiple(%lb1 : i64, %ub1 : i64, %step1 : i64, %lb2 : i64, %ub2 : i64, %step2 : i64, %arg0: !llvm.ptr<f32>, %arg1: !llvm.ptr<f32>) { | ||||
omp.simdloop for (%iv1, %iv2) : i64 = (%lb1, %lb2) to (%ub1, %ub2) step (%step1, %step2) { | omp.simdloop for (%iv1, %iv2) : i64 = (%lb1, %lb2) to (%ub1, %ub2) step (%step1, %step2) { | ||||
%3 = llvm.mlir.constant(2.000000e+00 : f32) : f32 | %3 = llvm.mlir.constant(2.000000e+00 : f32) : f32 | ||||
// The form of the emitted IR is controlled by OpenMPIRBuilder and | // The form of the emitted IR is controlled by OpenMPIRBuilder and | ||||
// tested there. Just check that the right metadata is added. | // tested there. Just check that the right metadata is added and collapsed | ||||
// loop bound is generated (Collapse clause is represented as a loop with | |||||
// list of indices, bounds and steps where the size of the list is equal | |||||
// to the collapse value.) | |||||
// CHECK: icmp slt i64 | |||||
// CHECK-COUNT-3: select | |||||
// CHECK: %[[TRIPCOUNT0:.*]] = select | |||||
// CHECK: br label %[[PREHEADER:.*]] | |||||
kiranchandramohan: As you know checking for names is not always the best. Can you instead do something similar to… | |||||
// CHECK: [[PREHEADER]]: | |||||
// CHECK: icmp slt i64 | |||||
// CHECK-COUNT-3: select | |||||
// CHECK: %[[TRIPCOUNT1:.*]] = select | |||||
// CHECK: mul nuw i64 %[[TRIPCOUNT0]], %[[TRIPCOUNT1]] | |||||
// CHECK: br label %[[COLLAPSED_PREHEADER:.*]] | |||||
// CHECK: [[COLLAPSED_PREHEADER]]: | |||||
// CHECK: br label %[[COLLAPSED_HEADER:.*]] | |||||
// CHECK: llvm.access.group | // CHECK: llvm.access.group | ||||
// CHECK-NEXT: llvm.access.group | // CHECK-NEXT: llvm.access.group | ||||
%4 = llvm.getelementptr %arg0[%iv1] : (!llvm.ptr<f32>, i64) -> !llvm.ptr<f32> | %4 = llvm.getelementptr %arg0[%iv1] : (!llvm.ptr<f32>, i64) -> !llvm.ptr<f32> | ||||
%5 = llvm.getelementptr %arg1[%iv2] : (!llvm.ptr<f32>, i64) -> !llvm.ptr<f32> | %5 = llvm.getelementptr %arg1[%iv2] : (!llvm.ptr<f32>, i64) -> !llvm.ptr<f32> | ||||
llvm.store %3, %4 : !llvm.ptr<f32> | llvm.store %3, %4 : !llvm.ptr<f32> | ||||
llvm.store %3, %5 : !llvm.ptr<f32> | llvm.store %3, %5 : !llvm.ptr<f32> | ||||
omp.yield | omp.yield | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,587 Lines • Show Last 20 Lines |
As you know checking for names is not always the best. Can you instead do something similar to the way the collapse test is written in D105706?