[llvm] [GenericDomTreeConstruction] Use SmallVector (NFC) (PR #96138)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 19 21:25:38 PDT 2024
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/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.
>From 96239ff733cbbd0ca77de76c82c8ffc90c73a36d Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Wed, 19 Jun 2024 19:38:05 -0700
Subject: [PATCH] [GenericDomTreeConstruction] Use SmallVector (NFC)
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.
---
llvm/include/llvm/Support/GenericDomTreeConstruction.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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