[PATCH] D133996: Add a cache for DL.getTypeAllocSize() to BasicAA.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 16 02:19:00 PDT 2022


nikic added a comment.

Compile-time on CTMark: http://llvm-compile-time-tracker.com/compare.php?from=71e52a125cb5f532192c40cf13692c18ede18cb4&to=14ba5930d47843050c2618b70c6cf6fc7d0fc66f&stat=instructions So not a great deal of impact end-to-end.

getTypeAllocSize() is indeed fairly expensive due to the ABI alignment calculation. I think a cache could generally make sense, though I wonder why it is BasicAA specific, and not part of DataLayout itself?

I would also be interested in whether the GEPs in your case are mostly constant offset GEPs. It's on my roadmap to canonicalize those to i8 GEPs, which would allow us to save on a lot of redundant offset calculation in both BasicAA and other places.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133996



More information about the llvm-commits mailing list