aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
index 23703ac54d0e..999b0b06baa6 100644
--- a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
+++ b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
@@ -108,6 +108,7 @@
#include "llvm/Transforms/Utils/LoopUtils.h"
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
#include <cassert>
+#include <cmath>
#include <iterator>
#include <utility>
@@ -714,7 +715,7 @@ PPCLoopInstrFormPrep::rewriteForBase(Loop *L, const SCEVAddRecExpr *BasePtrSCEV,
// Note that LoopPredecessor might occur in the predecessor list multiple
// times, and we need to add it the right number of times.
- for (auto PI : predecessors(Header)) {
+ for (auto *PI : predecessors(Header)) {
if (PI != LoopPredecessor)
continue;
@@ -729,7 +730,7 @@ PPCLoopInstrFormPrep::rewriteForBase(Loop *L, const SCEVAddRecExpr *BasePtrSCEV,
I8Ty, NewPHI, IncNode, getInstrName(BaseMemI, GEPNodeIncNameSuffix),
InsPoint);
cast<GetElementPtrInst>(PtrInc)->setIsInBounds(IsPtrInBounds(BasePtr));
- for (auto PI : predecessors(Header)) {
+ for (auto *PI : predecessors(Header)) {
if (PI == LoopPredecessor)
continue;
@@ -744,7 +745,7 @@ PPCLoopInstrFormPrep::rewriteForBase(Loop *L, const SCEVAddRecExpr *BasePtrSCEV,
} else {
// Note that LoopPredecessor might occur in the predecessor list multiple
// times, and we need to make sure no more incoming value for them in PHI.
- for (auto PI : predecessors(Header)) {
+ for (auto *PI : predecessors(Header)) {
if (PI == LoopPredecessor)
continue;
@@ -1049,16 +1050,15 @@ bool PPCLoopInstrFormPrep::rewriteLoadStores(
SmallPtrSet<Value *, 16> NewPtrs;
NewPtrs.insert(Base.first);
- for (auto I = std::next(BucketChain.Elements.begin()),
- IE = BucketChain.Elements.end(); I != IE; ++I) {
- Value *Ptr = getPointerOperandAndType(I->Instr);
+ for (const BucketElement &BE : llvm::drop_begin(BucketChain.Elements)) {
+ Value *Ptr = getPointerOperandAndType(BE.Instr);
assert(Ptr && "No pointer operand");
if (NewPtrs.count(Ptr))
continue;
Instruction *NewPtr = rewriteForBucketElement(
- Base, *I,
- I->Offset ? cast<SCEVConstant>(I->Offset)->getValue() : nullptr,
+ Base, BE,
+ BE.Offset ? cast<SCEVConstant>(BE.Offset)->getValue() : nullptr,
DeletedPtrs);
assert(NewPtr && "wrong rewrite!\n");
NewPtrs.insert(NewPtr);