[mlir][llvm] Allow literal structs to replaceImmediateSubElements
authorJeff Niu <jeff@modular.com>
Fri, 21 Oct 2022 22:00:20 +0000 (15:00 -0700)
committerJeff Niu <jeff@modular.com>
Fri, 21 Oct 2022 22:13:12 +0000 (15:13 -0700)
commit8dfc6042e93fe05b5936e24f734cd77d9906e85b
tree7b70b6b0550f62b9aa1650cb916bbaebc9f939e2
parent6144042c27a9a0b8ea90e49d82e800cde02a4e88
[mlir][llvm] Allow literal structs to replaceImmediateSubElements

SubElementInterfaces forbids all mutable types and attributes from
implementing `replaceImmediateSubElements`. However, this prohibits
literal structs, which are immutable, from implementing that function.
This patch defers the decision on whether to support
`replaceImmediateSubElements` to the individual types/attributes.

Depends on D136505

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D136507
mlir/include/mlir/IR/SubElementInterfaces.td
mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
mlir/lib/IR/SubElementInterfaces.cpp