diff options
| author | Justin Lebar <jlebar@google.com> | 2018-12-22 01:30:37 +0000 |
|---|---|---|
| committer | Justin Lebar <jlebar@google.com> | 2018-12-22 01:30:37 +0000 |
| commit | 7f41fe3a58b0deb25190c2e67ef22e15d7b745b7 (patch) | |
| tree | b0167fdedfefefb286ea4379be73b27775e7c6f7 /llvm/lib | |
| parent | 9953577cb2b5fae3284725d35ef678bfb5695a2d (diff) | |
| download | bcm5719-llvm-7f41fe3a58b0deb25190c2e67ef22e15d7b745b7.tar.gz bcm5719-llvm-7f41fe3a58b0deb25190c2e67ef22e15d7b745b7.zip | |
[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!
llvm-svn: 349982
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp index 63e227a12ed..ad9b3b37810 100644 --- a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp @@ -788,11 +788,8 @@ bool NVPTXAsmPrinter::doInitialization(Module &M) { // Construct a default subtarget off of the TargetMachine defaults. The // rest of NVPTX isn't friendly to change subtargets per function and // so the default TargetMachine will have all of the options. - const Triple &TT = TM.getTargetTriple(); - StringRef CPU = TM.getTargetCPU(); - StringRef FS = TM.getTargetFeatureString(); const NVPTXTargetMachine &NTM = static_cast<const NVPTXTargetMachine &>(TM); - const NVPTXSubtarget STI(TT, CPU, FS, NTM); + const auto* STI = static_cast<const NVPTXSubtarget*>(NTM.getSubtargetImpl()); if (M.alias_size()) { report_fatal_error("Module has aliases, which NVPTX does not support."); @@ -816,7 +813,7 @@ bool NVPTXAsmPrinter::doInitialization(Module &M) { bool Result = AsmPrinter::doInitialization(M); // Emit header before any dwarf directives are emitted below. - emitHeader(M, OS1, STI); + emitHeader(M, OS1, *STI); OutStreamer->EmitRawText(OS1.str()); // Emit module-level inline asm if it exists. |

