mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
[Transforms/Utils] Construct SmallVector with iterator ranges (NFC)
This commit is contained in:
parent
6fefce8f75
commit
db085a4bfd
@ -2050,7 +2050,7 @@ unsigned llvm::changeToUnreachable(Instruction *I, bool UseLLVMTrap,
|
||||
}
|
||||
|
||||
CallInst *llvm::createCallMatchingInvoke(InvokeInst *II) {
|
||||
SmallVector<Value *, 8> Args(II->arg_begin(), II->arg_end());
|
||||
SmallVector<Value *, 8> Args(II->args());
|
||||
SmallVector<OperandBundleDef, 1> OpBundles;
|
||||
II->getOperandBundlesAsDefs(OpBundles);
|
||||
CallInst *NewCall = CallInst::Create(II->getFunctionType(),
|
||||
@ -2107,7 +2107,7 @@ BasicBlock *llvm::changeToInvokeAndSplitBasicBlock(CallInst *CI,
|
||||
BB->getInstList().pop_back();
|
||||
|
||||
// Create the new invoke instruction.
|
||||
SmallVector<Value *, 8> InvokeArgs(CI->arg_begin(), CI->arg_end());
|
||||
SmallVector<Value *, 8> InvokeArgs(CI->args());
|
||||
SmallVector<OperandBundleDef, 1> OpBundles;
|
||||
|
||||
CI->getOperandBundlesAsDefs(OpBundles);
|
||||
|
@ -48,7 +48,7 @@ static bool runImpl(Function &F) {
|
||||
bool Changed = false;
|
||||
for (BasicBlock &BB : F)
|
||||
if (InvokeInst *II = dyn_cast<InvokeInst>(BB.getTerminator())) {
|
||||
SmallVector<Value *, 16> CallArgs(II->arg_begin(), II->arg_end());
|
||||
SmallVector<Value *, 16> CallArgs(II->args());
|
||||
SmallVector<OperandBundleDef, 1> OpBundles;
|
||||
II->getOperandBundlesAsDefs(OpBundles);
|
||||
// Insert a normal call instruction...
|
||||
|
@ -740,7 +740,7 @@ void PromoteMem2Reg::run() {
|
||||
continue;
|
||||
|
||||
// Get the preds for BB.
|
||||
SmallVector<BasicBlock *, 16> Preds(pred_begin(BB), pred_end(BB));
|
||||
SmallVector<BasicBlock *, 16> Preds(predecessors(BB));
|
||||
|
||||
// Ok, now we know that all of the PHI nodes are missing entries for some
|
||||
// basic blocks. Start by sorting the incoming predecessors for efficient
|
||||
|
@ -309,7 +309,7 @@ static bool FactorOutConstant(const SCEV *&S, const SCEV *&Remainder,
|
||||
if (const SCEVConstant *FC = dyn_cast<SCEVConstant>(Factor))
|
||||
if (const SCEVConstant *C = dyn_cast<SCEVConstant>(M->getOperand(0)))
|
||||
if (!C->getAPInt().srem(FC->getAPInt())) {
|
||||
SmallVector<const SCEV *, 4> NewMulOps(M->op_begin(), M->op_end());
|
||||
SmallVector<const SCEV *, 4> NewMulOps(M->operands());
|
||||
NewMulOps[0] = SE.getConstant(C->getAPInt().sdiv(FC->getAPInt()));
|
||||
S = SE.getMulExpr(NewMulOps);
|
||||
return true;
|
||||
@ -911,7 +911,7 @@ static void ExposePointerBase(const SCEV *&Base, const SCEV *&Rest,
|
||||
}
|
||||
if (const SCEVAddExpr *A = dyn_cast<SCEVAddExpr>(Base)) {
|
||||
Base = A->getOperand(A->getNumOperands()-1);
|
||||
SmallVector<const SCEV *, 8> NewAddOps(A->op_begin(), A->op_end());
|
||||
SmallVector<const SCEV *, 8> NewAddOps(A->operands());
|
||||
NewAddOps.back() = Rest;
|
||||
Rest = SE.getAddExpr(NewAddOps);
|
||||
ExposePointerBase(Base, Rest, SE);
|
||||
@ -1556,7 +1556,7 @@ Value *SCEVExpander::visitAddRecExpr(const SCEVAddRecExpr *S) {
|
||||
|
||||
// {X,+,F} --> X + {0,+,F}
|
||||
if (!S->getStart()->isZero()) {
|
||||
SmallVector<const SCEV *, 4> NewOps(S->op_begin(), S->op_end());
|
||||
SmallVector<const SCEV *, 4> NewOps(S->operands());
|
||||
NewOps[0] = SE.getConstant(Ty, 0);
|
||||
const SCEV *Rest = SE.getAddRecExpr(NewOps, L,
|
||||
S->getNoWrapFlags(SCEV::FlagNW));
|
||||
|
@ -1076,7 +1076,7 @@ bool SimplifyCFGOpt::FoldValueComparisonIntoPredecessors(Instruction *TI,
|
||||
++NumFoldValueComparisonIntoPredecessors;
|
||||
});
|
||||
|
||||
SmallVector<BasicBlock *, 16> Preds(pred_begin(BB), pred_end(BB));
|
||||
SmallVector<BasicBlock *, 16> Preds(predecessors(BB));
|
||||
while (!Preds.empty()) {
|
||||
BasicBlock *Pred = Preds.pop_back_val();
|
||||
|
||||
@ -4597,7 +4597,7 @@ bool SimplifyCFGOpt::simplifyUnreachable(UnreachableInst *UI) {
|
||||
|
||||
std::vector<DominatorTree::UpdateType> Updates;
|
||||
|
||||
SmallVector<BasicBlock *, 8> Preds(pred_begin(BB), pred_end(BB));
|
||||
SmallVector<BasicBlock *, 8> Preds(predecessors(BB));
|
||||
for (unsigned i = 0, e = Preds.size(); i != e; ++i) {
|
||||
auto *Predecessor = Preds[i];
|
||||
Instruction *TI = Predecessor->getTerminator();
|
||||
|
Loading…
Reference in New Issue
Block a user