esakella created this revision.
esakella added a subscriber: ABataev.

Hello,

I have made a small change in the initial size of the StackTy SmallVector of 
class DSAStackTy.

I reduced the initial size of this SmallVector  from 64 elements to 4 elements, 
in order to improve the memory consumption during the creation of the Sema, 
whose constructor calls the Sema::InitDataSharingAttributesStack() function, 
which in turn creates a DSAStackTy.

After profiling Clang (I just gave it a simple source file to compile) before 
and after this change, the difference in memory consumption is up to almost 400 
KB.

Would that change be acceptable?

Thank you,
Sakellari Elisavet

http://reviews.llvm.org/D16801

Files:
  lib/Sema/SemaOpenMP.cpp

Index: lib/Sema/SemaOpenMP.cpp
===================================================================
--- lib/Sema/SemaOpenMP.cpp
+++ lib/Sema/SemaOpenMP.cpp
@@ -123,7 +123,7 @@
           CancelRegion(false), AssociatedLoops(1), InnerTeamsRegionLoc() {}
   };
- typedef SmallVector<SharingMapTy, 64> StackTy;
+  typedef SmallVector<SharingMapTy, 4> StackTy;
/// \brief Stack of used declaration and their data-sharing attributes.
   StackTy Stack;




Index: lib/Sema/SemaOpenMP.cpp
===================================================================
--- lib/Sema/SemaOpenMP.cpp
+++ lib/Sema/SemaOpenMP.cpp
@@ -123,7 +123,7 @@
           CancelRegion(false), AssociatedLoops(1), InnerTeamsRegionLoc() {}
   };
 
-  typedef SmallVector<SharingMapTy, 64> StackTy;
+  typedef SmallVector<SharingMapTy, 4> StackTy;
 
   /// \brief Stack of used declaration and their data-sharing attributes.
   StackTy Stack;
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to