Add extra error checking to prevent passes from being run on unsupported ops through the pass manager infrastructure.
Depends On: D153143
Differential D153144
[mlir][Pass] Check supported op types before running a pass springerm on Jun 16 2023, 8:15 AM. Authored by
Details Add extra error checking to prevent passes from being run on unsupported ops through the pass manager infrastructure. Depends On: D153143
Diff Detail
Event TimelineComment Actions I added a unit test. This issue can only be triggered from C++. (I cannot be triggered from test/Pass/pipeline-invalid.mlir.) Comment Actions Something like this should work: // RUN: mlir-opt %s --pass-pipeline='any(test-function-pass)' module {}
Comment Actions I tried this but it does not trigger the error. I spent some time looking into this yesterday and I think I found the reason why but I can't remember now of the top of my head...
|
fyi there's a bunch of similar (but slightly different) checks spread out in other places as well, and they all fail in slightly different ways:
https://github.com/llvm/llvm-project/blob/b7a86d03cb49229634419be4ae44df00fadd990d/mlir/lib/Pass/Pass.cpp#L804-L807
https://github.com/llvm/llvm-project/blob/b7a86d03cb49229634419be4ae44df00fadd990d/mlir/lib/Pass/PassRegistry.cpp#L48-L51
https://github.com/llvm/llvm-project/blob/b7a86d03cb49229634419be4ae44df00fadd990d/mlir/lib/Pass/Pass.cpp#L200-L206
https://github.com/llvm/llvm-project/blob/b7a86d03cb49229634419be4ae44df00fadd990d/mlir/lib/Pass/Pass.cpp#L266-L271
just pointing them out in case you see a way to unify anything