diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-12-03 02:31:43 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-12-03 02:31:43 +0000 |
commit | 7145382389e5509e953506a156bf4858e25033f4 (patch) | |
tree | c183f13ed82b21d5b82122ee99516ccc94c68cd0 /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 2ca285fc5c1cab57d886594098aa15f929ca001e (diff) | |
download | bcm5719-llvm-7145382389e5509e953506a156bf4858e25033f4.tar.gz bcm5719-llvm-7145382389e5509e953506a156bf4858e25033f4.zip |
Fill out codegen SSA updater. It's not yet tested.
llvm-svn: 90395
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index f73a5a36211..ba9be6a8703 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -1058,6 +1058,20 @@ bool MachineInstr::isInvariantLoad(AliasAnalysis *AA) const { return true; } +/// isConstantValuePHI - If the specified instruction is a PHI that always +/// merges together the same virtual register, return the register, otherwise +/// return 0. +unsigned MachineInstr::isConstantValuePHI() const { + if (getOpcode() != TargetInstrInfo::PHI) + return 0; + + unsigned Reg = getOperand(1).getReg(); + for (unsigned i = 3, e = getNumOperands(); i < e; i += 2) + if (getOperand(i).getReg() != Reg) + return 0; + return Reg; +} + void MachineInstr::dump() const { errs() << " " << *this; } |