diff options
| author | Nicolas Vasilache <ntv@google.com> | 2019-04-03 00:46:40 -0700 |
|---|---|---|
| committer | Mehdi Amini <joker.eph@gmail.com> | 2019-04-03 01:09:13 -0700 |
| commit | f1b12f5a64eeb5ea9de8060e46b77c18806c49bf (patch) | |
| tree | 804109a1a522c2e928d0c980db9516bff3233074 /mlir/test/Transforms/Vectorize | |
| parent | c2e9ab8ef1809f148f29d855e1175fe920246fd2 (diff) | |
| download | bcm5719-llvm-f1b12f5a64eeb5ea9de8060e46b77c18806c49bf.tar.gz bcm5719-llvm-f1b12f5a64eeb5ea9de8060e46b77c18806c49bf.zip | |
Fix test that fails on non-determinism in LowerVectorTransfers
This CL fixes the non-determinism across compilers in an edsc::select expression used in LowerVectorTransfers. This is achieved by factoring the expression out of the function call to ensure a deterministic order of evaluation.
Since the expression is now factored out, fewer IR is generated and the test is updated accordingly.
--
PiperOrigin-RevId: 241679962
Diffstat (limited to 'mlir/test/Transforms/Vectorize')
| -rw-r--r-- | mlir/test/Transforms/Vectorize/lower_vector_transfers.mlir | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/mlir/test/Transforms/Vectorize/lower_vector_transfers.mlir b/mlir/test/Transforms/Vectorize/lower_vector_transfers.mlir index 4805a8652cb..b5345f3fb53 100644 --- a/mlir/test/Transforms/Vectorize/lower_vector_transfers.mlir +++ b/mlir/test/Transforms/Vectorize/lower_vector_transfers.mlir @@ -70,33 +70,29 @@ func @materialize_read(%M: index, %N: index, %O: index, %P: index) { // CHECK-NEXT: %[[C0:.*]] = constant 0 : index // CHECK-NEXT: %[[C1:.*]] = constant 1 : index // CHECK-NEXT: {{.*}} = affine.apply #[[ADD]](%[[I0]], %[[I4]]) - // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, %[[C0]] : index - // CHECK-NEXT: {{.*}} = affine.apply #[[ADD]](%[[I0]], %[[I4]]) - // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}} : index - // CHECK-NEXT: {{.*}} = affine.apply #[[ADD]](%[[I0]], %[[I4]]) // CHECK-NEXT: {{.*}} = affine.apply #[[SUB]]()[%[[D0]]] + // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}} : index // CHECK-NEXT: {{.*}} = select + // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, %[[C0]] : index // CHECK-NEXT: %[[L0:.*]] = select // - // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}} : index - // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}} : index // CHECK-NEXT: {{.*}} = affine.apply #[[SUB]]()[%[[D1]]] - // CHECK-NEXT: {{.*}} = select + // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}} : index + // CHECK-NEXT: {{.*}} = select + // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, %[[C0]] : index // CHECK-NEXT: %[[L1:.*]] = select // - // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}} : index - // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}} : index // CHECK-NEXT: {{.*}} = affine.apply #[[SUB]]()[%[[D2]]] + // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}} : index // CHECK-NEXT: {{.*}} = select + // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, %[[C0]] : index // CHECK-NEXT: %[[L2:.*]] = select // // CHECK-NEXT: {{.*}} = affine.apply #[[ADD]](%[[I3]], %[[I6]]) - // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, %[[C0]] : index - // CHECK-NEXT: {{.*}} = affine.apply #[[ADD]](%[[I3]], %[[I6]]) - // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}} : index - // CHECK-NEXT: {{.*}} = affine.apply #[[ADD]](%[[I3]], %[[I6]]) // CHECK-NEXT: {{.*}} = affine.apply #[[SUB]]()[%[[D3]]] + // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}} : index // CHECK-NEXT: {{.*}} = select + // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, %[[C0]] : index // CHECK-NEXT: %[[L3:.*]] = select // // CHECK-NEXT: {{.*}} = load %0[%[[L0]], %[[L1]], %[[L2]], %[[L3]]] : memref<?x?x?x?xf32> @@ -150,36 +146,30 @@ func @materialize_write(%M: index, %N: index, %O: index, %P: index) { // CHECK-NEXT: %[[C0:.*]] = constant 0 : index // CHECK-NEXT: %[[C1:.*]] = constant 1 : index // CHECK-NEXT: {{.*}} = affine.apply #[[ADD]](%[[I0]], %[[I4]]) - // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, %[[C0]] : index - // CHECK-NEXT: {{.*}} = affine.apply #[[ADD]](%[[I0]], %[[I4]]) - // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, {{.*}} : index - // CHECK-NEXT: {{.*}} = affine.apply #[[ADD]](%[[I0]], %[[I4]]) // CHECK-NEXT: {{.*}} = affine.apply #[[SUB]]()[%[[D0]]] + // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, {{.*}} : index // CHECK-NEXT: {{.*}} = select {{.*}}, {{.*}}, {{.*}} : index + // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, %[[C0]] : index // CHECK-NEXT: %[[S0:.*]] = select {{.*}}, %[[C0]], {{.*}} : index // // CHECK-NEXT: {{.*}} = affine.apply #[[ADD]](%[[I1]], %[[I5]]) - // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, %[[C0]] : index - // CHECK-NEXT: {{.*}} = affine.apply #[[ADD]](%[[I1]], %[[I5]]) - // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, {{.*}} : index - // CHECK-NEXT: {{.*}} = affine.apply #[[ADD]](%[[I1]], %[[I5]]) // CHECK-NEXT: {{.*}} = affine.apply #[[SUB]]()[%[[D1]]] + // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, {{.*}} : index // CHECK-NEXT: {{.*}} = select {{.*}}, {{.*}}, {{.*}} : index + // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, %[[C0]] : index // CHECK-NEXT: %[[S1:.*]] = select {{.*}}, %[[C0]], {{.*}} : index // - // CHECK-NEXT: {{.*}} = cmpi "slt", %[[I2]], %[[C0]] : index - // CHECK-NEXT: {{.*}} = cmpi "slt", %[[I2]], %3 : index // CHECK-NEXT: {{.*}} = affine.apply #[[SUB]]()[%[[D2]]] + // CHECK-NEXT: {{.*}} = cmpi "slt", %[[I2]], %3 : index // CHECK-NEXT: {{.*}} = select {{.*}}, %[[I2]], {{.*}} : index + // CHECK-NEXT: {{.*}} = cmpi "slt", %[[I2]], %[[C0]] : index // CHECK-NEXT: %[[S2:.*]] = select {{.*}}, %[[C0]], {{.*}} : index // // CHECK-NEXT: {{.*}} = affine.apply #[[ADD]](%[[I3]], %[[I6]]) - // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, %[[C0]] : index - // CHECK-NEXT: {{.*}} = affine.apply #[[ADD]](%[[I3]], %[[I6]]) - // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, {{.*}} : index - // CHECK-NEXT: {{.*}} = affine.apply #[[ADD]](%[[I3]], %[[I6]]) // CHECK-NEXT: {{.*}} = affine.apply #[[SUB]]()[%[[D3]]] + // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, {{.*}} : index // CHECK-NEXT: {{.*}} = select {{.*}}, {{.*}}, {{.*}} : index + // CHECK-NEXT: {{.*}} = cmpi "slt", {{.*}}, %[[C0]] : index // CHECK-NEXT: %[[S3:.*]] = select {{.*}}, %[[C0]], {{.*}} : index // // CHECK-NEXT: {{.*}} = load {{.*}}[%[[I6]], %[[I5]], %[[I4]]] : memref<5x4x3xf32> |

