-//===-- StackSlotColoring.cpp - Sinking for machine instructions ----------===//
+//===-- StackSlotColoring.cpp - Stack slot coloring pass. -----------------===//
//
// The LLVM Compiler Infrastructure
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "stackcoloring"
+#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/LiveStackAnalysis.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
cl::init(false), cl::Hidden,
cl::desc("Surpress slot sharing during stack coloring"));
-static cl::opt<int>
-DeleteLimit("slot-delete-limit", cl::init(-1), cl::Hidden,
- cl::desc("Stack coloring slot deletion limit"));
-
STATISTIC(NumEliminated, "Number of stack slots eliminated due to coloring");
namespace {
int StackSlotColoring::ColorSlot(LiveInterval *li) {
int Color = -1;
bool Share = false;
- if (!DisableSharing &&
- (DeleteLimit == -1 || (int)NumEliminated < DeleteLimit)) {
+ if (!DisableSharing) {
// Check if it's possible to reuse any of the used colors.
Color = UsedColors.find_first();
while (Color != -1) {
bool StackSlotColoring::ColorSlots(MachineFunction &MF) {
unsigned NumObjs = MFI->getObjectIndexEnd();
std::vector<int> SlotMapping(NumObjs, -1);
- SlotMapping.resize(NumObjs, -1);
bool Changed = false;
for (unsigned i = 0, e = SSIntervals.size(); i != e; ++i) {