[PATCH] D114082: [WIP] Normalize String Attributes
serge via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 30 09:42:27 PST 2021
serge-sans-paille added a comment.
In D114082#3149631 <https://reviews.llvm.org/D114082#3149631>, @rnk wrote:
>> it is possible to list all internal keys in one place
> I think one of the original goals of adding support for string attributes (maybe @void will give some input) was specifically to avoid having one giant list with all the attributes supported by all the backends. String attributes were initially called "target dependent attributes", or something like that. I think we had a `td_attrs` accessor at some point. There was this idea that LLVM should not know about x86-specific attributes. There should be some kind of indirection and delegation to the target backend. LLVM has not always succeeded in following this vision, see for example the target-specific intrinsic enums, which were one giant enum until D71320 <https://reviews.llvm.org/D71320>.
> I think, even if LLVM IR has to know all of the target-specific internally used attributes, we can try to honor that target independent vision by having separate headers for different target specific attributes. Does that sound reasonable? It's at least consistent with how we handle intrinsics (IntrinsicsX86.h, IntrinsicsAArch64.h etc).
The sub-review I proposed in https://reviews.llvm.org/D114394 does not introduce any list, so that should be a decent first step. As a second step, many passes already register their attribute in some local header and I can just generalize that: no big list but some local explicit definition.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits