[PATCH] D105780: [Attributes] Determine attribute properties from TableGen data

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 11 09:16:46 PDT 2021


nikic created this revision.
nikic added a reviewer: opaque-pointers.
Herald added subscribers: ormris, dexonsmith, jdoerfert, hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Continuing from D105763 <https://reviews.llvm.org/D105763>, this allows placing certain properties about attributes in the TableGen definition. In particular, we store whether an attribute applies to fn/param/ret (or a combination thereof). This information is used by the Verifier, as well as the ForceFunctionAttrs pass. I also plan to use this in LLParser, which also duplicates info on which attributes are valid where.

This keeps metadata about attributes in one place, and makes it more likely that it stays in sync, rather than in various functions spread across the codebase.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105780

Files:
  llvm/include/llvm/IR/Attributes.h
  llvm/include/llvm/IR/Attributes.td
  llvm/lib/IR/Attributes.cpp
  llvm/lib/IR/Verifier.cpp
  llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp
  llvm/unittests/IR/VerifierTest.cpp
  llvm/utils/TableGen/Attributes.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105780.357803.patch
Type: text/x-patch
Size: 27392 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210711/d8cf23f2/attachment.bin>


More information about the llvm-commits mailing list