[PATCH] D32819: [IR] Switch AttributeList to use an array for O(1) access

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 15:28:38 PDT 2017


rnk added a comment.

I benchmarked opt on sqlite3.bc, and this was a nice improvement.

I could try to measure memory usage, but I've convinced myself that there should be the exact same number of AttributeLists as their were before.

One question remains: do you think I should completely encapsulate this indexing change by adding 1 inside AttributeList::getAttributes, or is it better to update all the callers as I did in this change? The problem with this change is that it will break out-of-tree backends and frontends that use the APIs with one-based indexing. It won't even be a compile failure because the APIs still take `unsigned` integers. That's a bit rude without some more hand waving on llvm-dev and release notes.


https://reviews.llvm.org/D32819





More information about the llvm-commits mailing list