llvm-project
e89bd48c - [mlir] Avoid crash in mlir-query's MatchFinder class (#145049)

Commit
33 days ago
[mlir] Avoid crash in mlir-query's MatchFinder class (#145049) It was failing for cases where the location was not a FileLineColLoc and fileLoc a nullptr. If the following query is run: `match getUsersByPredicate(hasOpName("memref.alloc"), hasOpName("memref.dealloc"), true)` on the IR illustrated below, it caused the program to crash. ``` mlir func.func @slicing_linalg_op(%arg0 : index, %arg1 : index, %arg2 : index) { %a = memref.alloc(%arg0, %arg2) : memref<?x?xf32> %b = memref.alloc(%arg2, %arg1) : memref<?x?xf32> %c = memref.alloc(%arg0, %arg1) : memref<?x?xf32> %d = memref.alloc(%arg0, %arg1) : memref<?x?xf32> linalg.matmul ins(%a, %b : memref<?x?xf32>, memref<?x?xf32>) outs(%c : memref<?x?xf32>) linalg.matmul ins(%a, %b : memref<?x?xf32>, memref<?x?xf32>) outs(%d : memref<?x?xf32>) memref.dealloc %c : memref<?x?xf32> memref.dealloc %b : memref<?x?xf32> memref.dealloc %a : memref<?x?xf32> memref.dealloc %d : memref<?x?xf32> return } ```
Author
Parents
Loading