summaryrefslogtreecommitdiffstats
path: root/mlir/utils/generate-test-checks.py
Commit message (Collapse)AuthorAgeFilesLines
* Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-231-13/+3
| | | | PiperOrigin-RevId: 286906740
* Fix minor spelling tweaks (NFC)Kazuaki Ishizaki2019-10-201-1/+1
| | | | | | Closes tensorflow/mlir#175 PiperOrigin-RevId: 275726876
* Remove unused import and two import formsJacques Pienaar2019-09-191-3/+1
| | | | | | argparse was imported with both 'import' and 'import from' and string import was unused, PiperOrigin-RevId: 270164488
* Add a preprocess pass to remove sequences that are problematic with FileCheckRiver Riddle2019-09-171-0/+19
| | | | | | Add a preprocess phase to rewrite parts of the input line that may be problematic with filecheck. This change adds preprocessing to escape '[[' bracket sequences, as these are used by FileCheck for variables. PiperOrigin-RevId: 269648490
* Add a utility script to auto-generate CHECK commands for mlir test cases.River Riddle2019-08-131-0/+201
This script is a utility to add FileCheck patterns to an mlir file. The script will heuristically insert CHECK/CHECK-LABEL commands for each line within the file. By default this script will also try to insert string substitution blocks for all SSA value names. The script is designed to make adding checks to a test case fast, it is *not* designed to be authoritative about what constitutes a good test! Note: Some cases may not be handled well, e.g. operands to operations with regions, but this script is only intended to be a starting point. Example usage: $ generate-test-checks.py foo.mlir $ mlir-opt foo.mlir -transformation | generate-test-checks.py module { func @fold_extract_element(%arg0: index) -> (f32, f16, f16, i32) { %cst = constant 4.500000e+00 : f32 %cst_0 = constant -2.000000e+00 : f16 %cst_1 = constant 0.000000e+00 : f16 %c64_i32 = constant 64 : i32 return %cst, %cst_0, %cst_1, %c64_i32 : f32, f16, f16, i32 } } // CHECK-LABEL: func @fold_extract_element( // CHECK-SAME: [[VAL_0:%.*]]: index) -> (f32, f16, f16, i32) { // CHECK: [[VAL_1:%.*]] = constant 4.500000e+00 : f32 // CHECK: [[VAL_2:%.*]] = constant -2.000000e+00 : f16 // CHECK: [[VAL_3:%.*]] = constant 0.000000e+00 : f16 // CHECK: [[VAL_4:%.*]] = constant 64 : i32 // CHECK: return [[VAL_1]], [[VAL_2]], [[VAL_3]], [[VAL_4]] : f32, f16, f16, i32 // CHECK: } PiperOrigin-RevId: 263242983
OpenPOWER on IntegriCloud