diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2022-03-20 11:40:34 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2022-05-14 11:43:05 +0000 |
commit | 349cc55c9796c4596a5b9904cd3281af295f878f (patch) | |
tree | 410c5a785075730a35f1272ca6a7adf72222ad03 /contrib/llvm-project/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp | |
parent | cb2ae6163174b90e999326ecec3699ee093a5d43 (diff) | |
parent | c0981da47d5696fe36474fcf86b4ce03ae3ff818 (diff) | |
download | src-349cc55c9796c4596a5b9904cd3281af295f878f.tar.gz src-349cc55c9796c4596a5b9904cd3281af295f878f.zip |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/contrib/llvm-project/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp b/contrib/llvm-project/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp index 19b703bbb226..ac94570e568f 100644 --- a/contrib/llvm-project/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp +++ b/contrib/llvm-project/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp @@ -571,10 +571,9 @@ bool SystemZElimCompare::optimizeCompareZero( // Also do a forward search to handle cases where an instruction after the // compare can be converted, like // LTEBRCompare %f0s, %f0s; %f2s = LER %f0s => LTEBRCompare %f2s, %f0s - for (MachineBasicBlock::iterator MBBI = - std::next(MachineBasicBlock::iterator(&Compare)), MBBE = MBB.end(); - MBBI != MBBE;) { - MachineInstr &MI = *MBBI++; + auto MIRange = llvm::make_range( + std::next(MachineBasicBlock::iterator(&Compare)), MBB.end()); + for (MachineInstr &MI : llvm::make_early_inc_range(MIRange)) { if (preservesValueOf(MI, SrcReg)) { // Try to eliminate Compare by reusing a CC result from MI. if (convertToLoadAndTest(MI, Compare, CCUsers)) { |