mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
[Scalar] Construct SmallVector with iterator ranges (NFC)
This commit is contained in:
parent
1dfecad1b5
commit
e162a6c78e
@ -2800,7 +2800,7 @@ void GVN::addDeadBlock(BasicBlock *BB) {
|
||||
|
||||
// First, split the critical edges. This might also create additional blocks
|
||||
// to preserve LoopSimplify form and adjust edges accordingly.
|
||||
SmallVector<BasicBlock *, 4> Preds(pred_begin(B), pred_end(B));
|
||||
SmallVector<BasicBlock *, 4> Preds(predecessors(B));
|
||||
for (BasicBlock *P : Preds) {
|
||||
if (!DeadBlocks.count(P))
|
||||
continue;
|
||||
|
@ -597,7 +597,7 @@ Value *InferAddressSpaces::cloneInstructionWithNewAddressSpace(
|
||||
GetElementPtrInst *GEP = cast<GetElementPtrInst>(I);
|
||||
GetElementPtrInst *NewGEP = GetElementPtrInst::Create(
|
||||
GEP->getSourceElementType(), NewPointerOperands[0],
|
||||
SmallVector<Value *, 4>(GEP->idx_begin(), GEP->idx_end()));
|
||||
SmallVector<Value *, 4>(GEP->indices()));
|
||||
NewGEP->setIsInBounds(GEP->isInBounds());
|
||||
return NewGEP;
|
||||
}
|
||||
|
@ -755,13 +755,13 @@ static int64_t ExtractImmediate(const SCEV *&S, ScalarEvolution &SE) {
|
||||
return C->getValue()->getSExtValue();
|
||||
}
|
||||
} else if (const SCEVAddExpr *Add = dyn_cast<SCEVAddExpr>(S)) {
|
||||
SmallVector<const SCEV *, 8> NewOps(Add->op_begin(), Add->op_end());
|
||||
SmallVector<const SCEV *, 8> NewOps(Add->operands());
|
||||
int64_t Result = ExtractImmediate(NewOps.front(), SE);
|
||||
if (Result != 0)
|
||||
S = SE.getAddExpr(NewOps);
|
||||
return Result;
|
||||
} else if (const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(S)) {
|
||||
SmallVector<const SCEV *, 8> NewOps(AR->op_begin(), AR->op_end());
|
||||
SmallVector<const SCEV *, 8> NewOps(AR->operands());
|
||||
int64_t Result = ExtractImmediate(NewOps.front(), SE);
|
||||
if (Result != 0)
|
||||
S = SE.getAddRecExpr(NewOps, AR->getLoop(),
|
||||
@ -781,13 +781,13 @@ static GlobalValue *ExtractSymbol(const SCEV *&S, ScalarEvolution &SE) {
|
||||
return GV;
|
||||
}
|
||||
} else if (const SCEVAddExpr *Add = dyn_cast<SCEVAddExpr>(S)) {
|
||||
SmallVector<const SCEV *, 8> NewOps(Add->op_begin(), Add->op_end());
|
||||
SmallVector<const SCEV *, 8> NewOps(Add->operands());
|
||||
GlobalValue *Result = ExtractSymbol(NewOps.back(), SE);
|
||||
if (Result)
|
||||
S = SE.getAddExpr(NewOps);
|
||||
return Result;
|
||||
} else if (const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(S)) {
|
||||
SmallVector<const SCEV *, 8> NewOps(AR->op_begin(), AR->op_end());
|
||||
SmallVector<const SCEV *, 8> NewOps(AR->operands());
|
||||
GlobalValue *Result = ExtractSymbol(NewOps.front(), SE);
|
||||
if (Result)
|
||||
S = SE.getAddRecExpr(NewOps, AR->getLoop(),
|
||||
|
@ -1993,7 +1993,7 @@ Value *ReassociatePass::OptimizeExpression(BinaryOperator *I,
|
||||
void ReassociatePass::RecursivelyEraseDeadInsts(Instruction *I,
|
||||
OrderedSet &Insts) {
|
||||
assert(isInstructionTriviallyDead(I) && "Trivially dead instructions only!");
|
||||
SmallVector<Value *, 4> Ops(I->op_begin(), I->op_end());
|
||||
SmallVector<Value *, 4> Ops(I->operands());
|
||||
ValueRankMap.erase(I);
|
||||
Insts.remove(I);
|
||||
RedoInsts.remove(I);
|
||||
@ -2010,7 +2010,7 @@ void ReassociatePass::EraseInst(Instruction *I) {
|
||||
assert(isInstructionTriviallyDead(I) && "Trivially dead instructions only!");
|
||||
LLVM_DEBUG(dbgs() << "Erasing dead inst: "; I->dump());
|
||||
|
||||
SmallVector<Value*, 8> Ops(I->op_begin(), I->op_end());
|
||||
SmallVector<Value *, 8> Ops(I->operands());
|
||||
// Erase the dead instruction.
|
||||
ValueRankMap.erase(I);
|
||||
RedoInsts.remove(I);
|
||||
|
@ -3477,7 +3477,7 @@ private:
|
||||
<< "\n " << GEPI);
|
||||
|
||||
IRBuilderTy Builder(&GEPI);
|
||||
SmallVector<Value *, 4> Index(GEPI.idx_begin(), GEPI.idx_end());
|
||||
SmallVector<Value *, 4> Index(GEPI.indices());
|
||||
bool IsInBounds = GEPI.isInBounds();
|
||||
|
||||
Value *True = Sel->getTrueValue();
|
||||
@ -3531,7 +3531,7 @@ private:
|
||||
<< "\n " << GEPI
|
||||
<< "\n to: ");
|
||||
|
||||
SmallVector<Value *, 4> Index(GEPI.idx_begin(), GEPI.idx_end());
|
||||
SmallVector<Value *, 4> Index(GEPI.indices());
|
||||
bool IsInBounds = GEPI.isInBounds();
|
||||
IRBuilderTy PHIBuilder(GEPI.getParent()->getFirstNonPHI());
|
||||
PHINode *NewPN = PHIBuilder.CreatePHI(GEPI.getType(),
|
||||
|
Loading…
Reference in New Issue
Block a user