From 87feb4e64e2ea574df3a45ba057d9fc506f0c8f7 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Fri, 4 Mar 2016 00:58:39 +0000 Subject: [PATCH] CodeGen: Tune the SmallVector size in LiveRange The vast majority of LiveRanges (ie, 4/5) have exactly 1 segment and 1 value number, and a good chunk of the rest have 2 of each, so allocating space for 4 is wasteful. This is especially noticeable when dealing with a very large number of vregs, and I have an internal case where dropping this to 2 shaves over 5% off of peak memory when compiling a particularly large function. llvm-svn: 262681 --- llvm/include/llvm/CodeGen/LiveInterval.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/CodeGen/LiveInterval.h b/llvm/include/llvm/CodeGen/LiveInterval.h index 27c53556e421..177280916a18 100644 --- a/llvm/include/llvm/CodeGen/LiveInterval.h +++ b/llvm/include/llvm/CodeGen/LiveInterval.h @@ -190,8 +190,8 @@ namespace llvm { void dump() const; }; - typedef SmallVector Segments; - typedef SmallVector VNInfoList; + typedef SmallVector Segments; + typedef SmallVector VNInfoList; Segments segments; // the liveness segments VNInfoList valnos; // value#'s