[llvm-commits] [llvm] r108734 - in /llvm/trunk/lib/CodeGen: InlineSpiller.cpp RegAllocLinearScan.cpp Spiller.cpp Spiller.h
Jakob Stoklund Olesen
stoklund at 2pi.dk
Mon Jul 19 11:41:20 PDT 2010
Author: stoklund
Date: Mon Jul 19 13:41:20 2010
New Revision: 108734
URL: http://llvm.org/viewvc/llvm-project?rev=108734&view=rev
Log:
Spillers may alter MachineLoopInfo when breaking critical edges, so make it
non-const.
Modified:
llvm/trunk/lib/CodeGen/InlineSpiller.cpp
llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
llvm/trunk/lib/CodeGen/Spiller.cpp
llvm/trunk/lib/CodeGen/Spiller.h
Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/InlineSpiller.cpp?rev=108734&r1=108733&r2=108734&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/InlineSpiller.cpp (original)
+++ llvm/trunk/lib/CodeGen/InlineSpiller.cpp Mon Jul 19 13:41:20 2010
@@ -18,6 +18,7 @@
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetInstrInfo.h"
@@ -30,6 +31,7 @@
class InlineSpiller : public Spiller {
MachineFunction &mf_;
LiveIntervals &lis_;
+ MachineLoopInfo &loops_;
VirtRegMap &vrm_;
MachineFrameInfo &mfi_;
MachineRegisterInfo &mri_;
@@ -53,8 +55,9 @@
~InlineSpiller() {}
public:
- InlineSpiller(MachineFunction *mf, LiveIntervals *lis, VirtRegMap *vrm)
- : mf_(*mf), lis_(*lis), vrm_(*vrm),
+ InlineSpiller(MachineFunction *mf, LiveIntervals *lis, MachineLoopInfo *mli,
+ VirtRegMap *vrm)
+ : mf_(*mf), lis_(*lis), loops_(*mli), vrm_(*vrm),
mfi_(*mf->getFrameInfo()),
mri_(mf->getRegInfo()),
tii_(*mf->getTarget().getInstrInfo()),
@@ -82,9 +85,9 @@
namespace llvm {
Spiller *createInlineSpiller(MachineFunction *mf,
LiveIntervals *lis,
- const MachineLoopInfo *mli,
+ MachineLoopInfo *mli,
VirtRegMap *vrm) {
- return new InlineSpiller(mf, lis, vrm);
+ return new InlineSpiller(mf, lis, mli, vrm);
}
}
Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=108734&r1=108733&r2=108734&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Mon Jul 19 13:41:20 2010
@@ -127,7 +127,7 @@
BitVector allocatableRegs_;
LiveIntervals* li_;
LiveStacks* ls_;
- const MachineLoopInfo *loopInfo;
+ MachineLoopInfo *loopInfo;
/// handled_ - Intervals are added to the handled_ set in the order of their
/// start value. This is uses for backtracking.
@@ -799,7 +799,7 @@
static
float getConflictWeight(LiveInterval *cur, unsigned Reg, LiveIntervals *li_,
MachineRegisterInfo *mri_,
- const MachineLoopInfo *loopInfo) {
+ MachineLoopInfo *loopInfo) {
float Conflicts = 0;
for (MachineRegisterInfo::reg_iterator I = mri_->reg_begin(Reg),
E = mri_->reg_end(); I != E; ++I) {
Modified: llvm/trunk/lib/CodeGen/Spiller.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/Spiller.cpp?rev=108734&r1=108733&r2=108734&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/Spiller.cpp (original)
+++ llvm/trunk/lib/CodeGen/Spiller.cpp Mon Jul 19 13:41:20 2010
@@ -193,10 +193,10 @@
class StandardSpiller : public Spiller {
protected:
LiveIntervals *lis;
- const MachineLoopInfo *loopInfo;
+ MachineLoopInfo *loopInfo;
VirtRegMap *vrm;
public:
- StandardSpiller(LiveIntervals *lis, const MachineLoopInfo *loopInfo,
+ StandardSpiller(LiveIntervals *lis, MachineLoopInfo *loopInfo,
VirtRegMap *vrm)
: lis(lis), loopInfo(loopInfo), vrm(vrm) {}
@@ -222,7 +222,7 @@
class SplittingSpiller : public StandardSpiller {
public:
SplittingSpiller(MachineFunction *mf, LiveIntervals *lis,
- const MachineLoopInfo *loopInfo, VirtRegMap *vrm)
+ MachineLoopInfo *loopInfo, VirtRegMap *vrm)
: StandardSpiller(lis, loopInfo, vrm) {
mri = &mf->getRegInfo();
@@ -508,12 +508,12 @@
namespace llvm {
Spiller *createInlineSpiller(MachineFunction*,
LiveIntervals*,
- const MachineLoopInfo*,
+ MachineLoopInfo*,
VirtRegMap*);
}
llvm::Spiller* llvm::createSpiller(MachineFunction *mf, LiveIntervals *lis,
- const MachineLoopInfo *loopInfo,
+ MachineLoopInfo *loopInfo,
VirtRegMap *vrm) {
switch (spillerOpt) {
default: assert(0 && "unknown spiller");
Modified: llvm/trunk/lib/CodeGen/Spiller.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/Spiller.h?rev=108734&r1=108733&r2=108734&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/Spiller.h (original)
+++ llvm/trunk/lib/CodeGen/Spiller.h Mon Jul 19 13:41:20 2010
@@ -51,7 +51,7 @@
/// Create and return a spiller object, as specified on the command line.
Spiller* createSpiller(MachineFunction *mf, LiveIntervals *li,
- const MachineLoopInfo *loopInfo, VirtRegMap *vrm);
+ MachineLoopInfo *loopInfo, VirtRegMap *vrm);
}
#endif
More information about the llvm-commits
mailing list