R600: Use .AMDGPU.config section to emit stacksize
[oota-llvm.git] / lib / Target / R600 / AMDGPUAsmPrinter.cpp
index d8a380de839c543ce30194267e136b2f221fc496..dc0461a641b6f847e1da4a5e428df951b370a1a3 100644 (file)
@@ -22,6 +22,7 @@
 #include "SIDefines.h"
 #include "SIMachineFunctionInfo.h"
 #include "SIRegisterInfo.h"
+#include "R600MachineFunctionInfo.h"
 #include "R600RegisterInfo.h"
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCSectionELF.h"
@@ -75,6 +76,7 @@ void AMDGPUAsmPrinter::EmitProgramInfoR600(MachineFunction &MF) {
   unsigned MaxGPR = 0;
   const R600RegisterInfo * RI =
                 static_cast<const R600RegisterInfo*>(TM.getRegisterInfo());
+  R600MachineFunctionInfo *MFI = MF.getInfo<R600MachineFunctionInfo>();
 
   for (MachineFunction::iterator BB = MF.begin(), BB_E = MF.end();
                                                   BB != BB_E; ++BB) {
@@ -97,6 +99,7 @@ void AMDGPUAsmPrinter::EmitProgramInfoR600(MachineFunction &MF) {
     }
   }
   OutStreamer.EmitIntValue(MaxGPR + 1, 4);
+  OutStreamer.EmitIntValue(MFI->StackSize, 4);
 }
 
 void AMDGPUAsmPrinter::EmitProgramInfoSI(MachineFunction &MF) {