mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
[mips] [IAS] Do not generate redundant ORi in createLShiftOri.
Summary: If the immediate is 0, the ORi is pointless. Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8969 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235990 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1645,6 +1645,10 @@ void createLShiftOri(MCOperand Operand, unsigned RegNo, SMLoc IDLoc,
|
||||
Instructions.push_back(tmpInst);
|
||||
tmpInst.clear();
|
||||
}
|
||||
// There's no need for an ORi if the immediate is 0.
|
||||
if (Operand.isImm() && Operand.getImm() == 0)
|
||||
return;
|
||||
|
||||
tmpInst.setOpcode(Mips::ORi);
|
||||
tmpInst.addOperand(MCOperand::CreateReg(RegNo));
|
||||
tmpInst.addOperand(MCOperand::CreateReg(RegNo));
|
||||
|
Reference in New Issue
Block a user