diff options
| author | River Riddle <riverriddle@google.com> | 2019-11-01 15:46:28 -0700 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-11-01 15:47:03 -0700 |
| commit | e94a8bfca8f9dadda5d8a548c210ae39d97a45c1 (patch) | |
| tree | f325c0ecfbd69e1bdddd766ac8f3d963b6e383c3 /mlir/test/Dialect/QuantOps | |
| parent | 2ba4d802e030b51e78b7d29238ccc552ea19d1c4 (diff) | |
| download | bcm5719-llvm-e94a8bfca8f9dadda5d8a548c210ae39d97a45c1.tar.gz bcm5719-llvm-e94a8bfca8f9dadda5d8a548c210ae39d97a45c1.zip | |
Refactor QuantOps TypeParser to use the DialectAsmParser methods directly.
This greatly simplifies the implementation and removes custom parser functionality. The necessary methods are added to the DialectAsmParser.
PiperOrigin-RevId: 278015983
Diffstat (limited to 'mlir/test/Dialect/QuantOps')
| -rw-r--r-- | mlir/test/Dialect/QuantOps/parse-any-invalid.mlir | 16 | ||||
| -rw-r--r-- | mlir/test/Dialect/QuantOps/parse-uniform-invalid.mlir | 34 |
2 files changed, 25 insertions, 25 deletions
diff --git a/mlir/test/Dialect/QuantOps/parse-any-invalid.mlir b/mlir/test/Dialect/QuantOps/parse-any-invalid.mlir index 06fb7f0f966..d90423ef408 100644 --- a/mlir/test/Dialect/QuantOps/parse-any-invalid.mlir +++ b/mlir/test/Dialect/QuantOps/parse-any-invalid.mlir @@ -2,27 +2,27 @@ // ----- // Unrecognized token: missing storage type maximum -// expected-error@+1 {{unrecognized token: >}} +// expected-error@+1 {{expected ':'}} !qalias = type !quant.any<i8<16>:f32> // ----- // Unrecognized token: missing closing angle bracket -// expected-error@+1 {{unrecognized token: :}} +// expected-error@+1 {{expected '>'}} !qalias = type !quant<"any<i8<-4:3:f32>"> // ----- // Unrecognized token: missing type colon -// expected-error@+1 {{unrecognized token: f}} +// expected-error@+1 {{expected '>'}} !qalias = type !quant.any<i8<-4:3>f32> // ----- // Unrecognized storage type: illegal prefix -// expected-error@+1 {{illegal storage type prefix: int}} +// expected-error@+1 {{illegal storage type prefix}} !qalias = type !quant.any<int8<-4:3>:f32> // ----- // Unrecognized storage type: no width -// expected-error@+1 {{expected storage type width}} +// expected-error@+1 {{illegal storage type prefix}} !qalias = type !quant.any<i<-4:3>:f32> // ----- @@ -32,12 +32,12 @@ // ----- // Unrecognized storage type: storage size < 0 -// expected-error@+1 {{illegal storage type size: -1}} -!qalias = type !quant.any<i-1<-4:3>:f32> +// expected-error@+1 {{illegal storage type size: 1024}} +!qalias = type !quant.any<i1024<-4:3>:f32> // ----- // Unrecognized storage type: storage size == 0 -// expected-error@+1 {{illegal storage type size: 0}} +// expected-error@+1 {{invalid integer width}} !qalias = type !quant.any<i0<-4:3>:f32> // ----- diff --git a/mlir/test/Dialect/QuantOps/parse-uniform-invalid.mlir b/mlir/test/Dialect/QuantOps/parse-uniform-invalid.mlir index e1aab5f584f..114ab7dc0d7 100644 --- a/mlir/test/Dialect/QuantOps/parse-uniform-invalid.mlir +++ b/mlir/test/Dialect/QuantOps/parse-uniform-invalid.mlir @@ -7,42 +7,42 @@ // ----- // Unrecognized token: illegal token -// expected-error@+1 {{unrecognized token: _}} +// expected-error@+1 {{unknown quantized type __}} !qalias = type !quant.__ // ----- // Unrecognized token: trailing -// expected-error@+1 {{unrecognized token: 23}} +// expected-error@+1 {{expected '>'}} !qalias = type !quant.uniform<i8<-4:3>:f32, 0.99872:127 23> // ----- // Unrecognized token: missing storage type maximum -// expected-error@+1 {{unrecognized token: >}} +// expected-error@+1 {{expected ':'}} !qalias = type !quant.uniform<i8<16>:f32, 0.99872:127> // ----- // Unrecognized token: missing closing angle bracket -// expected-error@+1 {{unrecognized token: :}} +// expected-error@+1 {{expected '>'}} !qalias = type !quant<"uniform<i8<-4:3:f32, 0.99872:127>"> // ----- // Unrecognized token: missing type colon -// expected-error@+1 {{unrecognized token: f}} +// expected-error@+1 {{expected ':'}} !qalias = type !quant.uniform<i8<-4:3>f32, 0.99872:127> // ----- // Unrecognized token: missing comma -// expected-error@+1 {{unrecognized token: 0.99872}} +// expected-error@+1 {{expected ','}} !qalias = type !quant.uniform<i8<-4:3>:f32 0.99872:127> // ----- // Unrecognized storage type: illegal prefix -// expected-error@+1 {{illegal storage type prefix: int}} +// expected-error@+1 {{illegal storage type prefix}} !qalias = type !quant.uniform<int8<-4:3>:f32, 0.99872:127> // ----- // Unrecognized storage type: no width -// expected-error@+1 {{expected storage type width}} +// expected-error@+1 {{illegal storage type prefix}} !qalias = type !quant.uniform<i<-4:3>:f32, 0.99872:127> // ----- @@ -52,12 +52,12 @@ // ----- // Unrecognized storage type: storage size < 0 -// expected-error@+1 {{illegal storage type size: -1}} +// expected-error@+1 {{illegal storage type prefix}} !qalias = type !quant.uniform<i-1<-4:3>:f32, 0.99872:127> // ----- // Unrecognized storage type: storage size == 0 -// expected-error@+1 {{illegal storage type size: 0}} +// expected-error@+1 {{invalid integer width}} !qalias = type !quant.uniform<i0<-4:3>:f32, 0.99872:127> // ----- @@ -82,27 +82,27 @@ // ----- // Illegal uniform params: invalid scale -// expected-error@+1 {{expected valid uniform scale. got: abc}} +// expected-error@+1 {{expected floating point literal}} !qalias = type !quant.uniform<i8<-4:3>:f32, abc:127> // ----- // Illegal uniform params: invalid zero point separator -// expected-error@+1 {{unrecognized token: abc}} +// expected-error@+1 {{expected '>'}} !qalias = type !quant.uniform<i8<-4:3>:f32, 0.1abc> // ----- // Illegal uniform params: missing zero point -// expected-error@+1 {{expected integer uniform zero point. got: >}} +// expected-error@+1 {{expected integer value}} !qalias = type !quant.uniform<i8<-4:3>:f32, 0.1:> // ----- // Illegal uniform params: invalid zero point -// expected-error@+1 {{expected integer uniform zero point. got: abc}} +// expected-error@+1 {{expected integer value}} !qalias = type !quant.uniform<i8<-4:3>:f32, 0.1:abc> // ----- // Illegal expressed type: f33 -// expected-error@+1 {{unrecognized expressed type: f33}} +// expected-error@+1 {{expected non-function type}} !qalias = type !quant.uniform<i8<-4:3>:f33, 0.99872:127> // ----- @@ -112,11 +112,11 @@ // ----- // Illegal uniform params: missing quantized dimension -// expected-error@+1 {{expected quantized dimension}} +// expected-error@+1 {{expected integer value}} !qalias = type !quant.uniform<i8<-4:3>:f32:, {2.000000e+02:-19.987200e-01:1}> // ----- // Illegal uniform params: unspecified quantized dimension, when multiple scales // provided. -// expected-error@+1 {{expected valid uniform scale. got: {}} +// expected-error@+1 {{expected floating point literal}} !qalias = type !quant.uniform<i8<-4:3>:f32, {2.000000e+02,-19.987200e-01:1}> |

