[mlir] Cleanup lingering problems surrounding attribute/type aliases
authorRiver Riddle <riddleriver@gmail.com>
Tue, 29 Nov 2022 02:35:00 +0000 (18:35 -0800)
committerRiver Riddle <riddleriver@gmail.com>
Thu, 1 Dec 2022 01:02:54 +0000 (17:02 -0800)
commitaef89c8b41847c7235e00fbf8b2a2f10cb1aad25
tree89e59914865fde8af73869edab5525027b66ba4e
parent658a5039373e3272e9920a07312a013c2f629538
[mlir] Cleanup lingering problems surrounding attribute/type aliases

This commit refactors attribute/type alias generation to be similar to how
we do it for operations, i.e. we generate aliases determined on what is
actually necessary when printing the IR (using a dummy printer for alias
collection). This allows for generating aliases only when necessary, and
also allows for proper propagation of when a nested alias can be deferred.
This also necessitated a fix for location parsing to actually parse aliases
instead of ignoring them.

Fixes #59041

Differential Revision: https://reviews.llvm.org/D138886
mlir/include/mlir/IR/OpImplementation.h
mlir/lib/AsmParser/LocationParser.cpp
mlir/lib/IR/AsmPrinter.cpp
mlir/test/Dialect/DLTI/roundtrip.mlir
mlir/test/Dialect/SparseTensor/sparse_vector_chain.mlir
mlir/test/Dialect/SparseTensor/sparse_vector_index.mlir
mlir/test/IR/pretty-locations.mlir
mlir/test/IR/print-attr-type-aliases.mlir
mlir/test/Target/LLVMIR/Import/debug-info.ll