diff options
Diffstat (limited to 'llvm/lib/Target/Sparc/InstrSelection/InstrSelectionSupport.cpp')
-rw-r--r-- | llvm/lib/Target/Sparc/InstrSelection/InstrSelectionSupport.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/Sparc/InstrSelection/InstrSelectionSupport.cpp b/llvm/lib/Target/Sparc/InstrSelection/InstrSelectionSupport.cpp index 131107b991e..a7923862cfa 100644 --- a/llvm/lib/Target/Sparc/InstrSelection/InstrSelectionSupport.cpp +++ b/llvm/lib/Target/Sparc/InstrSelection/InstrSelectionSupport.cpp @@ -71,7 +71,8 @@ ChooseRegOrImmed(int64_t intValue, opType = isSigned? MachineOperand::MO_SignExtendedImmed : MachineOperand::MO_UnextendedImmed; getImmedValue = intValue; - } else if (intValue == 0 && target.getRegInfo().getZeroRegNum() >= 0) { + } else if (intValue == 0 && + target.getRegInfo().getZeroRegNum() != (unsigned)-1) { opType = MachineOperand::MO_MachineRegister; getMachineRegNum = target.getRegInfo().getZeroRegNum(); } |