llvm.org GIT mirror llvm / b51dce3
Eastimate required stack alignment early, so we can decide, whether we will need frame pointer or not git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50161 91177308-0d34-0410-b5e6-96231b3b80d8 Anton Korobeynikov 12 years ago
2 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
368368 MI.getOperand(i+3).getImm();
369369
370370 MI.getOperand(i+3).ChangeToImmediate(Offset);
371 }
372
373 void
374 X86RegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
375 RegScavenger *RS) const {
376 MachineFrameInfo *FFI = MF.getFrameInfo();
377
378 // Calculate and set max stack object alignment early, so we can decide
379 // whether we will need stack realignment (and thus FP).
380 unsigned MaxAlign = 0;
381 for (int i = FFI->getObjectIndexBegin(),
382 e = FFI->getObjectIndexEnd(); i != e; ++i) {
383 if (FFI->isDeadObjectIndex(i))
384 continue;
385 unsigned Align = FFI->getObjectAlignment(i);
386 MaxAlign = std::max(MaxAlign, Align);
387 }
388
389 FFI->setMaxAlignment(MaxAlign);
371390 }
372391
373392 void
126126 int SPAdj, RegScavenger *RS = NULL) const;
127127
128128 void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
129 void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
130 RegScavenger *RS = NULL) const;
129131
130132 void emitPrologue(MachineFunction &MF) const;
131133 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;