diff options
author | Toma Tabacu <toma.tabacu@imgtec.com> | 2015-04-28 14:06:35 +0000 |
---|---|---|
committer | Toma Tabacu <toma.tabacu@imgtec.com> | 2015-04-28 14:06:35 +0000 |
commit | 7dea2e39824eb1d699c41bb113ce1f2b2a17d211 (patch) | |
tree | 0b6daf3f77d776a3988ea0bac7f8b2e0131d6e66 /llvm/lib/Target | |
parent | 842a51bad879e66c13ce69203238ee8501e157f9 (diff) | |
download | bcm5719-llvm-7dea2e39824eb1d699c41bb113ce1f2b2a17d211.tar.gz bcm5719-llvm-7dea2e39824eb1d699c41bb113ce1f2b2a17d211.zip |
[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
llvm-svn: 235990
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index 4d57c79c678..4779c227465 100644 --- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -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)); |