<p dir="ltr">We will get invalid references if SubtargetCopies is reallocated. </p>
<p dir="ltr">You need to keep the index or use an allocator when giving out copies.</p>
<p dir="ltr">What are the memory savings the you get with this patch? </p>
<p dir="ltr">Cheers, Rafael </p>
<div class="gmail_quote">On Nov 4, 2015 3:16 PM, "Akira Hatanaka via llvm-commits" <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ahatanak created this revision.<br>
ahatanak added a subscriber: llvm-commits.<br>
Herald added subscribers: dsanders, jyknight, arsenm.<br>
<br>
This patch replaces the copy of MCSubtargetInfo in MCRelaxableFragment, which accounted for nearly 40% of MCRelaxableFragment, with a const reference to MCSubtargetInfo to make MCRelaxableFragment smaller.<br>
<br>
<a href="http://reviews.llvm.org/D14346" rel="noreferrer" target="_blank">http://reviews.llvm.org/D14346</a><br>
<br>
Files:<br>
include/llvm/MC/MCAssembler.h<br>
include/llvm/MC/MCContext.h<br>
include/llvm/MC/MCTargetAsmParser.h<br>
include/llvm/Support/TargetRegistry.h<br>
lib/CodeGen/AsmPrinter/AsmPrinter.cpp<br>
lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp<br>
lib/MC/MCContext.cpp<br>
lib/MC/MCParser/MCTargetAsmParser.cpp<br>
lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp<br>
lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp<br>
lib/Target/ARM/AsmParser/ARMAsmParser.cpp<br>
lib/Target/Mips/AsmParser/MipsAsmParser.cpp<br>
lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp<br>
lib/Target/Sparc/AsmParser/SparcAsmParser.cpp<br>
lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp<br>
lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp<br>
lib/Target/X86/AsmParser/X86AsmInstrumentation.h<br>
lib/Target/X86/AsmParser/X86AsmParser.cpp<br>
utils/TableGen/AsmMatcherEmitter.cpp<br>
<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div>