llvm.org GIT mirror llvm / b57910b
[NVPTX] Reduce stack size in NVPTXAsmPrinter::doInitialization(). NVPTXAsmPrinter::doInitialization() was creating an NVPTXSubtarget on the stack. This object is huge, about 80kb. Also it's slow to create. And it's all redundant; we have one in NVPTXTargetMachine anyway! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349982 91177308-0d34-0410-b5e6-96231b3b80d8 Justin Lebar 1 year, 11 months ago
1 changed file(s) with 2 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
787787 // Construct a default subtarget off of the TargetMachine defaults. The
788788 // rest of NVPTX isn't friendly to change subtargets per function and
789789 // so the default TargetMachine will have all of the options.
790 const Triple &TT = TM.getTargetTriple();
791 StringRef CPU = TM.getTargetCPU();
792 StringRef FS = TM.getTargetFeatureString();
793790 const NVPTXTargetMachine &NTM = static_cast(TM);
794 const NVPTXSubtarget STI(TT, CPU, FS, NTM);
791 const auto* STI = static_cast(NTM.getSubtargetImpl());
795792
796793 if (M.alias_size()) {
797794 report_fatal_error("Module has aliases, which NVPTX does not support.");
815812 bool Result = AsmPrinter::doInitialization(M);
816813
817814 // Emit header before any dwarf directives are emitted below.
818 emitHeader(M, OS1, STI);
815 emitHeader(M, OS1, *STI);
819816 OutStreamer->EmitRawText(OS1.str());
820817
821818 // Emit module-level inline asm if it exists.