[llvm] bed2eb6 - [GenericDomTreeConstruction] Use SmallVector (NFC) (#96138)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 20 08:20:41 PDT 2024


Author: Kazu Hirata
Date: 2024-06-20T08:20:38-07:00
New Revision: bed2eb64de05d0e1f5a8494e8c0f44b24d41dd18

URL: https://github.com/llvm/llvm-project/commit/bed2eb64de05d0e1f5a8494e8c0f44b24d41dd18
DIFF: https://github.com/llvm/llvm-project/commit/bed2eb64de05d0e1f5a8494e8c0f44b24d41dd18.diff

LOG: [GenericDomTreeConstruction] Use SmallVector (NFC) (#96138)

The use of SmallVector here saves 4.7% of heap allocations during the
compilation of ConvertExpr.cpp.ii, a preprocessed version of
flang/lib/Lower/ConvertExpr.cpp.

Added: 
    

Modified: 
    llvm/include/llvm/Support/GenericDomTreeConstruction.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/GenericDomTreeConstruction.h b/llvm/include/llvm/Support/GenericDomTreeConstruction.h
index 29b5f9159c68e..a216cd2a03596 100644
--- a/llvm/include/llvm/Support/GenericDomTreeConstruction.h
+++ b/llvm/include/llvm/Support/GenericDomTreeConstruction.h
@@ -72,7 +72,7 @@ struct SemiNCAInfo {
 
   // Number to node mapping is 1-based. Initialize the mapping to start with
   // a dummy element.
-  std::vector<NodePtr> NumToNode = {nullptr};
+  SmallVector<NodePtr, 64> NumToNode = {nullptr};
   DenseMap<NodePtr, InfoRec> NodeToInfo;
 
   using UpdateT = typename DomTreeT::UpdateType;


        


More information about the llvm-commits mailing list