diff options
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MachinePipeliner.cpp | 16 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 6 |
3 files changed, 14 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp index 01823527f1f..f32ae787d3f 100644 --- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -846,13 +846,13 @@ bool IRTranslator::translateKnownIntrinsic(const CallInst &CI, Intrinsic::ID ID, // Get the underlying objects for the location passed on the lifetime // marker. - SmallVector<Value *, 4> Allocas; + SmallVector<const Value *, 4> Allocas; GetUnderlyingObjects(CI.getArgOperand(1), Allocas, *DL); // Iterate over each underlying object, creating lifetime markers for each // static alloca. Quit if we find a non-static alloca. - for (Value *V : Allocas) { - AllocaInst *AI = dyn_cast<AllocaInst>(V); + for (const Value *V : Allocas) { + const AllocaInst *AI = dyn_cast<AllocaInst>(V); if (!AI) continue; diff --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp index 62760d222a8..9c1a5a73375 100644 --- a/llvm/lib/CodeGen/MachinePipeliner.cpp +++ b/llvm/lib/CodeGen/MachinePipeliner.cpp @@ -541,16 +541,16 @@ static bool isDependenceBarrier(MachineInstr &MI, AliasAnalysis *AA) { /// Return the underlying objects for the memory references of an instruction. /// This function calls the code in ValueTracking, but first checks that the /// instruction has a memory operand. -static void getUnderlyingObjects(MachineInstr *MI, - SmallVectorImpl<Value *> &Objs, +static void getUnderlyingObjects(const MachineInstr *MI, + SmallVectorImpl<const Value *> &Objs, const DataLayout &DL) { if (!MI->hasOneMemOperand()) return; MachineMemOperand *MM = *MI->memoperands_begin(); if (!MM->getValue()) return; - GetUnderlyingObjects(const_cast<Value *>(MM->getValue()), Objs, DL); - for (Value *V : Objs) { + GetUnderlyingObjects(MM->getValue(), Objs, DL); + for (const Value *V : Objs) { if (!isIdentifiedObject(V)) { Objs.clear(); return; @@ -564,7 +564,7 @@ static void getUnderlyingObjects(MachineInstr *MI, /// dependence. This code is very similar to the code in ScheduleDAGInstrs /// but that code doesn't create loop carried dependences. void SwingSchedulerDAG::addLoopCarriedDependences(AliasAnalysis *AA) { - MapVector<Value *, SmallVector<SUnit *, 4>> PendingLoads; + MapVector<const Value *, SmallVector<SUnit *, 4>> PendingLoads; Value *UnknownValue = UndefValue::get(Type::getVoidTy(MF.getFunction().getContext())); for (auto &SU : SUnits) { @@ -572,7 +572,7 @@ void SwingSchedulerDAG::addLoopCarriedDependences(AliasAnalysis *AA) { if (isDependenceBarrier(MI, AA)) PendingLoads.clear(); else if (MI.mayLoad()) { - SmallVector<Value *, 4> Objs; + SmallVector<const Value *, 4> Objs; getUnderlyingObjects(&MI, Objs, MF.getDataLayout()); if (Objs.empty()) Objs.push_back(UnknownValue); @@ -581,12 +581,12 @@ void SwingSchedulerDAG::addLoopCarriedDependences(AliasAnalysis *AA) { SUs.push_back(&SU); } } else if (MI.mayStore()) { - SmallVector<Value *, 4> Objs; + SmallVector<const Value *, 4> Objs; getUnderlyingObjects(&MI, Objs, MF.getDataLayout()); if (Objs.empty()) Objs.push_back(UnknownValue); for (auto V : Objs) { - MapVector<Value *, SmallVector<SUnit *, 4>>::iterator I = + MapVector<const Value *, SmallVector<SUnit *, 4>>::iterator I = PendingLoads.find(V); if (I == PendingLoads.end()) continue; diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 818f1ada04b..46dd0bf1316 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -6463,12 +6463,12 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) { const int64_t ObjectSize = cast<ConstantInt>(I.getArgOperand(0))->getSExtValue(); Value *const ObjectPtr = I.getArgOperand(1); - SmallVector<Value *, 4> Allocas; + SmallVector<const Value *, 4> Allocas; GetUnderlyingObjects(ObjectPtr, Allocas, *DL); - for (SmallVectorImpl<Value*>::iterator Object = Allocas.begin(), + for (SmallVectorImpl<const Value*>::iterator Object = Allocas.begin(), E = Allocas.end(); Object != E; ++Object) { - AllocaInst *LifetimeObject = dyn_cast_or_null<AllocaInst>(*Object); + const AllocaInst *LifetimeObject = dyn_cast_or_null<AllocaInst>(*Object); // Could not find an Alloca. if (!LifetimeObject) |