[clang] [Clang] Generate the GEP instead of adding AST nodes (PR #73730)

Bill Wendling via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 09:50:14 PST 2023


================
@@ -1411,6 +1411,8 @@ class CodeGenFunction : public CodeGenTypeCache {
   /// decls.
   DeclMapTy LocalDeclMap;
 
+  llvm::SmallDenseMap<const Expr *, LValue, 32> ExprLValueMap;
----------------
bwendling wrote:

It will. I did a test to see how many Exprs are typically stored. For both Linux and Clang, the vast majority of functions have fewer than 14 entries. And most (over 2 million for LLVM and over 90,000 for Linux) have no entries at all. It cuts off pretty drastically around 40 entries for each. The larger the number of entries the fewer the number of functions that have them. Both LLVM and Linux have a function that has 5,900 and 1,900 resp.

https://github.com/llvm/llvm-project/pull/73730


More information about the cfe-commits mailing list