summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PHIElimination.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-07-01 01:51:32 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-07-01 01:51:32 +0000
commitd26fdc83c9f620992b579adbebab45716fdfc001 (patch)
treefad6c2ecbf1fb1aec9b7a1565873f56b73c94647 /llvm/lib/CodeGen/PHIElimination.cpp
parent241f34cde81c46167ac2e10b5bffb6857a3f881b (diff)
downloadbcm5719-llvm-d26fdc83c9f620992b579adbebab45716fdfc001.tar.gz
bcm5719-llvm-d26fdc83c9f620992b579adbebab45716fdfc001.zip
CodeGen: Use MachineInstr& in LiveVariables API, NFC
Change all the methods in LiveVariables that expect non-null MachineInstr* to take MachineInstr& and update the call sites. This clarifies the API, and designs away a class of iterator to pointer implicit conversions. llvm-svn: 274319
Diffstat (limited to 'llvm/lib/CodeGen/PHIElimination.cpp')
-rw-r--r--llvm/lib/CodeGen/PHIElimination.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/PHIElimination.cpp b/llvm/lib/CodeGen/PHIElimination.cpp
index f593fafe774..b8d54315d14 100644
--- a/llvm/lib/CodeGen/PHIElimination.cpp
+++ b/llvm/lib/CodeGen/PHIElimination.cpp
@@ -283,7 +283,7 @@ void PHIElimination::LowerPHINode(MachineBasicBlock &MBB,
if (reusedIncoming)
if (MachineInstr *OldKill = VI.findKill(&MBB)) {
DEBUG(dbgs() << "Remove old kill from " << *OldKill);
- LV->removeVirtualRegisterKilled(IncomingReg, OldKill);
+ LV->removeVirtualRegisterKilled(IncomingReg, *OldKill);
DEBUG(MBB.dump());
}
@@ -291,18 +291,18 @@ void PHIElimination::LowerPHINode(MachineBasicBlock &MBB,
// killed. Note that because the value is defined in several places (once
// each for each incoming block), the "def" block and instruction fields
// for the VarInfo is not filled in.
- LV->addVirtualRegisterKilled(IncomingReg, &PHICopy);
+ LV->addVirtualRegisterKilled(IncomingReg, PHICopy);
}
// Since we are going to be deleting the PHI node, if it is the last use of
// any registers, or if the value itself is dead, we need to move this
// information over to the new copy we just inserted.
- LV->removeVirtualRegistersKilled(MPhi);
+ LV->removeVirtualRegistersKilled(*MPhi);
// If the result is dead, update LV.
if (isDead) {
- LV->addVirtualRegisterDead(DestReg, &PHICopy);
- LV->removeVirtualRegisterDead(DestReg, MPhi);
+ LV->addVirtualRegisterDead(DestReg, PHICopy);
+ LV->removeVirtualRegisterDead(DestReg, *MPhi);
}
}
@@ -452,7 +452,7 @@ void PHIElimination::LowerPHINode(MachineBasicBlock &MBB,
assert(KillInst->readsRegister(SrcReg) && "Cannot find kill instruction");
// Finally, mark it killed.
- LV->addVirtualRegisterKilled(SrcReg, &*KillInst);
+ LV->addVirtualRegisterKilled(SrcReg, *KillInst);
// This vreg no longer lives all of the way through opBlock.
unsigned opBlockNum = opBlock.getNumber();
OpenPOWER on IntegriCloud