diff options
Diffstat (limited to 'llvm/lib/CodeGen/BreakFalseDeps.cpp')
-rw-r--r-- | llvm/lib/CodeGen/BreakFalseDeps.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/BreakFalseDeps.cpp b/llvm/lib/CodeGen/BreakFalseDeps.cpp index 9bae9d36add16..b01a264dd97d7 100644 --- a/llvm/lib/CodeGen/BreakFalseDeps.cpp +++ b/llvm/lib/CodeGen/BreakFalseDeps.cpp @@ -106,9 +106,18 @@ FunctionPass *llvm::createBreakFalseDeps() { return new BreakFalseDeps(); } bool BreakFalseDeps::pickBestRegisterForUndef(MachineInstr *MI, unsigned OpIdx, unsigned Pref) { + + // We can't change tied operands. + if (MI->isRegTiedToDefOperand(OpIdx)) + return false; + MachineOperand &MO = MI->getOperand(OpIdx); assert(MO.isUndef() && "Expected undef machine operand"); + // We can't change registers that aren't renamable. + if (!MO.isRenamable()) + return false; + Register OriginalReg = MO.getReg(); // Update only undef operands that have reg units that are mapped to one root. |