diff options
author | Kazu Hirata <kazu@google.com> | 2021-11-07 17:03:15 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2021-11-07 17:03:15 -0800 |
commit | 0d182d9d1e09dea0f78bcc3afa91946c6f97c23e (patch) | |
tree | d2972bf01a7a82172c64e8e40220a8a757965146 /llvm/lib/Transforms/Utils/LoopRotationUtils.cpp | |
parent | 55e4cd8485dc6308211f85c60559a373ae96873e (diff) | |
download | llvm-0d182d9d1e09dea0f78bcc3afa91946c6f97c23e.zip llvm-0d182d9d1e09dea0f78bcc3afa91946c6f97c23e.tar.gz llvm-0d182d9d1e09dea0f78bcc3afa91946c6f97c23e.tar.bz2 |
[Transforms] Use make_early_inc_range (NFC)
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopRotationUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopRotationUtils.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp index a2c7fa8..c66fd7b 100644 --- a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp @@ -134,15 +134,7 @@ static void RewriteUsesOfClonedInstructions(BasicBlock *OrigHeader, SSA.AddAvailableValue(OrigPreheader, OrigPreHeaderVal); // Visit each use of the OrigHeader instruction. - for (Value::use_iterator UI = OrigHeaderVal->use_begin(), - UE = OrigHeaderVal->use_end(); - UI != UE;) { - // Grab the use before incrementing the iterator. - Use &U = *UI; - - // Increment the iterator before removing the use from the list. - ++UI; - + for (Use &U : llvm::make_early_inc_range(OrigHeaderVal->uses())) { // SSAUpdater can't handle a non-PHI use in the same block as an // earlier def. We can easily handle those cases manually. Instruction *UserInst = cast<Instruction>(U.getUser()); |