From b11ef0897cd7c67740d309e28d228c03f4dcba88 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Sat, 14 Nov 2015 06:35:56 +0000 Subject: Reduce the size of MCRelaxableFragment. MCRelaxableFragment previously kept a copy of MCSubtargetInfo and MCInst to enable re-encoding the MCInst later during relaxation. A copy of MCSubtargetInfo (instead of a reference or pointer) was needed because the feature bits could be modified by the parser. This commit replaces the MCSubtargetInfo copy in MCRelaxableFragment with a constant reference to MCSubtargetInfo. The copies of MCSubtargetInfo are kept in MCContext, and the target parsers are now responsible for asking MCContext to provide a copy whenever the feature bits of MCSubtargetInfo have to be toggled. With this patch, I saw a 4% reduction in peak memory usage when I compiled verify-uselistorder.lto.bc using llc. rdar://problem/21736951 Differential Revision: http://reviews.llvm.org/D14346 llvm-svn: 253127 --- llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Target/Hexagon/AsmParser') diff --git a/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp b/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp index 9fccd9afe52..b73ec0bfb19 100644 --- a/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp +++ b/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp @@ -133,7 +133,7 @@ class HexagonAsmParser : public MCTargetAsmParser { /// } public: - HexagonAsmParser(MCSubtargetInfo &_STI, MCAsmParser &_Parser, + HexagonAsmParser(const MCSubtargetInfo &_STI, MCAsmParser &_Parser, const MCInstrInfo &MII, const MCTargetOptions &Options) : MCTargetAsmParser(Options, _STI), Parser(_Parser), MCII (MII), MCB(HexagonMCInstrInfo::createBundle()), InBrackets(false) { -- cgit v1.2.3