[mlir][DRR] Add location directive
authorJacques Pienaar <jpienaar@google.com>
Tue, 7 Apr 2020 14:44:19 +0000 (07:44 -0700)
committerJacques Pienaar <jpienaar@google.com>
Tue, 7 Apr 2020 20:38:25 +0000 (13:38 -0700)
commit3f7439b28063c284975b49ebdc9c5645cedae7a0
treeb558c5ed0295b7bd332649a7a2ae2fc82cb74e74
parentc8de17bca658e62bbf8c33eae839e457332e885e
[mlir][DRR] Add location directive

Summary:
Add directive to indicate the location to give to op being created. This
directive is optional and if unused the location will still be the fused
location of all source operations.

Currently this directive only works with other op locations, reusing an
existing op location or a fusion of op locations. But doesn't yet support
supplying metadata for the FusedLoc.

Based off initial revision by antiagainst@ and effectively mirrors GlobalIsel
debug_locations directive.

Differential Revision: https://reviews.llvm.org/D77649
mlir/docs/DeclarativeRewrites.md
mlir/include/mlir/IR/OpBase.td
mlir/include/mlir/TableGen/Pattern.h
mlir/lib/TableGen/Pattern.cpp
mlir/test/lib/Dialect/Test/TestOps.td
mlir/test/mlir-tblgen/pattern.mlir
mlir/tools/mlir-tblgen/RewriterGen.cpp