[Mlir-commits] [mlir] [mlir][llvm] support -new-struct-path-tbaa (PR #119698)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Feb 27 01:09:29 PST 2025


================
@@ -58,7 +58,15 @@ mlir::LLVM::detail::verifyAliasAnalysisOpInterface(Operation *op) {
   ArrayAttr tags = iface.getTBAATagsOrNull();
   if (!tags)
     return success();
-
+  if (tags.size() > 0) {
----------------
PikachuHyA wrote:

The `isArrayOf<xxx>` reports an error if any element in the provided array is not type of xxx.
and the result type `LogicalResult` dose not support the `||` operator.

```
/// Verifies that all elements of `array` are instances of `Attr`.
template <class AttrT>
static LogicalResult isArrayOf(Operation *op, ArrayAttr array) {
  for (Attribute iter : array)
    if (!isa<AttrT>(iter))
      return op->emitOpError("expected op to return array of ")
             << AttrT::getMnemonic() << " attributes";
  return success();
}
```
see 
https://github.com/llvm/llvm-project/blob/main/mlir/lib/Dialect/LLVMIR/IR/LLVMInterfaces.cpp#L19-L27

https://github.com/llvm/llvm-project/pull/119698


More information about the Mlir-commits mailing list