[llvm-commits] [llvm] r141602 - /llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp
Bill Wendling
isanbard at gmail.com
Mon Oct 10 17:10:41 PDT 2011
Author: void
Date: Mon Oct 10 19:10:41 2011
New Revision: 141602
URL: http://llvm.org/viewvc/llvm-project?rev=141602&view=rev
Log:
Simplify check that optional def is there and is CPSR.
Modified:
llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp
Modified: llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp?rev=141602&r1=141601&r2=141602&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp Mon Oct 10 19:10:41 2011
@@ -140,11 +140,10 @@
// rsb r1, 0
// rsb r2, 0
//
- //
- for (unsigned I = 0, E = MI->getNumOperands(); I != E; ++I)
- if (MI->getOperand(I).isReg() && MI->getOperand(I).getReg() == ARM::CPSR &&
- MI->getOperand(I).isDef())
- return false;
+ const MCInstrDesc &MCID = MI->getDesc();
+ if (MCID.hasOptionalDef() &&
+ MI->getOperand(MCID.getNumOperands() - 1).getReg() == ARM::CPSR)
+ return false;
// Then peek at the next instruction to see if it's predicated on CC or OCC.
// If not, then there is nothing to be gained by moving the copy.
More information about the llvm-commits
mailing list