[llvm] r205992 - [ARM64,C++11]: Range'ify loops in InstrInfo.
Jim Grosbach
grosbach at apple.com
Thu Apr 10 15:00:19 PDT 2014
Author: grosbach
Date: Thu Apr 10 17:00:18 2014
New Revision: 205992
URL: http://llvm.org/viewvc/llvm-project?rev=205992&view=rev
Log:
[ARM64,C++11]: Range'ify loops in InstrInfo.
Modified:
llvm/trunk/lib/Target/ARM64/ARM64InstrInfo.cpp
Modified: llvm/trunk/lib/Target/ARM64/ARM64InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM64/ARM64InstrInfo.cpp?rev=205992&r1=205991&r2=205992&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM64/ARM64InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM64/ARM64InstrInfo.cpp Thu Apr 10 17:00:18 2014
@@ -798,11 +798,9 @@ bool ARM64InstrInfo::optimizeCompareInst
// If CPSR is not killed nor re-defined, we should check whether it is
// live-out. If it is live-out, do not optimize.
if (!IsSafe) {
- MachineBasicBlock *MBB = CmpInstr->getParent();
- for (MachineBasicBlock::succ_iterator SI = MBB->succ_begin(),
- SE = MBB->succ_end();
- SI != SE; ++SI)
- if ((*SI)->isLiveIn(ARM64::CPSR))
+ MachineBasicBlock *ParentBlock = CmpInstr->getParent();
+ for (auto *MBB : ParentBlock->successors())
+ if (MBB->isLiveIn(ARM64::CPSR))
return false;
}
@@ -976,11 +974,8 @@ bool ARM64InstrInfo::isScaledAddr(const
bool ARM64InstrInfo::isLdStPairSuppressed(const MachineInstr *MI) const {
assert(MOSuppressPair < (1 << MachineMemOperand::MOTargetNumBits) &&
"Too many target MO flags");
- for (MachineInstr::mmo_iterator MM = MI->memoperands_begin(),
- E = MI->memoperands_end();
- MM != E; ++MM) {
-
- if ((*MM)->getFlags() &
+ for (auto *MM : MI->memoperands()) {
+ if (MM->getFlags() &
(MOSuppressPair << MachineMemOperand::MOTargetStartBit)) {
return true;
}
More information about the llvm-commits
mailing list