Change the attribute dictionary syntax to separate name and value with '='.

The current syntax separates the name and value with ':', but ':' is already overloaded by several other things(e.g. trailing types). This makes the syntax difficult to parse in some situtations:

Old:
  "foo: 10 : i32"

New:
  "foo = 10 : i32"
PiperOrigin-RevId: 255097928
This commit is contained in:
River Riddle 2019-06-25 19:06:06 -07:00 committed by A. Unique TensorFlower
parent 49162524d8
commit 679a3b4191
64 changed files with 715 additions and 715 deletions

View File

@ -57,7 +57,7 @@ class EdscTest:
# CHECK-LABEL: testBlockContext
# CHECK: %c42 = constant 42 : index
# CHECK: ^bb1:
# CHECK: %0 = "affine.apply"() {map: () -> (84)} : () -> index
# CHECK: %0 = "affine.apply"() {map = () -> (84)} : () -> index
def testBlockContextAppend(self):
self.setUp()
@ -283,7 +283,7 @@ class EdscTest:
f = self.module.declare_function("foo", [t, t_llvm_noalias, t_readonly], [])
printWithCurrentFunctionName(str(self.module))
# CHECK-LABEL: testFunctionDeclaration
# CHECK: func @foo(memref<10xf32>, memref<10xf32> {llvm.noalias: true}, memref<10xf32> {readonly: true})
# CHECK: func @foo(memref<10xf32>, memref<10xf32> {llvm.noalias = true}, memref<10xf32> {readonly = true})
def testFunctionMultiple(self):
self.setUp()
@ -316,8 +316,8 @@ class EdscTest:
# CHECK: %0 = load %arg0[%i0, %i1] : memref<10x42xf32>
# CHECK: %1 = addf %0, %cst : f32
# CHECK: store %1, %arg0[%i0, %i1] : memref<10x42xf32>
# CHECK: {lower_bound: () -> (0), step: 1 : index, upper_bound: () -> (42)}
# CHECK: {lower_bound: () -> (0), step: 1 : index, upper_bound: () -> (10)}
# CHECK: {lower_bound = () -> (0), step = 1 : index, upper_bound = () -> (42)}
# CHECK: {lower_bound = () -> (0), step = 1 : index, upper_bound = () -> (10)}
def testLoopContext(self):
self.setUp()
@ -334,9 +334,9 @@ class EdscTest:
# CHECK: ^bb1(%i0: index):
# CHECK: "affine.for"(%c42, %2) (
# CHECK: ^bb2(%i1: index):
# CHECK: "affine.apply"(%i0, %i1) {map: (d0, d1) -> (d0 + d1)} : (index, index) -> index
# CHECK: {lower_bound: (d0) -> (d0), step: 2 : index, upper_bound: (d0) -> (d0)} : (index, index) -> ()
# CHECK: {lower_bound: () -> (0), step: 1 : index, upper_bound: () -> (42)}
# CHECK: "affine.apply"(%i0, %i1) {map = (d0, d1) -> (d0 + d1)} : (index, index) -> index
# CHECK: {lower_bound = (d0) -> (d0), step = 2 : index, upper_bound = (d0) -> (d0)} : (index, index) -> ()
# CHECK: {lower_bound = () -> (0), step = 1 : index, upper_bound = () -> (42)}
def testLoopNestContext(self):
self.setUp()
@ -355,7 +355,7 @@ class EdscTest:
# CHECK: ^bb3(%i2: index):
# CHECK: "affine.for"() (
# CHECK: ^bb4(%i3: index):
# CHECK: %2 = "affine.apply"(%i0, %i1, %i2, %i3) {map: (d0, d1, d2, d3) -> (d0 + d1 + d2 + d3)} : (index, index, index, index) -> index
# CHECK: %2 = "affine.apply"(%i0, %i1, %i2, %i3) {map = (d0, d1, d2, d3) -> (d0 + d1 + d2 + d3)} : (index, index, index, index) -> index
def testMLIRBooleanCompilation(self):
self.setUp()
@ -437,9 +437,9 @@ class EdscTest:
# CHECK-DAG: %1 = load %arg1[%i2, %i1] : memref<32x32xf32>
# CHECK: %2 = mulf %0, %1 : f32
# CHECK: store %2, %arg2[%i0, %i1] : memref<32x32xf32>
# CHECK: {lower_bound: () -> (0), step: 1 : index, upper_bound: () -> (32)} : () -> ()
# CHECK: {lower_bound: () -> (0), step: 1 : index, upper_bound: () -> (32)} : () -> ()
# CHECK: {lower_bound: () -> (0), step: 1 : index, upper_bound: () -> (32)} : () -> ()
# CHECK: {lower_bound = () -> (0), step = 1 : index, upper_bound = () -> (32)} : () -> ()
# CHECK: {lower_bound = () -> (0), step = 1 : index, upper_bound = () -> (32)} : () -> ()
# CHECK: {lower_bound = () -> (0), step = 1 : index, upper_bound = () -> (32)} : () -> ()
def testRet(self):
self.setUp()
@ -479,4 +479,4 @@ def runTests():
test()
if __name__ == '__main__':
runTests()
runTests()

View File

@ -117,7 +117,7 @@ ParseResult linalg::SliceOp::parse(OpAsmParser *parser,
// A SliceOp prints as:
//
// ```{.mlir}
// linalg.slice %0[%i0] {dim: 0} : !linalg.view<?xf32>, index
// linalg.slice %0[%i0] {dim = 0} : !linalg.view<?xf32>, index
// ```
//
// Where %0 is an ssa-value holding a `view<?x?xf32>`, %i0 is an ssa-value
@ -125,7 +125,7 @@ ParseResult linalg::SliceOp::parse(OpAsmParser *parser,
void linalg::SliceOp::print(OpAsmPrinter *p) {
*p << getOperationName() << " " << *getParentView() << "[" << *getIndexing()
<< "]";
*p << " {dim: ";
*p << " {dim = ";
p->printAttribute(getAttr("dim"));
*p << "}";
p->printOptionalAttrDict(getAttrs(), {"dim"});

View File

@ -59,10 +59,10 @@ TEST_FUNC(linalg_ops) {
dot(sA, sB, ssC);
ret();
// CHECK-LABEL: func @linalg_ops(%arg0: index, %arg1: index, %arg2: index) {
// CHECK: {{.*}} = linalg.slice {{.*}}[{{.*}}] {dim: 1} : !linalg.view<?x?xf32>, index
// CHECK-NEXT: {{.*}} = linalg.slice {{.*}}[{{.*}}] {dim: 1} : !linalg.view<?x?xf32>, index
// CHECK-NEXT: {{.*}} = linalg.slice {{.*}}[{{.*}}] {dim: 0} : !linalg.view<?x?xf32>, index
// CHECK-NEXT: {{.*}} = linalg.slice {{.*}}[{{.*}}] {dim: 0} : !linalg.view<?xf32>, index
// CHECK: {{.*}} = linalg.slice {{.*}}[{{.*}}] {dim = 1} : !linalg.view<?x?xf32>, index
// CHECK-NEXT: {{.*}} = linalg.slice {{.*}}[{{.*}}] {dim = 1} : !linalg.view<?x?xf32>, index
// CHECK-NEXT: {{.*}} = linalg.slice {{.*}}[{{.*}}] {dim = 0} : !linalg.view<?x?xf32>, index
// CHECK-NEXT: {{.*}} = linalg.slice {{.*}}[{{.*}}] {dim = 0} : !linalg.view<?xf32>, index
// CHECK: linalg.matmul({{.*}}, {{.*}}, {{.*}}) : !linalg.view<?x?xf32>
// CHECK-NEXT: linalg.matvec({{.*}}, {{.*}}, {{.*}}) : !linalg.view<?xf32>
// CHECK-NEXT: linalg.dot({{.*}}, {{.*}}, {{.*}}) : !linalg.view<f32>

View File

@ -647,8 +647,8 @@ Syntax:
attribute-dict ::= `{` `}`
| `{` attribute-entry (`,` attribute-entry)* `}`
attribute-entry ::= dialect-attribute-entry | dependent-attribute-entry
dialect-attribute-entry ::= dialect-namespace `.` bare-id `:` attribute-value
dependent-attribute-entry ::= dependent-attribute-name `:` attribute-value
dialect-attribute-entry ::= dialect-namespace `.` bare-id `=` attribute-value
dependent-attribute-entry ::= dependent-attribute-name `=` attribute-value
dependent-attribute-name ::= (letter|[_]) (letter|digit|[_$])*
```

View File

@ -635,7 +635,7 @@ void ModulePrinter::printAttributeOptionalType(Attribute attr,
os << '{';
interleaveComma(attr.cast<DictionaryAttr>().getValue(),
[&](NamedAttribute attr) {
os << attr.first << ": ";
os << attr.first << " = ";
printAttribute(attr.second);
});
os << '}';
@ -1153,7 +1153,7 @@ void ModulePrinter::printOptionalAttrDict(ArrayRef<NamedAttribute> attrs,
if (attr.second.isa<UnitAttr>())
return;
os << ": ";
os << " = ";
printAttributeAndType(attr.second);
});
os << '}';

View File

@ -1054,7 +1054,7 @@ Attribute Parser::parseAttribute(Type type) {
///
/// attribute-dict ::= `{` `}`
/// | `{` attribute-entry (`,` attribute-entry)* `}`
/// attribute-entry ::= bare-id `:` attribute-value
/// attribute-entry ::= bare-id `=` attribute-value
///
ParseResult
Parser::parseAttributeDict(SmallVectorImpl<NamedAttribute> &attributes) {
@ -1069,9 +1069,9 @@ Parser::parseAttributeDict(SmallVectorImpl<NamedAttribute> &attributes) {
Identifier nameId = builder.getIdentifier(getTokenSpelling());
consumeToken();
// Try to parse the ':' for the attribute value.
if (!consumeIf(Token::colon)) {
// If there is no ':', we treat this as a unit attribute.
// Try to parse the '=' for the attribute value.
if (!consumeIf(Token::equal)) {
// If there is no '=', we treat this as a unit attribute.
attributes.push_back({nameId, builder.getUnitAttr()});
return success();
}

View File

@ -32,7 +32,7 @@ func @affine_apply_operand_non_index(%arg0 : i32) {
// Custom parser automatically assigns all arguments the `index` so we must
// use the generic syntax here to exercise the verifier.
// expected-error@+1 {{operands must be of type 'index'}}
%0 = "affine.apply"(%arg0) {map: (d0) -> (d0)} : (i32) -> (index)
%0 = "affine.apply"(%arg0) {map = (d0) -> (d0)} : (i32) -> (index)
return
}
@ -42,7 +42,7 @@ func @affine_apply_resul_non_index(%arg0 : index) {
// Custom parser automatically assigns `index` as the result type so we must
// use the generic syntax here to exercise the verifier.
// expected-error@+1 {{result must be of type 'index'}}
%0 = "affine.apply"(%arg0) {map: (d0) -> (d0)} : (index) -> (i32)
%0 = "affine.apply"(%arg0) {map = (d0) -> (d0)} : (index) -> (i32)
return
}

View File

@ -6,27 +6,27 @@
// CHECK-LABEL: @empty
func @empty() {
// CHECK: affine.for %i
// CHECK-NEXT: } {some_attr: true}
// CHECK-NEXT: } {some_attr = true}
//
// GENERIC: "affine.for"()
// GENERIC-NEXT: ^bb1(%i0: index):
// GENERIC-NEXT: "affine.terminator"() : () -> ()
// GENERIC-NEXT: })
affine.for %i = 0 to 10 {
} {some_attr: true}
} {some_attr = true}
// CHECK: affine.if
// CHECK-NEXT: } {some_attr: true}
// CHECK-NEXT: } {some_attr = true}
//
// GENERIC: "affine.if"()
// GENERIC-NEXT: "affine.terminator"() : () -> ()
// GENERIC-NEXT: }, {
// GENERIC-NEXT: })
affine.if () : () () {
} {some_attr: true}
} {some_attr = true}
// CHECK: } else {
// CHECK: } {some_attr: true}
// CHECK: } {some_attr = true}
//
// GENERIC: "affine.if"()
// GENERIC-NEXT: "affine.terminator"() : () -> ()
@ -37,7 +37,7 @@ func @empty() {
affine.if () : () () {
} else {
"foo"() : () -> ()
} {some_attr: true}
} {some_attr = true}
return
}
@ -52,7 +52,7 @@ func @affine_terminator() {
// GENERIC: "affine.for"() ( {
// GENERIC-NEXT: ^bb1(%i0: index): // no predecessors
// GENERIC-NEXT: "affine.terminator"() : () -> ()
// GENERIC-NEXT: }) {lower_bound: #map0, step: 1 : index, upper_bound: #map1} : () -> ()
// GENERIC-NEXT: }) {lower_bound = #map0, step = 1 : index, upper_bound = #map1} : () -> ()
affine.for %i = 0 to 10 {
"affine.terminator"() : () -> ()
}

View File

@ -4,32 +4,32 @@
func @gpu_index_ops()
attributes { gpu.kernel } {
// CHECK: = nvvm.read.ptx.sreg.tid.x : !llvm.i32
%tIdX = "gpu.thread_id"() {dimension: "x"} : () -> (index)
%tIdX = "gpu.thread_id"() {dimension = "x"} : () -> (index)
// CHECK: = nvvm.read.ptx.sreg.tid.y : !llvm.i32
%tIdY = "gpu.thread_id"() {dimension: "y"} : () -> (index)
%tIdY = "gpu.thread_id"() {dimension = "y"} : () -> (index)
// CHECK: = nvvm.read.ptx.sreg.tid.z : !llvm.i32
%tIdZ = "gpu.thread_id"() {dimension: "z"} : () -> (index)
%tIdZ = "gpu.thread_id"() {dimension = "z"} : () -> (index)
// CHECK: = nvvm.read.ptx.sreg.ntid.x : !llvm.i32
%bDimX = "gpu.block_dim"() {dimension: "x"} : () -> (index)
%bDimX = "gpu.block_dim"() {dimension = "x"} : () -> (index)
// CHECK: = nvvm.read.ptx.sreg.ntid.y : !llvm.i32
%bDimY = "gpu.block_dim"() {dimension: "y"} : () -> (index)
%bDimY = "gpu.block_dim"() {dimension = "y"} : () -> (index)
// CHECK: = nvvm.read.ptx.sreg.ntid.z : !llvm.i32
%bDimZ = "gpu.block_dim"() {dimension: "z"} : () -> (index)
%bDimZ = "gpu.block_dim"() {dimension = "z"} : () -> (index)
// CHECK: = nvvm.read.ptx.sreg.ctaid.x : !llvm.i32
%bIdX = "gpu.block_id"() {dimension: "x"} : () -> (index)
%bIdX = "gpu.block_id"() {dimension = "x"} : () -> (index)
// CHECK: = nvvm.read.ptx.sreg.ctaid.y : !llvm.i32
%bIdY = "gpu.block_id"() {dimension: "y"} : () -> (index)
%bIdY = "gpu.block_id"() {dimension = "y"} : () -> (index)
// CHECK: = nvvm.read.ptx.sreg.ctaid.z : !llvm.i32
%bIdZ = "gpu.block_id"() {dimension: "z"} : () -> (index)
%bIdZ = "gpu.block_id"() {dimension = "z"} : () -> (index)
// CHECK: = nvvm.read.ptx.sreg.nctaid.x : !llvm.i32
%gDimX = "gpu.grid_dim"() {dimension: "x"} : () -> (index)
%gDimX = "gpu.grid_dim"() {dimension = "x"} : () -> (index)
// CHECK: = nvvm.read.ptx.sreg.nctaid.y : !llvm.i32
%gDimY = "gpu.grid_dim"() {dimension: "y"} : () -> (index)
%gDimY = "gpu.grid_dim"() {dimension = "y"} : () -> (index)
// CHECK: = nvvm.read.ptx.sreg.nctaid.z : !llvm.i32
%gDimZ = "gpu.grid_dim"() {dimension: "z"} : () -> (index)
%gDimZ = "gpu.grid_dim"() {dimension = "z"} : () -> (index)
std.return
}

View File

@ -12,7 +12,7 @@ func @real_addew_fixedpoint_isomorphic(%arg0 : !type_lhs, %arg1: !type_rhs) -> !
// CHECK-NEXT: %2 = "fxpmath.convertis"(%0) : (tensor<4xi8>) -> tensor<4xi16>
// CHECK-NEXT: %3 = "fxpmath.convertis"(%1) : (tensor<4xi8>) -> tensor<4xi16>
// CHECK-NEXT: %4 = addi %2, %3 : tensor<4xi16>
// CHECK-NEXT: %5 = "fxpmath.clampis"(%4) {clamp_max: 127 : i16, clamp_min: -128 : i16} : (tensor<4xi16>) -> tensor<4xi16>
// CHECK-NEXT: %5 = "fxpmath.clampis"(%4) {clamp_max = 127 : i16, clamp_min = -128 : i16} : (tensor<4xi16>) -> tensor<4xi16>
// CHECK-NEXT: %6 = "fxpmath.convertis"(%5) : (tensor<4xi16>) -> tensor<4xi8>
// CHECK-NEXT: %7 = "quant.scast"(%6) : (tensor<4xi8>) -> tensor<4x!quant.uniform<i8:f32, 6.250000e-02>>
// CHECK-NEXT: return %7 : tensor<4x!quant.uniform<i8:f32, 6.250000e-02>>
@ -35,7 +35,7 @@ func @real_addew_affine_isomorphic(%arg0 : !type_lhs, %arg1: !type_rhs) -> !type
// CHECK-NEXT: %3 = "fxpmath.convertis"(%1) : (tensor<4xi8>) -> tensor<4xi16>
// CHECK-NEXT: %4 = addi %2, %3 : tensor<4xi16>
// CHECK-NEXT: %5 = addi %4, %cst : tensor<4xi16>
// CHECK-NEXT: %6 = "fxpmath.clampis"(%5) {clamp_max: 127 : i16, clamp_min: -128 : i16} : (tensor<4xi16>) -> tensor<4xi16>
// CHECK-NEXT: %6 = "fxpmath.clampis"(%5) {clamp_max = 127 : i16, clamp_min = -128 : i16} : (tensor<4xi16>) -> tensor<4xi16>
// CHECK-NEXT: %7 = "fxpmath.convertis"(%6) : (tensor<4xi16>) -> tensor<4xi8>
// CHECK-NEXT: %8 = "quant.scast"(%7) : (tensor<4xi8>) -> tensor<4x!quant.uniform<i8:f32, 6.250000e-02:-5>>
// CHECK-NEXT: return %8 : tensor<4x!quant.uniform<i8:f32, 6.250000e-02:-5>>
@ -56,11 +56,11 @@ func @real_addew_fixedpoint_clamp(%arg0 : !type_lhs, %arg1: !type_rhs) -> !type_
// CHECK-NEXT: %2 = "fxpmath.convertis"(%0) : (tensor<4xi8>) -> tensor<4xi16>
// CHECK-NEXT: %3 = "fxpmath.convertis"(%1) : (tensor<4xi8>) -> tensor<4xi16>
// CHECK-NEXT: %4 = addi %2, %3 : tensor<4xi16>
// CHECK-NEXT: %5 = "fxpmath.clampis"(%4) {clamp_max: 64 : i16, clamp_min: -64 : i16} : (tensor<4xi16>) -> tensor<4xi16>
// CHECK-NEXT: %5 = "fxpmath.clampis"(%4) {clamp_max = 64 : i16, clamp_min = -64 : i16} : (tensor<4xi16>) -> tensor<4xi16>
// CHECK-NEXT: %6 = "fxpmath.convertis"(%5) : (tensor<4xi16>) -> tensor<4xi8>
// CHECK-NEXT: %7 = "quant.scast"(%6) : (tensor<4xi8>) -> tensor<4x!quant.uniform<i8:f32, 6.250000e-02>>
// CHECK-NEXT: return %7 : tensor<4x!quant.uniform<i8:f32, 6.250000e-02>>
%0 = "fxpmath.real_add_ew"(%arg0, %arg1) { clamp_min:-4.0, clamp_max:4.0 }
%0 = "fxpmath.real_add_ew"(%arg0, %arg1) { clamp_min = -4.0, clamp_max = 4.0 }
: (!type_lhs, !type_rhs) -> (!type_result)
return %0 : !type_result
}

View File

@ -12,9 +12,9 @@ func @real_mulew_fixedpoint(%arg0 : !type_lhs, %arg1: !type_rhs) -> !type_result
// CHECK-NEXT: %2 = "fxpmath.convertis"(%0) : (tensor<4xi8>) -> tensor<4xi32>
// CHECK-NEXT: %3 = "fxpmath.convertis"(%1) : (tensor<4xi8>) -> tensor<4xi32>
// CHECK-NEXT: %4 = muli %2, %3 : tensor<4xi32>
// CHECK-NEXT: %5 = "fxpmath.vs_saturating_rounding_doubling_high_mulis"(%4) {b: 1562722842 : i32} : (tensor<4xi32>) -> tensor<4xi32>
// CHECK-NEXT: %6 = "fxpmath.rounding_divide_by_potis"(%5) {exponent: 5 : i32} : (tensor<4xi32>) -> tensor<4xi32>
// CHECK-NEXT: %7 = "fxpmath.clampis"(%6) {clamp_max: 127 : i32, clamp_min: -128 : i32} : (tensor<4xi32>) -> tensor<4xi32>
// CHECK-NEXT: %5 = "fxpmath.vs_saturating_rounding_doubling_high_mulis"(%4) {b = 1562722842 : i32} : (tensor<4xi32>) -> tensor<4xi32>
// CHECK-NEXT: %6 = "fxpmath.rounding_divide_by_potis"(%5) {exponent = 5 : i32} : (tensor<4xi32>) -> tensor<4xi32>
// CHECK-NEXT: %7 = "fxpmath.clampis"(%6) {clamp_max = 127 : i32, clamp_min = -128 : i32} : (tensor<4xi32>) -> tensor<4xi32>
// CHECK-NEXT: %8 = "fxpmath.convertis"(%7) : (tensor<4xi32>) -> tensor<4xi8>
// CHECK-NEXT: %9 = "quant.scast"(%8) : (tensor<4xi8>) -> tensor<4x!quant.uniform<i8:f32, 1.065000e-01>>
// CHECK-NEXT: return %9 : tensor<4x!quant.uniform<i8:f32, 1.065000e-01>>
@ -38,8 +38,8 @@ func @real_mulew_affine_clamp(%arg0 : !type_lhs, %arg1: !type_rhs) -> !type_resu
// CHECK: addi %3, %cst_0 : tensor<4xi32>
// CHECK: muli %4, %5 : tensor<4xi32>
// CHECK: addi %8, %cst_1 : tensor<4xi32>
// CHECK: {clamp_max: 55 : i32, clamp_min: -73 : i32}
%0 = "fxpmath.real_mul_ew"(%arg0, %arg1) { clamp_min:-4.0, clamp_max:4.0 } : (!type_lhs, !type_rhs) -> (!type_result)
// CHECK: {clamp_max = 55 : i32, clamp_min = -73 : i32}
%0 = "fxpmath.real_mul_ew"(%arg0, %arg1) { clamp_min = -4.0, clamp_max = 4.0 } : (!type_lhs, !type_rhs) -> (!type_result)
return %0 : !type_result
}

View File

@ -6,7 +6,7 @@ func @fakeQuantArgs(tensor<8x4x3xf32>) -> tensor<8x4x3xf32> {
^bb0(%arg0: tensor<8x4x3xf32>):
// expected-error@+1 {{FakeQuant range must straddle zero: [1.100000e+00,1.500000e+00]}}
%0 = "quant.const_fake_quant"(%arg0) {
min: 1.1 : f32, max: 1.5 : f32, num_bits: 8
min = 1.1 : f32, max = 1.5 : f32, num_bits = 8
} : (tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
return %0 : tensor<8x4x3xf32>
}
@ -17,7 +17,7 @@ func @fakeQuantArgs(tensor<8x4x3xf32>) -> tensor<8x4x3xf32> {
^bb0(%arg0: tensor<8x4x3xf32>):
// expected-error@+1 {{FakeQuant range must straddle zero: [1.100000e+00,1.000000e+00}}
%0 = "quant.const_fake_quant"(%arg0) {
min: 1.1 : f32, max: 1.0 : f32, num_bits: 8
min = 1.1 : f32, max = 1.0 : f32, num_bits = 8
} : (tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
return %0 : tensor<8x4x3xf32>
}
@ -28,7 +28,7 @@ func @fakeQuantArgs(tensor<8x4x3xi1>) -> tensor<8x4x3xi1> {
^bb0(%arg0: tensor<8x4x3xi1>):
// expected-error@+1 {{op operand #0 must be tensor of 32-bit float values}}
%0 = "quant.const_fake_quant"(%arg0) {
min: 1.1 : f32, max: 1.0 : f32, num_bits: 8
min = 1.1 : f32, max = 1.0 : f32, num_bits = 8
} : (tensor<8x4x3xi1>) -> tensor<8x4x3xi1>
return %0 : tensor<8x4x3xi1>
}

View File

@ -10,7 +10,7 @@ func @fakeQuantArgs_Quint8_0_1(tensor<8x4x3xf32>) -> tensor<8x4x3xf32> {
// CHECK-NEXT: %1 = "quant.dcast"(%0) : (tensor<8x4x3x!quant.uniform<u8:f32, 0.0039215686274509803>>)
// CHECK-SAME: -> tensor<8x4x3xf32>
%0 = "quant.const_fake_quant"(%arg0) {
min: 0.0 : f32, max: 1.0 : f32, num_bits: 8
min = 0.0 : f32, max = 1.0 : f32, num_bits = 8
} : (tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
return %0 : tensor<8x4x3xf32>
}
@ -25,7 +25,7 @@ func @fakeQuantArgs_Quint8_NarrowRange(tensor<8x4x3xf32>) -> tensor<8x4x3xf32> {
// CHECK-NEXT: %1 = "quant.dcast"(%0) : (tensor<8x4x3x!quant.uniform<u8<1:255>:f32, 0.003937007874015748:1>>)
// CHECK-SAME: -> tensor<8x4x3xf32>
%0 = "quant.const_fake_quant"(%arg0) {
min: 0.0 : f32, max: 1.0 : f32, num_bits: 8, narrow_range: true
min = 0.0 : f32, max = 1.0 : f32, num_bits = 8, narrow_range = true
} : (tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
return %0 : tensor<8x4x3xf32>
}
@ -40,7 +40,7 @@ func @fakeQuantArgs_Quint8_SymmetricRange(tensor<8x4x3xf32>) -> tensor<8x4x3xf32
// CHECK-NEXT: %1 = "quant.dcast"(%0) : (tensor<8x4x3x!quant.uniform<u8:f32, 7.812500e-03:128>>)
// CHECK-SAME: -> tensor<8x4x3xf32>
%0 = "quant.const_fake_quant"(%arg0) {
min: -1.0 : f32, max: 0.9921875 : f32, num_bits: 8, narrow_range: false
min = -1.0 : f32, max = 0.9921875 : f32, num_bits = 8, narrow_range = false
} : (tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
return %0 : tensor<8x4x3xf32>
}
@ -56,7 +56,7 @@ func @fakeQuantArgs_Qint16_Symmetric(tensor<8x4x3xf32>) -> tensor<8x4x3xf32> {
// CHECK-NEXT: %1 = "quant.dcast"(%0) : (tensor<8x4x3x!quant.uniform<i16:f32, 3.0517578125E-5>>)
// CHECK-SAME: -> tensor<8x4x3xf32>
%0 = "quant.const_fake_quant"(%arg0) {
min: -1.0 : f32, max: 0.999969482 : f32, num_bits: 16
min = -1.0 : f32, max = 0.999969482 : f32, num_bits = 16
} : (tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
return %0 : tensor<8x4x3xf32>
}
@ -71,7 +71,7 @@ func @fakeQuantArgs_UnrankedTensor(tensor<f32>) -> tensor<f32> {
// CHECK-NEXT: %1 = "quant.dcast"(%0) : (tensor<!quant.uniform<u8:f32, 0.0039215686274509803>>)
// CHECK-SAME: -> tensor<f32>
%0 = "quant.const_fake_quant"(%arg0) {
min: 0.0 : f32, max: 1.0 : f32, num_bits: 8
min = 0.0 : f32, max = 1.0 : f32, num_bits = 8
} : (tensor<f32>) -> tensor<f32>
return %0 : tensor<f32>
}

View File

@ -5,7 +5,7 @@ func @invalidStatisticsMismatchedLayerType(%arg0: tensor<8x4x3xf32>) ->
tensor<8x4x3xf32> {
// expected-error@+1 {{layerStats must have a floating point element type}}
%0 = "quant.stats"(%arg0) {
layerStats: dense<[-1, 1]> : tensor<2xi8>
layerStats = dense<[-1, 1]> : tensor<2xi8>
} : (tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
return %0 : tensor<8x4x3xf32>
}
@ -15,7 +15,7 @@ func @invalidStatisticsMismatchedLayerRank(%arg0: tensor<8x4x3xf32>) ->
tensor<8x4x3xf32> {
// expected-error@+1 {{layerStats must have shape [2]}}
%0 = "quant.stats"(%arg0) {
layerStats: dense<[[-1.0, 1.0]]> : tensor<1x2xf32>
layerStats = dense<[[-1.0, 1.0]]> : tensor<1x2xf32>
} : (tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
return %0 : tensor<8x4x3xf32>
}
@ -25,7 +25,7 @@ func @invalidStatisticsMismatchedLayerShape(%arg0: tensor<8x4x3xf32>) ->
tensor<8x4x3xf32> {
// expected-error@+1 {{layerStats must have shape [2]}}
%0 = "quant.stats"(%arg0) {
layerStats: dense<[-1.0, 1.0, 2.0]> : tensor<3xf32>
layerStats = dense<[-1.0, 1.0, 2.0]> : tensor<3xf32>
} : (tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
return %0 : tensor<8x4x3xf32>
}
@ -35,8 +35,8 @@ func @invalidStatisticsMismatchedLayerShape(%arg0: tensor<8x4x3xf32>) ->
func @invalidStatisticsMismatchedAxisType(%arg0: tensor<8x4x3xf32>) -> tensor<8x4x3xf32> {
// expected-error@+1 {{axisStats must have a floating point element type}}
%0 = "quant.stats"(%0) {
layerStats: dense<[-1.0, 1.0]> : tensor<2xf32>,
axisStats: dense<[
layerStats = dense<[-1.0, 1.0]> : tensor<2xf32>,
axisStats = dense<[
[-1, 1],
[-8, 8],
[-1, 0]
@ -50,8 +50,8 @@ func @invalidStatisticsMismatchedAxisRank(%arg0: tensor<8x4x3xf32>) ->
tensor<8x4x3xf32> {
// expected-error@+1 {{axisStats must have shape [N,2] where N = the argument rank}}
%0 = "quant.stats"(%arg0) {
layerStats: dense<[-1.0, 1.0]> : tensor<2xf32>,
axisStats: dense<[
layerStats = dense<[-1.0, 1.0]> : tensor<2xf32>,
axisStats = dense<[
[-1.0, 1.0],
[-8.0, 8.0],
[-0.5, 0.5],
@ -66,8 +66,8 @@ func @invalidStatisticsMismatchedAxisShape(%arg0: tensor<8x4x3xf32>) ->
tensor<8x4x3xf32> {
// expected-error@+1 {{axisStats must have shape [N,2] where N = the argument rank}}
%0 = "quant.stats"(%arg0) {
layerStats: dense<[-1.0, 1.0]> : tensor<2xf32>,
axisStats: dense<[
layerStats = dense<[-1.0, 1.0]> : tensor<2xf32>,
axisStats = dense<[
[-1.0, 1.0, 1.0],
[-8.0, 8.0, 1.0],
[-0.5, 0.5, 1.0]

View File

@ -4,13 +4,13 @@
// CHECK-LABEL: validConstFakeQuant
func @validConstFakeQuant(%arg0: tensor<8x4x3xf32>) -> tensor<8x4x3xf32> {
%0 = "quant.const_fake_quant"(%arg0) {
min: 0.0 : f32, max: 1.0 : f32, num_bits: 8, narrow_range: true
min = 0.0 : f32, max = 1.0 : f32, num_bits = 8, narrow_range = true
} : (tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
%1 = "quant.const_fake_quant"(%0) {
min: 0.0 : f32, max: 1.0 : f32, num_bits: 8, narrow_range: false
min = 0.0 : f32, max = 1.0 : f32, num_bits = 8, narrow_range = false
} : (tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
%2 = "quant.const_fake_quant"(%1) {
min: 0.0 : f32, max: 1.0 : f32, num_bits: 8
min = 0.0 : f32, max = 1.0 : f32, num_bits = 8
} : (tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
return %2 : tensor<8x4x3xf32>
}
@ -18,7 +18,7 @@ func @validConstFakeQuant(%arg0: tensor<8x4x3xf32>) -> tensor<8x4x3xf32> {
// -----
// CHECK-LABEL: validStatisticsRef
func @validStatisticsRef(%arg0: tensor<8x4x3xf32>) -> tensor<8x4x3xf32> {
%0 = "quant.stats_ref"(%arg0) { statsKey: "foobar" } :
%0 = "quant.stats_ref"(%arg0) { statsKey = "foobar" } :
(tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
return %0 : tensor<8x4x3xf32>
}
@ -27,11 +27,11 @@ func @validStatisticsRef(%arg0: tensor<8x4x3xf32>) -> tensor<8x4x3xf32> {
// CHECK-LABEL: validStatistics
func @validStatistics(%arg0: tensor<8x4x3xf32>) -> tensor<8x4x3xf32> {
%0 = "quant.stats"(%arg0) {
layerStats: dense<[-1.0, 1.0]> : tensor<2xf32>
layerStats = dense<[-1.0, 1.0]> : tensor<2xf32>
} : (tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
%1 = "quant.stats"(%0) {
layerStats: dense<[-1.0, 1.0]> : tensor<2xf32>,
axisStats: dense<[
layerStats = dense<[-1.0, 1.0]> : tensor<2xf32>,
axisStats = dense<[
[-1.0, 1.0],
[-8.0, 8.0],
[-0.5, 0.5]
@ -43,7 +43,7 @@ func @validStatistics(%arg0: tensor<8x4x3xf32>) -> tensor<8x4x3xf32> {
// -----
// CHECK-LABEL: validCoupledRef
func @validCoupledRef(%arg0: tensor<8x4x3xf32>) -> tensor<8x4x3xf32> {
%0 = "quant.coupled_ref"(%arg0) { coupledKey: "foobar" } :
%0 = "quant.coupled_ref"(%arg0) { coupledKey = "foobar" } :
(tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
return %0 : tensor<8x4x3xf32>
}

View File

@ -570,10 +570,10 @@ TEST_FUNC(vectorize_2d) {
// CHECK-NEXT: affine.for %i0 = 0 to (d0) -> (d0)(%[[M]]) {
// CHECK-NEXT: affine.for %i1 = 0 to (d0) -> (d0)(%[[N]]) step 4 {
// CHECK-NEXT: affine.for %i2 = 0 to (d0) -> (d0)(%[[P]]) step 4 {
// CHECK-NEXT: %[[vA:.*]] = "vector.transfer_read"(%arg1, %i0, %i1, %i2) {permutation_map: (d0, d1, d2) -> (d1, d2)} : (memref<?x?x?xf32>, index, index, index) -> vector<4x4xf32>
// CHECK-NEXT: %[[vB:.*]] = "vector.transfer_read"(%arg0, %i0, %i1, %i2) {permutation_map: (d0, d1, d2) -> (d1, d2)} : (memref<?x?x?xf32>, index, index, index) -> vector<4x4xf32>
// CHECK-NEXT: %[[vA:.*]] = "vector.transfer_read"(%arg1, %i0, %i1, %i2) {permutation_map = (d0, d1, d2) -> (d1, d2)} : (memref<?x?x?xf32>, index, index, index) -> vector<4x4xf32>
// CHECK-NEXT: %[[vB:.*]] = "vector.transfer_read"(%arg0, %i0, %i1, %i2) {permutation_map = (d0, d1, d2) -> (d1, d2)} : (memref<?x?x?xf32>, index, index, index) -> vector<4x4xf32>
// CHECK-NEXT: %[[vRES:.*]] = addf %[[vB]], %[[vA]] : vector<4x4xf32>
// CHECK-NEXT: "vector.transfer_write"(%[[vRES:.*]], %arg2, %i0, %i1, %i2) {permutation_map: (d0, d1, d2) -> (d1, d2)} : (vector<4x4xf32>, memref<?x?x?xf32>, index, index, index) -> ()
// CHECK-NEXT: "vector.transfer_write"(%[[vRES:.*]], %arg2, %i0, %i1, %i2) {permutation_map = (d0, d1, d2) -> (d1, d2)} : (vector<4x4xf32>, memref<?x?x?xf32>, index, index, index) -> ()
// clang-format on
mlir::PassManager pm;

View File

@ -28,10 +28,10 @@ func @slice_op(%arg0: memref<?x?xf32>) {
%5 = linalg.view %arg0[%3, %4] : memref<?x?xf32>, !linalg.range, !linalg.range, !linalg.view<?x?xf32>
affine.for %i0 = 0 to (d0) -> (d0)(%1) {
affine.for %i1 = 0 to (d0) -> (d0)(%2) {
%6 = linalg.slice %5[%i0] {dim: 1} : !linalg.view<?x?xf32>, index
%6 = linalg.slice %5[%i0] {dim = 1} : !linalg.view<?x?xf32>, index
"some_consumer"(%6) : (!linalg.view<?xf32>) -> ()
%7 = linalg.slice %5[%i1] {dim: 0} : !linalg.view<?x?xf32>, index
%8 = linalg.slice %7[%i0] {dim: 0} : !linalg.view<?xf32>, index
%7 = linalg.slice %5[%i1] {dim = 0} : !linalg.view<?x?xf32>, index
%8 = linalg.slice %7[%i0] {dim = 0} : !linalg.view<?xf32>, index
}
}
return
@ -44,9 +44,9 @@ func @slice_op(%arg0: memref<?x?xf32>) {
// CHECK: %[[V:.*]] = linalg.view %arg0[%[[r1]], %[[r2]]] : memref<?x?xf32>, !linalg.range, !linalg.range, !linalg.view<?x?xf32>
// CHECK: affine.for %i0 = 0 to #map1(%0) {
// CHECK: affine.for %i1 = 0 to #map1(%1) {
// CHECK: {{.*}} = linalg.slice %[[V]][%i0] {dim: 1} : !linalg.view<?x?xf32>, index
// CHECK: %[[V2:.*]] = linalg.slice %[[V]][%i1] {dim: 0} : !linalg.view<?x?xf32>, index
// CHECK: {{.*}} = linalg.slice %[[V2]][%i0] {dim: 0} : !linalg.view<?xf32>, index
// CHECK: {{.*}} = linalg.slice %[[V]][%i0] {dim = 1} : !linalg.view<?x?xf32>, index
// CHECK: %[[V2:.*]] = linalg.slice %[[V]][%i1] {dim = 0} : !linalg.view<?x?xf32>, index
// CHECK: {{.*}} = linalg.slice %[[V2]][%i0] {dim = 0} : !linalg.view<?xf32>, index
func @rangeConversion(%arg0: index, %arg1: index, %arg2: index) {
%0 = linalg.range %arg0:%arg1:%arg2 : !linalg.range
@ -120,7 +120,7 @@ func @viewNonRangeConversion(%arg0: memref<?x?xf32>, %arg1: !linalg.range, %arg2
func @sliceRangeConversion(%arg0: memref<?x?xf32>, %arg1: !linalg.range, %arg2: !linalg.range, %arg3: !linalg.range) {
%0 = linalg.view %arg0[%arg1, %arg2] : memref<?x?xf32>, !linalg.range, !linalg.range, !linalg.view<?x?xf32>
%1 = linalg.slice %0[%arg3] {dim: 0} : !linalg.view<?x?xf32>, !linalg.range
%1 = linalg.slice %0[%arg3] {dim = 0} : !linalg.view<?x?xf32>, !linalg.range
return
}
// LLVM-LABEL: @sliceRangeConversion
@ -148,7 +148,7 @@ func @sliceRangeConversion(%arg0: memref<?x?xf32>, %arg1: !linalg.range, %arg2:
func @sliceNonRangeConversion2(%arg0: memref<?x?xf32>, %arg1: !linalg.range, %arg2: !linalg.range, %arg3: index) {
%0 = linalg.view %arg0[%arg1, %arg2] : memref<?x?xf32>, !linalg.range, !linalg.range, !linalg.view<?x?xf32>
%1 = linalg.slice %0[%arg3] {dim: 0} : !linalg.view<?x?xf32>, index
%1 = linalg.slice %0[%arg3] {dim = 0} : !linalg.view<?x?xf32>, index
return
}
// LLVM-LABEL: @sliceNonRangeConversion2

View File

@ -14,19 +14,19 @@ def main() {
}
# CHECK-LABEL: func @multiply_transpose(%arg0: !toy.array, %arg1: !toy.array)
# CHECK-NEXT: attributes {toy.generic: true} {
# CHECK-NEXT: attributes {toy.generic = true} {
# CHECK-NEXT: %0 = "toy.transpose"(%arg1) : (!toy.array) -> !toy.array
# CHECK-NEXT: %1 = "toy.mul"(%arg0, %0) : (!toy.array, !toy.array) -> !toy.array
# CHECK-NEXT: "toy.return"(%1) : (!toy.array) -> ()
# CHECK-NEXT: }
# CHECK-LABEL: func @main() {
# CHECK-NEXT: %0 = "toy.constant"() {value: dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> !toy.array<2, 3>
# CHECK-NEXT: %0 = "toy.constant"() {value = dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> !toy.array<2, 3>
# CHECK-NEXT: %1 = "toy.reshape"(%0) : (!toy.array<2, 3>) -> !toy.array<2, 3>
# CHECK-NEXT: %2 = "toy.constant"() {value: dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> !toy.array<6>
# CHECK-NEXT: %2 = "toy.constant"() {value = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> !toy.array<6>
# CHECK-NEXT: %3 = "toy.reshape"(%2) : (!toy.array<6>) -> !toy.array<2, 3>
# CHECK-NEXT: %4 = "toy.generic_call"(%1, %3) {callee: "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: %5 = "toy.generic_call"(%3, %1) {callee: "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: %4 = "toy.generic_call"(%1, %3) {callee = "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: %5 = "toy.generic_call"(%3, %1) {callee = "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: "toy.print"(%5) : (!toy.array) -> ()
# CHECK-NEXT: "toy.return"() : () -> ()

View File

@ -14,19 +14,19 @@ def main() {
}
# CHECK-LABEL: func @multiply_transpose(%arg0: !toy.array, %arg1: !toy.array)
# CHECK-NEXT: attributes {toy.generic: true} {
# CHECK-NEXT: attributes {toy.generic = true} {
# CHECK-NEXT: %0 = "toy.transpose"(%arg1) : (!toy.array) -> !toy.array
# CHECK-NEXT: %1 = "toy.mul"(%arg0, %0) : (!toy.array, !toy.array) -> !toy.array
# CHECK-NEXT: "toy.return"(%1) : (!toy.array) -> ()
# CHECK-NEXT: }
# CHECK-LABEL: func @main() {
# CHECK-NEXT: %0 = "toy.constant"() {value: dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> !toy.array<2, 3>
# CHECK-NEXT: %0 = "toy.constant"() {value = dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> !toy.array<2, 3>
# CHECK-NEXT: %1 = "toy.reshape"(%0) : (!toy.array<2, 3>) -> !toy.array<2, 3>
# CHECK-NEXT: %2 = "toy.constant"() {value: dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> !toy.array<6>
# CHECK-NEXT: %2 = "toy.constant"() {value = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> !toy.array<6>
# CHECK-NEXT: %3 = "toy.reshape"(%2) : (!toy.array<6>) -> !toy.array<2, 3>
# CHECK-NEXT: %4 = "toy.generic_call"(%1, %3) {callee: "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: %5 = "toy.generic_call"(%3, %1) {callee: "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: %4 = "toy.generic_call"(%1, %3) {callee = "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: %5 = "toy.generic_call"(%3, %1) {callee = "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: "toy.print"(%5) : (!toy.array) -> ()
# CHECK-NEXT: "toy.return"() : () -> ()

View File

@ -6,7 +6,7 @@ def main() {
}
# CHECK-LABEL: func @main() {
# CHECK-NEXT: %0 = "toy.constant"() {value: dense<5.500000e+00> : tensor<1xf64>} : () -> !toy.array<1>
# CHECK-NEXT: %0 = "toy.constant"() {value = dense<5.500000e+00> : tensor<1xf64>} : () -> !toy.array<1>
# CHECK-NEXT: %1 = "toy.reshape"(%0) : (!toy.array<1>) -> !toy.array<2, 2>
# CHECK-NEXT: "toy.print"(%1) : (!toy.array<2, 2>) -> ()
# CHECK-NEXT: "toy.return"() : () -> ()

View File

@ -14,19 +14,19 @@ def main() {
}
# CHECK-LABEL: func @multiply_transpose(%arg0: !toy.array, %arg1: !toy.array)
# CHECK-NEXT: attributes {toy.generic: true} {
# CHECK-NEXT: attributes {toy.generic = true} {
# CHECK-NEXT: %0 = "toy.transpose"(%arg1) : (!toy.array) -> !toy.array
# CHECK-NEXT: %1 = "toy.mul"(%arg0, %0) : (!toy.array, !toy.array) -> !toy.array
# CHECK-NEXT: "toy.return"(%1) : (!toy.array) -> ()
# CHECK-NEXT: }
# CHECK-LABEL: func @main() {
# CHECK-NEXT: %0 = "toy.constant"() {value: dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> !toy.array<2, 3>
# CHECK-NEXT: %0 = "toy.constant"() {value = dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> !toy.array<2, 3>
# CHECK-NEXT: %1 = "toy.reshape"(%0) : (!toy.array<2, 3>) -> !toy.array<2, 3>
# CHECK-NEXT: %2 = "toy.constant"() {value: dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> !toy.array<6>
# CHECK-NEXT: %2 = "toy.constant"() {value = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> !toy.array<6>
# CHECK-NEXT: %3 = "toy.reshape"(%2) : (!toy.array<6>) -> !toy.array<2, 3>
# CHECK-NEXT: %4 = "toy.generic_call"(%1, %3) {callee: "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: %5 = "toy.generic_call"(%3, %1) {callee: "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: %4 = "toy.generic_call"(%1, %3) {callee = "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: %5 = "toy.generic_call"(%3, %1) {callee = "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: "toy.print"(%5) : (!toy.array) -> ()
# CHECK-NEXT: "toy.return"() : () -> ()

View File

@ -6,7 +6,7 @@ def main() {
}
# CHECK-LABEL: func @main() {
# CHECK-NEXT: %0 = "toy.constant"() {value: dense<5.500000e+00> : tensor<1xf64>} : () -> !toy.array<1>
# CHECK-NEXT: %0 = "toy.constant"() {value = dense<5.500000e+00> : tensor<1xf64>} : () -> !toy.array<1>
# CHECK-NEXT: %1 = "toy.reshape"(%0) : (!toy.array<1>) -> !toy.array<2, 2>
# CHECK-NEXT: "toy.print"(%1) : (!toy.array<2, 2>) -> ()
# CHECK-NEXT: "toy.return"() : () -> ()

View File

@ -14,19 +14,19 @@ def main() {
}
# CHECK-LABEL: func @multiply_transpose(%arg0: !toy.array, %arg1: !toy.array)
# CHECK-NEXT: attributes {toy.generic: true} {
# CHECK-NEXT: attributes {toy.generic = true} {
# CHECK-NEXT: %0 = "toy.transpose"(%arg1) : (!toy.array) -> !toy.array
# CHECK-NEXT: %1 = "toy.mul"(%arg0, %0) : (!toy.array, !toy.array) -> !toy.array
# CHECK-NEXT: "toy.return"(%1) : (!toy.array) -> ()
# CHECK-NEXT: }
# CHECK-LABEL: func @main() {
# CHECK-NEXT: %0 = "toy.constant"() {value: dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> !toy.array<2, 3>
# CHECK-NEXT: %0 = "toy.constant"() {value = dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> !toy.array<2, 3>
# CHECK-NEXT: %1 = "toy.reshape"(%0) : (!toy.array<2, 3>) -> !toy.array<2, 3>
# CHECK-NEXT: %2 = "toy.constant"() {value: dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> !toy.array<6>
# CHECK-NEXT: %2 = "toy.constant"() {value = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> !toy.array<6>
# CHECK-NEXT: %3 = "toy.reshape"(%2) : (!toy.array<6>) -> !toy.array<2, 3>
# CHECK-NEXT: %4 = "toy.generic_call"(%1, %3) {callee: "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: %5 = "toy.generic_call"(%3, %1) {callee: "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: %4 = "toy.generic_call"(%1, %3) {callee = "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: %5 = "toy.generic_call"(%3, %1) {callee = "multiply_transpose"} : (!toy.array<2, 3>, !toy.array<2, 3>) -> !toy.array
# CHECK-NEXT: "toy.print"(%5) : (!toy.array) -> ()
# CHECK-NEXT: "toy.return"() : () -> ()

View File

@ -6,7 +6,7 @@ def main() {
}
# CHECK-LABEL: func @main() {
# CHECK-NEXT: %0 = "toy.constant"() {value: dense<5.500000e+00> : tensor<1xf64>} : () -> !toy.array<1>
# CHECK-NEXT: %0 = "toy.constant"() {value = dense<5.500000e+00> : tensor<1xf64>} : () -> !toy.array<1>
# CHECK-NEXT: %1 = "toy.reshape"(%0) : (!toy.array<1>) -> !toy.array<2, 2>
# CHECK-NEXT: "toy.print"(%1) : (!toy.array<2, 2>) -> ()
# CHECK-NEXT: "toy.return"() : () -> ()

View File

@ -98,7 +98,7 @@ func @launch_func_too_few_operands(%sz : index) {
func @launch_func_missing_callee_attribute(%sz : index) {
// expected-error@+1 {{attribute 'kernel' must be specified}}
"gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz) {foo: "bar"}
"gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz) {foo = "bar"}
: (index, index, index, index, index, index) -> ()
return
}
@ -107,7 +107,7 @@ func @launch_func_missing_callee_attribute(%sz : index) {
func @launch_func_no_function_attribute(%sz : index) {
// expected-error@+1 {{attribute 'kernel' must be a function}}
"gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz) {kernel: 10}
"gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz) {kernel = 10}
: (index, index, index, index, index, index) -> ()
return
}
@ -116,7 +116,7 @@ func @launch_func_no_function_attribute(%sz : index) {
func @launch_func_undefined_function(%sz : index) {
// expected-error@+1 {{kernel function '@kernel_1' is undefined}}
"gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz) { kernel: @kernel_1 }
"gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz) { kernel = @kernel_1 }
: (index, index, index, index, index, index) -> ()
return
}
@ -129,7 +129,7 @@ func @kernel_1(%arg1 : !llvm<"float*">) {
func @launch_func_missing_kernel_attr(%sz : index, %arg : !llvm<"float*">) {
// expected-error@+1 {{kernel function is missing the 'gpu.kernel' attribute}}
"gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz, %arg) {kernel: @kernel_1}
"gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz, %arg) {kernel = @kernel_1}
: (index, index, index, index, index, index, !llvm<"float*">) -> ()
return
}
@ -143,7 +143,7 @@ func @kernel_1(%arg1 : !llvm<"float*">) attributes { gpu.kernel } {
func @launch_func_kernel_operand_size(%sz : index, %arg : !llvm<"float*">) {
// expected-error@+1 {{got 2 kernel operands but expected 1}}
"gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz, %arg, %arg)
{kernel: @kernel_1}
{kernel = @kernel_1}
: (index, index, index, index, index, index, !llvm<"float*">,
!llvm<"float*">) -> ()
return
@ -158,7 +158,7 @@ func @kernel_1(%arg1 : !llvm<"float*">) attributes { gpu.kernel } {
func @launch_func_kernel_operand_types(%sz : index, %arg : f32) {
// expected-error@+1 {{type of function argument 0 does not match}}
"gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz, %arg)
{kernel: @kernel_1}
{kernel = @kernel_1}
: (index, index, index, index, index, index, f32) -> ()
return
}

View File

@ -60,21 +60,21 @@ func @nested_isolation(%sz : index) {
func @kernel_1(%arg0 : f32, %arg1 : memref<?xf32, 1>)
attributes { gpu.kernel } {
%tIdX = "gpu.thread_id"() {dimension: "x"} : () -> (index)
%tIdY = "gpu.thread_id"() {dimension: "y"} : () -> (index)
%tIdZ = "gpu.thread_id"() {dimension: "z"} : () -> (index)
%tIdX = "gpu.thread_id"() {dimension = "x"} : () -> (index)
%tIdY = "gpu.thread_id"() {dimension = "y"} : () -> (index)
%tIdZ = "gpu.thread_id"() {dimension = "z"} : () -> (index)
%bDimX = "gpu.block_dim"() {dimension: "x"} : () -> (index)
%bDimY = "gpu.block_dim"() {dimension: "y"} : () -> (index)
%bDimZ = "gpu.block_dim"() {dimension: "z"} : () -> (index)
%bDimX = "gpu.block_dim"() {dimension = "x"} : () -> (index)
%bDimY = "gpu.block_dim"() {dimension = "y"} : () -> (index)
%bDimZ = "gpu.block_dim"() {dimension = "z"} : () -> (index)
%bIdX = "gpu.block_id"() {dimension: "x"} : () -> (index)
%bIdY = "gpu.block_id"() {dimension: "y"} : () -> (index)
%bIdZ = "gpu.block_id"() {dimension: "z"} : () -> (index)
%bIdX = "gpu.block_id"() {dimension = "x"} : () -> (index)
%bIdY = "gpu.block_id"() {dimension = "y"} : () -> (index)
%bIdZ = "gpu.block_id"() {dimension = "z"} : () -> (index)
%gDimX = "gpu.grid_dim"() {dimension: "x"} : () -> (index)
%gDimY = "gpu.grid_dim"() {dimension: "y"} : () -> (index)
%gDimZ = "gpu.grid_dim"() {dimension: "z"} : () -> (index)
%gDimX = "gpu.grid_dim"() {dimension = "x"} : () -> (index)
%gDimY = "gpu.grid_dim"() {dimension = "y"} : () -> (index)
%gDimZ = "gpu.grid_dim"() {dimension = "z"} : () -> (index)
"some_op"(%bIdX, %tIdX) : (index, index) -> ()
%42 = load %arg1[%bIdX] : memref<?xf32, 1>
@ -90,12 +90,12 @@ func @foo() {
// CHECK: %c8 = constant 8
%cst = constant 8 : index
// CHECK: "gpu.launch_func"(%c8, %c8, %c8, %c8, %c8, %c8, %0, %1) {kernel: @kernel_1} : (index, index, index, index, index, index, f32, memref<?xf32, 1>) -> ()
"gpu.launch_func"(%cst, %cst, %cst, %cst, %cst, %cst, %0, %1) { kernel: @kernel_1 }
// CHECK: "gpu.launch_func"(%c8, %c8, %c8, %c8, %c8, %c8, %0, %1) {kernel = @kernel_1} : (index, index, index, index, index, index, f32, memref<?xf32, 1>) -> ()
"gpu.launch_func"(%cst, %cst, %cst, %cst, %cst, %cst, %0, %1) { kernel = @kernel_1 }
: (index, index, index, index, index, index, f32, memref<?xf32, 1>) -> ()
// CHECK: "gpu.launch_func"(%c8, %c8, %c8, %c8, %c8, %c8, %0, %1) {kernel: @kernel_2} : (index, index, index, index, index, index, f32, memref<?xf32, 1>) -> ()
"gpu.launch_func"(%cst, %cst, %cst, %cst, %cst, %cst, %0, %1) { kernel: @kernel_2 }
// CHECK: "gpu.launch_func"(%c8, %c8, %c8, %c8, %c8, %c8, %0, %1) {kernel = @kernel_2} : (index, index, index, index, index, index, f32, memref<?xf32, 1>) -> ()
"gpu.launch_func"(%cst, %cst, %cst, %cst, %cst, %cst, %0, %1) { kernel = @kernel_2 }
: (index, index, index, index, index, index, f32, memref<?xf32, 1>) -> ()
return

View File

@ -10,7 +10,7 @@ func @launch() {
%bDimY = constant 24 : index
%bDimZ = constant 28 : index
// CHECK: "gpu.launch_func"(%c8, %c12, %c16, %c20, %c24, %c28, %0, %1) {kernel: @launch_kernel} : (index, index, index, index, index, index, f32, memref<?xf32, 1>) -> ()
// CHECK: "gpu.launch_func"(%c8, %c12, %c16, %c20, %c24, %c28, %0, %1) {kernel = @launch_kernel} : (index, index, index, index, index, index, f32, memref<?xf32, 1>) -> ()
// CHECK-NOT: gpu.launch blocks
gpu.launch blocks(%bx, %by, %bz) in (%grid_x = %gDimX, %grid_y = %gDimY,
%grid_z = %gDimZ)
@ -27,18 +27,18 @@ func @launch() {
// CHECK: func @launch_kernel(%arg0: f32, %arg1: memref<?xf32, 1>)
// CHECK-NEXT: attributes {gpu.kernel}
// CHECK-NEXT: %0 = "gpu.block_id"() {dimension: "x"} : () -> index
// CHECK-NEXT: %1 = "gpu.block_id"() {dimension: "y"} : () -> index
// CHECK-NEXT: %2 = "gpu.block_id"() {dimension: "z"} : () -> index
// CHECK-NEXT: %3 = "gpu.thread_id"() {dimension: "x"} : () -> index
// CHECK-NEXT: %4 = "gpu.thread_id"() {dimension: "y"} : () -> index
// CHECK-NEXT: %5 = "gpu.thread_id"() {dimension: "z"} : () -> index
// CHECK-NEXT: %6 = "gpu.grid_dim"() {dimension: "x"} : () -> index
// CHECK-NEXT: %7 = "gpu.grid_dim"() {dimension: "y"} : () -> index
// CHECK-NEXT: %8 = "gpu.grid_dim"() {dimension: "z"} : () -> index
// CHECK-NEXT: %9 = "gpu.block_dim"() {dimension: "x"} : () -> index
// CHECK-NEXT: %10 = "gpu.block_dim"() {dimension: "y"} : () -> index
// CHECK-NEXT: %11 = "gpu.block_dim"() {dimension: "z"} : () -> index
// CHECK-NEXT: %0 = "gpu.block_id"() {dimension = "x"} : () -> index
// CHECK-NEXT: %1 = "gpu.block_id"() {dimension = "y"} : () -> index
// CHECK-NEXT: %2 = "gpu.block_id"() {dimension = "z"} : () -> index
// CHECK-NEXT: %3 = "gpu.thread_id"() {dimension = "x"} : () -> index
// CHECK-NEXT: %4 = "gpu.thread_id"() {dimension = "y"} : () -> index
// CHECK-NEXT: %5 = "gpu.thread_id"() {dimension = "z"} : () -> index
// CHECK-NEXT: %6 = "gpu.grid_dim"() {dimension = "x"} : () -> index
// CHECK-NEXT: %7 = "gpu.grid_dim"() {dimension = "y"} : () -> index
// CHECK-NEXT: %8 = "gpu.grid_dim"() {dimension = "z"} : () -> index
// CHECK-NEXT: %9 = "gpu.block_dim"() {dimension = "x"} : () -> index
// CHECK-NEXT: %10 = "gpu.block_dim"() {dimension = "y"} : () -> index
// CHECK-NEXT: %11 = "gpu.block_dim"() {dimension = "z"} : () -> index
// CHECK-NEXT: "use"(%arg0) : (f32) -> ()
// CHECK-NEXT: "some_op"(%0, %9) : (index, index) -> ()
// CHECK-NEXT: %12 = load %arg1[%3] : memref<?xf32, 1>
@ -47,14 +47,14 @@ func @launch() {
func @multiple_launches() {
%cst = constant 8 : index
// CHECK: "gpu.launch_func"(%c8, %c8, %c8, %c8, %c8, %c8) {kernel: @multiple_launches_kernel} : (index, index, index, index, index, index) -> ()
// CHECK: "gpu.launch_func"(%c8, %c8, %c8, %c8, %c8, %c8) {kernel = @multiple_launches_kernel} : (index, index, index, index, index, index) -> ()
gpu.launch blocks(%bx, %by, %bz) in (%grid_x = %cst, %grid_y = %cst,
%grid_z = %cst)
threads(%tx, %ty, %tz) in (%block_x = %cst, %block_y = %cst,
%block_z = %cst) {
gpu.return
}
// CHECK: "gpu.launch_func"(%c8, %c8, %c8, %c8, %c8, %c8) {kernel: @multiple_launches_kernel_0} : (index, index, index, index, index, index) -> ()
// CHECK: "gpu.launch_func"(%c8, %c8, %c8, %c8, %c8, %c8) {kernel = @multiple_launches_kernel_0} : (index, index, index, index, index, index) -> ()
gpu.launch blocks(%bx2, %by2, %bz2) in (%grid_x2 = %cst, %grid_y2 = %cst,
%grid_z2 = %cst)
threads(%tx2, %ty2, %tz2) in (%block_x2 = %cst, %block_y2 = %cst,

View File

@ -6,7 +6,7 @@
func @correct_type_array_attr_pass() {
// CHECK: test.type_array_attr
"test.type_array_attr"() {attr: [i32, f32]} : () -> ()
"test.type_array_attr"() {attr = [i32, f32]} : () -> ()
return
}
@ -14,6 +14,6 @@ func @correct_type_array_attr_pass() {
func @non_type_in_type_array_attr_fail() {
// expected-error @+1 {{'attr' failed to satisfy constraint: type array attribute}}
"test.type_array_attr"() {attr: [i32, 5: i64]} : () -> ()
"test.type_array_attr"() {attr = [i32, 5 : i64]} : () -> ()
return
}

View File

@ -18,7 +18,7 @@ func @func_with_ops(f32) {
%t = "getTensor"() : () -> tensor<4x4x?xf32>
// CHECK: %1 = dim %0, 2 : tensor<4x4x?xf32>
%t2 = "std.dim"(%t){index: 2} : (tensor<4x4x?xf32>) -> index
%t2 = "std.dim"(%t){index = 2} : (tensor<4x4x?xf32>) -> index
// CHECK: %2 = addf %arg0, %arg0 : f32
%x = "std.addf"(%a, %a) : (f32,f32) -> (f32)
@ -31,7 +31,7 @@ func @func_with_ops(f32) {
func @standard_instrs(tensor<4x4x?xf32>, f32, i32, index) {
^bb42(%t: tensor<4x4x?xf32>, %f: f32, %i: i32, %idx : index):
// CHECK: %0 = dim %arg0, 2 : tensor<4x4x?xf32>
%a = "std.dim"(%t){index: 2} : (tensor<4x4x?xf32>) -> index
%a = "std.dim"(%t){index = 2} : (tensor<4x4x?xf32>) -> index
// CHECK: %1 = dim %arg0, 2 : tensor<4x4x?xf32>
%a2 = dim %t, 2 : tensor<4x4x?xf32>
@ -73,13 +73,13 @@ func @standard_instrs(tensor<4x4x?xf32>, f32, i32, index) {
%i6 = muli %i2, %i2 : i32
// CHECK: %c42_i32 = constant 42 : i32
%x = "std.constant"(){value: 42 : i32} : () -> i32
%x = "std.constant"(){value = 42 : i32} : () -> i32
// CHECK: %c42_i32_0 = constant 42 : i32
%7 = constant 42 : i32
// CHECK: %c43 = constant {crazy: "std.foo"} 43 : index
%8 = constant {crazy: "std.foo"} 43: index
// CHECK: %c43 = constant {crazy = "std.foo"} 43 : index
%8 = constant {crazy = "std.foo"} 43: index
// CHECK: %cst = constant 4.300000e+01 : bf16
%9 = constant 43.0 : bf16
@ -107,13 +107,13 @@ func @standard_instrs(tensor<4x4x?xf32>, f32, i32, index) {
// Predicate 1 means inequality comparison.
// CHECK: %{{[0-9]+}} = cmpi "ne", %{{[0-9]+}}, %{{[0-9]+}} : i32
%15 = "std.cmpi"(%i3, %i4) {predicate: 1} : (i32, i32) -> i1
%15 = "std.cmpi"(%i3, %i4) {predicate = 1} : (i32, i32) -> i1
// CHECK: %{{[0-9]+}} = cmpi "slt", %cst_3, %cst_3 : vector<4xi32>
%16 = cmpi "slt", %13, %13 : vector<4 x i32>
// CHECK: %{{[0-9]+}} = cmpi "ne", %cst_3, %cst_3 : vector<4xi32>
%17 = "std.cmpi"(%13, %13) {predicate: 1} : (vector<4 x i32>, vector<4 x i32>) -> vector<4 x i1>
%17 = "std.cmpi"(%13, %13) {predicate = 1} : (vector<4 x i32>, vector<4 x i32>) -> vector<4 x i1>
// CHECK: %{{[0-9]+}} = cmpi "slt", %arg3, %arg3 : index
%18 = cmpi "slt", %idx, %idx : index
@ -262,13 +262,13 @@ func @standard_instrs(tensor<4x4x?xf32>, f32, i32, index) {
// Predicate 0 means ordered equality comparison.
// CHECK: %{{[0-9]+}} = cmpf "oeq", %{{[0-9]+}}, %{{[0-9]+}} : f32
%66 = "std.cmpf"(%f3, %f4) {predicate: 1} : (f32, f32) -> i1
%66 = "std.cmpf"(%f3, %f4) {predicate = 1} : (f32, f32) -> i1
// CHECK: %{{[0-9]+}} = cmpf "olt", %cst_8, %cst_8 : vector<4xf32>
%67 = cmpf "olt", %vcf32, %vcf32 : vector<4 x f32>
// CHECK: %{{[0-9]+}} = cmpf "oeq", %cst_8, %cst_8 : vector<4xf32>
%68 = "std.cmpf"(%vcf32, %vcf32) {predicate: 1} : (vector<4 x f32>, vector<4 x f32>) -> vector<4 x i1>
%68 = "std.cmpf"(%vcf32, %vcf32) {predicate = 1} : (vector<4 x f32>, vector<4 x f32>) -> vector<4 x i1>
// CHECK: %{{[0-9]+}} = cmpf "oeq", %cst_7, %cst_7 : tensor<42xf32>
%69 = cmpf "oeq", %tcf32, %tcf32 : tensor<42 x f32>
@ -296,11 +296,11 @@ func @standard_instrs(tensor<4x4x?xf32>, f32, i32, index) {
// CHECK-LABEL: func @affine_apply() {
func @affine_apply() {
%i = "std.constant"() {value: 0: index} : () -> index
%j = "std.constant"() {value: 1: index} : () -> index
%i = "std.constant"() {value = 0: index} : () -> index
%j = "std.constant"() {value = 1: index} : () -> index
// CHECK: affine.apply #map0(%c0)
%a = "affine.apply" (%i) { map: (d0) -> (d0 + 1) } :
%a = "affine.apply" (%i) { map = (d0) -> (d0 + 1) } :
(index) -> (index)
// CHECK: affine.apply #map1()[%c0]
@ -334,7 +334,7 @@ func @calls(%arg0: i32) {
// CHECK: %1 = call @return_op(%0) : (i32) -> i32
%y = call @return_op(%x) : (i32) -> i32
// CHECK: %2 = call @return_op(%0) : (i32) -> i32
%z = "std.call"(%x) {callee: @return_op} : (i32) -> i32
%z = "std.call"(%x) {callee = @return_op} : (i32) -> i32
// CHECK: %f = constant @affine_apply : () -> ()
%f = constant @affine_apply : () -> ()
@ -356,7 +356,7 @@ func @calls(%arg0: i32) {
// CHECK-LABEL: func @extract_element(%arg0: tensor<*xi32>, %arg1: tensor<4x4xf32>) -> i32 {
func @extract_element(%arg0: tensor<*xi32>, %arg1 : tensor<4x4xf32>) -> i32 {
%c0 = "std.constant"() {value: 0: index} : () -> index
%c0 = "std.constant"() {value = 0: index} : () -> index
// CHECK: %0 = extract_element %arg0[%c0, %c0, %c0, %c0] : tensor<*xi32>
%0 = extract_element %arg0[%c0, %c0, %c0, %c0] : tensor<*xi32>
@ -408,18 +408,18 @@ func @test_dimop(%arg0: tensor<4x4x?xf32>) {
func @test_vector.transfer_ops(%arg0: memref<?x?xf32>) {
%c3 = constant 3 : index
%cst = constant 3.0 : f32
// CHECK: %0 = vector.transfer_read %arg0[%c3, %c3] {permutation_map: #[[map_proj_d0d1_d0]]} : memref<?x?xf32>, vector<128xf32>
%0 = vector.transfer_read %arg0[%c3, %c3] {permutation_map: (d0, d1)->(d0)} : memref<?x?xf32>, vector<128xf32>
// CHECK: %1 = vector.transfer_read %arg0[%c3, %c3] {permutation_map: #[[map_proj_d0d1_d1d0]]} : memref<?x?xf32>, vector<3x7xf32>
%1 = vector.transfer_read %arg0[%c3, %c3] {permutation_map: (d0, d1)->(d1, d0)} : memref<?x?xf32>, vector<3x7xf32>
// CHECK: %2 = vector.transfer_read %arg0[%c3, %c3], (%cst) {permutation_map: #[[map_proj_d0d1_d0]]} : memref<?x?xf32>, vector<128xf32>
%2 = vector.transfer_read %arg0[%c3, %c3], (%cst) {permutation_map: (d0, d1)->(d0)} : memref<?x?xf32>, vector<128xf32>
// CHECK: %3 = vector.transfer_read %arg0[%c3, %c3], (%cst) {permutation_map: #[[map_proj_d0d1_d1]]} : memref<?x?xf32>, vector<128xf32>
%3 = vector.transfer_read %arg0[%c3, %c3], (%cst) {permutation_map: (d0, d1)->(d1)} : memref<?x?xf32>, vector<128xf32>
// CHECK: %0 = vector.transfer_read %arg0[%c3, %c3] {permutation_map = #[[map_proj_d0d1_d0]]} : memref<?x?xf32>, vector<128xf32>
%0 = vector.transfer_read %arg0[%c3, %c3] {permutation_map = (d0, d1)->(d0)} : memref<?x?xf32>, vector<128xf32>
// CHECK: %1 = vector.transfer_read %arg0[%c3, %c3] {permutation_map = #[[map_proj_d0d1_d1d0]]} : memref<?x?xf32>, vector<3x7xf32>
%1 = vector.transfer_read %arg0[%c3, %c3] {permutation_map = (d0, d1)->(d1, d0)} : memref<?x?xf32>, vector<3x7xf32>
// CHECK: %2 = vector.transfer_read %arg0[%c3, %c3], (%cst) {permutation_map = #[[map_proj_d0d1_d0]]} : memref<?x?xf32>, vector<128xf32>
%2 = vector.transfer_read %arg0[%c3, %c3], (%cst) {permutation_map = (d0, d1)->(d0)} : memref<?x?xf32>, vector<128xf32>
// CHECK: %3 = vector.transfer_read %arg0[%c3, %c3], (%cst) {permutation_map = #[[map_proj_d0d1_d1]]} : memref<?x?xf32>, vector<128xf32>
%3 = vector.transfer_read %arg0[%c3, %c3], (%cst) {permutation_map = (d0, d1)->(d1)} : memref<?x?xf32>, vector<128xf32>
//
// CHECK: vector.transfer_write %0, %arg0[%c3, %c3] {permutation_map: #[[map_proj_d0d1_d0]]} : vector<128xf32>, memref<?x?xf32>
vector.transfer_write %0, %arg0[%c3, %c3] {permutation_map: (d0, d1)->(d0)} : vector<128xf32>, memref<?x?xf32>
// CHECK: vector.transfer_write %1, %arg0[%c3, %c3] {permutation_map: #[[map_proj_d0d1_d1d0]]} : vector<3x7xf32>, memref<?x?xf32>
vector.transfer_write %1, %arg0[%c3, %c3] {permutation_map: (d0, d1)->(d1, d0)} : vector<3x7xf32>, memref<?x?xf32>
// CHECK: vector.transfer_write %0, %arg0[%c3, %c3] {permutation_map = #[[map_proj_d0d1_d0]]} : vector<128xf32>, memref<?x?xf32>
vector.transfer_write %0, %arg0[%c3, %c3] {permutation_map = (d0, d1)->(d0)} : vector<128xf32>, memref<?x?xf32>
// CHECK: vector.transfer_write %1, %arg0[%c3, %c3] {permutation_map = #[[map_proj_d0d1_d1d0]]} : vector<3x7xf32>, memref<?x?xf32>
vector.transfer_write %1, %arg0[%c3, %c3] {permutation_map = (d0, d1)->(d1, d0)} : vector<3x7xf32>, memref<?x?xf32>
return
}

View File

@ -23,19 +23,19 @@ func @complex_func() {
// CHECK-LABEL: func @func_attributes
func @func_attributes() {
// CHECK-NEXT: func @foo()
// CHECK-NEXT: attributes {foo: true}
func @foo() attributes {foo: true}
// CHECK-NEXT: attributes {foo = true}
func @foo() attributes {foo = true}
return
}
// CHECK-LABEL: func @func_arg_attributes
func @func_arg_attributes() {
// CHECK-NEXT: func @external_func_arg_attrs(i32, i1 {dialect.attr: 10 : i64}, i32)
func @external_func_arg_attrs(i32, i1 {dialect.attr: 10 : i64}, i32)
// CHECK-NEXT: func @external_func_arg_attrs(i32, i1 {dialect.attr = 10 : i64}, i32)
func @external_func_arg_attrs(i32, i1 {dialect.attr = 10 : i64}, i32)
// CHECK: func @func_arg_attrs(%i0: i1 {dialect.attr: 10 : i64})
func @func_arg_attrs(%i0: i1 {dialect.attr: 10 : i64}) {
// CHECK: func @func_arg_attrs(%i0: i1 {dialect.attr = 10 : i64})
func @func_arg_attrs(%i0: i1 {dialect.attr = 10 : i64}) {
return
}

View File

@ -2,7 +2,7 @@
func @dim(tensor<1xf32>) {
^bb(%0: tensor<1xf32>):
"std.dim"(%0){index: "xyz"} : (tensor<1xf32>)->index // expected-error {{attribute 'index' failed to satisfy constraint: arbitrary integer attribute}}
"std.dim"(%0){index = "xyz"} : (tensor<1xf32>)->index // expected-error {{attribute 'index' failed to satisfy constraint: arbitrary integer attribute}}
return
}
@ -10,7 +10,7 @@ func @dim(tensor<1xf32>) {
func @dim2(tensor<1xf32>) {
^bb(%0: tensor<1xf32>):
"std.dim"(){index: "xyz"} : ()->index // expected-error {{'std.dim' op requires a single operand}}
"std.dim"(){index = "xyz"} : ()->index // expected-error {{'std.dim' op requires a single operand}}
return
}
@ -18,7 +18,7 @@ func @dim2(tensor<1xf32>) {
func @dim3(tensor<1xf32>) {
^bb(%0: tensor<1xf32>):
"std.dim"(%0){index: 1} : (tensor<1xf32>)->index // expected-error {{'std.dim' op index is out of range}}
"std.dim"(%0){index = 1} : (tensor<1xf32>)->index // expected-error {{'std.dim' op index is out of range}}
return
}
@ -34,7 +34,7 @@ func @rank(f32) {
func @constant() {
^bb:
%x = "std.constant"(){value: "xyz"} : () -> i32 // expected-error {{requires a result type that aligns with the 'value' attribute}}
%x = "std.constant"(){value = "xyz"} : () -> i32 // expected-error {{requires a result type that aligns with the 'value' attribute}}
return
}
@ -42,7 +42,7 @@ func @constant() {
func @constant_out_of_range() {
^bb:
%x = "std.constant"(){value: 100} : () -> i1 // expected-error {{requires attribute's type ('i64') to match op's return type ('i1')}}
%x = "std.constant"(){value = 100} : () -> i1 // expected-error {{requires attribute's type ('i64') to match op's return type ('i1')}}
return
}
@ -50,7 +50,7 @@ func @constant_out_of_range() {
func @constant_wrong_type() {
^bb:
%x = "std.constant"(){value: 10.} : () -> f32 // expected-error {{requires attribute's type ('f64') to match op's return type ('f32')}}
%x = "std.constant"(){value = 10.} : () -> f32 // expected-error {{requires attribute's type ('f64') to match op's return type ('f32')}}
return
}
@ -67,7 +67,7 @@ func @affine_apply_no_map() {
func @affine_apply_wrong_operand_count() {
^bb0:
%i = constant 0 : index
%x = "affine.apply" (%i) {map: (d0, d1) -> ((d0 + 1), (d1 + 2))} : (index) -> (index) // expected-error {{'affine.apply' op operand count and affine map dimension and symbol count must match}}
%x = "affine.apply" (%i) {map = (d0, d1) -> ((d0 + 1), (d1 + 2))} : (index) -> (index) // expected-error {{'affine.apply' op operand count and affine map dimension and symbol count must match}}
return
}
@ -77,7 +77,7 @@ func @affine_apply_wrong_result_count() {
^bb0:
%i = constant 0 : index
%j = constant 1 : index
%x = "affine.apply" (%i, %j) {map: (d0, d1) -> ((d0 + 1), (d1 + 2))} : (index,index) -> (index) // expected-error {{'affine.apply' op mapping must produce one value}}
%x = "affine.apply" (%i, %j) {map = (d0, d1) -> ((d0 + 1), (d1 + 2))} : (index,index) -> (index) // expected-error {{'affine.apply' op mapping must produce one value}}
return
}
@ -85,7 +85,7 @@ func @affine_apply_wrong_result_count() {
func @unknown_custom_op() {
^bb0:
%i = crazyThing() {value: 0} : () -> index // expected-error {{custom op 'crazyThing' is unknown}}
%i = crazyThing() {value = 0} : () -> index // expected-error {{custom op 'crazyThing' is unknown}}
return
}
@ -149,8 +149,8 @@ func @test_alloc_memref_map_rank_mismatch() {
func @intlimit2() {
^bb:
%0 = "std.constant"() {value: 0} : () -> i4096
%1 = "std.constant"() {value: 1} : () -> i4097 // expected-error {{integer bitwidth is limited to 4096 bits}}
%0 = "std.constant"() {value = 0} : () -> i4096
%1 = "std.constant"() {value = 1} : () -> i4097 // expected-error {{integer bitwidth is limited to 4096 bits}}
return
}
@ -202,7 +202,7 @@ func @func_with_ops(i32) {
func @func_with_ops(i32) {
^bb0(%a : i32):
// expected-error@+1 {{'predicate' attribute value out of range}}
%r = "std.cmpi"(%a, %a) {predicate: 42} : (i32, i32) -> i1
%r = "std.cmpi"(%a, %a) {predicate = 42} : (i32, i32) -> i1
}
// -----
@ -234,7 +234,7 @@ func @func_with_ops(f32, f32) {
// Result type must be boolean like.
func @func_with_ops(i32, i32) {
^bb0(%a : i32, %b : i32):
%r = "std.cmpi"(%a, %b) {predicate: 0} : (i32, i32) -> i32 // expected-error {{op result #0 must be bool-like}}
%r = "std.cmpi"(%a, %b) {predicate = 0} : (i32, i32) -> i32 // expected-error {{op result #0 must be bool-like}}
}
// -----
@ -242,7 +242,7 @@ func @func_with_ops(i32, i32) {
func @func_with_ops(i32, i32) {
^bb0(%a : i32, %b : i32):
// expected-error@+1 {{requires an integer attribute named 'predicate'}}
%r = "std.cmpi"(%a, %b) {foo: 1} : (i32, i32) -> i1
%r = "std.cmpi"(%a, %b) {foo = 1} : (i32, i32) -> i1
}
// -----
@ -251,7 +251,7 @@ func @func_with_ops() {
^bb0:
%c = constant dense<0> : vector<42 x i32>
// expected-error@+1 {{op requires the same shape for all operands and results}}
%r = "std.cmpi"(%c, %c) {predicate: 0} : (vector<42 x i32>, vector<42 x i32>) -> vector<41 x i1>
%r = "std.cmpi"(%c, %c) {predicate = 0} : (vector<42 x i32>, vector<42 x i32>) -> vector<41 x i1>
}
// -----
@ -340,7 +340,7 @@ func @test_vector.transfer_read(memref<?x?xf32>) {
%c3 = constant 3 : index
%cst = constant 3.0 : f32
// expected-error@+1 {{requires an AffineMapAttr named 'permutation_map'}}
%0 = vector.transfer_read %arg0[%c3, %c3] {perm: (d0)->(d0)} : memref<?x?xf32>, vector<128xf32>
%0 = vector.transfer_read %arg0[%c3, %c3] {perm = (d0)->(d0)} : memref<?x?xf32>, vector<128xf32>
}
// -----
@ -350,7 +350,7 @@ func @test_vector.transfer_read(memref<?x?xf32>) {
%c3 = constant 3 : index
%cst = constant 3.0 : f32
// expected-error@+1 {{requires a permutation_map with input dims of the same rank as the memref type}}
%0 = vector.transfer_read %arg0[%c3, %c3] {permutation_map: (d0)->(d0)} : memref<?x?xf32>, vector<128xf32>
%0 = vector.transfer_read %arg0[%c3, %c3] {permutation_map = (d0)->(d0)} : memref<?x?xf32>, vector<128xf32>
}
// -----
@ -360,7 +360,7 @@ func @test_vector.transfer_read(memref<?x?xf32>) {
%c3 = constant 3 : index
%cst = constant 3.0 : f32
// expected-error@+1 {{requires a permutation_map with result dims of the same rank as the vector type}}
%0 = vector.transfer_read %arg0[%c3, %c3] {permutation_map: (d0, d1)->(d0, d1)} : memref<?x?xf32>, vector<128xf32>
%0 = vector.transfer_read %arg0[%c3, %c3] {permutation_map = (d0, d1)->(d0, d1)} : memref<?x?xf32>, vector<128xf32>
}
// -----
@ -370,7 +370,7 @@ func @test_vector.transfer_read(memref<?x?xf32>) {
%c3 = constant 3 : index
%cst = constant 3.0 : f32
// expected-error@+1 {{requires a projected permutation_map (at most one dim or the zero constant can appear in each result)}}
%0 = vector.transfer_read %arg0[%c3, %c3] {permutation_map: (d0, d1)->(d0 + d1)} : memref<?x?xf32>, vector<128xf32>
%0 = vector.transfer_read %arg0[%c3, %c3] {permutation_map = (d0, d1)->(d0 + d1)} : memref<?x?xf32>, vector<128xf32>
}
// -----
@ -380,7 +380,7 @@ func @test_vector.transfer_read(memref<?x?xf32>) {
%c3 = constant 3 : index
%cst = constant 3.0 : f32
// expected-error@+1 {{requires a projected permutation_map (at most one dim or the zero constant can appear in each result)}}
%0 = vector.transfer_read %arg0[%c3, %c3] {permutation_map: (d0, d1)->(d0 + 1)} : memref<?x?xf32>, vector<128xf32>
%0 = vector.transfer_read %arg0[%c3, %c3] {permutation_map = (d0, d1)->(d0 + 1)} : memref<?x?xf32>, vector<128xf32>
}
// -----
@ -390,7 +390,7 @@ func @test_vector.transfer_read(memref<?x?x?xf32>) {
%c3 = constant 3 : index
%cst = constant 3.0 : f32
// expected-error@+1 {{requires a permutation_map that is a permutation (found one dim used more than once)}}
%0 = vector.transfer_read %arg0[%c3, %c3, %c3] {permutation_map: (d0, d1, d2)->(d0, d0)} : memref<?x?x?xf32>, vector<3x7xf32>
%0 = vector.transfer_read %arg0[%c3, %c3, %c3] {permutation_map = (d0, d1, d2)->(d0, d0)} : memref<?x?x?xf32>, vector<3x7xf32>
}
// -----
@ -430,7 +430,7 @@ func @test_vector.transfer_write(memref<?x?xf32>) {
%c3 = constant 3 : index
%cst = constant dense<3.0> : vector<128 x f32>
// expected-error@+1 {{requires an AffineMapAttr named 'permutation_map'}}
vector.transfer_write %cst, %arg0[%c3, %c3] {perm: (d0)->(d0)} : vector<128xf32>, memref<?x?xf32>
vector.transfer_write %cst, %arg0[%c3, %c3] {perm = (d0)->(d0)} : vector<128xf32>, memref<?x?xf32>
}
// -----
@ -440,7 +440,7 @@ func @test_vector.transfer_write(memref<?x?xf32>) {
%c3 = constant 3 : index
%cst = constant dense<3.0> : vector<128 x f32>
// expected-error@+1 {{requires a permutation_map with input dims of the same rank as the memref type}}
vector.transfer_write %cst, %arg0[%c3, %c3] {permutation_map: (d0)->(d0)} : vector<128xf32>, memref<?x?xf32>
vector.transfer_write %cst, %arg0[%c3, %c3] {permutation_map = (d0)->(d0)} : vector<128xf32>, memref<?x?xf32>
}
// -----
@ -450,7 +450,7 @@ func @test_vector.transfer_write(memref<?x?xf32>) {
%c3 = constant 3 : index
%cst = constant dense<3.0> : vector<128 x f32>
// expected-error@+1 {{requires a permutation_map with result dims of the same rank as the vector type}}
vector.transfer_write %cst, %arg0[%c3, %c3] {permutation_map: (d0, d1)->(d0, d1)} : vector<128xf32>, memref<?x?xf32>
vector.transfer_write %cst, %arg0[%c3, %c3] {permutation_map = (d0, d1)->(d0, d1)} : vector<128xf32>, memref<?x?xf32>
}
// -----
@ -460,7 +460,7 @@ func @test_vector.transfer_write(memref<?x?xf32>) {
%c3 = constant 3 : index
%cst = constant dense<3.0> : vector<128 x f32>
// expected-error@+1 {{requires a projected permutation_map (at most one dim or the zero constant can appear in each result)}}
vector.transfer_write %cst, %arg0[%c3, %c3] {permutation_map: (d0, d1)->(d0 + d1)} : vector<128xf32>, memref<?x?xf32>
vector.transfer_write %cst, %arg0[%c3, %c3] {permutation_map = (d0, d1)->(d0 + d1)} : vector<128xf32>, memref<?x?xf32>
}
// -----
@ -470,7 +470,7 @@ func @test_vector.transfer_write(memref<?x?xf32>) {
%c3 = constant 3 : index
%cst = constant dense<3.0> : vector<128 x f32>
// expected-error@+1 {{requires a projected permutation_map (at most one dim or the zero constant can appear in each result)}}
vector.transfer_write %cst, %arg0[%c3, %c3] {permutation_map: (d0, d1)->(d0 + 1)} : vector<128xf32>, memref<?x?xf32>
vector.transfer_write %cst, %arg0[%c3, %c3] {permutation_map = (d0, d1)->(d0 + 1)} : vector<128xf32>, memref<?x?xf32>
}
// -----
@ -479,7 +479,7 @@ func @test_vector.transfer_write(memref<?x?x?xf32>) {
%c3 = constant 3 : index
%cst = constant dense<3.0> : vector<3 x 7 x f32>
// expected-error@+1 {{requires a permutation_map that is a permutation (found one dim used more than once)}}
vector.transfer_write %cst, %arg0[%c3, %c3, %c3] {permutation_map: (d0, d1, d2)->(d0, d0)} : vector<3x7xf32>, memref<?x?x?xf32>
vector.transfer_write %cst, %arg0[%c3, %c3, %c3] {permutation_map = (d0, d1, d2)->(d0, d0)} : vector<3x7xf32>, memref<?x?x?xf32>
}
// -----
@ -534,7 +534,7 @@ func @invalid_cmp_attr(%idx : i32) {
func @cmpf_generic_invalid_predicate_value(%a : f32) {
// expected-error@+1 {{'predicate' attribute value out of range}}
%r = "std.cmpf"(%a, %a) {predicate: 42} : (f32, f32) -> i1
%r = "std.cmpf"(%a, %a) {predicate = 42} : (f32, f32) -> i1
}
// -----
@ -568,7 +568,7 @@ func @cmpf_canonical_no_predicate_attr(%a : f32, %b : f32) {
func @cmpf_generic_no_predicate_attr(%a : f32, %b : f32) {
// expected-error@+1 {{requires an integer attribute named 'predicate'}}
%r = "std.cmpf"(%a, %b) {foo: 1} : (f32, f32) -> i1
%r = "std.cmpf"(%a, %b) {foo = 1} : (f32, f32) -> i1
}
// -----
@ -581,7 +581,7 @@ func @cmpf_wrong_type(%a : i32, %b : i32) {
func @cmpf_generic_wrong_result_type(%a : f32, %b : f32) {
// expected-error@+1 {{result #0 must be bool-like}}
%r = "std.cmpf"(%a, %b) {predicate: 0} : (f32, f32) -> f32
%r = "std.cmpf"(%a, %b) {predicate = 0} : (f32, f32) -> f32
}
// -----
@ -596,21 +596,21 @@ func @cmpf_canonical_wrong_result_type(%a : f32, %b : f32) -> f32 {
func @cmpf_result_shape_mismatch(%a : vector<42xf32>) {
// expected-error@+1 {{op requires the same shape for all operands and results}}
%r = "std.cmpf"(%a, %a) {predicate: 0} : (vector<42 x f32>, vector<42 x f32>) -> vector<41 x i1>
%r = "std.cmpf"(%a, %a) {predicate = 0} : (vector<42 x f32>, vector<42 x f32>) -> vector<41 x i1>
}
// -----
func @cmpf_operand_shape_mismatch(%a : vector<42xf32>, %b : vector<41xf32>) {
// expected-error@+1 {{op requires all operands to have the same type}}
%r = "std.cmpf"(%a, %b) {predicate: 0} : (vector<42 x f32>, vector<41 x f32>) -> vector<42 x i1>
%r = "std.cmpf"(%a, %b) {predicate = 0} : (vector<42 x f32>, vector<41 x f32>) -> vector<42 x i1>
}
// -----
func @cmpf_generic_operand_type_mismatch(%a : f32, %b : f64) {
// expected-error@+1 {{op requires all operands to have the same type}}
%r = "std.cmpf"(%a, %b) {predicate: 0} : (f32, f64) -> i1
%r = "std.cmpf"(%a, %b) {predicate = 0} : (f32, f64) -> i1
}
// -----

View File

@ -295,8 +295,8 @@ func @test() {
func @redef() {
^bb42:
%x = "xxx"(){index: 0} : ()->i32 // expected-note {{previously defined here}}
%x = "xxx"(){index: 0} : ()->i32 // expected-error {{redefinition of SSA value '%x'}}
%x = "xxx"(){index = 0} : ()->i32 // expected-note {{previously defined here}}
%x = "xxx"(){index = 0} : ()->i32 // expected-error {{redefinition of SSA value '%x'}}
return
}
@ -585,35 +585,35 @@ func@n(){^b(
func @elementsattr_non_tensor_type() -> () {
^bb0:
"foo"(){bar: dense<[4]> : i32} : () -> () // expected-error {{elements literal must be a ranked tensor or vector type}}
"foo"(){bar = dense<[4]> : i32} : () -> () // expected-error {{elements literal must be a ranked tensor or vector type}}
}
// -----
func @elementsattr_non_ranked() -> () {
^bb0:
"foo"(){bar: dense<[4]> : tensor<?xi32>} : () -> () // expected-error {{elements literal type must have static shape}}
"foo"(){bar = dense<[4]> : tensor<?xi32>} : () -> () // expected-error {{elements literal type must have static shape}}
}
// -----
func @elementsattr_shape_mismatch() -> () {
^bb0:
"foo"(){bar: dense<[4]> : tensor<5xi32>} : () -> () // expected-error {{inferred shape of elements literal ([1]) does not match type ([5])}}
"foo"(){bar = dense<[4]> : tensor<5xi32>} : () -> () // expected-error {{inferred shape of elements literal ([1]) does not match type ([5])}}
}
// -----
func @elementsattr_invalid() -> () {
^bb0:
"foo"(){bar: dense<[4, [5]]> : tensor<2xi32>} : () -> () // expected-error {{tensor literal is invalid; ranks are not consistent between elements}}
"foo"(){bar = dense<[4, [5]]> : tensor<2xi32>} : () -> () // expected-error {{tensor literal is invalid; ranks are not consistent between elements}}
}
// -----
func @elementsattr_badtoken() -> () {
^bb0:
"foo"(){bar: dense<[tf_opaque]> : tensor<1xi32>} : () -> () // expected-error {{expected element literal of primitive type}}
"foo"(){bar = dense<[tf_opaque]> : tensor<1xi32>} : () -> () // expected-error {{expected element literal of primitive type}}
}
// -----
@ -621,7 +621,7 @@ func @elementsattr_badtoken() -> () {
func @elementsattr_floattype1() -> () {
^bb0:
// expected-error@+1 {{expected integer elements, but parsed floating-point}}
"foo"(){bar: dense<[4.0]> : tensor<1xi32>} : () -> ()
"foo"(){bar = dense<[4.0]> : tensor<1xi32>} : () -> ()
}
// -----
@ -629,7 +629,7 @@ func @elementsattr_floattype1() -> () {
func @elementsattr_floattype1() -> () {
^bb0:
// expected-error@+1 {{expected integer elements, but parsed floating-point}}
"foo"(){bar: dense<4.0> : tensor<i32>} : () -> ()
"foo"(){bar = dense<4.0> : tensor<i32>} : () -> ()
}
// -----
@ -637,49 +637,49 @@ func @elementsattr_floattype1() -> () {
func @elementsattr_floattype2() -> () {
^bb0:
// expected-error@+1 {{expected floating-point elements, but parsed integer}}
"foo"(){bar: dense<[4]> : tensor<1xf32>} : () -> ()
"foo"(){bar = dense<[4]> : tensor<1xf32>} : () -> ()
}
// -----
func @elementsattr_toolarge1() -> () {
^bb0:
"foo"(){bar: dense<[777]> : tensor<1xi8>} : () -> () // expected-error {{integer constant out of range}}
"foo"(){bar = dense<[777]> : tensor<1xi8>} : () -> () // expected-error {{integer constant out of range}}
}
// -----
func @elementsattr_toolarge2() -> () {
^bb0:
"foo"(){bar: dense<[-777]> : tensor<1xi8>} : () -> () // expected-error {{integer constant out of range}}
"foo"(){bar = dense<[-777]> : tensor<1xi8>} : () -> () // expected-error {{integer constant out of range}}
}
// -----
func @elementsattr_malformed_opaque() -> () {
^bb0:
"foo"(){bar: opaque<10, "0xQZz123"> : tensor<1xi8>} : () -> () // expected-error {{expected dialect namespace}}
"foo"(){bar = opaque<10, "0xQZz123"> : tensor<1xi8>} : () -> () // expected-error {{expected dialect namespace}}
}
// -----
func @elementsattr_malformed_opaque1() -> () {
^bb0:
"foo"(){bar: opaque<"", "0xQZz123"> : tensor<1xi8>} : () -> () // expected-error {{opaque string only contains hex digits}}
"foo"(){bar = opaque<"", "0xQZz123"> : tensor<1xi8>} : () -> () // expected-error {{opaque string only contains hex digits}}
}
// -----
func @elementsattr_malformed_opaque2() -> () {
^bb0:
"foo"(){bar: opaque<"", "00abc"> : tensor<1xi8>} : () -> () // expected-error {{opaque string should start with '0x'}}
"foo"(){bar = opaque<"", "00abc"> : tensor<1xi8>} : () -> () // expected-error {{opaque string should start with '0x'}}
}
// -----
func @elementsattr_malformed_opaque3() -> () {
^bb0:
"foo"(){bar: opaque<"t", "0xabc"> : tensor<1xi8>} : () -> () // expected-error {{no registered dialect with namespace 't'}}
"foo"(){bar = opaque<"t", "0xabc"> : tensor<1xi8>} : () -> () // expected-error {{no registered dialect with namespace 't'}}
}
// -----
@ -779,25 +779,25 @@ func @type_alias_unknown(!unknown_alias) -> () { // expected-error {{undefined s
func @complex_loops() {
affine.for %i1 = 1 to 100 {
// expected-error @+1 {{expected '"' in string literal}}
"opaqueIntTensor"(){bar: opaque<"", "0x686]> : tensor<2x1x4xi32>} : () -> ()
"opaqueIntTensor"(){bar = opaque<"", "0x686]> : tensor<2x1x4xi32>} : () -> ()
// -----
func @mi() {
// expected-error @+1 {{expected element literal of primitive type}}
"fooi64"(){bar: sparse<vector<1xi64>,[,[,1]
"fooi64"(){bar = sparse<vector<1xi64>,[,[,1]
// -----
func @invalid_tensor_literal() {
// expected-error @+1 {{expected 1-d tensor for values}}
"foof16"(){bar: sparse<[[0, 0, 0]], [[-2.0]]> : vector<1x1x1xf16>} : () -> ()
"foof16"(){bar = sparse<[[0, 0, 0]], [[-2.0]]> : vector<1x1x1xf16>} : () -> ()
// -----
func @invalid_tensor_literal() {
// expected-error @+1 {{expected element literal of primitive type}}
"fooi16"(){bar: sparse<[[1, 1, 0], [0, 1, 0], [0,, [[0, 0, 0]], [-2.0]> : tensor<2x2x2xi16>} : () -> ()
"fooi16"(){bar = sparse<[[1, 1, 0], [0, 1, 0], [0,, [[0, 0, 0]], [-2.0]> : tensor<2x2x2xi16>} : () -> ()
// -----
@ -894,7 +894,7 @@ func @$invalid_function_name()
// -----
// expected-error @+1 {{function arguments may only have dialect attributes}}
func @invalid_func_arg_attr(i1 {non_dialect_attr: 10})
func @invalid_func_arg_attr(i1 {non_dialect_attr = 10})
// -----

View File

@ -9,8 +9,8 @@ func @alloc() {
// CHECK: %0 = alloc() : memref<1024x64xf32, 1>
%0 = alloc() : memref<1024x64xf32, (d0, d1) -> (d0, d1), 1>
%c0 = "std.constant"() {value: 0: index} : () -> index
%c1 = "std.constant"() {value: 1: index} : () -> index
%c0 = "std.constant"() {value = 0: index} : () -> index
%c1 = "std.constant"() {value = 1: index} : () -> index
// Test alloc with dynamic dimensions.
// CHECK: %1 = alloc(%c0, %c1) : memref<?x?xf32, 1>

View File

@ -12,8 +12,8 @@ func @module_parsing() {
"module_terminator"() : () -> ()
}
// CHECK: module attributes {foo.attr: true} {
module attributes {foo.attr: true} {
// CHECK: module attributes {foo.attr = true} {
module attributes {foo.attr = true} {
}
return

View File

@ -348,42 +348,42 @@ func @attributes() {
// CHECK: "foo"()
"foo"(){} : ()->()
// CHECK: "foo"() {a: 1 : i64, b: -423 : i64, c: [true, false], d: 1.600000e+01 : f64} : () -> ()
"foo"() {a: 1, b: -423, c: [true, false], d: 16.0 } : () -> ()
// CHECK: "foo"() {a = 1 : i64, b = -423 : i64, c = [true, false], d = 1.600000e+01 : f64} : () -> ()
"foo"() {a = 1, b = -423, c = [true, false], d = 16.0 } : () -> ()
// CHECK: "foo"() {map1: #map{{[0-9]+}}}
"foo"() {map1: #map1} : () -> ()
// CHECK: "foo"() {map1 = #map{{[0-9]+}}}
"foo"() {map1 = #map1} : () -> ()
// CHECK: "foo"() {map2: #map{{[0-9]+}}}
"foo"() {map2: (d0, d1, d2) -> (d0, d1, d2)} : () -> ()
// CHECK: "foo"() {map2 = #map{{[0-9]+}}}
"foo"() {map2 = (d0, d1, d2) -> (d0, d1, d2)} : () -> ()
// CHECK: "foo"() {map12: [#map{{[0-9]+}}, #map{{[0-9]+}}]}
"foo"() {map12: [#map1, #map2]} : () -> ()
// CHECK: "foo"() {map12 = [#map{{[0-9]+}}, #map{{[0-9]+}}]}
"foo"() {map12 = [#map1, #map2]} : () -> ()
// CHECK: "foo"() {set1: #set{{[0-9]+}}}
"foo"() {set1: #set1} : () -> ()
// CHECK: "foo"() {set1 = #set{{[0-9]+}}}
"foo"() {set1 = #set1} : () -> ()
// CHECK: "foo"() {set2: #set{{[0-9]+}}}
"foo"() {set2: (d0, d1, d2) : (d0 >= 0, d1 >= 0, d2 - d1 == 0)} : () -> ()
// CHECK: "foo"() {set2 = #set{{[0-9]+}}}
"foo"() {set2 = (d0, d1, d2) : (d0 >= 0, d1 >= 0, d2 - d1 == 0)} : () -> ()
// CHECK: "foo"() {set12: [#set{{[0-9]+}}, #set{{[0-9]+}}]}
"foo"() {set12: [#set1, #set2]} : () -> ()
// CHECK: "foo"() {set12 = [#set{{[0-9]+}}, #set{{[0-9]+}}]}
"foo"() {set12 = [#set1, #set2]} : () -> ()
// CHECK: "foo"() {dictionary: {bool: true, fn: @ifinst}}
"foo"() {dictionary: {bool: true, fn: @ifinst}} : () -> ()
// CHECK: "foo"() {dictionary = {bool = true, fn = @ifinst}}
"foo"() {dictionary = {bool = true, fn = @ifinst}} : () -> ()
// Check that the dictionary attribute elements are sorted.
// CHECK: "foo"() {dictionary: {bar: false, bool: true, fn: @ifinst}}
"foo"() {dictionary: {fn: @ifinst, bar: false, bool: true}} : () -> ()
// CHECK: "foo"() {dictionary = {bar = false, bool = true, fn = @ifinst}}
"foo"() {dictionary = {fn = @ifinst, bar = false, bool = true}} : () -> ()
// CHECK: "foo"() {d: 1.000000e-09 : f64, func: [], i123: 7 : i64, if: "foo"} : () -> ()
"foo"() {if: "foo", func: [], i123: 7, d: 1.e-9} : () -> ()
// CHECK: "foo"() {d = 1.000000e-09 : f64, func = [], i123 = 7 : i64, if = "foo"} : () -> ()
"foo"() {if = "foo", func = [], i123 = 7, d = 1.e-9} : () -> ()
// CHECK: "foo"() {fn: @attributes, if: @ifinst} : () -> ()
"foo"() {fn: @attributes, if: @ifinst} : () -> ()
// CHECK: "foo"() {fn = @attributes, if = @ifinst} : () -> ()
"foo"() {fn = @attributes, if = @ifinst} : () -> ()
// CHECK: "foo"() {int: 0 : i42} : () -> ()
"foo"() {int: 0 : i42} : () -> ()
// CHECK: "foo"() {int = 0 : i42} : () -> ()
"foo"() {int = 0 : i42} : () -> ()
return
}
@ -502,23 +502,23 @@ func @constants() -> (i32, i23, i23, i1, i1) {
// CHECK-LABEL: func @typeattr
func @typeattr() -> () {
^bb0:
// CHECK: "foo"() {bar: tensor<*xf32>} : () -> ()
"foo"(){bar: tensor<*xf32>} : () -> ()
// CHECK: "foo"() {bar = tensor<*xf32>} : () -> ()
"foo"(){bar = tensor<*xf32>} : () -> ()
return
}
// CHECK-LABEL: func @stringquote
func @stringquote() -> () {
^bb0:
// CHECK: "foo"() {bar: "a\22quoted\22string"} : () -> ()
"foo"(){bar: "a\"quoted\"string"} : () -> ()
// CHECK: "foo"() {bar = "a\22quoted\22string"} : () -> ()
"foo"(){bar = "a\"quoted\"string"} : () -> ()
return
}
// CHECK-LABEL: func @unitAttrs
func @unitAttrs() -> () {
// CHECK-NEXT: "foo"() {unitAttr} : () -> ()
"foo"() {unitAttr : unit} : () -> ()
"foo"() {unitAttr = unit} : () -> ()
// CHECK-NEXT: "foo"() {unitAttr} : () -> ()
"foo"() {unitAttr} : () -> ()
@ -528,15 +528,15 @@ func @unitAttrs() -> () {
// CHECK-LABEL: func @floatAttrs
func @floatAttrs() -> () {
^bb0:
// CHECK: "foo"() {a: 4.000000e+00 : f64, b: 2.000000e+00 : f64, c: 7.100000e+00 : f64, d: -0.000000e+00 : f64} : () -> ()
"foo"(){a: 4.0, b: 2.0, c: 7.1, d: -0.0} : () -> ()
// CHECK: "foo"() {a = 4.000000e+00 : f64, b = 2.000000e+00 : f64, c = 7.100000e+00 : f64, d = -0.000000e+00 : f64} : () -> ()
"foo"(){a = 4.0, b = 2.0, c = 7.1, d = -0.0} : () -> ()
return
}
// CHECK-LABEL: func @externalfuncattr
func @externalfuncattr() -> ()
// CHECK: attributes {dialect.a: "a\22quoted\22string", dialect.b: 4.000000e+00 : f64, dialect.c: tensor<*xf32>}
attributes {dialect.a: "a\"quoted\"string", dialect.b: 4.0, dialect.c: tensor<*xf32>}
// CHECK: attributes {dialect.a = "a\22quoted\22string", dialect.b = 4.000000e+00 : f64, dialect.c = tensor<*xf32>}
attributes {dialect.a = "a\"quoted\"string", dialect.b = 4.0, dialect.c = tensor<*xf32>}
// CHECK-LABEL: func @funcattrempty
func @funcattrempty() -> ()
@ -544,8 +544,8 @@ func @funcattrempty() -> ()
// CHECK-LABEL: func @funcattr
func @funcattr() -> ()
// CHECK: attributes {dialect.a: "a\22quoted\22string", dialect.b: 4.000000e+00 : f64, dialect.c: tensor<*xf32>}
attributes {dialect.a: "a\"quoted\"string", dialect.b: 4.0, dialect.c: tensor<*xf32>} {
// CHECK: attributes {dialect.a = "a\22quoted\22string", dialect.b = 4.000000e+00 : f64, dialect.c = tensor<*xf32>}
attributes {dialect.a = "a\"quoted\"string", dialect.b = 4.0, dialect.c = tensor<*xf32>} {
^bb0:
return
}
@ -590,25 +590,25 @@ func @funcsimplemap(%arg0: index, %arg1: index) -> () {
// CHECK-LABEL: func @splattensorattr
func @splattensorattr() -> () {
^bb0:
// CHECK: "splatBoolTensor"() {bar: dense<0> : tensor<i1>} : () -> ()
"splatBoolTensor"(){bar: dense<false> : tensor<i1>} : () -> ()
// CHECK: "splatBoolTensor"() {bar = dense<0> : tensor<i1>} : () -> ()
"splatBoolTensor"(){bar = dense<false> : tensor<i1>} : () -> ()
// CHECK: "splatIntTensor"() {bar: dense<5> : tensor<2x1x4xi32>} : () -> ()
"splatIntTensor"(){bar: dense<5> : tensor<2x1x4xi32>} : () -> ()
// CHECK: "splatIntTensor"() {bar = dense<5> : tensor<2x1x4xi32>} : () -> ()
"splatIntTensor"(){bar = dense<5> : tensor<2x1x4xi32>} : () -> ()
// CHECK: "splatFloatTensor"() {bar: dense<-5.000000e+00> : tensor<2x1x4xf32>} : () -> ()
"splatFloatTensor"(){bar: dense<-5.0> : tensor<2x1x4xf32>} : () -> ()
// CHECK: "splatFloatTensor"() {bar = dense<-5.000000e+00> : tensor<2x1x4xf32>} : () -> ()
"splatFloatTensor"(){bar = dense<-5.0> : tensor<2x1x4xf32>} : () -> ()
// CHECK: "splatIntVector"() {bar: dense<5> : vector<2x1x4xi64>} : () -> ()
"splatIntVector"(){bar: dense<5> : vector<2x1x4xi64>} : () -> ()
// CHECK: "splatIntVector"() {bar = dense<5> : vector<2x1x4xi64>} : () -> ()
"splatIntVector"(){bar = dense<5> : vector<2x1x4xi64>} : () -> ()
// CHECK: "splatFloatVector"() {bar: dense<-5.000000e+00> : vector<2x1x4xf16>} : () -> ()
"splatFloatVector"(){bar: dense<-5.0> : vector<2x1x4xf16>} : () -> ()
// CHECK: "splatFloatVector"() {bar = dense<-5.000000e+00> : vector<2x1x4xf16>} : () -> ()
"splatFloatVector"(){bar = dense<-5.0> : vector<2x1x4xf16>} : () -> ()
// CHECK: "splatIntScalar"() {bar: dense<5> : tensor<i9>} : () -> ()
"splatIntScalar"() {bar: dense<5> : tensor<i9>} : () -> ()
// CHECK: "splatFloatScalar"() {bar: dense<-5.000000e+00> : tensor<f16>} : () -> ()
"splatFloatScalar"() {bar: dense<-5.0> : tensor<f16>} : () -> ()
// CHECK: "splatIntScalar"() {bar = dense<5> : tensor<i9>} : () -> ()
"splatIntScalar"() {bar = dense<5> : tensor<i9>} : () -> ()
// CHECK: "splatFloatScalar"() {bar = dense<-5.000000e+00> : tensor<f16>} : () -> ()
"splatFloatScalar"() {bar = dense<-5.0> : tensor<f16>} : () -> ()
return
}
@ -617,60 +617,60 @@ func @densetensorattr() -> () {
^bb0:
// NOTE: The {{\[\[}} syntax is because "[[" confuses FileCheck.
// CHECK: "fooi3"() {bar: dense<{{\[\[\[}}1, -2, 1, 2]], {{\[\[}}0, 2, -1, 2]]]> : tensor<2x1x4xi3>} : () -> ()
"fooi3"(){bar: dense<[[[1, -2, 1, 2]], [[0, 2, -1, 2]]]> : tensor<2x1x4xi3>} : () -> ()
// CHECK: "fooi6"() {bar: dense<{{\[\[\[}}5, -6, 1, 2]], {{\[\[}}7, 8, 3, 4]]]> : tensor<2x1x4xi6>} : () -> ()
"fooi6"(){bar: dense<[[[5, -6, 1, 2]], [[7, 8, 3, 4]]]> : tensor<2x1x4xi6>} : () -> ()
// CHECK: "fooi8"() {bar: dense<5> : tensor<1x1x1xi8>} : () -> ()
"fooi8"(){bar: dense<[[[5]]]> : tensor<1x1x1xi8>} : () -> ()
// CHECK: "fooi13"() {bar: dense<{{\[\[\[}}1, -2, 1, 2]], {{\[\[}}0, 2, -1, 2]]]> : tensor<2x1x4xi13>} : () -> ()
"fooi13"(){bar: dense<[[[1, -2, 1, 2]], [[0, 2, -1, 2]]]> : tensor<2x1x4xi13>} : () -> ()
// CHECK: "fooi16"() {bar: dense<-5> : tensor<1x1x1xi16>} : () -> ()
"fooi16"(){bar: dense<[[[-5]]]> : tensor<1x1x1xi16>} : () -> ()
// CHECK: "fooi23"() {bar: dense<{{\[\[\[}}1, -2, 1, 2]], {{\[\[}}0, 2, -1, 2]]]> : tensor<2x1x4xi23>} : () -> ()
"fooi23"(){bar: dense<[[[1, -2, 1, 2]], [[0, 2, -1, 2]]]> : tensor<2x1x4xi23>} : () -> ()
// CHECK: "fooi32"() {bar: dense<5> : tensor<1x1x1xi32>} : () -> ()
"fooi32"(){bar: dense<[[[5]]]> : tensor<1x1x1xi32>} : () -> ()
// CHECK: "fooi33"() {bar: dense<{{\[\[\[}}1, -2, 1, 2]], {{\[\[}}0, 2, -1, 2]]]> : tensor<2x1x4xi33>} : () -> ()
"fooi33"(){bar: dense<[[[1, -2, 1, 2]], [[0, 2, -1, 2]]]> : tensor<2x1x4xi33>} : () -> ()
// CHECK: "fooi43"() {bar: dense<{{\[\[\[}}1, -2, 1, 2]], {{\[\[}}0, 2, -1, 2]]]> : tensor<2x1x4xi43>} : () -> ()
"fooi43"(){bar: dense<[[[1, -2, 1, 2]], [[0, 2, -1, 2]]]> : tensor<2x1x4xi43>} : () -> ()
// CHECK: "fooi53"() {bar: dense<{{\[\[\[}}1, -2, 1, 2]], {{\[\[}}0, 2, -1, 2]]]> : tensor<2x1x4xi53>} : () -> ()
"fooi53"(){bar: dense<[[[1, -2, 1, 2]], [[0, 2, -1, 2]]]> : tensor<2x1x4xi53>} : () -> ()
// CHECK: "fooi64"() {bar: dense<{{\[\[\[}}1, -2, 1, 2]], {{\[\[}}0, 3, -1, 2]]]> : tensor<2x1x4xi64>} : () -> ()
"fooi64"(){bar: dense<[[[1, -2, 1, 2]], [[0, 3, -1, 2]]]> : tensor<2x1x4xi64>} : () -> ()
// CHECK: "fooi64"() {bar: dense<-5> : tensor<1x1x1xi64>} : () -> ()
"fooi64"(){bar: dense<[[[-5]]]> : tensor<1x1x1xi64>} : () -> ()
// CHECK: "fooi67"() {bar: dense<{{\[\[\[}}-5, 4, 6, 2]]]> : vector<1x1x4xi67>} : () -> ()
"fooi67"(){bar: dense<[[[-5, 4, 6, 2]]]> : vector<1x1x4xi67>} : () -> ()
// CHECK: "fooi3"() {bar = dense<{{\[\[\[}}1, -2, 1, 2]], {{\[\[}}0, 2, -1, 2]]]> : tensor<2x1x4xi3>} : () -> ()
"fooi3"(){bar = dense<[[[1, -2, 1, 2]], [[0, 2, -1, 2]]]> : tensor<2x1x4xi3>} : () -> ()
// CHECK: "fooi6"() {bar = dense<{{\[\[\[}}5, -6, 1, 2]], {{\[\[}}7, 8, 3, 4]]]> : tensor<2x1x4xi6>} : () -> ()
"fooi6"(){bar = dense<[[[5, -6, 1, 2]], [[7, 8, 3, 4]]]> : tensor<2x1x4xi6>} : () -> ()
// CHECK: "fooi8"() {bar = dense<5> : tensor<1x1x1xi8>} : () -> ()
"fooi8"(){bar = dense<[[[5]]]> : tensor<1x1x1xi8>} : () -> ()
// CHECK: "fooi13"() {bar = dense<{{\[\[\[}}1, -2, 1, 2]], {{\[\[}}0, 2, -1, 2]]]> : tensor<2x1x4xi13>} : () -> ()
"fooi13"(){bar = dense<[[[1, -2, 1, 2]], [[0, 2, -1, 2]]]> : tensor<2x1x4xi13>} : () -> ()
// CHECK: "fooi16"() {bar = dense<-5> : tensor<1x1x1xi16>} : () -> ()
"fooi16"(){bar = dense<[[[-5]]]> : tensor<1x1x1xi16>} : () -> ()
// CHECK: "fooi23"() {bar = dense<{{\[\[\[}}1, -2, 1, 2]], {{\[\[}}0, 2, -1, 2]]]> : tensor<2x1x4xi23>} : () -> ()
"fooi23"(){bar = dense<[[[1, -2, 1, 2]], [[0, 2, -1, 2]]]> : tensor<2x1x4xi23>} : () -> ()
// CHECK: "fooi32"() {bar = dense<5> : tensor<1x1x1xi32>} : () -> ()
"fooi32"(){bar = dense<[[[5]]]> : tensor<1x1x1xi32>} : () -> ()
// CHECK: "fooi33"() {bar = dense<{{\[\[\[}}1, -2, 1, 2]], {{\[\[}}0, 2, -1, 2]]]> : tensor<2x1x4xi33>} : () -> ()
"fooi33"(){bar = dense<[[[1, -2, 1, 2]], [[0, 2, -1, 2]]]> : tensor<2x1x4xi33>} : () -> ()
// CHECK: "fooi43"() {bar = dense<{{\[\[\[}}1, -2, 1, 2]], {{\[\[}}0, 2, -1, 2]]]> : tensor<2x1x4xi43>} : () -> ()
"fooi43"(){bar = dense<[[[1, -2, 1, 2]], [[0, 2, -1, 2]]]> : tensor<2x1x4xi43>} : () -> ()
// CHECK: "fooi53"() {bar = dense<{{\[\[\[}}1, -2, 1, 2]], {{\[\[}}0, 2, -1, 2]]]> : tensor<2x1x4xi53>} : () -> ()
"fooi53"(){bar = dense<[[[1, -2, 1, 2]], [[0, 2, -1, 2]]]> : tensor<2x1x4xi53>} : () -> ()
// CHECK: "fooi64"() {bar = dense<{{\[\[\[}}1, -2, 1, 2]], {{\[\[}}0, 3, -1, 2]]]> : tensor<2x1x4xi64>} : () -> ()
"fooi64"(){bar = dense<[[[1, -2, 1, 2]], [[0, 3, -1, 2]]]> : tensor<2x1x4xi64>} : () -> ()
// CHECK: "fooi64"() {bar = dense<-5> : tensor<1x1x1xi64>} : () -> ()
"fooi64"(){bar = dense<[[[-5]]]> : tensor<1x1x1xi64>} : () -> ()
// CHECK: "fooi67"() {bar = dense<{{\[\[\[}}-5, 4, 6, 2]]]> : vector<1x1x4xi67>} : () -> ()
"fooi67"(){bar = dense<[[[-5, 4, 6, 2]]]> : vector<1x1x4xi67>} : () -> ()
// CHECK: "foo2"() {bar: dense<[]> : tensor<0xi32>} : () -> ()
"foo2"(){bar: dense<[]> : tensor<0xi32>} : () -> ()
// CHECK: "foo2"() {bar: dense<{{\[\[}}]]> : tensor<1x0xi32>} : () -> ()
"foo2"(){bar: dense<[[]]> : tensor<1x0xi32>} : () -> ()
// CHECK: "foo3"() {bar: dense<{{\[\[\[}}5, -6, 1, 2]], {{\[\[}}7, 8, 3, 4]]]> : tensor<2x1x4xi32>} : () -> ()
"foo3"(){bar: dense<[[[5, -6, 1, 2]], [[7, 8, 3, 4]]]> : tensor<2x1x4xi32>} : () -> ()
// CHECK: "foo2"() {bar = dense<[]> : tensor<0xi32>} : () -> ()
"foo2"(){bar = dense<[]> : tensor<0xi32>} : () -> ()
// CHECK: "foo2"() {bar = dense<{{\[\[}}]]> : tensor<1x0xi32>} : () -> ()
"foo2"(){bar = dense<[[]]> : tensor<1x0xi32>} : () -> ()
// CHECK: "foo3"() {bar = dense<{{\[\[\[}}5, -6, 1, 2]], {{\[\[}}7, 8, 3, 4]]]> : tensor<2x1x4xi32>} : () -> ()
"foo3"(){bar = dense<[[[5, -6, 1, 2]], [[7, 8, 3, 4]]]> : tensor<2x1x4xi32>} : () -> ()
// CHECK: "float1"() {bar: dense<5.000000e+00> : tensor<1x1x1xf32>} : () -> ()
"float1"(){bar: dense<[[[5.0]]]> : tensor<1x1x1xf32>} : () -> ()
// CHECK: "float2"() {bar: dense<[]> : tensor<0xf32>} : () -> ()
"float2"(){bar: dense<[]> : tensor<0xf32>} : () -> ()
// CHECK: "float2"() {bar: dense<{{\[\[}}]]> : tensor<1x0xf32>} : () -> ()
"float2"(){bar: dense<[[]]> : tensor<1x0xf32>} : () -> ()
// CHECK: "float1"() {bar = dense<5.000000e+00> : tensor<1x1x1xf32>} : () -> ()
"float1"(){bar = dense<[[[5.0]]]> : tensor<1x1x1xf32>} : () -> ()
// CHECK: "float2"() {bar = dense<[]> : tensor<0xf32>} : () -> ()
"float2"(){bar = dense<[]> : tensor<0xf32>} : () -> ()
// CHECK: "float2"() {bar = dense<{{\[\[}}]]> : tensor<1x0xf32>} : () -> ()
"float2"(){bar = dense<[[]]> : tensor<1x0xf32>} : () -> ()
// CHECK: "bfloat16"() {bar: dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : tensor<2x1x4xbf16>} : () -> ()
"bfloat16"(){bar: dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : tensor<2x1x4xbf16>} : () -> ()
// CHECK: "float16"() {bar: dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : tensor<2x1x4xf16>} : () -> ()
"float16"(){bar: dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : tensor<2x1x4xf16>} : () -> ()
// CHECK: "float32"() {bar: dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : tensor<2x1x4xf32>} : () -> ()
"float32"(){bar: dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : tensor<2x1x4xf32>} : () -> ()
// CHECK: "float64"() {bar: dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : tensor<2x1x4xf64>} : () -> ()
"float64"(){bar: dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : tensor<2x1x4xf64>} : () -> ()
// CHECK: "bfloat16"() {bar = dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : tensor<2x1x4xbf16>} : () -> ()
"bfloat16"(){bar = dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : tensor<2x1x4xbf16>} : () -> ()
// CHECK: "float16"() {bar = dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : tensor<2x1x4xf16>} : () -> ()
"float16"(){bar = dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : tensor<2x1x4xf16>} : () -> ()
// CHECK: "float32"() {bar = dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : tensor<2x1x4xf32>} : () -> ()
"float32"(){bar = dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : tensor<2x1x4xf32>} : () -> ()
// CHECK: "float64"() {bar = dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : tensor<2x1x4xf64>} : () -> ()
"float64"(){bar = dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : tensor<2x1x4xf64>} : () -> ()
// CHECK: "intscalar"() {bar: dense<1> : tensor<i32>} : () -> ()
"intscalar"(){bar: dense<1> : tensor<i32>} : () -> ()
// CHECK: "floatscalar"() {bar: dense<5.000000e+00> : tensor<f32>} : () -> ()
"floatscalar"(){bar: dense<5.0> : tensor<f32>} : () -> ()
// CHECK: "intscalar"() {bar = dense<1> : tensor<i32>} : () -> ()
"intscalar"(){bar = dense<1> : tensor<i32>} : () -> ()
// CHECK: "floatscalar"() {bar = dense<5.000000e+00> : tensor<f32>} : () -> ()
"floatscalar"(){bar = dense<5.0> : tensor<f32>} : () -> ()
return
}
@ -678,29 +678,29 @@ func @densetensorattr() -> () {
func @densevectorattr() -> () {
^bb0:
// NOTE: The {{\[\[}} syntax is because "[[" confuses FileCheck.
// CHECK: "fooi8"() {bar: dense<5> : vector<1x1x1xi8>} : () -> ()
"fooi8"(){bar: dense<[[[5]]]> : vector<1x1x1xi8>} : () -> ()
// CHECK: "fooi16"() {bar: dense<-5> : vector<1x1x1xi16>} : () -> ()
"fooi16"(){bar: dense<[[[-5]]]> : vector<1x1x1xi16>} : () -> ()
// CHECK: "foo32"() {bar: dense<5> : vector<1x1x1xi32>} : () -> ()
"foo32"(){bar: dense<[[[5]]]> : vector<1x1x1xi32>} : () -> ()
// CHECK: "fooi64"() {bar: dense<-5> : vector<1x1x1xi64>} : () -> ()
"fooi64"(){bar: dense<[[[-5]]]> : vector<1x1x1xi64>} : () -> ()
// CHECK: "fooi8"() {bar = dense<5> : vector<1x1x1xi8>} : () -> ()
"fooi8"(){bar = dense<[[[5]]]> : vector<1x1x1xi8>} : () -> ()
// CHECK: "fooi16"() {bar = dense<-5> : vector<1x1x1xi16>} : () -> ()
"fooi16"(){bar = dense<[[[-5]]]> : vector<1x1x1xi16>} : () -> ()
// CHECK: "foo32"() {bar = dense<5> : vector<1x1x1xi32>} : () -> ()
"foo32"(){bar = dense<[[[5]]]> : vector<1x1x1xi32>} : () -> ()
// CHECK: "fooi64"() {bar = dense<-5> : vector<1x1x1xi64>} : () -> ()
"fooi64"(){bar = dense<[[[-5]]]> : vector<1x1x1xi64>} : () -> ()
// CHECK: "foo3"() {bar: dense<{{\[\[\[}}5, -6, 1, 2]], {{\[\[}}7, 8, 3, 4]]]> : vector<2x1x4xi32>} : () -> ()
"foo3"(){bar: dense<[[[5, -6, 1, 2]], [[7, 8, 3, 4]]]> : vector<2x1x4xi32>} : () -> ()
// CHECK: "foo3"() {bar = dense<{{\[\[\[}}5, -6, 1, 2]], {{\[\[}}7, 8, 3, 4]]]> : vector<2x1x4xi32>} : () -> ()
"foo3"(){bar = dense<[[[5, -6, 1, 2]], [[7, 8, 3, 4]]]> : vector<2x1x4xi32>} : () -> ()
// CHECK: "float1"() {bar: dense<5.000000e+00> : vector<1x1x1xf32>} : () -> ()
"float1"(){bar: dense<[[[5.0]]]> : vector<1x1x1xf32>} : () -> ()
// CHECK: "float1"() {bar = dense<5.000000e+00> : vector<1x1x1xf32>} : () -> ()
"float1"(){bar = dense<[[[5.0]]]> : vector<1x1x1xf32>} : () -> ()
// CHECK: "bfloat16"() {bar: dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : vector<2x1x4xbf16>} : () -> ()
"bfloat16"(){bar: dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : vector<2x1x4xbf16>} : () -> ()
// CHECK: "float16"() {bar: dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : vector<2x1x4xf16>} : () -> ()
"float16"(){bar: dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : vector<2x1x4xf16>} : () -> ()
// CHECK: "float32"() {bar: dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : vector<2x1x4xf32>} : () -> ()
"float32"(){bar: dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : vector<2x1x4xf32>} : () -> ()
// CHECK: "float64"() {bar: dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : vector<2x1x4xf64>} : () -> ()
"float64"(){bar: dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : vector<2x1x4xf64>} : () -> ()
// CHECK: "bfloat16"() {bar = dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : vector<2x1x4xbf16>} : () -> ()
"bfloat16"(){bar = dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : vector<2x1x4xbf16>} : () -> ()
// CHECK: "float16"() {bar = dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : vector<2x1x4xf16>} : () -> ()
"float16"(){bar = dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : vector<2x1x4xf16>} : () -> ()
// CHECK: "float32"() {bar = dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : vector<2x1x4xf32>} : () -> ()
"float32"(){bar = dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : vector<2x1x4xf32>} : () -> ()
// CHECK: "float64"() {bar = dense<{{\[\[\[}}-5.000000e+00, 6.000000e+00, 1.000000e+00, 2.000000e+00]], {{\[\[}}7.000000e+00, -8.000000e+00, 3.000000e+00, 4.000000e+00]]]> : vector<2x1x4xf64>} : () -> ()
"float64"(){bar = dense<[[[-5.0, 6.0, 1.0, 2.0]], [[7.0, -8.0, 3.0, 4.0]]]> : vector<2x1x4xf64>} : () -> ()
return
}
@ -708,31 +708,31 @@ func @densevectorattr() -> () {
func @sparsetensorattr() -> () {
^bb0:
// NOTE: The {{\[\[}} syntax is because "[[" confuses FileCheck.
// CHECK: "fooi8"() {bar: sparse<0, -2> : tensor<1x1x1xi8>} : () -> ()
"fooi8"(){bar: sparse<0, -2> : tensor<1x1x1xi8>} : () -> ()
// CHECK: "fooi16"() {bar: sparse<{{\[\[}}1, 1, 0], {{\[}}0, 1, 0], {{\[}}0, 0, 1]], {{\[}}2, -1, 5]> : tensor<2x2x2xi16>} : () -> ()
"fooi16"(){bar: sparse<[[1, 1, 0], [0, 1, 0], [0, 0, 1]], [2, -1, 5]> : tensor<2x2x2xi16>} : () -> ()
// CHECK: "fooi32"() {bar: sparse<{{\[}}], {{\[}}]> : tensor<1x1xi32>} : () -> ()
"fooi32"(){bar: sparse<[], []> : tensor<1x1xi32>} : () -> ()
// CHECK: "fooi64"() {bar: sparse<0, -1> : tensor<1xi64>} : () -> ()
"fooi64"(){bar: sparse<[[0]], [-1]> : tensor<1xi64>} : () -> ()
// CHECK: "foo2"() {bar: sparse<{{\[}}], {{\[}}]> : tensor<0xi32>} : () -> ()
"foo2"(){bar: sparse<[], []> : tensor<0xi32>} : () -> ()
// CHECK: "foo3"() {bar: sparse<{{\[}}], {{\[}}]> : tensor<i32>} : () -> ()
"foo3"(){bar: sparse<[], []> : tensor<i32>} : () -> ()
// CHECK: "fooi8"() {bar = sparse<0, -2> : tensor<1x1x1xi8>} : () -> ()
"fooi8"(){bar = sparse<0, -2> : tensor<1x1x1xi8>} : () -> ()
// CHECK: "fooi16"() {bar = sparse<{{\[\[}}1, 1, 0], {{\[}}0, 1, 0], {{\[}}0, 0, 1]], {{\[}}2, -1, 5]> : tensor<2x2x2xi16>} : () -> ()
"fooi16"(){bar = sparse<[[1, 1, 0], [0, 1, 0], [0, 0, 1]], [2, -1, 5]> : tensor<2x2x2xi16>} : () -> ()
// CHECK: "fooi32"() {bar = sparse<{{\[}}], {{\[}}]> : tensor<1x1xi32>} : () -> ()
"fooi32"(){bar = sparse<[], []> : tensor<1x1xi32>} : () -> ()
// CHECK: "fooi64"() {bar = sparse<0, -1> : tensor<1xi64>} : () -> ()
"fooi64"(){bar = sparse<[[0]], [-1]> : tensor<1xi64>} : () -> ()
// CHECK: "foo2"() {bar = sparse<{{\[}}], {{\[}}]> : tensor<0xi32>} : () -> ()
"foo2"(){bar = sparse<[], []> : tensor<0xi32>} : () -> ()
// CHECK: "foo3"() {bar = sparse<{{\[}}], {{\[}}]> : tensor<i32>} : () -> ()
"foo3"(){bar = sparse<[], []> : tensor<i32>} : () -> ()
// CHECK: "foof16"() {bar: sparse<0, -2.000000e+00> : tensor<1x1x1xf16>} : () -> ()
"foof16"(){bar: sparse<0, -2.0> : tensor<1x1x1xf16>} : () -> ()
// CHECK: "foobf16"() {bar: sparse<{{\[\[}}1, 1, 0], {{\[}}0, 1, 0], {{\[}}0, 0, 1]], {{\[}}2.000000e+00, -1.000000e+00, 5.000000e+00]> : tensor<2x2x2xbf16>} : () -> ()
"foobf16"(){bar: sparse<[[1, 1, 0], [0, 1, 0], [0, 0, 1]], [2.0, -1.0, 5.0]> : tensor<2x2x2xbf16>} : () -> ()
// CHECK: "foof32"() {bar: sparse<{{\[}}], {{\[}}]> : tensor<1x0x1xf32>} : () -> ()
"foof32"(){bar: sparse<[], []> : tensor<1x0x1xf32>} : () -> ()
// CHECK: "foof64"() {bar: sparse<0, -1.000000e+00> : tensor<1xf64>} : () -> ()
"foof64"(){bar: sparse<[[0]], [-1.0]> : tensor<1xf64>} : () -> ()
// CHECK: "foof320"() {bar: sparse<{{\[}}], {{\[}}]> : tensor<0xf32>} : () -> ()
"foof320"(){bar: sparse<[], []> : tensor<0xf32>} : () -> ()
// CHECK: "foof321"() {bar: sparse<{{\[}}], {{\[}}]> : tensor<f32>} : () -> ()
"foof321"(){bar: sparse<[], []> : tensor<f32>} : () -> ()
// CHECK: "foof16"() {bar = sparse<0, -2.000000e+00> : tensor<1x1x1xf16>} : () -> ()
"foof16"(){bar = sparse<0, -2.0> : tensor<1x1x1xf16>} : () -> ()
// CHECK: "foobf16"() {bar = sparse<{{\[\[}}1, 1, 0], {{\[}}0, 1, 0], {{\[}}0, 0, 1]], {{\[}}2.000000e+00, -1.000000e+00, 5.000000e+00]> : tensor<2x2x2xbf16>} : () -> ()
"foobf16"(){bar = sparse<[[1, 1, 0], [0, 1, 0], [0, 0, 1]], [2.0, -1.0, 5.0]> : tensor<2x2x2xbf16>} : () -> ()
// CHECK: "foof32"() {bar = sparse<{{\[}}], {{\[}}]> : tensor<1x0x1xf32>} : () -> ()
"foof32"(){bar = sparse<[], []> : tensor<1x0x1xf32>} : () -> ()
// CHECK: "foof64"() {bar = sparse<0, -1.000000e+00> : tensor<1xf64>} : () -> ()
"foof64"(){bar = sparse<[[0]], [-1.0]> : tensor<1xf64>} : () -> ()
// CHECK: "foof320"() {bar = sparse<{{\[}}], {{\[}}]> : tensor<0xf32>} : () -> ()
"foof320"(){bar = sparse<[], []> : tensor<0xf32>} : () -> ()
// CHECK: "foof321"() {bar = sparse<{{\[}}], {{\[}}]> : tensor<f32>} : () -> ()
"foof321"(){bar = sparse<[], []> : tensor<f32>} : () -> ()
return
}
@ -740,21 +740,21 @@ func @sparsetensorattr() -> () {
func @sparsevectorattr() -> () {
^bb0:
// NOTE: The {{\[\[}} syntax is because "[[" confuses FileCheck.
// CHECK: "fooi8"() {bar: sparse<0, -2> : vector<1x1x1xi8>} : () -> ()
"fooi8"(){bar: sparse<0, -2> : vector<1x1x1xi8>} : () -> ()
// CHECK: "fooi16"() {bar: sparse<{{\[\[}}1, 1, 0], {{\[}}0, 1, 0], {{\[}}0, 0, 1]], {{\[}}2, -1, 5]> : vector<2x2x2xi16>} : () -> ()
"fooi16"(){bar: sparse<[[1, 1, 0], [0, 1, 0], [0, 0, 1]], [2, -1, 5]> : vector<2x2x2xi16>} : () -> ()
// CHECK: "fooi32"() {bar: sparse<{{\[}}], {{\[}}]> : vector<1x1xi32>} : () -> ()
"fooi32"(){bar: sparse<[], []> : vector<1x1xi32>} : () -> ()
// CHECK: "fooi64"() {bar: sparse<0, -1> : vector<1xi64>} : () -> ()
"fooi64"(){bar: sparse<[[0]], [-1]> : vector<1xi64>} : () -> ()
// CHECK: "fooi8"() {bar = sparse<0, -2> : vector<1x1x1xi8>} : () -> ()
"fooi8"(){bar = sparse<0, -2> : vector<1x1x1xi8>} : () -> ()
// CHECK: "fooi16"() {bar = sparse<{{\[\[}}1, 1, 0], {{\[}}0, 1, 0], {{\[}}0, 0, 1]], {{\[}}2, -1, 5]> : vector<2x2x2xi16>} : () -> ()
"fooi16"(){bar = sparse<[[1, 1, 0], [0, 1, 0], [0, 0, 1]], [2, -1, 5]> : vector<2x2x2xi16>} : () -> ()
// CHECK: "fooi32"() {bar = sparse<{{\[}}], {{\[}}]> : vector<1x1xi32>} : () -> ()
"fooi32"(){bar = sparse<[], []> : vector<1x1xi32>} : () -> ()
// CHECK: "fooi64"() {bar = sparse<0, -1> : vector<1xi64>} : () -> ()
"fooi64"(){bar = sparse<[[0]], [-1]> : vector<1xi64>} : () -> ()
// CHECK: "foof16"() {bar: sparse<0, -2.000000e+00> : vector<1x1x1xf16>} : () -> ()
"foof16"(){bar: sparse<0, -2.0> : vector<1x1x1xf16>} : () -> ()
// CHECK: "foobf16"() {bar: sparse<{{\[\[}}1, 1, 0], {{\[}}0, 1, 0], {{\[}}0, 0, 1]], {{\[}}2.000000e+00, -1.000000e+00, 5.000000e+00]> : vector<2x2x2xbf16>} : () -> ()
"foobf16"(){bar: sparse<[[1, 1, 0], [0, 1, 0], [0, 0, 1]], [2.0, -1.0, 5.0]> : vector<2x2x2xbf16>} : () -> ()
// CHECK: "foof64"() {bar: sparse<0, -1.000000e+00> : vector<1xf64>} : () -> ()
"foof64"(){bar: sparse<0, [-1.0]> : vector<1xf64>} : () -> ()
// CHECK: "foof16"() {bar = sparse<0, -2.000000e+00> : vector<1x1x1xf16>} : () -> ()
"foof16"(){bar = sparse<0, -2.0> : vector<1x1x1xf16>} : () -> ()
// CHECK: "foobf16"() {bar = sparse<{{\[\[}}1, 1, 0], {{\[}}0, 1, 0], {{\[}}0, 0, 1]], {{\[}}2.000000e+00, -1.000000e+00, 5.000000e+00]> : vector<2x2x2xbf16>} : () -> ()
"foobf16"(){bar = sparse<[[1, 1, 0], [0, 1, 0], [0, 0, 1]], [2.0, -1.0, 5.0]> : vector<2x2x2xbf16>} : () -> ()
// CHECK: "foof64"() {bar = sparse<0, -1.000000e+00> : vector<1xf64>} : () -> ()
"foof64"(){bar = sparse<0, [-1.0]> : vector<1xf64>} : () -> ()
return
}
@ -802,7 +802,7 @@ func @verbose_if(%N: index) {
%z = "add"(%c, %c) : (index, index) -> index
"affine.terminator"() : () -> ()
})
{ condition: #set0 } : (index, index, index) -> ()
{ condition = #set0 } : (index, index, index) -> ()
return
}
@ -827,19 +827,19 @@ func @unregistered_term(%arg0 : i1) -> i1 {
// CHECK-LABEL: func @dialect_attrs
func @dialect_attrs()
// CHECK-NEXT: attributes {dialect.attr: 10
attributes {dialect.attr: 10} {
// CHECK-NEXT: attributes {dialect.attr = 10
attributes {dialect.attr = 10} {
return
}
// CHECK-LABEL: func @_valid.function$name
func @_valid.function$name()
// CHECK-LABEL: func @external_func_arg_attrs(i32, i1 {dialect.attr: 10 : i64}, i32)
func @external_func_arg_attrs(i32, i1 {dialect.attr: 10 : i64}, i32)
// CHECK-LABEL: func @external_func_arg_attrs(i32, i1 {dialect.attr = 10 : i64}, i32)
func @external_func_arg_attrs(i32, i1 {dialect.attr = 10 : i64}, i32)
// CHECK-LABEL: func @func_arg_attrs(%arg0: i1 {dialect.attr: 10 : i64})
func @func_arg_attrs(%arg0: i1 {dialect.attr: 10 : i64}) {
// CHECK-LABEL: func @func_arg_attrs(%arg0: i1 {dialect.attr = 10 : i64})
func @func_arg_attrs(%arg0: i1 {dialect.attr = 10 : i64}) {
return
}
@ -865,24 +865,24 @@ func @pretty_form_multi_result() -> (i16, i16) {
// CHECK-LABEL: func @pretty_dialect_attribute()
func @pretty_dialect_attribute() {
// CHECK: "foo.unknown_op"() {foo: #foo.simpleattr} : () -> ()
"foo.unknown_op"() {foo: #foo.simpleattr} : () -> ()
// CHECK: "foo.unknown_op"() {foo = #foo.simpleattr} : () -> ()
"foo.unknown_op"() {foo = #foo.simpleattr} : () -> ()
// CHECK: "foo.unknown_op"() {foo: #foo.complexattr<abcd>} : () -> ()
"foo.unknown_op"() {foo: #foo.complexattr<abcd>} : () -> ()
// CHECK: "foo.unknown_op"() {foo = #foo.complexattr<abcd>} : () -> ()
"foo.unknown_op"() {foo = #foo.complexattr<abcd>} : () -> ()
// CHECK: "foo.unknown_op"() {foo: #foo.complexattr<abcd<f32>>} : () -> ()
"foo.unknown_op"() {foo: #foo.complexattr<abcd<f32>>} : () -> ()
// CHECK: "foo.unknown_op"() {foo = #foo.complexattr<abcd<f32>>} : () -> ()
"foo.unknown_op"() {foo = #foo.complexattr<abcd<f32>>} : () -> ()
// CHECK: "foo.unknown_op"() {foo: #foo.complexattr<abcd<[f]$$[32]>>} : () -> ()
"foo.unknown_op"() {foo: #foo.complexattr<abcd<[f]$$[32]>>} : () -> ()
// CHECK: "foo.unknown_op"() {foo = #foo.complexattr<abcd<[f]$$[32]>>} : () -> ()
"foo.unknown_op"() {foo = #foo.complexattr<abcd<[f]$$[32]>>} : () -> ()
// CHECK: "foo.unknown_op"() {foo: #foo.dialect<!x@#!@#>} : () -> ()
"foo.unknown_op"() {foo: #foo.dialect<!x@#!@#>} : () -> ()
// CHECK: "foo.unknown_op"() {foo = #foo.dialect<!x@#!@#>} : () -> ()
"foo.unknown_op"() {foo = #foo.dialect<!x@#!@#>} : () -> ()
// Extraneous extra > character can't use the pretty syntax.
// CHECK: "foo.unknown_op"() {foo: #foo<"dialect<!x@#!@#>>">} : () -> ()
"foo.unknown_op"() {foo: #foo<"dialect<!x@#!@#>>">} : () -> ()
// CHECK: "foo.unknown_op"() {foo = #foo<"dialect<!x@#!@#>>">} : () -> ()
"foo.unknown_op"() {foo = #foo<"dialect<!x@#!@#>>">} : () -> ()
return
}
@ -934,5 +934,5 @@ func @scoped_names() {
return
}
// CHECK-LABEL: func @loc_attr(i1 {foo.loc_attr: loc(callsite("foo" at "mysource.cc":10:8))})
func @loc_attr(i1 {foo.loc_attr: loc(callsite("foo" at "mysource.cc":10:8))})
// CHECK-LABEL: func @loc_attr(i1 {foo.loc_attr = loc(callsite("foo" at "mysource.cc":10:8))})
func @loc_attr(i1 {foo.loc_attr = loc(callsite("foo" at "mysource.cc":10:8))})

View File

@ -2,108 +2,108 @@
func @testType(tensor<1x224x224x3xf32>) -> tensor<96xf32> {
^bb0(%arg0: tensor<1x224x224x3xf32>):
%1 = "std.constant"() {value: dense<0.1> : tensor<1xf32>} : () -> (tensor<1xf32>)
%2 = "std.constant"() {value: dense<0.1> : tensor<2xf32>} : () -> (tensor<2xf32>)
%3 = "std.constant"() {value: dense<0.1> : tensor<3xf32>} : () -> (tensor<3xf32>)
%4 = "std.constant"() {value: dense<0.1> : tensor<4xf32>} : () -> (tensor<4xf32>)
%5 = "std.constant"() {value: dense<0.1> : tensor<5xf32>} : () -> (tensor<5xf32>)
%6 = "std.constant"() {value: dense<0.1> : tensor<6xf32>} : () -> (tensor<6xf32>)
%7 = "std.constant"() {value: dense<0.1> : tensor<7xf32>} : () -> (tensor<7xf32>)
%8 = "std.constant"() {value: dense<0.1> : tensor<8xf32>} : () -> (tensor<8xf32>)
%9 = "std.constant"() {value: dense<0.1> : tensor<9xf32>} : () -> (tensor<9xf32>)
%10 = "std.constant"() {value: dense<0.1> : tensor<10xf32>} : () -> (tensor<10xf32>)
%11 = "std.constant"() {value: dense<0.1> : tensor<11xf32>} : () -> (tensor<11xf32>)
%12 = "std.constant"() {value: dense<0.1> : tensor<12xf32>} : () -> (tensor<12xf32>)
%13 = "std.constant"() {value: dense<0.1> : tensor<13xf32>} : () -> (tensor<13xf32>)
%14 = "std.constant"() {value: dense<0.1> : tensor<14xf32>} : () -> (tensor<14xf32>)
%15 = "std.constant"() {value: dense<0.1> : tensor<15xf32>} : () -> (tensor<15xf32>)
%16 = "std.constant"() {value: dense<0.1> : tensor<16xf32>} : () -> (tensor<16xf32>)
%17 = "std.constant"() {value: dense<0.1> : tensor<17xf32>} : () -> (tensor<17xf32>)
%18 = "std.constant"() {value: dense<0.1> : tensor<18xf32>} : () -> (tensor<18xf32>)
%19 = "std.constant"() {value: dense<0.1> : tensor<19xf32>} : () -> (tensor<19xf32>)
%20 = "std.constant"() {value: dense<0.1> : tensor<20xf32>} : () -> (tensor<20xf32>)
%21 = "std.constant"() {value: dense<0.1> : tensor<21xf32>} : () -> (tensor<21xf32>)
%22 = "std.constant"() {value: dense<0.1> : tensor<22xf32>} : () -> (tensor<22xf32>)
%23 = "std.constant"() {value: dense<0.1> : tensor<23xf32>} : () -> (tensor<23xf32>)
%24 = "std.constant"() {value: dense<0.1> : tensor<24xf32>} : () -> (tensor<24xf32>)
%25 = "std.constant"() {value: dense<0.1> : tensor<25xf32>} : () -> (tensor<25xf32>)
%26 = "std.constant"() {value: dense<0.1> : tensor<26xf32>} : () -> (tensor<26xf32>)
%27 = "std.constant"() {value: dense<0.1> : tensor<27xf32>} : () -> (tensor<27xf32>)
%28 = "std.constant"() {value: dense<0.1> : tensor<28xf32>} : () -> (tensor<28xf32>)
%29 = "std.constant"() {value: dense<0.1> : tensor<29xf32>} : () -> (tensor<29xf32>)
%30 = "std.constant"() {value: dense<0.1> : tensor<30xf32>} : () -> (tensor<30xf32>)
%31 = "std.constant"() {value: dense<0.1> : tensor<31xf32>} : () -> (tensor<31xf32>)
%32 = "std.constant"() {value: dense<0.1> : tensor<32xf32>} : () -> (tensor<32xf32>)
%33 = "std.constant"() {value: dense<0.1> : tensor<33xf32>} : () -> (tensor<33xf32>)
%34 = "std.constant"() {value: dense<0.1> : tensor<34xf32>} : () -> (tensor<34xf32>)
%35 = "std.constant"() {value: dense<0.1> : tensor<35xf32>} : () -> (tensor<35xf32>)
%36 = "std.constant"() {value: dense<0.1> : tensor<36xf32>} : () -> (tensor<36xf32>)
%37 = "std.constant"() {value: dense<0.1> : tensor<37xf32>} : () -> (tensor<37xf32>)
%38 = "std.constant"() {value: dense<0.1> : tensor<38xf32>} : () -> (tensor<38xf32>)
%39 = "std.constant"() {value: dense<0.1> : tensor<39xf32>} : () -> (tensor<39xf32>)
%40 = "std.constant"() {value: dense<0.1> : tensor<40xf32>} : () -> (tensor<40xf32>)
%41 = "std.constant"() {value: dense<0.1> : tensor<41xf32>} : () -> (tensor<41xf32>)
%42 = "std.constant"() {value: dense<0.1> : tensor<42xf32>} : () -> (tensor<42xf32>)
%43 = "std.constant"() {value: dense<0.1> : tensor<43xf32>} : () -> (tensor<43xf32>)
%44 = "std.constant"() {value: dense<0.1> : tensor<44xf32>} : () -> (tensor<44xf32>)
%45 = "std.constant"() {value: dense<0.1> : tensor<45xf32>} : () -> (tensor<45xf32>)
%46 = "std.constant"() {value: dense<0.1> : tensor<46xf32>} : () -> (tensor<46xf32>)
%47 = "std.constant"() {value: dense<0.1> : tensor<47xf32>} : () -> (tensor<47xf32>)
%48 = "std.constant"() {value: dense<0.1> : tensor<48xf32>} : () -> (tensor<48xf32>)
%49 = "std.constant"() {value: dense<0.1> : tensor<49xf32>} : () -> (tensor<49xf32>)
%50 = "std.constant"() {value: dense<0.1> : tensor<50xf32>} : () -> (tensor<50xf32>)
%51 = "std.constant"() {value: dense<0.1> : tensor<51xf32>} : () -> (tensor<51xf32>)
%52 = "std.constant"() {value: dense<0.1> : tensor<52xf32>} : () -> (tensor<52xf32>)
%53 = "std.constant"() {value: dense<0.1> : tensor<53xf32>} : () -> (tensor<53xf32>)
%54 = "std.constant"() {value: dense<0.1> : tensor<54xf32>} : () -> (tensor<54xf32>)
%55 = "std.constant"() {value: dense<0.1> : tensor<55xf32>} : () -> (tensor<55xf32>)
%56 = "std.constant"() {value: dense<0.1> : tensor<56xf32>} : () -> (tensor<56xf32>)
%57 = "std.constant"() {value: dense<0.1> : tensor<57xf32>} : () -> (tensor<57xf32>)
%58 = "std.constant"() {value: dense<0.1> : tensor<58xf32>} : () -> (tensor<58xf32>)
%59 = "std.constant"() {value: dense<0.1> : tensor<59xf32>} : () -> (tensor<59xf32>)
%60 = "std.constant"() {value: dense<0.1> : tensor<60xf32>} : () -> (tensor<60xf32>)
%61 = "std.constant"() {value: dense<0.1> : tensor<61xf32>} : () -> (tensor<61xf32>)
%62 = "std.constant"() {value: dense<0.1> : tensor<62xf32>} : () -> (tensor<62xf32>)
%63 = "std.constant"() {value: dense<0.1> : tensor<63xf32>} : () -> (tensor<63xf32>)
%64 = "std.constant"() {value: dense<0.1> : tensor<64xf32>} : () -> (tensor<64xf32>)
%65 = "std.constant"() {value: dense<0.1> : tensor<65xf32>} : () -> (tensor<65xf32>)
%66 = "std.constant"() {value: dense<0.1> : tensor<66xf32>} : () -> (tensor<66xf32>)
%67 = "std.constant"() {value: dense<0.1> : tensor<67xf32>} : () -> (tensor<67xf32>)
%68 = "std.constant"() {value: dense<0.1> : tensor<68xf32>} : () -> (tensor<68xf32>)
%69 = "std.constant"() {value: dense<0.1> : tensor<69xf32>} : () -> (tensor<69xf32>)
%70 = "std.constant"() {value: dense<0.1> : tensor<70xf32>} : () -> (tensor<70xf32>)
%71 = "std.constant"() {value: dense<0.1> : tensor<71xf32>} : () -> (tensor<71xf32>)
%72 = "std.constant"() {value: dense<0.1> : tensor<72xf32>} : () -> (tensor<72xf32>)
%73 = "std.constant"() {value: dense<0.1> : tensor<73xf32>} : () -> (tensor<73xf32>)
%74 = "std.constant"() {value: dense<0.1> : tensor<74xf32>} : () -> (tensor<74xf32>)
%75 = "std.constant"() {value: dense<0.1> : tensor<75xf32>} : () -> (tensor<75xf32>)
%76 = "std.constant"() {value: dense<0.1> : tensor<76xf32>} : () -> (tensor<76xf32>)
%77 = "std.constant"() {value: dense<0.1> : tensor<77xf32>} : () -> (tensor<77xf32>)
%78 = "std.constant"() {value: dense<0.1> : tensor<78xf32>} : () -> (tensor<78xf32>)
%79 = "std.constant"() {value: dense<0.1> : tensor<79xf32>} : () -> (tensor<79xf32>)
%80 = "std.constant"() {value: dense<0.1> : tensor<80xf32>} : () -> (tensor<80xf32>)
%81 = "std.constant"() {value: dense<0.1> : tensor<81xf32>} : () -> (tensor<81xf32>)
%82 = "std.constant"() {value: dense<0.1> : tensor<82xf32>} : () -> (tensor<82xf32>)
%83 = "std.constant"() {value: dense<0.1> : tensor<83xf32>} : () -> (tensor<83xf32>)
%84 = "std.constant"() {value: dense<0.1> : tensor<84xf32>} : () -> (tensor<84xf32>)
%85 = "std.constant"() {value: dense<0.1> : tensor<85xf32>} : () -> (tensor<85xf32>)
%86 = "std.constant"() {value: dense<0.1> : tensor<86xf32>} : () -> (tensor<86xf32>)
%87 = "std.constant"() {value: dense<0.1> : tensor<87xf32>} : () -> (tensor<87xf32>)
%88 = "std.constant"() {value: dense<0.1> : tensor<88xf32>} : () -> (tensor<88xf32>)
%89 = "std.constant"() {value: dense<0.1> : tensor<89xf32>} : () -> (tensor<89xf32>)
%90 = "std.constant"() {value: dense<0.1> : tensor<90xf32>} : () -> (tensor<90xf32>)
%91 = "std.constant"() {value: dense<0.1> : tensor<91xf32>} : () -> (tensor<91xf32>)
%92 = "std.constant"() {value: dense<0.1> : tensor<92xf32>} : () -> (tensor<92xf32>)
%93 = "std.constant"() {value: dense<0.1> : tensor<93xf32>} : () -> (tensor<93xf32>)
%94 = "std.constant"() {value: dense<0.1> : tensor<94xf32>} : () -> (tensor<94xf32>)
%95 = "std.constant"() {value: dense<0.1> : tensor<95xf32>} : () -> (tensor<95xf32>)
%96 = "std.constant"() {value: dense<0.1> : tensor<96xf32>} : () -> (tensor<96xf32>)
%97 = "std.constant"() {value: dense<0.1> : tensor<97xf32>} : () -> (tensor<97xf32>)
%98 = "std.constant"() {value: dense<0.1> : tensor<98xf32>} : () -> (tensor<98xf32>)
%99 = "std.constant"() {value: dense<0.1> : tensor<99xf32>} : () -> (tensor<99xf32>)
%100 = "std.constant"() {value: dense<0.1> : tensor<100xf32>} : () -> (tensor<100xf32>)
%101 = "std.constant"() {value: dense<0.1> : tensor<101xf32>} : () -> (tensor<101xf32>)
%102 = "std.constant"() {value: dense<0.1> : tensor<102xf32>} : () -> (tensor<102xf32>)
%1 = "std.constant"() {value = dense<0.1> : tensor<1xf32>} : () -> (tensor<1xf32>)
%2 = "std.constant"() {value = dense<0.1> : tensor<2xf32>} : () -> (tensor<2xf32>)
%3 = "std.constant"() {value = dense<0.1> : tensor<3xf32>} : () -> (tensor<3xf32>)
%4 = "std.constant"() {value = dense<0.1> : tensor<4xf32>} : () -> (tensor<4xf32>)
%5 = "std.constant"() {value = dense<0.1> : tensor<5xf32>} : () -> (tensor<5xf32>)
%6 = "std.constant"() {value = dense<0.1> : tensor<6xf32>} : () -> (tensor<6xf32>)
%7 = "std.constant"() {value = dense<0.1> : tensor<7xf32>} : () -> (tensor<7xf32>)
%8 = "std.constant"() {value = dense<0.1> : tensor<8xf32>} : () -> (tensor<8xf32>)
%9 = "std.constant"() {value = dense<0.1> : tensor<9xf32>} : () -> (tensor<9xf32>)
%10 = "std.constant"() {value = dense<0.1> : tensor<10xf32>} : () -> (tensor<10xf32>)
%11 = "std.constant"() {value = dense<0.1> : tensor<11xf32>} : () -> (tensor<11xf32>)
%12 = "std.constant"() {value = dense<0.1> : tensor<12xf32>} : () -> (tensor<12xf32>)
%13 = "std.constant"() {value = dense<0.1> : tensor<13xf32>} : () -> (tensor<13xf32>)
%14 = "std.constant"() {value = dense<0.1> : tensor<14xf32>} : () -> (tensor<14xf32>)
%15 = "std.constant"() {value = dense<0.1> : tensor<15xf32>} : () -> (tensor<15xf32>)
%16 = "std.constant"() {value = dense<0.1> : tensor<16xf32>} : () -> (tensor<16xf32>)
%17 = "std.constant"() {value = dense<0.1> : tensor<17xf32>} : () -> (tensor<17xf32>)
%18 = "std.constant"() {value = dense<0.1> : tensor<18xf32>} : () -> (tensor<18xf32>)
%19 = "std.constant"() {value = dense<0.1> : tensor<19xf32>} : () -> (tensor<19xf32>)
%20 = "std.constant"() {value = dense<0.1> : tensor<20xf32>} : () -> (tensor<20xf32>)
%21 = "std.constant"() {value = dense<0.1> : tensor<21xf32>} : () -> (tensor<21xf32>)
%22 = "std.constant"() {value = dense<0.1> : tensor<22xf32>} : () -> (tensor<22xf32>)
%23 = "std.constant"() {value = dense<0.1> : tensor<23xf32>} : () -> (tensor<23xf32>)
%24 = "std.constant"() {value = dense<0.1> : tensor<24xf32>} : () -> (tensor<24xf32>)
%25 = "std.constant"() {value = dense<0.1> : tensor<25xf32>} : () -> (tensor<25xf32>)
%26 = "std.constant"() {value = dense<0.1> : tensor<26xf32>} : () -> (tensor<26xf32>)
%27 = "std.constant"() {value = dense<0.1> : tensor<27xf32>} : () -> (tensor<27xf32>)
%28 = "std.constant"() {value = dense<0.1> : tensor<28xf32>} : () -> (tensor<28xf32>)
%29 = "std.constant"() {value = dense<0.1> : tensor<29xf32>} : () -> (tensor<29xf32>)
%30 = "std.constant"() {value = dense<0.1> : tensor<30xf32>} : () -> (tensor<30xf32>)
%31 = "std.constant"() {value = dense<0.1> : tensor<31xf32>} : () -> (tensor<31xf32>)
%32 = "std.constant"() {value = dense<0.1> : tensor<32xf32>} : () -> (tensor<32xf32>)
%33 = "std.constant"() {value = dense<0.1> : tensor<33xf32>} : () -> (tensor<33xf32>)
%34 = "std.constant"() {value = dense<0.1> : tensor<34xf32>} : () -> (tensor<34xf32>)
%35 = "std.constant"() {value = dense<0.1> : tensor<35xf32>} : () -> (tensor<35xf32>)
%36 = "std.constant"() {value = dense<0.1> : tensor<36xf32>} : () -> (tensor<36xf32>)
%37 = "std.constant"() {value = dense<0.1> : tensor<37xf32>} : () -> (tensor<37xf32>)
%38 = "std.constant"() {value = dense<0.1> : tensor<38xf32>} : () -> (tensor<38xf32>)
%39 = "std.constant"() {value = dense<0.1> : tensor<39xf32>} : () -> (tensor<39xf32>)
%40 = "std.constant"() {value = dense<0.1> : tensor<40xf32>} : () -> (tensor<40xf32>)
%41 = "std.constant"() {value = dense<0.1> : tensor<41xf32>} : () -> (tensor<41xf32>)
%42 = "std.constant"() {value = dense<0.1> : tensor<42xf32>} : () -> (tensor<42xf32>)
%43 = "std.constant"() {value = dense<0.1> : tensor<43xf32>} : () -> (tensor<43xf32>)
%44 = "std.constant"() {value = dense<0.1> : tensor<44xf32>} : () -> (tensor<44xf32>)
%45 = "std.constant"() {value = dense<0.1> : tensor<45xf32>} : () -> (tensor<45xf32>)
%46 = "std.constant"() {value = dense<0.1> : tensor<46xf32>} : () -> (tensor<46xf32>)
%47 = "std.constant"() {value = dense<0.1> : tensor<47xf32>} : () -> (tensor<47xf32>)
%48 = "std.constant"() {value = dense<0.1> : tensor<48xf32>} : () -> (tensor<48xf32>)
%49 = "std.constant"() {value = dense<0.1> : tensor<49xf32>} : () -> (tensor<49xf32>)
%50 = "std.constant"() {value = dense<0.1> : tensor<50xf32>} : () -> (tensor<50xf32>)
%51 = "std.constant"() {value = dense<0.1> : tensor<51xf32>} : () -> (tensor<51xf32>)
%52 = "std.constant"() {value = dense<0.1> : tensor<52xf32>} : () -> (tensor<52xf32>)
%53 = "std.constant"() {value = dense<0.1> : tensor<53xf32>} : () -> (tensor<53xf32>)
%54 = "std.constant"() {value = dense<0.1> : tensor<54xf32>} : () -> (tensor<54xf32>)
%55 = "std.constant"() {value = dense<0.1> : tensor<55xf32>} : () -> (tensor<55xf32>)
%56 = "std.constant"() {value = dense<0.1> : tensor<56xf32>} : () -> (tensor<56xf32>)
%57 = "std.constant"() {value = dense<0.1> : tensor<57xf32>} : () -> (tensor<57xf32>)
%58 = "std.constant"() {value = dense<0.1> : tensor<58xf32>} : () -> (tensor<58xf32>)
%59 = "std.constant"() {value = dense<0.1> : tensor<59xf32>} : () -> (tensor<59xf32>)
%60 = "std.constant"() {value = dense<0.1> : tensor<60xf32>} : () -> (tensor<60xf32>)
%61 = "std.constant"() {value = dense<0.1> : tensor<61xf32>} : () -> (tensor<61xf32>)
%62 = "std.constant"() {value = dense<0.1> : tensor<62xf32>} : () -> (tensor<62xf32>)
%63 = "std.constant"() {value = dense<0.1> : tensor<63xf32>} : () -> (tensor<63xf32>)
%64 = "std.constant"() {value = dense<0.1> : tensor<64xf32>} : () -> (tensor<64xf32>)
%65 = "std.constant"() {value = dense<0.1> : tensor<65xf32>} : () -> (tensor<65xf32>)
%66 = "std.constant"() {value = dense<0.1> : tensor<66xf32>} : () -> (tensor<66xf32>)
%67 = "std.constant"() {value = dense<0.1> : tensor<67xf32>} : () -> (tensor<67xf32>)
%68 = "std.constant"() {value = dense<0.1> : tensor<68xf32>} : () -> (tensor<68xf32>)
%69 = "std.constant"() {value = dense<0.1> : tensor<69xf32>} : () -> (tensor<69xf32>)
%70 = "std.constant"() {value = dense<0.1> : tensor<70xf32>} : () -> (tensor<70xf32>)
%71 = "std.constant"() {value = dense<0.1> : tensor<71xf32>} : () -> (tensor<71xf32>)
%72 = "std.constant"() {value = dense<0.1> : tensor<72xf32>} : () -> (tensor<72xf32>)
%73 = "std.constant"() {value = dense<0.1> : tensor<73xf32>} : () -> (tensor<73xf32>)
%74 = "std.constant"() {value = dense<0.1> : tensor<74xf32>} : () -> (tensor<74xf32>)
%75 = "std.constant"() {value = dense<0.1> : tensor<75xf32>} : () -> (tensor<75xf32>)
%76 = "std.constant"() {value = dense<0.1> : tensor<76xf32>} : () -> (tensor<76xf32>)
%77 = "std.constant"() {value = dense<0.1> : tensor<77xf32>} : () -> (tensor<77xf32>)
%78 = "std.constant"() {value = dense<0.1> : tensor<78xf32>} : () -> (tensor<78xf32>)
%79 = "std.constant"() {value = dense<0.1> : tensor<79xf32>} : () -> (tensor<79xf32>)
%80 = "std.constant"() {value = dense<0.1> : tensor<80xf32>} : () -> (tensor<80xf32>)
%81 = "std.constant"() {value = dense<0.1> : tensor<81xf32>} : () -> (tensor<81xf32>)
%82 = "std.constant"() {value = dense<0.1> : tensor<82xf32>} : () -> (tensor<82xf32>)
%83 = "std.constant"() {value = dense<0.1> : tensor<83xf32>} : () -> (tensor<83xf32>)
%84 = "std.constant"() {value = dense<0.1> : tensor<84xf32>} : () -> (tensor<84xf32>)
%85 = "std.constant"() {value = dense<0.1> : tensor<85xf32>} : () -> (tensor<85xf32>)
%86 = "std.constant"() {value = dense<0.1> : tensor<86xf32>} : () -> (tensor<86xf32>)
%87 = "std.constant"() {value = dense<0.1> : tensor<87xf32>} : () -> (tensor<87xf32>)
%88 = "std.constant"() {value = dense<0.1> : tensor<88xf32>} : () -> (tensor<88xf32>)
%89 = "std.constant"() {value = dense<0.1> : tensor<89xf32>} : () -> (tensor<89xf32>)
%90 = "std.constant"() {value = dense<0.1> : tensor<90xf32>} : () -> (tensor<90xf32>)
%91 = "std.constant"() {value = dense<0.1> : tensor<91xf32>} : () -> (tensor<91xf32>)
%92 = "std.constant"() {value = dense<0.1> : tensor<92xf32>} : () -> (tensor<92xf32>)
%93 = "std.constant"() {value = dense<0.1> : tensor<93xf32>} : () -> (tensor<93xf32>)
%94 = "std.constant"() {value = dense<0.1> : tensor<94xf32>} : () -> (tensor<94xf32>)
%95 = "std.constant"() {value = dense<0.1> : tensor<95xf32>} : () -> (tensor<95xf32>)
%96 = "std.constant"() {value = dense<0.1> : tensor<96xf32>} : () -> (tensor<96xf32>)
%97 = "std.constant"() {value = dense<0.1> : tensor<97xf32>} : () -> (tensor<97xf32>)
%98 = "std.constant"() {value = dense<0.1> : tensor<98xf32>} : () -> (tensor<98xf32>)
%99 = "std.constant"() {value = dense<0.1> : tensor<99xf32>} : () -> (tensor<99xf32>)
%100 = "std.constant"() {value = dense<0.1> : tensor<100xf32>} : () -> (tensor<100xf32>)
%101 = "std.constant"() {value = dense<0.1> : tensor<101xf32>} : () -> (tensor<101xf32>)
%102 = "std.constant"() {value = dense<0.1> : tensor<102xf32>} : () -> (tensor<102xf32>)
return %96 : tensor<96xf32>
}
// CHECK: testType

View File

@ -1,8 +1,8 @@
// RUN: mlir-opt -lower-to-llvm %s | FileCheck %s
// CHECK-LABEL: func @check_attributes(%arg0: !llvm<"float*"> {dialect.a: true, dialect.b: 4 : i64}) {
func @check_attributes(%static: memref<10x20xf32> {dialect.a: true, dialect.b: 4 : i64 }) {
// CHECK-LABEL: func @check_attributes(%arg0: !llvm<"float*"> {dialect.a = true, dialect.b = 4 : i64}) {
func @check_attributes(%static: memref<10x20xf32> {dialect.a = true, dialect.b = 4 : i64 }) {
return
}

View File

@ -1,7 +1,7 @@
// RUN: mlir-opt %s -split-input-file -verify-diagnostics
// expected-error@+1{{llvm.noalias argument attribute of non boolean type}}
func @invalid_noalias(%arg0: !llvm.i32 {llvm.noalias: 3}) {
func @invalid_noalias(%arg0: !llvm.i32 {llvm.noalias = 3}) {
"llvm.return"() : () -> ()
}

View File

@ -139,8 +139,8 @@ func @copy_view0(%arg0: !linalg.view<f32>, %arg1: !linalg.view<f32>) {
// CHECK: linalg.store %0, %arg1[] : !linalg.view<f32>
func @copy_view3(%arg0: !linalg.view<?x?x?xf32>, %arg1: !linalg.view<?x?x?xf32>) {
linalg.copy(%arg0, %arg1) {inputPermutation : (i, j, k) -> (i, k, j),
outputPermutation : (i, j, k) -> (k, j, i)} :
linalg.copy(%arg0, %arg1) {inputPermutation = (i, j, k) -> (i, k, j),
outputPermutation = (i, j, k) -> (k, j, i)} :
!linalg.view<?x?x?xf32>, !linalg.view<?x?x?xf32>
return
}
@ -152,7 +152,7 @@ func @copy_view3(%arg0: !linalg.view<?x?x?xf32>, %arg1: !linalg.view<?x?x?xf32>)
// CHECK: linalg.store %[[L]], %arg1[%i2, %i1, %i0] : !linalg.view<?x?x?xf32>
func @conv_view3(%arg0: !linalg.view<?x?x?xf32>, %arg1: !linalg.view<?x?x?xf32>, %arg2: !linalg.view<?x?x?xf32>) {
linalg.conv(%arg0, %arg1, %arg2) {strides: [2]}: !linalg.view<?x?x?xf32>, !linalg.view<?x?x?xf32>, !linalg.view<?x?x?xf32>
linalg.conv(%arg0, %arg1, %arg2) {strides = [2]}: !linalg.view<?x?x?xf32>, !linalg.view<?x?x?xf32>, !linalg.view<?x?x?xf32>
return
}
// CHECK-LABEL: func @conv_view3(%arg0: !linalg.view<?x?x?xf32>, %arg1: !linalg.view<?x?x?xf32>, %arg2: !linalg.view<?x?x?xf32>) {
@ -175,7 +175,7 @@ func @conv_view3(%arg0: !linalg.view<?x?x?xf32>, %arg1: !linalg.view<?x?x?xf32>,
// CHECK: linalg.store %{{.*}}, %arg2[%i0, %i1, %i2] : !linalg.view<?x?x?xf32>
func @conv_view4(%arg0: !linalg.view<?x?x?x?xf32>, %arg1: !linalg.view<?x?x?x?xf32>, %arg2: !linalg.view<?x?x?x?xf32>) {
linalg.conv(%arg0, %arg1, %arg2) {dilations: [4, 5], strides: [2, 3]} : !linalg.view<?x?x?x?xf32>, !linalg.view<?x?x?x?xf32>, !linalg.view<?x?x?x?xf32>
linalg.conv(%arg0, %arg1, %arg2) {dilations = [4, 5], strides = [2, 3]} : !linalg.view<?x?x?x?xf32>, !linalg.view<?x?x?x?xf32>, !linalg.view<?x?x?x?xf32>
return
}
// CHECK-LABEL: func @conv_view4(%arg0: !linalg.view<?x?x?x?xf32>, %arg1: !linalg.view<?x?x?x?xf32>, %arg2: !linalg.view<?x?x?x?xf32>) {

View File

@ -123,13 +123,13 @@ func @copy_view(%arg0: !linalg.view<?xf32>, %arg1: !linalg.view<?xf32>) {
// CHECK: linalg.copy(%arg0, %arg1) : !linalg.view<?xf32>, !linalg.view<?xf32>
func @copy_view3(%arg0: !linalg.view<?x?x?xf32>, %arg1: !linalg.view<?x?x?xf32>) {
linalg.copy(%arg0, %arg1) {inputPermutation : (i, j, k) -> (i, k, j),
outputPermutation : (i, j, k) -> (k, j, i)} :
linalg.copy(%arg0, %arg1) {inputPermutation = (i, j, k) -> (i, k, j),
outputPermutation = (i, j, k) -> (k, j, i)} :
!linalg.view<?x?x?xf32>, !linalg.view<?x?x?xf32>
return
}
// CHECK-LABEL: func @copy_view3(%arg0: !linalg.view<?x?x?xf32>, %arg1: !linalg.view<?x?x?xf32>) {
// CHECK: linalg.copy(%arg0, %arg1) {inputPermutation: #[[map0]], outputPermutation: #[[map1]]} : !linalg.view<?x?x?xf32>, !linalg.view<?x?x?xf32>
// CHECK: linalg.copy(%arg0, %arg1) {inputPermutation = #[[map0]], outputPermutation = #[[map1]]} : !linalg.view<?x?x?xf32>, !linalg.view<?x?x?xf32>
func @conv_view3(%arg0: !linalg.view<?x?x?xf32>, %arg1: !linalg.view<?x?x?xf32>, %arg2: !linalg.view<?x?x?xf32>) {
linalg.conv(%arg0, %arg1, %arg2) : !linalg.view<?x?x?xf32>, !linalg.view<?x?x?xf32>, !linalg.view<?x?x?xf32>
@ -139,11 +139,11 @@ func @conv_view3(%arg0: !linalg.view<?x?x?xf32>, %arg1: !linalg.view<?x?x?xf32>,
// CHECK: linalg.conv(%arg0, %arg1, %arg2) : !linalg.view<?x?x?xf32>, !linalg.view<?x?x?xf32>, !linalg.view<?x?x?xf32>
func @conv_view6(%arg0: !linalg.view<?x?x?x?x?x?xf32>, %arg1: !linalg.view<?x?x?x?x?x?xf32>, %arg2: !linalg.view<?x?x?x?x?x?xf32>) {
linalg.conv(%arg0, %arg1, %arg2) {dilations: [4, 4, 5, 5], strides: [2, 2, 3, 3]} : !linalg.view<?x?x?x?x?x?xf32>, !linalg.view<?x?x?x?x?x?xf32>, !linalg.view<?x?x?x?x?x?xf32>
linalg.conv(%arg0, %arg1, %arg2) {dilations = [4, 4, 5, 5], strides = [2, 2, 3, 3]} : !linalg.view<?x?x?x?x?x?xf32>, !linalg.view<?x?x?x?x?x?xf32>, !linalg.view<?x?x?x?x?x?xf32>
return
}
// CHECK-LABEL: func @conv_view6(%arg0: !linalg.view<?x?x?x?x?x?xf32>, %arg1: !linalg.view<?x?x?x?x?x?xf32>, %arg2: !linalg.view<?x?x?x?x?x?xf32>) {
// CHECK: linalg.conv(%arg0, %arg1, %arg2) {dilations: [4, 4, 5, 5], strides: [2, 2, 3, 3]} : !linalg.view<?x?x?x?x?x?xf32>, !linalg.view<?x?x?x?x?x?xf32>, !linalg.view<?x?x?x?x?x?xf32>
// CHECK: linalg.conv(%arg0, %arg1, %arg2) {dilations = [4, 4, 5, 5], strides = [2, 2, 3, 3]} : !linalg.view<?x?x?x?x?x?xf32>, !linalg.view<?x?x?x?x?x?xf32>, !linalg.view<?x?x?x?x?x?xf32>
func @subview(%arg0: !linalg.view<?x?xvector<3x4xi4>>) {
%c0 = constant 0 : index

View File

@ -9,10 +9,10 @@
// CHECK-NEXT: %2 = "fxpmath.real_matmul"(%0, %1) : (tensor<300x3x!quant.uniform<i8:f32, 0.037564418067230126:35>>, tensor<3x5x!quant.uniform<i8:f32, 0.0062823070315864236:-1>>) -> tensor<300x5x!quant.uniform<i8:f32, 0.0629921259842528:-1>>
// CHECK-NEXT: %3 = "quant.dcast"(%2) : (tensor<300x5x!quant.uniform<i8:f32, 0.0629921259842528:-1>>) -> tensor<300x5xf32>
func @matmul(%arg0: tensor<300x3xf32>) -> tensor<300x5xf32> {
%0 = "quant.stats"(%arg0) {layerStats: dense<[-6.123e+00, 3.45e+00]> : tensor<2xf32>} : (tensor<300x3xf32>) -> tensor<300x3xf32>
%cst = constant {name: "constant.35"} dense<[[-1.060230e-01, 1.215050e-01, 8.002390e-01, -7.688850e-01, 0.0966112986], [6.890140e-01, -4.070560e-01, -0.797852993, 3.789250e-03, -2.088810e-01], [-6.085290e-01, 2.766170e-02, 2.685570e-01, 5.774010e-01, -4.284370e-01]]> : tensor<3x5xf32>
%0 = "quant.stats"(%arg0) {layerStats = dense<[-6.123e+00, 3.45e+00]> : tensor<2xf32>} : (tensor<300x3xf32>) -> tensor<300x3xf32>
%cst = constant {name = "constant.35"} dense<[[-1.060230e-01, 1.215050e-01, 8.002390e-01, -7.688850e-01, 0.0966112986], [6.890140e-01, -4.070560e-01, -0.797852993, 3.789250e-03, -2.088810e-01], [-6.085290e-01, 2.766170e-02, 2.685570e-01, 5.774010e-01, -4.284370e-01]]> : tensor<3x5xf32>
%1 = "fxpmath.real_matmul"(%0, %cst) : (tensor<300x3xf32>, tensor<3x5xf32>) -> tensor<300x5xf32>
%2 = "quant.stats"(%1) {layerStats: dense<[-8.000000e+00, 8.000000e+00]> : tensor<2xf32>} : (tensor<300x5xf32>) -> tensor<300x5xf32>
%2 = "quant.stats"(%1) {layerStats = dense<[-8.000000e+00, 8.000000e+00]> : tensor<2xf32>} : (tensor<300x5xf32>) -> tensor<300x5xf32>
return %2 : tensor<300x5xf32>
}
@ -22,12 +22,12 @@ func @matmul(%arg0: tensor<300x3xf32>) -> tensor<300x5xf32> {
// CHECK: %cst = constant dense{{.*}}tensor<3x5xi8>
// CHECK-NEXT: %0 = "quant.qcast"(%arg0) : (tensor<300x3xf32>) -> tensor<300x3x!quant.uniform<i8:f32, 0.037564418067230126:35>>
// CHECK-NEXT: %1 = "quant.scast"(%cst) : (tensor<3x5xi8>) -> tensor<3x5x!quant.uniform<i8:f32, 0.0062823070315864236:-1>>
// CHECK-NEXT: %2 = "fxpmath.real_matmul"(%0, %1) {clamp_max: 6.100000e+00 : f64, clamp_min: -1.225000e+01 : f64} : (tensor<300x3x!quant.uniform<i8:f32, 0.037564418067230126:35>>, tensor<3x5x!quant.uniform<i8:f32, 0.0062823070315864236:-1>>) -> tensor<300x5x!quant.uniform<i8:f32, 0.072058823529412216:42>>
// CHECK-NEXT: %2 = "fxpmath.real_matmul"(%0, %1) {clamp_max = 6.100000e+00 : f64, clamp_min = -1.225000e+01 : f64} : (tensor<300x3x!quant.uniform<i8:f32, 0.037564418067230126:35>>, tensor<3x5x!quant.uniform<i8:f32, 0.0062823070315864236:-1>>) -> tensor<300x5x!quant.uniform<i8:f32, 0.072058823529412216:42>>
// CHECK-NEXT: %3 = "quant.dcast"(%2) : (tensor<300x5x!quant.uniform<i8:f32, 0.072058823529412216:42>>) -> tensor<300x5xf32>
func @matmul_clamp(%arg0: tensor<300x3xf32>) -> tensor<300x5xf32> {
%0 = "quant.stats"(%arg0) {layerStats: dense<[-6.123e+00, 3.45e+00]> : tensor<2xf32>} : (tensor<300x3xf32>) -> tensor<300x3xf32>
%cst = constant {name: "constant.35"} dense<[[-1.060230e-01, 1.215050e-01, 8.002390e-01, -7.688850e-01, 0.0966112986], [6.890140e-01, -4.070560e-01, -0.797852993, 3.789250e-03, -2.088810e-01], [-6.085290e-01, 2.766170e-02, 2.685570e-01, 5.774010e-01, -4.284370e-01]]> : tensor<3x5xf32>
%1 = "fxpmath.real_matmul"(%0, %cst) {clamp_max: 6.10, clamp_min: -12.25} : (tensor<300x3xf32>, tensor<3x5xf32>) -> tensor<300x5xf32>
%0 = "quant.stats"(%arg0) {layerStats = dense<[-6.123e+00, 3.45e+00]> : tensor<2xf32>} : (tensor<300x3xf32>) -> tensor<300x3xf32>
%cst = constant {name = "constant.35"} dense<[[-1.060230e-01, 1.215050e-01, 8.002390e-01, -7.688850e-01, 0.0966112986], [6.890140e-01, -4.070560e-01, -0.797852993, 3.789250e-03, -2.088810e-01], [-6.085290e-01, 2.766170e-02, 2.685570e-01, 5.774010e-01, -4.284370e-01]]> : tensor<3x5xf32>
%1 = "fxpmath.real_matmul"(%0, %cst) {clamp_max = 6.10, clamp_min = -12.25} : (tensor<300x3xf32>, tensor<3x5xf32>) -> tensor<300x5xf32>
return %1 : tensor<300x5xf32>
}
@ -39,13 +39,13 @@ func @matmul_clamp(%arg0: tensor<300x3xf32>) -> tensor<300x5xf32> {
// CHECK-NEXT: %0 = "quant.qcast"(%arg0) : (tensor<300x3xf32>) -> tensor<300x3x!quant.uniform<i8:f32, 0.037564418067230126:35>>
// CHECK-NEXT: %1 = "quant.scast"(%cst) : (tensor<3x5xi8>) -> tensor<3x5x!quant.uniform<i8:f32, 0.0062823070315864236:-1>>
// CHECK-NEXT: %2 = "quant.scast"(%cst_0) : (tensor<5xi32>) -> tensor<5x!quant.uniform<i32:f32, 0.072058823529412216>>
// CHECK-NEXT: %3 = "fxpmath.real_matmul_bias"(%0, %1, %2) {clamp_max: 6.100000e+00 : f64, clamp_min: -1.225000e+01 : f64} : (tensor<300x3x!quant.uniform<i8:f32, 0.037564418067230126:35>>, tensor<3x5x!quant.uniform<i8:f32, 0.0062823070315864236:-1>>, tensor<5x!quant.uniform<i32:f32, 0.072058823529412216>>) -> tensor<300x5x!quant.uniform<i8:f32, 0.072058823529412216:42>>
// CHECK-NEXT: %3 = "fxpmath.real_matmul_bias"(%0, %1, %2) {clamp_max = 6.100000e+00 : f64, clamp_min = -1.225000e+01 : f64} : (tensor<300x3x!quant.uniform<i8:f32, 0.037564418067230126:35>>, tensor<3x5x!quant.uniform<i8:f32, 0.0062823070315864236:-1>>, tensor<5x!quant.uniform<i32:f32, 0.072058823529412216>>) -> tensor<300x5x!quant.uniform<i8:f32, 0.072058823529412216:42>>
// CHECK-NEXT: %4 = "quant.dcast"(%3) : (tensor<300x5x!quant.uniform<i8:f32, 0.072058823529412216:42>>) -> tensor<300x5xf32>
func @matmul_add_clamp(%arg0: tensor<300x3xf32>) -> tensor<300x5xf32> {
%0 = "quant.stats"(%arg0) {layerStats: dense<[-6.123e+00, 3.45e+00]> : tensor<2xf32>} : (tensor<300x3xf32>) -> tensor<300x3xf32>
%cst = constant {name: "constant.35"} dense<[[-1.060230e-01, 1.215050e-01, 8.002390e-01, -7.688850e-01, 0.0966112986], [6.890140e-01, -4.070560e-01, -0.797852993, 3.789250e-03, -2.088810e-01], [-6.085290e-01, 2.766170e-02, 2.685570e-01, 5.774010e-01, -4.284370e-01]]> : tensor<3x5xf32>
%cst_0 = constant {name: "constant.37"} dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00]> : tensor<5xf32>
%1 = "fxpmath.real_matmul_bias"(%0, %cst, %cst_0) {clamp_max: 6.10, clamp_min: -12.25} : (tensor<300x3xf32>, tensor<3x5xf32>, tensor<5xf32>) -> tensor<300x5xf32>
%0 = "quant.stats"(%arg0) {layerStats = dense<[-6.123e+00, 3.45e+00]> : tensor<2xf32>} : (tensor<300x3xf32>) -> tensor<300x3xf32>
%cst = constant {name = "constant.35"} dense<[[-1.060230e-01, 1.215050e-01, 8.002390e-01, -7.688850e-01, 0.0966112986], [6.890140e-01, -4.070560e-01, -0.797852993, 3.789250e-03, -2.088810e-01], [-6.085290e-01, 2.766170e-02, 2.685570e-01, 5.774010e-01, -4.284370e-01]]> : tensor<3x5xf32>
%cst_0 = constant {name = "constant.37"} dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00]> : tensor<5xf32>
%1 = "fxpmath.real_matmul_bias"(%0, %cst, %cst_0) {clamp_max = 6.10, clamp_min = -12.25} : (tensor<300x3xf32>, tensor<3x5xf32>, tensor<5xf32>) -> tensor<300x5xf32>
return %1 : tensor<300x5xf32>
}

View File

@ -4,11 +4,11 @@
// CHECK-LABEL: remove_ops
func @remove_ops(%arg0: tensor<8x4x3xf32>) -> tensor<8x4x3xf32> {
%0 = "quant.stats"(%arg0) {
layerStats: dense<[-1.0, 1.0]> : tensor<2xf32>
layerStats = dense<[-1.0, 1.0]> : tensor<2xf32>
} : (tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
%1 = "quant.coupled_ref"(%0) { coupledKey: "foobar" } :
%1 = "quant.coupled_ref"(%0) { coupledKey = "foobar" } :
(tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
%2 = "quant.stats_ref"(%1) { statsKey: "foobar" } :
%2 = "quant.stats_ref"(%1) { statsKey = "foobar" } :
(tensor<8x4x3xf32>) -> tensor<8x4x3xf32>
// CHECK: return %arg0 : tensor<8x4x3xf32>
return %2 : tensor<8x4x3xf32>

View File

@ -1,13 +1,13 @@
// RUN: mlir-translate -serialize-spirv %s | mlir-translate -deserialize-spirv | FileCheck %s
// CHECK: spv.module {
// CHECK-NEXT: } attributes {addressing_model: "Logical", major_version: 1 : i32, memory_model: "VulkanKHR", minor_version: 0 : i32}
// CHECK-NEXT: } attributes {addressing_model = "Logical", major_version = 1 : i32, memory_model = "VulkanKHR", minor_version = 0 : i32}
func @spirv_module() -> () {
spv.module {
} attributes {
addressing_model: "Logical",
memory_model: "VulkanKHR"
addressing_model = "Logical",
memory_model = "VulkanKHR"
}
return
}

View File

@ -171,8 +171,8 @@ func @return_mismatch_func_signature() -> () {
spv.Return
}
} attributes {
addressing_model: "Logical",
memory_model: "VulkanKHR"
addressing_model = "Logical",
memory_model = "VulkanKHR"
}
return
}
@ -314,8 +314,8 @@ func @variable_bind() -> () {
func @variable_init_bind() -> () {
%0 = spv.constant 4.0 : f32
// CHECK: spv.Variable init(%0) {binding: 5 : i32} : !spv.ptr<f32, Private>
%1 = spv.Variable init(%0) {binding: 5 : i32} : !spv.ptr<f32, Private>
// CHECK: spv.Variable init(%0) {binding = 5 : i32} : !spv.ptr<f32, Private>
%1 = spv.Variable init(%0) {binding = 5 : i32} : !spv.ptr<f32, Private>
return
}
@ -340,7 +340,7 @@ func @variable_init(%arg0: f32) -> () {
func @storage_class_mismatch() -> () {
%0 = spv.constant 5.0 : f32
// expected-error @+1 {{storage class must match result pointer's storage class}}
%1 = "spv.Variable"(%0) {storage_class : "Uniform"} : (f32) -> !spv.ptr<f32, Function>
%1 = "spv.Variable"(%0) {storage_class = "Uniform"} : (f32) -> !spv.ptr<f32, Function>
return
}

View File

@ -50,7 +50,7 @@ func @array_constant() -> () {
func @value_result_type_mismatch() -> () {
// expected-error @+1 {{result type ('vector<4xi32>') does not match value type ('tensor<4xi32>')}}
%0 = "spv.constant"() {value: dense<0> : tensor<4xi32>} : () -> (vector<4xi32>)
%0 = "spv.constant"() {value = dense<0> : tensor<4xi32>} : () -> (vector<4xi32>)
}
// -----
@ -63,8 +63,8 @@ func @value_result_type_mismatch() -> () {
func @module_without_cap_ext() -> () {
// CHECK: spv.module
spv.module { } attributes {
addressing_model: "Logical",
memory_model: "VulkanKHR"
addressing_model = "Logical",
memory_model = "VulkanKHR"
}
return
}
@ -73,10 +73,10 @@ func @module_without_cap_ext() -> () {
func @module_with_cap_ext() -> () {
// CHECK: spv.module
spv.module { } attributes {
capability: ["Shader"],
extension: ["SPV_KHR_16bit_storage"],
addressing_model: "Logical",
memory_model: "VulkanKHR"
capability = ["Shader"],
extension = ["SPV_KHR_16bit_storage"],
addressing_model = "Logical",
memory_model = "VulkanKHR"
}
return
}
@ -87,8 +87,8 @@ func @module_with_explict_module_end() -> () {
spv.module {
spv._module_end
} attributes {
addressing_model: "Logical",
memory_model: "VulkanKHR"
addressing_model = "Logical",
memory_model = "VulkanKHR"
}
return
}
@ -101,8 +101,8 @@ func @module_with_func() -> () {
spv.Return
}
} attributes {
addressing_model: "Logical",
memory_model: "VulkanKHR"
addressing_model = "Logical",
memory_model = "VulkanKHR"
}
return
}
@ -119,7 +119,7 @@ func @missing_addressing_model() -> () {
func @wrong_addressing_model() -> () {
// expected-error@+1 {{attribute 'addressing_model' failed to satisfy constraint}}
spv.module { } attributes {addressing_model: "Physical", memory_model: "VulkanHKR"}
spv.module { } attributes {addressing_model = "Physical", memory_model = "VulkanHKR"}
return
}
@ -127,7 +127,7 @@ func @wrong_addressing_model() -> () {
func @missing_memory_model() -> () {
// expected-error@+1 {{requires attribute 'memory_model'}}
spv.module { } attributes {addressing_model: "Logical"}
spv.module { } attributes {addressing_model = "Logical"}
return
}
@ -141,8 +141,8 @@ func @module_with_multiple_blocks() -> () {
^second:
spv.Return
} attributes {
addressing_model: "Logical",
memory_model: "VulkanKHR"
addressing_model = "Logical",
memory_model = "VulkanKHR"
}
return
}
@ -154,8 +154,8 @@ func @use_non_spv_op_inside_module() -> () {
// expected-error @+1 {{'spv.module' can only contain func and spv.* ops}}
"dialect.op"() : () -> ()
} attributes {
addressing_model: "Logical",
memory_model: "VulkanKHR"
addressing_model = "Logical",
memory_model = "VulkanKHR"
}
return
}
@ -169,8 +169,8 @@ func @use_non_spv_op_inside_func() -> () {
"dialect.op"() : () -> ()
}
} attributes {
addressing_model: "Logical",
memory_model: "VulkanKHR"
addressing_model = "Logical",
memory_model = "VulkanKHR"
}
return
}
@ -182,8 +182,8 @@ func @use_extern_func() -> () {
// expected-error @+1 {{'spv.module' cannot contain external functions}}
func @extern() -> ()
} attributes {
addressing_model: "Logical",
memory_model: "VulkanKHR"
addressing_model = "Logical",
memory_model = "VulkanKHR"
}
return
}
@ -200,8 +200,8 @@ func @module_with_nested_func() -> () {
spv.Return
}
} attributes {
addressing_model: "Logical",
memory_model: "VulkanKHR"
addressing_model = "Logical",
memory_model = "VulkanKHR"
}
return
}

View File

@ -803,13 +803,13 @@ func @cond_br_arguments(%arg0: !llvm.i1, %arg1: !llvm.i1) {
}
// CHECK-LABEL: define void @llvm_noalias(float* noalias) {
func @llvm_noalias(%arg0: !llvm<"float*"> {llvm.noalias: true}) {
func @llvm_noalias(%arg0: !llvm<"float*"> {llvm.noalias = true}) {
llvm.return
}
// CHECK-LABEL: @llvm_varargs(...)
func @llvm_varargs()
attributes {std.varargs: true}
attributes {std.varargs = true}
func @intpointerconversion(%arg0 : !llvm.i32) -> !llvm.i32 {
// CHECK: %2 = inttoptr i32 %0 to i32*

View File

@ -3,129 +3,129 @@
// For all these cases, the test traverses the `test_affine_map` ops and
// composes them in order one-by-one.
// For instance, the pseudo-sequence:
// "test_affine_map"() { affine_map: f } : () -> ()
// "test_affine_map"() { affine_map: g } : () -> ()
// "test_affine_map"() { affine_map: h } : () -> ()
// "test_affine_map"() { affine_map = f } : () -> ()
// "test_affine_map"() { affine_map = g } : () -> ()
// "test_affine_map"() { affine_map = h } : () -> ()
// will produce the sequence of compositions: f, g(f), h(g(f)) and print the
// AffineMap h(g(f)), which is what FileCheck checks against.
func @simple1() {
// CHECK: Composed map: (d0) -> (d0)
"test_affine_map"() { affine_map: (d0) -> (d0 - 1) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 + 1) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 - 1) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 + 1) } : () -> ()
return
}
func @simple2() {
// CHECK: Composed map: (d0)[s0, s1] -> (d0 - s0 + s1)
"test_affine_map"() { affine_map: (d0)[s0] -> (d0 + s0 - 1) } : () -> ()
"test_affine_map"() { affine_map: (d0)[s0] -> (d0 - s0 + 1) } : () -> ()
"test_affine_map"() { affine_map = (d0)[s0] -> (d0 + s0 - 1) } : () -> ()
"test_affine_map"() { affine_map = (d0)[s0] -> (d0 - s0 + 1) } : () -> ()
return
}
func @simple3a() {
// CHECK: Composed map: (d0, d1)[s0, s1, s2, s3] -> ((d0 ceildiv s2) * s0, (d1 ceildiv s3) * s1)
"test_affine_map"() { affine_map: (d0, d1)[s0, s1] -> (d0 ceildiv s0, d1 ceildiv s1) } : () -> ()
"test_affine_map"() { affine_map: (d0, d1)[s0, s1] -> (d0 * s0, d1 * s1) } : () -> ()
"test_affine_map"() { affine_map = (d0, d1)[s0, s1] -> (d0 ceildiv s0, d1 ceildiv s1) } : () -> ()
"test_affine_map"() { affine_map = (d0, d1)[s0, s1] -> (d0 * s0, d1 * s1) } : () -> ()
return
}
func @simple3b() {
// CHECK: Composed map: (d0, d1)[s0, s1] -> (d0 mod s0, d1 mod s1)
"test_affine_map"() { affine_map: (d0, d1)[s0, s1] -> (d0 mod s0, d1 mod s1) } : () -> ()
"test_affine_map"() { affine_map = (d0, d1)[s0, s1] -> (d0 mod s0, d1 mod s1) } : () -> ()
return
}
func @simple3c() {
// CHECK: Composed map: (d0, d1)[s0, s1, s2, s3, s4, s5] -> ((d0 ceildiv s4) * s4 + d0 mod s2, (d1 ceildiv s5) * s5 + d1 mod s3)
"test_affine_map"() { affine_map: (d0, d1)[s0, s1] -> ((d0 ceildiv s0) * s0, (d1 ceildiv s1) * s1, d0, d1) } : () -> ()
"test_affine_map"() { affine_map: (d0, d1, d2, d3)[s0, s1, s2, s3] -> (d0 + d2 mod s2, d1 + d3 mod s3) } : () -> ()
"test_affine_map"() { affine_map = (d0, d1)[s0, s1] -> ((d0 ceildiv s0) * s0, (d1 ceildiv s1) * s1, d0, d1) } : () -> ()
"test_affine_map"() { affine_map = (d0, d1, d2, d3)[s0, s1, s2, s3] -> (d0 + d2 mod s2, d1 + d3 mod s3) } : () -> ()
return
}
func @simple4() {
// CHECK: Composed map: (d0, d1)[s0, s1] -> (d1 * s1, d0 ceildiv s0)
"test_affine_map"() { affine_map: (d0, d1) -> (d1, d0) } : () -> ()
"test_affine_map"() { affine_map: (d0, d1)[s0, s1] -> (d0 * s1, d1 ceildiv s0) } : () -> ()
"test_affine_map"() { affine_map = (d0, d1) -> (d1, d0) } : () -> ()
"test_affine_map"() { affine_map = (d0, d1)[s0, s1] -> (d0 * s1, d1 ceildiv s0) } : () -> ()
return
}
func @simple5a() {
// CHECK: Composed map: (d0) -> (d0 * 3 + 18)
"test_affine_map"() { affine_map: (d0) -> (d0 - 1) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 + 7) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 * 24) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 ceildiv 8) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 - 1) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 + 7) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 * 24) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 ceildiv 8) } : () -> ()
return
}
func @simple5b() {
// CHECK: Composed map: (d0) -> ((d0 + 6) ceildiv 2)
"test_affine_map"() { affine_map: (d0) -> (d0 - 1) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 + 7) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 * 4) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 ceildiv 8) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 - 1) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 + 7) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 * 4) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 ceildiv 8) } : () -> ()
return
}
func @simple5c() {
// CHECK: Composed map: (d0) -> (d0 * 8 + 48)
"test_affine_map"() { affine_map: (d0) -> (d0 - 1) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 + 7) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 * 24) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 floordiv 3) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 - 1) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 + 7) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 * 24) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 floordiv 3) } : () -> ()
return
}
func @simple5d() {
// CHECK: Composed map: (d0) -> ((d0 * 4 + 24) floordiv 3)
"test_affine_map"() { affine_map: (d0) -> (d0 - 1) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 + 7) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 * 4) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 floordiv 3) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 - 1) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 + 7) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 * 4) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 floordiv 3) } : () -> ()
return
}
func @simple5e() {
// CHECK: Composed map: (d0) -> ((d0 + 6) ceildiv 8)
"test_affine_map"() { affine_map: (d0) -> (d0 - 1) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 + 7) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 ceildiv 8) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 - 1) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 + 7) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 ceildiv 8) } : () -> ()
return
}
func @simple5f() {
// CHECK: Composed map: (d0) -> ((d0 * 4 - 4) floordiv 3)
"test_affine_map"() { affine_map: (d0) -> (d0 - 1) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 * 4) } : () -> ()
"test_affine_map"() { affine_map: (d0) -> (d0 floordiv 3) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 - 1) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 * 4) } : () -> ()
"test_affine_map"() { affine_map = (d0) -> (d0 floordiv 3) } : () -> ()
return
}
func @perm_and_proj() {
// CHECK: Composed map: (d0, d1, d2, d3) -> (d1, d3, d0)
"test_affine_map"() { affine_map: (d0, d1, d2, d3) -> (d3, d1, d2, d0) } : () -> ()
"test_affine_map"() { affine_map: (d0, d1, d2, d3) -> (d1, d0, d3) } : () -> ()
"test_affine_map"() { affine_map = (d0, d1, d2, d3) -> (d3, d1, d2, d0) } : () -> ()
"test_affine_map"() { affine_map = (d0, d1, d2, d3) -> (d1, d0, d3) } : () -> ()
return
}
func @symbols1() {
// CHECK: Composed map: (d0)[s0] -> (d0 + s0 + 1, d0 - s0 - 1)
"test_affine_map"() { affine_map: (d0)[s0] -> (d0 + s0, d0 - s0) } : () -> ()
"test_affine_map"() { affine_map: (d0, d1) -> (d0 + 1, d1 - 1) } : () -> ()
"test_affine_map"() { affine_map = (d0)[s0] -> (d0 + s0, d0 - s0) } : () -> ()
"test_affine_map"() { affine_map = (d0, d1) -> (d0 + 1, d1 - 1) } : () -> ()
return
}
func @drop() {
// CHECK: Composed map: (d0, d1, d2)[s0, s1] -> (d0 * 2 + d1 + d2 + s1)
"test_affine_map"() { affine_map: (d0, d1, d2)[s0, s1] -> (d0 + s1, d1 + s0, d0 + d1 + d2) } : () -> ()
"test_affine_map"() { affine_map: (d0, d1, d2) -> (d0 + d2) } : () -> ()
"test_affine_map"() { affine_map = (d0, d1, d2)[s0, s1] -> (d0 + s1, d1 + s0, d0 + d1 + d2) } : () -> ()
"test_affine_map"() { affine_map = (d0, d1, d2) -> (d0 + d2) } : () -> ()
return
}
func @multi_symbols() {
// CHECK: Composed map: (d0)[s0, s1, s2] -> (d0 + s1 + s2 + 1, d0 - s0 - s2 - 1)
"test_affine_map"() { affine_map: (d0)[s0] -> (d0 + s0, d0 - s0) } : () -> ()
"test_affine_map"() { affine_map: (d0, d1)[s0, s1] -> (d0 + 1 + s1, d1 - 1 - s0) } : () -> ()
"test_affine_map"() { affine_map = (d0)[s0] -> (d0 + s0, d0 - s0) } : () -> ()
"test_affine_map"() { affine_map = (d0, d1)[s0, s1] -> (d0 + 1 + s1, d1 - 1 - s0) } : () -> ()
return
}

View File

@ -8,13 +8,13 @@ func @materialize_read_1d() {
%A = alloc () : memref<7x42xf32>
affine.for %i0 = 0 to 7 step 4 {
affine.for %i1 = 0 to 42 step 4 {
%f1 = vector.transfer_read %A[%i0, %i1] {permutation_map: (d0, d1) -> (d0)} : memref<7x42xf32>, vector<4xf32>
%f1 = vector.transfer_read %A[%i0, %i1] {permutation_map = (d0, d1) -> (d0)} : memref<7x42xf32>, vector<4xf32>
%ip1 = affine.apply (d0) -> (d0 + 1) (%i1)
%f2 = vector.transfer_read %A[%i0, %ip1] {permutation_map: (d0, d1) -> (d0)} : memref<7x42xf32>, vector<4xf32>
%f2 = vector.transfer_read %A[%i0, %ip1] {permutation_map = (d0, d1) -> (d0)} : memref<7x42xf32>, vector<4xf32>
%ip2 = affine.apply (d0) -> (d0 + 2) (%i1)
%f3 = vector.transfer_read %A[%i0, %ip2] {permutation_map: (d0, d1) -> (d0)} : memref<7x42xf32>, vector<4xf32>
%f3 = vector.transfer_read %A[%i0, %ip2] {permutation_map = (d0, d1) -> (d0)} : memref<7x42xf32>, vector<4xf32>
%ip3 = affine.apply (d0) -> (d0 + 3) (%i1)
%f4 = vector.transfer_read %A[%i0, %ip3] {permutation_map: (d0, d1) -> (d0)} : memref<7x42xf32>, vector<4xf32>
%f4 = vector.transfer_read %A[%i0, %ip3] {permutation_map = (d0, d1) -> (d0)} : memref<7x42xf32>, vector<4xf32>
// Both accesses in the load must be clipped otherwise %i1 + 2 and %i1 + 3 will go out of bounds.
// CHECK: {{.*}} = select
// CHECK: %[[FILTERED1:.*]] = select
@ -34,9 +34,9 @@ func @materialize_read_1d_partially_specialized(%dyn1 : index, %dyn2 : index, %d
affine.for %i2 = 0 to %dyn2 {
affine.for %i3 = 0 to 42 step 2 {
affine.for %i4 = 0 to %dyn4 {
%f1 = vector.transfer_read %A[%i0, %i1, %i2, %i3, %i4] {permutation_map: (d0, d1, d2, d3, d4) -> (d3)} : memref<7x?x?x42x?xf32>, vector<4xf32>
%f1 = vector.transfer_read %A[%i0, %i1, %i2, %i3, %i4] {permutation_map = (d0, d1, d2, d3, d4) -> (d3)} : memref<7x?x?x42x?xf32>, vector<4xf32>
%i3p1 = affine.apply (d0) -> (d0 + 1) (%i3)
%f2 = vector.transfer_read %A[%i0, %i1, %i2, %i3p1, %i4] {permutation_map: (d0, d1, d2, d3, d4) -> (d3)} : memref<7x?x?x42x?xf32>, vector<4xf32>
%f2 = vector.transfer_read %A[%i0, %i1, %i2, %i3p1, %i4] {permutation_map = (d0, d1, d2, d3, d4) -> (d3)} : memref<7x?x?x42x?xf32>, vector<4xf32>
}
}
}
@ -116,7 +116,7 @@ func @materialize_read(%M: index, %N: index, %O: index, %P: index) {
affine.for %i1 = 0 to %N {
affine.for %i2 = 0 to %O {
affine.for %i3 = 0 to %P step 5 {
%f = vector.transfer_read %A[%i0, %i1, %i2, %i3] {permutation_map: (d0, d1, d2, d3) -> (d3, 0, d0)} : memref<?x?x?x?xf32>, vector<5x4x3xf32>
%f = vector.transfer_read %A[%i0, %i1, %i2, %i3] {permutation_map = (d0, d1, d2, d3) -> (d3, 0, d0)} : memref<?x?x?x?xf32>, vector<5x4x3xf32>
}
}
}
@ -193,7 +193,7 @@ func @materialize_write(%M: index, %N: index, %O: index, %P: index) {
affine.for %i1 = 0 to %N step 4 {
affine.for %i2 = 0 to %O {
affine.for %i3 = 0 to %P step 5 {
vector.transfer_write %f1, %A[%i0, %i1, %i2, %i3] {permutation_map: (d0, d1, d2, d3) -> (d3, d1, d0)} : vector<5x4x3xf32>, memref<?x?x?x?xf32>
vector.transfer_write %f1, %A[%i0, %i1, %i2, %i3] {permutation_map = (d0, d1, d2, d3) -> (d3, d1, d0)} : vector<5x4x3xf32>, memref<?x?x?x?xf32>
}
}
}

View File

@ -18,18 +18,18 @@ func @materialize(%M : index, %N : index, %O : index, %P : index) {
// CHECK-NEXT: %[[b:[0-9]+]] = {{.*}}[[ID1]](%i1)
// CHECK-NEXT: %[[c:[0-9]+]] = {{.*}}[[ID1]](%i2)
// CHECK-NEXT: %[[d:[0-9]+]] = {{.*}}[[ID1]](%i3)
// CHECK-NEXT: vector.transfer_write {{.*}}, %0[%[[a]], %[[b]], %[[c]], %[[d]]] {permutation_map: #[[D0D1D2D3TOD1D0]]} : vector<4x4xf32>, memref<?x?x?x?xf32>
// CHECK-NEXT: vector.transfer_write {{.*}}, %0[%[[a]], %[[b]], %[[c]], %[[d]]] {permutation_map = #[[D0D1D2D3TOD1D0]]} : vector<4x4xf32>, memref<?x?x?x?xf32>
// CHECK: %[[b1:[0-9]+]] = {{.*}}[[D0P1]](%i1)
// CHECK: vector.transfer_write {{.*}}, %0[{{.*}}, %[[b1]], {{.*}}] {permutation_map: #[[D0D1D2D3TOD1D0]]} : vector<4x4xf32>, memref<?x?x?x?xf32>
// CHECK: vector.transfer_write {{.*}}, %0[{{.*}}, %[[b1]], {{.*}}] {permutation_map = #[[D0D1D2D3TOD1D0]]} : vector<4x4xf32>, memref<?x?x?x?xf32>
// CHECK: %[[b2:[0-9]+]] = {{.*}}[[D0P2]](%i1)
// CHECK: vector.transfer_write {{.*}}, %0[{{.*}}, %[[b2]], {{.*}}] {permutation_map: #[[D0D1D2D3TOD1D0]]} : vector<4x4xf32>, memref<?x?x?x?xf32>
// CHECK: vector.transfer_write {{.*}}, %0[{{.*}}, %[[b2]], {{.*}}] {permutation_map = #[[D0D1D2D3TOD1D0]]} : vector<4x4xf32>, memref<?x?x?x?xf32>
// CHECK: %[[b3:[0-9]+]] = {{.*}}[[D0P3]](%i1)
// CHECK: vector.transfer_write {{.*}}, %0[{{.*}}, %[[b3]], {{.*}}] {permutation_map: #[[D0D1D2D3TOD1D0]]} : vector<4x4xf32>, memref<?x?x?x?xf32>
// CHECK: vector.transfer_write {{.*}}, %0[{{.*}}, %[[b3]], {{.*}}] {permutation_map = #[[D0D1D2D3TOD1D0]]} : vector<4x4xf32>, memref<?x?x?x?xf32>
affine.for %i0 = 0 to %M step 4 {
affine.for %i1 = 0 to %N step 4 {
affine.for %i2 = 0 to %O {
affine.for %i3 = 0 to %P step 4 {
vector.transfer_write %f1, %A[%i0, %i1, %i2, %i3] {permutation_map: (d0, d1, d2, d3) -> (d3, d1, d0)} : vector<4x4x4xf32>, memref<?x?x?x?xf32, 0>
vector.transfer_write %f1, %A[%i0, %i1, %i2, %i3] {permutation_map = (d0, d1, d2, d3) -> (d3, d1, d0)} : vector<4x4x4xf32>, memref<?x?x?x?xf32, 0>
}
}
}

View File

@ -23,16 +23,16 @@ func @vector_add_2d(%M : index, %N : index) -> f32 {
// CHECK-NEXT: %[[CST3:.*]] = constant dense<1.000000e+00> : vector<8xf32>
// CHECK-NEXT: %[[VAL00:.*]] = affine.apply [[ID1]]{{.*}}
// CHECK-NEXT: %[[VAL01:.*]] = affine.apply [[ID1]]{{.*}}
// CHECK-NEXT: vector.transfer_write %[[CST0]], {{.*}}[%[[VAL00]], %[[VAL01]]] {permutation_map: [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write %[[CST0]], {{.*}}[%[[VAL00]], %[[VAL01]]] {permutation_map = [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: %[[VAL10:.*]] = affine.apply [[ID1]]{{.*}}
// CHECK-NEXT: %[[VAL11:.*]] = affine.apply [[D0P8]]{{.*}}
// CHECK-NEXT: vector.transfer_write %[[CST1]], {{.*}}[%[[VAL10]], %[[VAL11]]] {permutation_map: [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write %[[CST1]], {{.*}}[%[[VAL10]], %[[VAL11]]] {permutation_map = [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: %[[VAL20:.*]] = affine.apply [[ID1]]{{.*}}
// CHECK-NEXT: %[[VAL21:.*]] = affine.apply [[D0P16]]{{.*}}
// CHECK-NEXT: vector.transfer_write %[[CST2]], {{.*}}[%[[VAL20]], %[[VAL21]]] {permutation_map: [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write %[[CST2]], {{.*}}[%[[VAL20]], %[[VAL21]]] {permutation_map = [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: %[[VAL30:.*]] = affine.apply [[ID1]]{{.*}}
// CHECK-NEXT: %[[VAL31:.*]] = affine.apply [[D0P24]]{{.*}}
// CHECK-NEXT: vector.transfer_write %[[CST3]], {{.*}}[%[[VAL30]], %[[VAL31]]] {permutation_map: [[D0D1TOD1]]} : vector<8xf32>
// CHECK-NEXT: vector.transfer_write %[[CST3]], {{.*}}[%[[VAL30]], %[[VAL31]]] {permutation_map = [[D0D1TOD1]]} : vector<8xf32>
//
affine.for %i0 = 0 to %M {
affine.for %i1 = 0 to %N {
@ -49,16 +49,16 @@ func @vector_add_2d(%M : index, %N : index) -> f32 {
// CHECK-NEXT: %[[CST3:.*]] = constant dense<2.000000e+00> : vector<8xf32>
// CHECK-NEXT: %[[VAL00:.*]] = affine.apply [[ID1]]{{.*}}
// CHECK-NEXT: %[[VAL01:.*]] = affine.apply [[ID1]]{{.*}}
// CHECK-NEXT: vector.transfer_write %[[CST0]], {{.*}}[%[[VAL00]], %[[VAL01]]] {permutation_map: [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write %[[CST0]], {{.*}}[%[[VAL00]], %[[VAL01]]] {permutation_map = [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: %[[VAL10:.*]] = affine.apply [[ID1]]{{.*}}
// CHECK-NEXT: %[[VAL11:.*]] = affine.apply [[D0P8]]{{.*}}
// CHECK-NEXT: vector.transfer_write %[[CST1]], {{.*}}[%[[VAL10]], %[[VAL11]]] {permutation_map: [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write %[[CST1]], {{.*}}[%[[VAL10]], %[[VAL11]]] {permutation_map = [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: %[[VAL20:.*]] = affine.apply [[ID1]]{{.*}}
// CHECK-NEXT: %[[VAL21:.*]] = affine.apply [[D0P16]]{{.*}}
// CHECK-NEXT: vector.transfer_write %[[CST2]], {{.*}}[%[[VAL20]], %[[VAL21]]] {permutation_map: [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write %[[CST2]], {{.*}}[%[[VAL20]], %[[VAL21]]] {permutation_map = [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: %[[VAL30:.*]] = affine.apply [[ID1]]{{.*}}
// CHECK-NEXT: %[[VAL31:.*]] = affine.apply [[D0P24]]{{.*}}
// CHECK-NEXT: vector.transfer_write %[[CST3]], {{.*}}[%[[VAL30]], %[[VAL31]]] {permutation_map: [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write %[[CST3]], {{.*}}[%[[VAL30]], %[[VAL31]]] {permutation_map = [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
//
affine.for %i2 = 0 to %M {
affine.for %i3 = 0 to %N {

View File

@ -25,22 +25,22 @@ func @vector_add_2d(%M : index, %N : index) -> f32 {
// CHECK-NEXT: {{.*}} = constant dense<1.000000e+00> : vector<8xf32>
// CHECK-NEXT: %[[VAL00:.*]] = affine.apply [[ID1]](%i0)
// CHECK-NEXT: %[[VAL01:.*]] = affine.apply [[ID1]](%i1)
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL00]], %[[VAL01]]] {permutation_map: [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL00]], %[[VAL01]]] {permutation_map = [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: %[[VAL10:.*]] = affine.apply [[ID1]](%i0)
// CHECK-NEXT: %[[VAL11:.*]] = affine.apply [[D0P8]](%i1)
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL10]], %[[VAL11]]] {permutation_map: [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL10]], %[[VAL11]]] {permutation_map = [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: %[[VAL20:.*]] = affine.apply [[D0P1]](%i0)
// CHECK-NEXT: %[[VAL21:.*]] = affine.apply [[ID1]](%i1)
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL20]], %[[VAL21]]] {permutation_map: [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL20]], %[[VAL21]]] {permutation_map = [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: %[[VAL30:.*]] = affine.apply [[D0P1]](%i0)
// CHECK-NEXT: %[[VAL31:.*]] = affine.apply [[D0P8]](%i1)
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL30]], %[[VAL31]]] {permutation_map: [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL30]], %[[VAL31]]] {permutation_map = [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: %[[VAL40:.*]] = affine.apply [[D0P2]](%i0)
// CHECK-NEXT: %[[VAL41:.*]] = affine.apply [[ID1]](%i1)
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL40]], %[[VAL41]]] {permutation_map: [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL40]], %[[VAL41]]] {permutation_map = [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: %[[VAL50:.*]] = affine.apply [[D0P2]](%i0)
// CHECK-NEXT: %[[VAL51:.*]] = affine.apply [[D0P8]](%i1)
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL50]], %[[VAL51]]] {permutation_map: [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL50]], %[[VAL51]]] {permutation_map = [[D0D1TOD1]]} : vector<8xf32>, memref<?x?xf32>
affine.for %i0 = 0 to %M {
affine.for %i1 = 0 to %N {
// non-scoped %f1

View File

@ -19,10 +19,10 @@ func @vector_add_2d(%M : index, %N : index) -> f32 {
// CHECK-NEXT: {{.*}} = constant dense<1.000000e+00> : vector<3x16xf32>
// CHECK-NEXT: %[[VAL00:.*]] = affine.apply [[ID1]](%i0)
// CHECK-NEXT: %[[VAL01:.*]] = affine.apply [[ID1]](%i1)
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL00]], %[[VAL01]]] {permutation_map: [[ID2]]} : vector<3x16xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL00]], %[[VAL01]]] {permutation_map = [[ID2]]} : vector<3x16xf32>, memref<?x?xf32>
// CHECK-NEXT: %[[VAL10:.*]] = affine.apply [[ID1]](%i0)
// CHECK-NEXT: %[[VAL11:.*]] = affine.apply [[D0P16]](%i1)
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL10]], %[[VAL11]]] {permutation_map: [[ID2]]} : vector<3x16xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL10]], %[[VAL11]]] {permutation_map = [[ID2]]} : vector<3x16xf32>, memref<?x?xf32>
//
affine.for %i0 = 0 to %M {
affine.for %i1 = 0 to %N {
@ -37,10 +37,10 @@ func @vector_add_2d(%M : index, %N : index) -> f32 {
// CHECK-NEXT: {{.*}} = constant dense<2.000000e+00> : vector<3x16xf32>
// CHECK-NEXT: %[[VAL00:.*]] = affine.apply [[ID1]](%i2)
// CHECK-NEXT: %[[VAL01:.*]] = affine.apply [[ID1]](%i3)
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL00]], %[[VAL01]]] {permutation_map: [[ID2]]} : vector<3x16xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL00]], %[[VAL01]]] {permutation_map = [[ID2]]} : vector<3x16xf32>, memref<?x?xf32>
// CHECK-NEXT: %[[VAL10:.*]] = affine.apply [[ID1]](%i2)
// CHECK-NEXT: %[[VAL11:.*]] = affine.apply [[D0P16]](%i3)
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL10]], %[[VAL11]]] {permutation_map: [[ID2]]} : vector<3x16xf32>, memref<?x?xf32>
// CHECK-NEXT: vector.transfer_write {{.*}}, {{.*}}[%[[VAL10]], %[[VAL11]]] {permutation_map = [[ID2]]} : vector<3x16xf32>, memref<?x?xf32>
//
affine.for %i2 = 0 to %M {
affine.for %i3 = 0 to %N {

View File

@ -23,7 +23,7 @@ func @vec1d_1(%A : memref<?x?xf32>, %B : memref<?x?x?xf32>) {
%cst0 = constant 0 : index
//
// CHECK: for {{.*}} step 128
// CHECK-NEXT: {{.*}} = vector.transfer_read %arg0[%[[C0]], %[[C0]]] {permutation_map: #[[map_proj_d0d1_0]]} : memref<?x?xf32>, vector<128xf32>
// CHECK-NEXT: {{.*}} = vector.transfer_read %arg0[%[[C0]], %[[C0]]] {permutation_map = #[[map_proj_d0d1_0]]} : memref<?x?xf32>, vector<128xf32>
affine.for %i0 = 0 to %M { // vectorized due to scalar -> vector
%a0 = load %A[%cst0, %cst0] : memref<?x?xf32>
}
@ -43,7 +43,7 @@ func @vec1d_2(%A : memref<?x?xf32>, %B : memref<?x?x?xf32>) {
//
// CHECK:for [[IV3:%[a-zA-Z0-9]+]] = 0 to [[ARG_M]] step 128
// CHECK-NEXT: %[[APP3:[a-zA-Z0-9]+]] = affine.apply {{.*}}[[IV3]]
// CHECK-NEXT: {{.*}} = vector.transfer_read %arg0[%[[C0]], %[[APP3]]] {permutation_map: #[[map_proj_d0d1_d1]]} : memref<?x?xf32>, vector<128xf32>
// CHECK-NEXT: {{.*}} = vector.transfer_read %arg0[%[[C0]], %[[APP3]]] {permutation_map = #[[map_proj_d0d1_d1]]} : memref<?x?xf32>, vector<128xf32>
affine.for %i3 = 0 to %M { // vectorized
%r3 = affine.apply (d0) -> (d0) (%i3)
%a3 = load %A[%cst0, %r3] : memref<?x?xf32>
@ -66,7 +66,7 @@ func @vec1d_3(%A : memref<?x?xf32>, %B : memref<?x?x?xf32>) {
// CHECK-NEXT: for [[IV9:%[i0-9]*]] = 0 to [[ARG_N]] {
// CHECK-NEXT: %[[APP9_0:[0-9]+]] = affine.apply {{.*}}([[IV8]], [[IV9]])
// CHECK-NEXT: %[[APP9_1:[0-9]+]] = affine.apply {{.*}}([[IV8]], [[IV9]])
// CHECK-NEXT: {{.*}} = vector.transfer_read %arg0[%[[APP9_0]], %[[APP9_1]]] {permutation_map: #[[map_proj_d0d1_d1]]} : memref<?x?xf32>, vector<128xf32>
// CHECK-NEXT: {{.*}} = vector.transfer_read %arg0[%[[APP9_0]], %[[APP9_1]]] {permutation_map = #[[map_proj_d0d1_d1]]} : memref<?x?xf32>, vector<128xf32>
affine.for %i8 = 0 to %M { // vectorized
affine.for %i9 = 0 to %N {
%r90 = affine.apply (d0, d1) -> (d1) (%i8, %i9)
@ -87,7 +87,7 @@ func @vector_add_2d(%M : index, %N : index) -> f32 {
affine.for %i0 = 0 to %M {
affine.for %i1 = 0 to %N {
// CHECK: [[C1:%.*]] = constant dense<1.000000e+00> : vector<128xf32>
// CHECK: vector.transfer_write [[C1]], {{.*}} {permutation_map: #[[map_proj_d0d1_d1]]} : vector<128xf32>, memref<?x?xf32>
// CHECK: vector.transfer_write [[C1]], {{.*}} {permutation_map = #[[map_proj_d0d1_d1]]} : vector<128xf32>, memref<?x?xf32>
// non-scoped %f1
store %f1, %A[%i0, %i1] : memref<?x?xf32, 0>
}
@ -95,22 +95,22 @@ func @vector_add_2d(%M : index, %N : index) -> f32 {
affine.for %i2 = 0 to %M {
affine.for %i3 = 0 to %N {
// CHECK: [[C3:%.*]] = constant dense<2.000000e+00> : vector<128xf32>
// CHECK: vector.transfer_write [[C3]], {{.*}} {permutation_map: #[[map_proj_d0d1_d1]]} : vector<128xf32>, memref<?x?xf32>
// CHECK: vector.transfer_write [[C3]], {{.*}} {permutation_map = #[[map_proj_d0d1_d1]]} : vector<128xf32>, memref<?x?xf32>
// non-scoped %f2
store %f2, %B[%i2, %i3] : memref<?x?xf32, 0>
}
}
affine.for %i4 = 0 to %M {
affine.for %i5 = 0 to %N {
// CHECK: [[A5:%.*]] = vector.transfer_read %0[{{.*}}] {permutation_map: #[[map_proj_d0d1_d1]]} : memref<?x?xf32>, vector<128xf32>
// CHECK: [[B5:%.*]] = vector.transfer_read %1[{{.*}}] {permutation_map: #[[map_proj_d0d1_d1]]} : memref<?x?xf32>, vector<128xf32>
// CHECK: [[A5:%.*]] = vector.transfer_read %0[{{.*}}] {permutation_map = #[[map_proj_d0d1_d1]]} : memref<?x?xf32>, vector<128xf32>
// CHECK: [[B5:%.*]] = vector.transfer_read %1[{{.*}}] {permutation_map = #[[map_proj_d0d1_d1]]} : memref<?x?xf32>, vector<128xf32>
// CHECK: [[S5:%.*]] = addf [[A5]], [[B5]] : vector<128xf32>
// CHECK: [[SPLAT1:%.*]] = constant dense<1.000000e+00> : vector<128xf32>
// CHECK: [[S6:%.*]] = addf [[S5]], [[SPLAT1]] : vector<128xf32>
// CHECK: [[SPLAT2:%.*]] = constant dense<2.000000e+00> : vector<128xf32>
// CHECK: [[S7:%.*]] = addf [[S5]], [[SPLAT2]] : vector<128xf32>
// CHECK: [[S8:%.*]] = addf [[S7]], [[S6]] : vector<128xf32>
// CHECK: vector.transfer_write [[S8]], {{.*}} {permutation_map: #[[map_proj_d0d1_d1]]} : vector<128xf32>, memref<?x?xf32>
// CHECK: vector.transfer_write [[S8]], {{.*}} {permutation_map = #[[map_proj_d0d1_d1]]} : vector<128xf32>, memref<?x?xf32>
%a5 = load %A[%i4, %i5] : memref<?x?xf32, 0>
%b5 = load %B[%i4, %i5] : memref<?x?xf32, 0>
%s5 = addf %a5, %b5 : f32
@ -181,7 +181,7 @@ func @vec_rejected_3(%A : memref<?x?xf32>, %B : memref<?x?x?xf32>) {
// CHECK-NEXT: for [[IV5:%[i0-9]*]] = 0 to [[ARG_N]] {
// CHECK-NEXT: %[[APP50:[0-9]+]] = affine.apply {{.*}}([[IV4]], [[IV5]])
// CHECK-NEXT: %[[APP51:[0-9]+]] = affine.apply {{.*}}([[IV4]], [[IV5]])
// CHECK-NEXT: {{.*}} = vector.transfer_read %arg0[%[[APP50]], %[[APP51]]] {permutation_map: #[[map_proj_d0d1_d1]]} : memref<?x?xf32>, vector<128xf32>
// CHECK-NEXT: {{.*}} = vector.transfer_read %arg0[%[[APP50]], %[[APP51]]] {permutation_map = #[[map_proj_d0d1_d1]]} : memref<?x?xf32>, vector<128xf32>
affine.for %i4 = 0 to %M { // vectorized
affine.for %i5 = 0 to %N { // not vectorized, would vectorize with --test-fastest-varying=1
%r50 = affine.apply (d0, d1) -> (d1) (%i4, %i5)
@ -300,7 +300,7 @@ func @vec_rejected_8(%A : memref<?x?xf32>, %B : memref<?x?x?xf32>) {
//
// CHECK: affine.for %i{{[0-9]*}} = 0 to %{{[0-9]*}} {
// CHECK: for [[IV18:%[a-zA-Z0-9]+]] = 0 to [[ARG_M]] step 128
// CHECK: {{.*}} = vector.transfer_read %arg0[%[[C0]], %[[C0]]] {permutation_map: #[[map_proj_d0d1_0]]} : memref<?x?xf32>, vector<128xf32>
// CHECK: {{.*}} = vector.transfer_read %arg0[%[[C0]], %[[C0]]] {permutation_map = #[[map_proj_d0d1_0]]} : memref<?x?xf32>, vector<128xf32>
affine.for %i17 = 0 to %M { // not vectorized, the 1-D pattern that matched %i18 in DFS post-order prevents vectorizing %i17
affine.for %i18 = 0 to %M { // vectorized due to scalar -> vector
%a18 = load %A[%cst0, %cst0] : memref<?x?xf32>
@ -322,7 +322,7 @@ func @vec_rejected_9(%A : memref<?x?xf32>, %B : memref<?x?x?xf32>) {
//
// CHECK: affine.for %i{{[0-9]*}} = 0 to %{{[0-9]*}} {
// CHECK: for [[IV18:%[a-zA-Z0-9]+]] = 0 to [[ARG_M]] step 128
// CHECK: {{.*}} = vector.transfer_read %arg0[%[[C0]], %[[C0]]] {permutation_map: #[[map_proj_d0d1_0]]} : memref<?x?xf32>, vector<128xf32>
// CHECK: {{.*}} = vector.transfer_read %arg0[%[[C0]], %[[C0]]] {permutation_map = #[[map_proj_d0d1_0]]} : memref<?x?xf32>, vector<128xf32>
affine.for %i17 = 0 to %M { // not vectorized, the 1-D pattern that matched %i18 in DFS post-order prevents vectorizing %i17
affine.for %i18 = 0 to %M { // vectorized due to scalar -> vector
%a18 = load %A[%cst0, %cst0] : memref<?x?xf32>

View File

@ -54,7 +54,7 @@ func @vector_add_2d(%M : index, %N : index) -> f32 {
affine.for %i0 = 0 to %M {
affine.for %i1 = 0 to %N {
// CHECK: [[C1:%.*]] = constant dense<1.000000e+00> : vector<32x256xf32>
// CHECK: vector.transfer_write [[C1]], {{.*}} {permutation_map: #[[map_id2]]} : vector<32x256xf32>, memref<?x?xf32>
// CHECK: vector.transfer_write [[C1]], {{.*}} {permutation_map = #[[map_id2]]} : vector<32x256xf32>, memref<?x?xf32>
// non-scoped %f1
store %f1, %A[%i0, %i1] : memref<?x?xf32, 0>
}
@ -62,22 +62,22 @@ func @vector_add_2d(%M : index, %N : index) -> f32 {
affine.for %i2 = 0 to %M {
affine.for %i3 = 0 to %N {
// CHECK: [[C3:%.*]] = constant dense<2.000000e+00> : vector<32x256xf32>
// CHECK: vector.transfer_write [[C3]], {{.*}} {permutation_map: #[[map_id2]]} : vector<32x256xf32>, memref<?x?xf32>
// CHECK: vector.transfer_write [[C3]], {{.*}} {permutation_map = #[[map_id2]]} : vector<32x256xf32>, memref<?x?xf32>
// non-scoped %f2
store %f2, %B[%i2, %i3] : memref<?x?xf32, 0>
}
}
affine.for %i4 = 0 to %M {
affine.for %i5 = 0 to %N {
// CHECK: [[A5:%.*]] = vector.transfer_read %0[{{.*}}] {permutation_map: #[[map_id2]]} : memref<?x?xf32>, vector<32x256xf32>
// CHECK: [[B5:%.*]] = vector.transfer_read %1[{{.*}}] {permutation_map: #[[map_id2]]} : memref<?x?xf32>, vector<32x256xf32>
// CHECK: [[A5:%.*]] = vector.transfer_read %0[{{.*}}] {permutation_map = #[[map_id2]]} : memref<?x?xf32>, vector<32x256xf32>
// CHECK: [[B5:%.*]] = vector.transfer_read %1[{{.*}}] {permutation_map = #[[map_id2]]} : memref<?x?xf32>, vector<32x256xf32>
// CHECK: [[S5:%.*]] = addf [[A5]], [[B5]] : vector<32x256xf32>
// CHECK: [[SPLAT1:%.*]] = constant dense<1.000000e+00> : vector<32x256xf32>
// CHECK: [[S6:%.*]] = addf [[S5]], [[SPLAT1]] : vector<32x256xf32>
// CHECK: [[SPLAT2:%.*]] = constant dense<2.000000e+00> : vector<32x256xf32>
// CHECK: [[S7:%.*]] = addf [[S5]], [[SPLAT2]] : vector<32x256xf32>
// CHECK: [[S8:%.*]] = addf [[S7]], [[S6]] : vector<32x256xf32>
// CHECK: vector.transfer_write [[S8]], {{.*}} {permutation_map: #[[map_id2]]} : vector<32x256xf32>, memref<?x?xf32>
// CHECK: vector.transfer_write [[S8]], {{.*}} {permutation_map = #[[map_id2]]} : vector<32x256xf32>, memref<?x?xf32>
//
%a5 = load %A[%i4, %i5] : memref<?x?xf32, 0>
%b5 = load %B[%i4, %i5] : memref<?x?xf32, 0>
@ -110,7 +110,7 @@ func @vectorize_matmul(%arg0: memref<?x?xf32>, %arg1: memref<?x?xf32>, %arg2: me
// VECT: {{.*}} #[[map_id1]](%[[M]]) step 4 {
// VECT-NEXT: {{.*}} #[[map_id1]](%[[N]]) step 8 {
// VECT: %[[VC0:.*]] = constant dense<0.000000e+00> : vector<4x8xf32>
// VECT-NEXT: vector.transfer_write %[[VC0]], %arg2[%{{.*}}, %{{.*}}] {permutation_map: #[[map_id2]]} : vector<4x8xf32>, memref<?x?xf32>
// VECT-NEXT: vector.transfer_write %[[VC0]], %arg2[%{{.*}}, %{{.*}}] {permutation_map = #[[map_id2]]} : vector<4x8xf32>, memref<?x?xf32>
affine.for %i0 = (d0) -> (d0)(%c0) to (d0) -> (d0)(%M) {
affine.for %i1 = (d0) -> (d0)(%c0) to (d0) -> (d0)(%N) {
%cst = constant 0.000000e+00 : f32
@ -120,12 +120,12 @@ func @vectorize_matmul(%arg0: memref<?x?xf32>, %arg1: memref<?x?xf32>, %arg2: me
// VECT: affine.for %[[I2:.*]] = #[[map_id1]](%[[C0]]) to #[[map_id1]](%[[M]]) step 4 {
// VECT-NEXT: affine.for %[[I3:.*]] = #[[map_id1]](%[[C0]]) to #[[map_id1]](%[[N]]) step 8 {
// VECT-NEXT: affine.for %[[I4:.*]] = #map5(%[[C0]]) to #[[map_id1]](%[[K]]) {
// VECT-NEXT: %[[A:.*]] = vector.transfer_read %arg1[%[[I4]], %[[I3]]] {permutation_map: #[[map_proj_d0d1_zerod1]]} : memref<?x?xf32>, vector<4x8xf32>
// VECT-NEXT: %[[B:.*]] = vector.transfer_read %arg0[%[[I2]], %[[I4]]] {permutation_map: #[[map_proj_d0d1_d0zero]]} : memref<?x?xf32>, vector<4x8xf32>
// VECT-NEXT: %[[A:.*]] = vector.transfer_read %arg1[%[[I4]], %[[I3]]] {permutation_map = #[[map_proj_d0d1_zerod1]]} : memref<?x?xf32>, vector<4x8xf32>
// VECT-NEXT: %[[B:.*]] = vector.transfer_read %arg0[%[[I2]], %[[I4]]] {permutation_map = #[[map_proj_d0d1_d0zero]]} : memref<?x?xf32>, vector<4x8xf32>
// VECT-NEXT: %[[C:.*]] = mulf %[[B]], %[[A]] : vector<4x8xf32>
// VECT-NEXT: %[[D:.*]] = vector.transfer_read %arg2[%[[I2]], %[[I3]]] {permutation_map: #[[map_id2]]} : memref<?x?xf32>, vector<4x8xf32>
// VECT-NEXT: %[[D:.*]] = vector.transfer_read %arg2[%[[I2]], %[[I3]]] {permutation_map = #[[map_id2]]} : memref<?x?xf32>, vector<4x8xf32>
// VECT-NEXT: %[[E:.*]] = addf %[[D]], %[[C]] : vector<4x8xf32>
// VECT-NEXT: vector.transfer_write %[[E]], %arg2[%[[I2]], %[[I3]]] {permutation_map: #[[map_id2]]} : vector<4x8xf32>, memref<?x?xf32>
// VECT-NEXT: vector.transfer_write %[[E]], %arg2[%[[I2]], %[[I3]]] {permutation_map = #[[map_id2]]} : vector<4x8xf32>, memref<?x?xf32>
affine.for %i2 = (d0) -> (d0)(%c0) to (d0) -> (d0)(%M) {
affine.for %i3 = (d0) -> (d0)(%c0) to (d0) -> (d0)(%N) {
affine.for %i4 = (d0) -> (d0)(%c0) to (d0) -> (d0)(%K) {

View File

@ -12,7 +12,7 @@ func @vec3d(%A : memref<?x?x?xf32>) {
// CHECK: affine.for %i2 = 0 to %0 step 32 {
// CHECK: affine.for %i3 = 0 to %1 step 64 {
// CHECK: affine.for %i4 = 0 to %2 step 256 {
// CHECK: %3 = vector.transfer_read %arg0[%i2, %i3, %i4] {permutation_map: #[[map_proj_d0d1d2_d0d1d2]]} : memref<?x?x?xf32>, vector<32x64x256xf32>
// CHECK: %3 = vector.transfer_read %arg0[%i2, %i3, %i4] {permutation_map = #[[map_proj_d0d1d2_d0d1d2]]} : memref<?x?x?xf32>, vector<32x64x256xf32>
affine.for %t0 = 0 to %0 {
affine.for %t1 = 0 to %0 {
affine.for %i0 = 0 to %0 {

View File

@ -10,7 +10,7 @@ func @vec2d(%A : memref<?x?x?xf32>) {
// CHECK: affine.for %i0 = 0 to %0 step 32
// CHECK: affine.for %i1 = 0 to %1 {
// CHECK: affine.for %i2 = 0 to %2 step 256
// CHECK: {{.*}} = vector.transfer_read %arg0[%i0, %i1, %i2] {permutation_map: #[[map_proj_d0d1d2_d0d2]]} : memref<?x?x?xf32>, vector<32x256xf32>
// CHECK: {{.*}} = vector.transfer_read %arg0[%i0, %i1, %i2] {permutation_map = #[[map_proj_d0d1d2_d0d2]]} : memref<?x?x?xf32>, vector<32x256xf32>
affine.for %i0 = 0 to %M {
affine.for %i1 = 0 to %N {
affine.for %i2 = 0 to %P {

View File

@ -22,7 +22,7 @@ func @vec2d(%A : memref<?x?x?xf32>) {
// CHECK: affine.for %i3 = 0 to %0 step 32
// CHECK: affine.for %i4 = 0 to %1 step 256
// CHECK: affine.for %i5 = 0 to %2 {
// CHECK: {{.*}} = vector.transfer_read %arg0[%i4, %i5, %i3] {permutation_map: #[[map_proj_d0d1d2_d2d0]]} : memref<?x?x?xf32>, vector<32x256xf32>
// CHECK: {{.*}} = vector.transfer_read %arg0[%i4, %i5, %i3] {permutation_map = #[[map_proj_d0d1d2_d2d0]]} : memref<?x?x?xf32>, vector<32x256xf32>
affine.for %i3 = 0 to %M {
affine.for %i4 = 0 to %N {
affine.for %i5 = 0 to %P {
@ -40,12 +40,12 @@ func @vec2d_imperfectly_nested(%A : memref<?x?x?xf32>) {
// CHECK: affine.for %i0 = 0 to %0 step 32 {
// CHECK: affine.for %i1 = 0 to %1 {
// CHECK: affine.for %i2 = 0 to %2 step 256 {
// CHECK: %3 = vector.transfer_read %arg0[%i2, %i1, %i0] {permutation_map: #[[map_proj_d0d1d2_d2d0]]} : memref<?x?x?xf32>, vector<32x256xf32>
// CHECK: %3 = vector.transfer_read %arg0[%i2, %i1, %i0] {permutation_map = #[[map_proj_d0d1d2_d2d0]]} : memref<?x?x?xf32>, vector<32x256xf32>
// CHECK: affine.for %i3 = 0 to %1 step 256 {
// CHECK: affine.for %i4 = 0 to %2 {
// CHECK: %4 = vector.transfer_read %arg0[%i3, %i4, %i0] {permutation_map: #[[map_proj_d0d1d2_d2d0]]} : memref<?x?x?xf32>, vector<32x256xf32>
// CHECK: %4 = vector.transfer_read %arg0[%i3, %i4, %i0] {permutation_map = #[[map_proj_d0d1d2_d2d0]]} : memref<?x?x?xf32>, vector<32x256xf32>
// CHECK: affine.for %i5 = 0 to %2 {
// CHECK: %5 = vector.transfer_read %arg0[%i3, %i5, %i0] {permutation_map: #[[map_proj_d0d1d2_d2d0]]} : memref<?x?x?xf32>, vector<32x256xf32>
// CHECK: %5 = vector.transfer_read %arg0[%i3, %i5, %i0] {permutation_map = #[[map_proj_d0d1d2_d2d0]]} : memref<?x?x?xf32>, vector<32x256xf32>
affine.for %i0 = 0 to %0 {
affine.for %i1 = 0 to %1 {
affine.for %i2 = 0 to %2 {

View File

@ -22,7 +22,7 @@ func @vec2d(%A : memref<?x?x?xf32>) {
// CHECK: affine.for %i3 = 0 to %0 step 32
// CHECK: affine.for %i4 = 0 to %1 {
// CHECK: affine.for %i5 = 0 to %2 step 256
// CHECK: {{.*}} = vector.transfer_read %arg0[%i4, %i5, %i3] {permutation_map: #[[map_proj_d0d1d2_d2d1]]} : memref<?x?x?xf32>, vector<32x256xf32>
// CHECK: {{.*}} = vector.transfer_read %arg0[%i4, %i5, %i3] {permutation_map = #[[map_proj_d0d1d2_d2d1]]} : memref<?x?x?xf32>, vector<32x256xf32>
affine.for %i3 = 0 to %M {
affine.for %i4 = 0 to %N {
affine.for %i5 = 0 to %P {
@ -40,12 +40,12 @@ func @vec2d_imperfectly_nested(%A : memref<?x?x?xf32>) {
// CHECK: affine.for %i0 = 0 to %0 step 32 {
// CHECK: affine.for %i1 = 0 to %1 step 256 {
// CHECK: affine.for %i2 = 0 to %2 {
// CHECK: %3 = vector.transfer_read %arg0[%i2, %i1, %i0] {permutation_map: #[[map_proj_d0d1d2_d2d1]]} : memref<?x?x?xf32>, vector<32x256xf32>
// CHECK: %3 = vector.transfer_read %arg0[%i2, %i1, %i0] {permutation_map = #[[map_proj_d0d1d2_d2d1]]} : memref<?x?x?xf32>, vector<32x256xf32>
// CHECK: affine.for %i3 = 0 to %1 {
// CHECK: affine.for %i4 = 0 to %2 step 256 {
// CHECK: %4 = vector.transfer_read %arg0[%i3, %i4, %i0] {permutation_map: #[[map_proj_d0d1d2_d2d1]]} : memref<?x?x?xf32>, vector<32x256xf32>
// CHECK: %4 = vector.transfer_read %arg0[%i3, %i4, %i0] {permutation_map = #[[map_proj_d0d1d2_d2d1]]} : memref<?x?x?xf32>, vector<32x256xf32>
// CHECK: affine.for %i5 = 0 to %2 step 256 {
// CHECK: %5 = vector.transfer_read %arg0[%i3, %i5, %i0] {permutation_map: #[[map_proj_d0d1d2_d2d1]]} : memref<?x?x?xf32>, vector<32x256xf32>
// CHECK: %5 = vector.transfer_read %arg0[%i3, %i5, %i0] {permutation_map = #[[map_proj_d0d1d2_d2d1]]} : memref<?x?x?xf32>, vector<32x256xf32>
affine.for %i0 = 0 to %0 {
affine.for %i1 = 0 to %1 {
affine.for %i2 = 0 to %2 {

View File

@ -87,7 +87,7 @@ func @different_attributes(index, index) -> (i1, i1, i1) {
// CHECK-NEXT: %1 = cmpi "ne", %arg0, %arg1 : index
/// Predicate 1 means inequality comparison.
%1 = cmpi "ne", %a, %b : index
%2 = "std.cmpi"(%a, %b) {predicate: 1} : (index, index) -> i1
%2 = "std.cmpi"(%a, %b) {predicate = 1} : (index, index) -> i1
// CHECK-NEXT: return %0, %1, %1 : i1, i1, i1
return %0, %1, %2 : i1, i1, i1

View File

@ -2107,7 +2107,7 @@ func @should_not_slice_past_slice_barrier() {
affine.for %i1 = 0 to 16 {
%1 = "op1"() : () -> f32
store %1, %0[%i0, %i1] : memref<100x16xf32>
} {slice_fusion_barrier: true}
} {slice_fusion_barrier = true}
}
affine.for %i2 = 0 to 100 {
affine.for %i3 = 0 to 16 {
@ -2123,7 +2123,7 @@ func @should_not_slice_past_slice_barrier() {
// CHECK-NEXT: %2 = affine.apply [[MAP3]](%i0, %i0, %i1)
// CHECK-NEXT: %3 = affine.apply [[MAP4]](%i0, %i0, %i1)
// CHECK-NEXT: store %1, %0[%2, %3] : memref<1x16xf32>
// CHECK-NEXT: } {slice_fusion_barrier: true}
// CHECK-NEXT: } {slice_fusion_barrier = true}
// CHECK-NEXT: affine.for %i2 = 0 to 16 {
// CHECK-NEXT: %4 = affine.apply [[MAP3]](%i0, %i0, %i2)
// CHECK-NEXT: %5 = affine.apply [[MAP4]](%i0, %i0, %i2)

View File

@ -2,14 +2,14 @@
// CHECK-LABEL: verifyDirectPattern
func @verifyDirectPattern() -> i32 {
// CHECK-NEXT: "test.legal_op_a"() {status: "Success"}
// CHECK-NEXT: "test.legal_op_a"() {status = "Success"}
%result = "test.illegal_op_a"() : () -> (i32)
return %result : i32
}
// CHECK-LABEL: verifyLargerBenefit
func @verifyLargerBenefit() -> i32 {
// CHECK-NEXT: "test.legal_op_a"() {status: "Success"}
// CHECK-NEXT: "test.legal_op_a"() {status = "Success"}
%result = "test.illegal_op_c"() : () -> (i32)
return %result : i32
}

View File

@ -77,7 +77,7 @@ func @loop_nest_body_def_use() {
// UNROLL-FULL-NEXT: %9 = affine.apply [[MAP0]](%8)
// UNROLL-FULL-NEXT: %10 = "addi32"(%9, %c0_0) : (index, index) -> index
affine.for %j = 0 to 4 {
%x = "affine.apply" (%j) { map: (d0) -> (d0 + 1) } :
%x = "affine.apply" (%j) { map = (d0) -> (d0 + 1) } :
(index) -> (index)
%y = "addi32"(%x, %c0) : (index, index) -> index
}
@ -97,7 +97,7 @@ func @loop_nest_strided() {
// UNROLL-FULL-NEXT: %3 = affine.apply [[MAP0]](%2)
// UNROLL-FULL-NEXT: %4 = "addi32"(%3, %3) : (index, index) -> index
affine.for %j = 2 to 6 step 2 {
%x = "affine.apply" (%j) { map: (d0) -> (d0 + 1) } :
%x = "affine.apply" (%j) { map = (d0) -> (d0 + 1) } :
(index) -> (index)
%y = "addi32"(%x, %x) : (index, index) -> index
}
@ -110,7 +110,7 @@ func @loop_nest_strided() {
// UNROLL-FULL-NEXT: %11 = affine.apply [[MAP0]](%10)
// UNROLL-FULL-NEXT: %12 = "addi32"(%11, %11) : (index, index) -> index
affine.for %k = 2 to 7 step 2 {
%z = "affine.apply" (%k) { map: (d0) -> (d0 + 1) } :
%z = "affine.apply" (%k) { map = (d0) -> (d0 + 1) } :
(index) -> (index)
%w = "addi32"(%z, %z) : (index, index) -> index
}
@ -169,7 +169,7 @@ func @loop_nest_seq_imperfect(%a : memref<128x128xf32>) {
// UNROLL-FULL-NEXT: %14 = "vmulf"(%12, %13) : (index, index) -> index
// UNROLL-FULL-NEXT: %15 = "vaddf"(%14, %14) : (index, index) -> index
affine.for %j = 0 to 4 {
%x = "affine.apply" (%j) { map: (d0) -> (d0 + 1) } :
%x = "affine.apply" (%j) { map = (d0) -> (d0 + 1) } :
(index) -> (index)
%y = "vmulf"(%j, %x) : (index, index) -> index
%z = "vaddf"(%y, %y) : (index, index) -> index
@ -198,7 +198,7 @@ func @loop_nest_seq_multiple() {
// UNROLL-FULL-NEXT: %6 = affine.apply [[MAP0]](%5)
// UNROLL-FULL-NEXT: "mul"(%6, %6) : (index, index) -> ()
affine.for %j = 0 to 4 {
%x = "affine.apply" (%j) { map: (d0) -> (d0 + 1) } :
%x = "affine.apply" (%j) { map = (d0) -> (d0 + 1) } :
(index) -> (index)
"mul"(%x, %x) : (index, index) -> ()
}
@ -219,9 +219,9 @@ func @loop_nest_seq_multiple() {
// UNROLL-FULL-NEXT: %16 = affine.apply [[MAP0]](%15)
// UNROLL-FULL-NEXT: %17 = affine.apply [[MAP6]](%15)[%c99]
affine.for %n = 0 to 4 {
%y = "affine.apply" (%n) { map: (d0) -> (d0 + 1) } :
%y = "affine.apply" (%n) { map = (d0) -> (d0 + 1) } :
(index) -> (index)
%z = "affine.apply" (%n, %k) { map: (d0) [s0] -> (d0 + s0 + 1) } :
%z = "affine.apply" (%n, %k) { map = (d0) [s0] -> (d0 + s0 + 1) } :
(index, index) -> (index)
} // UNROLL-FULL }
} // UNROLL-FULL }
@ -252,7 +252,7 @@ func @loop_nest_outer_unroll() {
// SHORT-NEXT: }
affine.for %i = 0 to 2 {
affine.for %j = 0 to 4 {
%x = "affine.apply" (%j) { map: (d0) -> (d0 + 1) } :
%x = "affine.apply" (%j) { map = (d0) -> (d0 + 1) } :
(index) -> (index)
%y = "addi32"(%x, %x) : (index, index) -> index
}
@ -291,19 +291,19 @@ func @loop_nest_seq_long() -> i32 {
affine.for %i2 = 0 to 8 {
// CHECK-NOT: affine.for %i3
// CHECK: %{{[0-9]+}} = affine.apply
%b2 = "affine.apply" (%y, %i2) {map: (d0, d1) -> (16*d0 + d1)} : (index, index) -> index
%b2 = "affine.apply" (%y, %i2) {map = (d0, d1) -> (16*d0 + d1)} : (index, index) -> index
%z = load %B[%x, %b2] : memref<512 x 512 x i32, (d0, d1) -> (d0, d1), 2>
"op1"(%z) : (i32) -> ()
}
affine.for %j1 = 0 to 8 {
affine.for %j2 = 0 to 8 {
%a2 = "affine.apply" (%y, %j2) {map: (d0, d1) -> (16*d0 + d1)} : (index, index) -> index
%a2 = "affine.apply" (%y, %j2) {map = (d0, d1) -> (16*d0 + d1)} : (index, index) -> index
%v203 = load %A[%j1, %a2] : memref<512 x 512 x i32, (d0, d1) -> (d0, d1), 2>
"op2"(%v203) : (i32) -> ()
}
affine.for %k2 = 0 to 8 {
%s0 = "op3"() : () -> i32
%c2 = "affine.apply" (%x, %k2) {map: (d0, d1) -> (16*d0 + d1)} : (index, index) -> index
%c2 = "affine.apply" (%x, %k2) {map = (d0, d1) -> (16*d0 + d1)} : (index, index) -> index
%s1 = load %C[%j1, %c2] : memref<512 x 512 x i32, (d0, d1) -> (d0, d1), 2>
%s2 = "addi32"(%s0, %s1) : (i32, i32) -> i32
store %s2, %C[%j1, %c2] : memref<512 x 512 x i32, (d0, d1) -> (d0, d1), 2>

View File

@ -4,17 +4,17 @@
func @verifyConstantAttr(%arg0 : i32) -> i32 {
%0 = "test.op_c"(%arg0) : (i32) -> i32 loc("a")
// CHECK: "test.op_b"(%arg0) {attr: 17 : i32} : (i32) -> i32 loc("a")
// CHECK: "test.op_b"(%arg0) {attr = 17 : i32} : (i32) -> i32 loc("a")
return %0 : i32
}
// CHECK-LABEL: verifyFusedLocs
func @verifyFusedLocs(%arg0 : i32) -> i32 {
%0 = "test.op_a"(%arg0) {attr: 10 : i32} : (i32) -> i32 loc("a")
%result = "test.op_a"(%0) {attr: 20 : i32} : (i32) -> i32 loc("b")
%0 = "test.op_a"(%arg0) {attr = 10 : i32} : (i32) -> i32 loc("a")
%result = "test.op_a"(%0) {attr = 20 : i32} : (i32) -> i32 loc("b")
// CHECK: "test.op_b"(%arg0) {attr: 10 : i32} : (i32) -> i32 loc("a")
// CHECK: "test.op_b"(%arg0) {attr: 20 : i32} : (i32) -> i32 loc(fused["b", "a"])
// CHECK: "test.op_b"(%arg0) {attr = 10 : i32} : (i32) -> i32 loc("a")
// CHECK: "test.op_b"(%arg0) {attr = 20 : i32} : (i32) -> i32 loc(fused["b", "a"])
return %result : i32
}
@ -25,6 +25,6 @@ func @verifyBenefit(%arg0 : i32) -> i32 {
%2 = "test.op_g"(%1) : (i32) -> i32
// CHECK: "test.op_f"(%arg0)
// CHECK: "test.op_b"(%arg0) {attr: 34 : i32}
// CHECK: "test.op_b"(%arg0) {attr = 34 : i32}
return %0 : i32
}

View File

@ -83,7 +83,7 @@ func @nested_tuple_multi_level_wrong_type() {
// CHECK-LABEL: @fixed_element_types
func @fixed_element_types(%arg0: tensor<* x i32>, %arg1: tensor<* x f32>) {
%0 = "test.arg_and_res_have_fixed_element_types"(%arg0, %arg1) {attr: ""} : (tensor<* x i32>, tensor<* x f32>) -> tensor<* x i16>
%0 = "test.arg_and_res_have_fixed_element_types"(%arg0, %arg1) {attr = ""} : (tensor<* x i32>, tensor<* x f32>) -> tensor<* x i16>
return
}
@ -91,7 +91,7 @@ func @fixed_element_types(%arg0: tensor<* x i32>, %arg1: tensor<* x f32>) {
func @fixed_element_types(%arg0: tensor<* x i32>, %arg1: tensor<* x f32>) {
// expected-error@+1 {{'res' is 16-bit integer}}
%0 = "test.arg_and_res_have_fixed_element_types"(%arg0, %arg1) {attr: ""}: (tensor<* x i32>, tensor<* x f32>) -> tensor<* x i32>
%0 = "test.arg_and_res_have_fixed_element_types"(%arg0, %arg1) {attr = ""}: (tensor<* x i32>, tensor<* x f32>) -> tensor<* x i32>
return
}
@ -99,7 +99,7 @@ func @fixed_element_types(%arg0: tensor<* x i32>, %arg1: tensor<* x f32>) {
func @fixed_element_types(%arg0: tensor<* x i32>, %arg1: tensor<* x f32>) {
// expected-error@+1 {{fixed type combination}}
%0 = "test.arg_and_res_have_fixed_element_types"(%arg1, %arg0) {attr: ""}: (tensor<* x f32>, tensor<* x i32>) -> tensor<* x i16>
%0 = "test.arg_and_res_have_fixed_element_types"(%arg1, %arg0) {attr = ""}: (tensor<* x f32>, tensor<* x i32>) -> tensor<* x i16>
return
}