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

2022-01-04 Thread serge via Phabricator via cfe-commits
serge-sans-paille abandoned this revision. serge-sans-paille added a comment. Obsoleted by https://reviews.llvm.org/D116599 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115798/new/ https://reviews.llvm.org/D115798 ___ cfe-commits mailing lis

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

2021-12-15 Thread Arthur Eubanks via Phabricator via cfe-commits
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 li

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

2021-12-15 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. I would really prefer to avoid adding a new variant of AttrBuilder. What is the main blocker to making AttrBuilder more efficient? It just needs an `LLVMContext`, right? Would that be feasible instead? Most AttrBuilders are constructed from existing AttributeLists, which ha

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

2021-12-15 Thread serge via Phabricator via cfe-commits
serge-sans-paille added inline comments. Comment at: llvm/include/llvm/IR/Attributes.h:974 + SmallVector EnumAttrs; + SmallVector StringAttrs; + using iterator = typename SmallVector::iterator; nikic wrote: > Just wondering if storing both in one vector would

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

2021-12-15 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. Actual benchmarks: https://llvm-compile-time-tracker.com/compare.php?from=7d97678df7f514c14b7611447dad02e9cc5168c9&to=f39a39e09e8f4f3b7dc94e4d23d9acfbf36ab2e5&stat=instructions CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115798/new/ https://reviews.

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

2021-12-15 Thread Nikita Popov via Phabricator via cfe-commits
nikic added a comment. I like the general direction. A possible reframing would be SmallAttrBuilder -> MutableAttributeSet. I think my main question here would be in which contexts we still use / want to use the old AttrBuilder? Comment at: llvm/include/llvm/IR/Attributes.h:9

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

2021-12-15 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 394542. serge-sans-paille added a comment. Leverage the fact that AttributeSet nodes are already sorted CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115798/new/ https://reviews.llvm.org/D115798 Files: clang/include/clang/CodeGen/CodeGe

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

2021-12-15 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. My plan mid-term plan would be to rename `AttrBuilder` into `AttrQuery` at some point, and use `SmallAttrBuilder` as the actual `AttrBuilder` in most places. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115798/ne

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

2021-12-15 Thread serge via Phabricator via cfe-commits
serge-sans-paille created this revision. serge-sans-paille added reviewers: nikic, dblaikie, rnk. Herald added subscribers: dexonsmith, jdoerfert, mgrang, hiraditya. serge-sans-paille requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-