summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-10 20:41:10 +0000
committerChris Lattner <sabre@nondot.org>2004-02-10 20:41:10 +0000
commit373fba5c1d7943531e3c69a588417aa481e1c5eb (patch)
tree76177aff29bafde38374a25b7cd444d553152459
parent2aea68ccfd5ea673cafbd2961db0878e1902c968 (diff)
downloadbcm5719-llvm-373fba5c1d7943531e3c69a588417aa481e1c5eb.tar.gz
bcm5719-llvm-373fba5c1d7943531e3c69a588417aa481e1c5eb.zip
Eliminate users of MachineOperand::isPhysicalRegister
llvm-svn: 11278
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp6
-rw-r--r--llvm/lib/CodeGen/PrologEpilogInserter.cpp3
-rw-r--r--llvm/lib/CodeGen/RegAllocLocal.cpp4
3 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index a8627396ccc..28b5f1e90b7 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/lib/CodeGen/LiveVariables.cpp
@@ -234,7 +234,8 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) {
if (MO.isUse()) {
if (MO.isVirtualRegister() && !MO.getVRegValueOrNull()) {
HandleVirtRegUse(getVarInfo(MO.getReg()), MBB, MI);
- } else if (MO.isPhysicalRegister() &&
+ } else if (MO.isRegister() &&
+ MRegisterInfo::isPhysicalRegister(MO.getReg()) &&
AllocatablePhysicalRegisters[MO.getReg()]) {
HandlePhysRegUse(MO.getReg(), MI);
}
@@ -257,7 +258,8 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) {
VRInfo.DefBlock = MBB; // Created here...
VRInfo.DefInst = MI;
VRInfo.Kills.push_back(std::make_pair(MBB, MI)); // Defaults to dead
- } else if (MO.isPhysicalRegister() &&
+ } else if (MO.isRegister() &&
+ MRegisterInfo::isPhysicalRegister(MO.getReg()) &&
AllocatablePhysicalRegisters[MO.getReg()]) {
HandlePhysRegDef(MO.getReg(), MI);
}
diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
index bb5ad47544a..b44e386bbe8 100644
--- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
@@ -118,7 +118,8 @@ void PEI::saveCallerSavedRegisters(MachineFunction &Fn) {
MachineOperand &MO = (*I)->getOperand(i);
assert(!MO.isVirtualRegister() &&
"Register allocation must be performed!");
- if (MO.isPhysicalRegister() && MO.isDef())
+ if (MO.isRegister() && MO.isDef() &&
+ MRegisterInfo::isPhysicalRegister(MO.getReg()))
ModifiedRegs[MO.getReg()] = true; // Register is modified
}
++I;
diff --git a/llvm/lib/CodeGen/RegAllocLocal.cpp b/llvm/lib/CodeGen/RegAllocLocal.cpp
index b9c758c2f3d..23ec84531e3 100644
--- a/llvm/lib/CodeGen/RegAllocLocal.cpp
+++ b/llvm/lib/CodeGen/RegAllocLocal.cpp
@@ -556,8 +556,8 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) {
// Loop over all of the operands of the instruction, spilling registers that
// are defined, and marking explicit destinations in the PhysRegsUsed map.
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i)
- if (MI->getOperand(i).isDef() &&
- MI->getOperand(i).isPhysicalRegister()) {
+ if (MI->getOperand(i).isDef() && MI->getOperand(i).isRegister() &&
+ MRegisterInfo::isPhysicalRegister(MI->getOperand(i).getReg())) {
unsigned Reg = MI->getOperand(i).getAllocatedRegNum();
spillPhysReg(MBB, I, Reg, true); // Spill any existing value in the reg
PhysRegsUsed[Reg] = 0; // It is free and reserved now
OpenPOWER on IntegriCloud