summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/UnreachableBlockElim.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/UnreachableBlockElim.cpp')
-rw-r--r--llvm/lib/CodeGen/UnreachableBlockElim.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/UnreachableBlockElim.cpp b/llvm/lib/CodeGen/UnreachableBlockElim.cpp
index bdd25f29aea..407fd9b162e 100644
--- a/llvm/lib/CodeGen/UnreachableBlockElim.cpp
+++ b/llvm/lib/CodeGen/UnreachableBlockElim.cpp
@@ -207,12 +207,11 @@ bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) {
MachineRegisterInfo &MRI = F.getRegInfo();
unsigned InputSub = Input.getSubReg();
if (InputSub == 0 &&
- MRI.constrainRegClass(InputReg, MRI.getRegClass(OutputReg)) &&
- !Input.isUndef()) {
+ MRI.constrainRegClass(InputReg, MRI.getRegClass(OutputReg))) {
MRI.replaceRegWith(OutputReg, InputReg);
} else {
// The input register to the PHI has a subregister or it can't be
- // constrained to the proper register class or it is undef:
+ // constrained to the proper register class:
// insert a COPY instead of simply replacing the output
// with the input.
const TargetInstrInfo *TII = F.getSubtarget().getInstrInfo();
OpenPOWER on IntegriCloud