[PATCH] D115798: Provide SmallAttrBuilder as a lightweight alternative to AttrBuilder

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 15 12:13:08 PST 2021


aeubanks added a comment.

I agree that we really should only have one attribute builder class.

A SmallVector does seem nicer than having a static array the size of all possible attributes. We should avoid creating copies of AttributeLists/Sets into AttrBuilders and just have AttrBuilder be a list of attribute diffs, basically what you have as SmallAttrBuilder, although I'm not sure if we also want to handle a list of attributes we want to *remove* from an AttributeSet in SmallAttrBuilder as well?

As for querying the AttrBuilder for attributes it contains, IMO we shouldn't need to in most cases, typically we can directly query the AttributeList/Set directly. https://reviews.llvm.org/D115819 shows that a bunch of the query methods in AttrBuilder are easily removed. `LLParser::validateEndOfModule()` is the last major user of AttributeList functionality we may not want to support but it seems fixable.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115798/new/

https://reviews.llvm.org/D115798



More information about the llvm-commits mailing list