[flang-commits] [flang] [mlir] [mlir][AsmParser] Disambiguate location attributes from trailing loc (PR #180668)

via flang-commits flang-commits at lists.llvm.org
Tue Mar 17 09:22:02 PDT 2026


XiaoleiShi-NV wrote:

Rebased the branch onto current `main`, resolved the merge conflict, and addressed the remaining fallout. The current attached premerge checks are green (`Build and Test Linux`, `Build and Test Windows`, `Build and Test Linux AArch64`, `code_formatter`, `Graphite / mergeability_check`).

On the parser guard: I kept `tokenEnd != state.lex.getBufferEnd() && *tokenEnd == '('` because plain `#loc` aliases still need to stay on the extended-attribute path. Dropping that guard causes a plain `#loc` alias in attribute position to be misparsed as builtin location syntax. I added regression coverage for that in `mlir/test/IR/loc-attr-disambiguation.mlir`.

On the bytecode / test fallout: the failures were from cases that still used `loc(...)` where a `LocationAttr` is spelled as an attribute value. After this change, attribute-position locations use `#loc(...)`, while trailing op/block locations remain `loc(...)`, so I updated the remaining current-main MLIR and Flang tests accordingly.

I also added `Assisted by: OpenAI Codex` trailers to the follow-up commits, as requested.

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


More information about the flang-commits mailing list