[mlir] [VectorOps] Add create mask integration tests

Summary:
Two integration tests focused on i1 vectors, which exposed omissions
in the llvm backend which have since then been fixed. Note that this also
exposed an inaccuracy for print_i1 which has been fixed in this CL:
for a pure C ABI, int should be used rather than bool.

Reviewers: nicolasvasilache, ftynse, reidtatge, andydavis1, bkramer

Reviewed By: bkramer

Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul, msifontes

Tags: #mlir

Differential Revision: https://reviews.llvm.org/D81957
This commit is contained in:
aartbik 2020-06-16 12:15:40 -07:00
parent 438f7fc068
commit 9b22b29f68
4 changed files with 211 additions and 2 deletions

View File

@ -200,7 +200,7 @@ public:
//===----------------------------------------------------------------------===//
// Small runtime support "lib" for vector.print lowering during codegen.
//===----------------------------------------------------------------------===//
extern "C" MLIR_CRUNNERUTILS_EXPORT void print_i1(bool b);
extern "C" MLIR_CRUNNERUTILS_EXPORT void print_i1(int b);
extern "C" MLIR_CRUNNERUTILS_EXPORT void print_i32(int32_t i);
extern "C" MLIR_CRUNNERUTILS_EXPORT void print_i64(int64_t l);
extern "C" MLIR_CRUNNERUTILS_EXPORT void print_f32(float f);

View File

@ -0,0 +1,99 @@
// RUN: mlir-opt %s -convert-scf-to-std -convert-vector-to-llvm -convert-std-to-llvm | \
// RUN: mlir-cpu-runner -e entry -entry-point-result=void \
// RUN: -shared-libs=%mlir_integration_test_dir/libmlir_c_runner_utils%shlibext | \
// RUN: FileCheck %s
// NOTE: This is similar to test-create-mask.mlir, but with a different length,
// because the v4i1 vector specifially exposed bugs in the LLVM backend.
func @entry() {
%c0 = constant 0 : index
%c1 = constant 1 : index
%c2 = constant 2 : index
%c3 = constant 3 : index
%c5 = constant 5 : index
//
// 1-D.
//
%1 = vector.create_mask %c2 : vector<4xi1>
vector.print %1 : vector<4xi1>
// CHECK: ( 1, 1, 0, 0 )
scf.for %i = %c0 to %c5 step %c1 {
%2 = vector.create_mask %i : vector<4xi1>
vector.print %2 : vector<4xi1>
}
// CHECK: ( 0, 0, 0, 0 )
// CHECK: ( 1, 0, 0, 0 )
// CHECK: ( 1, 1, 0, 0 )
// CHECK: ( 1, 1, 1, 0 )
// CHECK: ( 1, 1, 1, 1 )
//
// 2-D.
//
%3 = vector.create_mask %c2, %c3 : vector<4x4xi1>
vector.print %3 : vector<4x4xi1>
// CHECK: ( ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ) )
%4 = vector.create_mask %c3, %c2 : vector<4x4xi1>
vector.print %4 : vector<4x4xi1>
// CHECK: ( ( 1, 1, 0, 0 ), ( 1, 1, 0, 0 ), ( 1, 1, 0, 0 ), ( 0, 0, 0, 0 ) )
scf.for %i = %c0 to %c5 step %c1 {
%5 = vector.create_mask %c2, %i : vector<4x4xi1>
vector.print %5 : vector<4x4xi1>
}
// CHECK: ( ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ) )
// CHECK: ( ( 1, 0, 0, 0 ), ( 1, 0, 0, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ) )
// CHECK: ( ( 1, 1, 0, 0 ), ( 1, 1, 0, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ) )
// CHECK: ( ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ) )
// CHECK: ( ( 1, 1, 1, 1 ), ( 1, 1, 1, 1 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ) )
scf.for %i = %c0 to %c5 step %c1 {
%6 = vector.create_mask %i, %c2 : vector<4x4xi1>
vector.print %6 : vector<4x4xi1>
}
// CHECK: ( ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ), ( 0, 0, 0, 0 ) )
// CHECK: (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 0 ), ( 1, 1, 0, 0 ), ( 1, 1, 0, 0 ) )
// CHECK: ( ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ), ( 1, 1, 1, 0 ) )
// CHECK: ( ( 1, 1, 1, 1 ), ( 1, 1, 1, 1 ), ( 1, 1, 1, 1 ), ( 1, 1, 1, 1 ) )
return
}

View File

@ -0,0 +1,110 @@
// RUN: mlir-opt %s -convert-scf-to-std -convert-vector-to-llvm -convert-std-to-llvm | \
// RUN: mlir-cpu-runner -e entry -entry-point-result=void \
// RUN: -shared-libs=%mlir_integration_test_dir/libmlir_c_runner_utils%shlibext | \
// RUN: FileCheck %s
func @entry() {
%c0 = constant 0 : index
%c1 = constant 1 : index
%c2 = constant 2 : index
%c3 = constant 3 : index
%c6 = constant 6 : index
//
// 1-D.
//
%1 = vector.create_mask %c2 : vector<5xi1>
vector.print %1 : vector<5xi1>
// CHECK: ( 1, 1, 0, 0, 0 )
scf.for %i = %c0 to %c6 step %c1 {
%2 = vector.create_mask %i : vector<5xi1>
vector.print %2 : vector<5xi1>
}
// CHECK: ( 0, 0, 0, 0, 0 )
// CHECK: ( 1, 0, 0, 0, 0 )
// CHECK: ( 1, 1, 0, 0, 0 )
// CHECK: ( 1, 1, 1, 0, 0 )
// CHECK: ( 1, 1, 1, 1, 0 )
// CHECK: ( 1, 1, 1, 1, 1 )
//
// 2-D.
//
%3 = vector.create_mask %c2, %c3 : vector<5x5xi1>
vector.print %3 : vector<5x5xi1>
// CHECK: ( ( 1, 1, 1, 0, 0 ), ( 1, 1, 1, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ) )
%4 = vector.create_mask %c3, %c2 : vector<5x5xi1>
vector.print %4 : vector<5x5xi1>
// CHECK: ( ( 1, 1, 0, 0, 0 ), ( 1, 1, 0, 0, 0 ), ( 1, 1, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ) )
scf.for %i = %c0 to %c6 step %c1 {
%5 = vector.create_mask %c2, %i : vector<5x5xi1>
vector.print %5 : vector<5x5xi1>
}
// CHECK: ( ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ) )
// CHECK: ( ( 1, 0, 0, 0, 0 ), ( 1, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ) )
// CHECK: ( ( 1, 1, 0, 0, 0 ), ( 1, 1, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ) )
// CHECK: ( ( 1, 1, 1, 0, 0 ), ( 1, 1, 1, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ) )
// CHECK: ( ( 1, 1, 1, 1, 0 ), ( 1, 1, 1, 1, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ) )
// CHECK: ( ( 1, 1, 1, 1, 1 ), ( 1, 1, 1, 1, 1 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ) )
scf.for %i = %c0 to %c6 step %c1 {
%6 = vector.create_mask %i, %c2 : vector<5x5xi1>
vector.print %6 : vector<5x5xi1>
}
// CHECK: ( ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ) )
// CHECK: ( ( 1, 1, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ), ( 0, 0, 0, 0, 0 ) )
// CHECK: ( ( 1, 1, 0, 0, 0 ), (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 1, 0 ), ( 1, 1, 1, 1, 0 ), ( 1, 1, 1, 1, 0 ), ( 1, 1, 1, 1, 0 ) )
// CHECK: ( ( 1, 1, 1, 1, 1 ), ( 1, 1, 1, 1, 1 ), ( 1, 1, 1, 1, 1 ), ( 1, 1, 1, 1, 1 ), ( 1, 1, 1, 1, 1 ) )
return
}

View File

@ -23,7 +23,7 @@
// By providing elementary printing methods only, this
// library can remain fully unaware of low-level implementation
// details of our vectors. Also useful for direct LLVM IR output.
extern "C" void print_i1(bool b) { fputc(b ? '1' : '0', stdout); }
extern "C" void print_i1(int b) { fputc(b ? '1' : '0', stdout); }
extern "C" void print_i32(int32_t i) { fprintf(stdout, "%" PRId32, i); }
extern "C" void print_i64(int64_t l) { fprintf(stdout, "%" PRId64, l); }
extern "C" void print_f32(float f) { fprintf(stdout, "%g", f); }