mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Simplify code by using SmallVector's pop_back_val() instead of
separate back() and pop_back() calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71089 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0ec4146db7
commit
e9d87f4906
@ -92,8 +92,7 @@ Loop *llvm::CloneLoop(Loop *OrigL, LPPassManager *LPM, LoopInfo *LI,
|
|||||||
|
|
||||||
Loop *NewParentLoop = NULL;
|
Loop *NewParentLoop = NULL;
|
||||||
while (!LoopNest.empty()) {
|
while (!LoopNest.empty()) {
|
||||||
Loop *L = LoopNest.back();
|
Loop *L = LoopNest.pop_back_val();
|
||||||
LoopNest.pop_back();
|
|
||||||
Loop *NewLoop = new Loop();
|
Loop *NewLoop = new Loop();
|
||||||
|
|
||||||
if (!NewParentLoop)
|
if (!NewParentLoop)
|
||||||
|
@ -188,8 +188,7 @@ void llvm::RecursivelyDeleteTriviallyDeadInstructions(Value *V) {
|
|||||||
DeadInsts.push_back(I);
|
DeadInsts.push_back(I);
|
||||||
|
|
||||||
while (!DeadInsts.empty()) {
|
while (!DeadInsts.empty()) {
|
||||||
I = DeadInsts.back();
|
I = DeadInsts.pop_back_val();
|
||||||
DeadInsts.pop_back();
|
|
||||||
|
|
||||||
// Null out all of the instruction's operands to see if any operand becomes
|
// Null out all of the instruction's operands to see if any operand becomes
|
||||||
// dead as we go.
|
// dead as we go.
|
||||||
|
@ -616,8 +616,7 @@ ComputeLiveInBlocks(AllocaInst *AI, AllocaInfo &Info,
|
|||||||
// Now that we have a set of blocks where the phi is live-in, recursively add
|
// Now that we have a set of blocks where the phi is live-in, recursively add
|
||||||
// their predecessors until we find the full region the value is live.
|
// their predecessors until we find the full region the value is live.
|
||||||
while (!LiveInBlockWorklist.empty()) {
|
while (!LiveInBlockWorklist.empty()) {
|
||||||
BasicBlock *BB = LiveInBlockWorklist.back();
|
BasicBlock *BB = LiveInBlockWorklist.pop_back_val();
|
||||||
LiveInBlockWorklist.pop_back();
|
|
||||||
|
|
||||||
// The block really is live in here, insert it into the set. If already in
|
// The block really is live in here, insert it into the set. If already in
|
||||||
// the set, then it has already been processed.
|
// the set, then it has already been processed.
|
||||||
|
@ -742,8 +742,7 @@ static bool FoldValueComparisonIntoPredecessors(TerminatorInst *TI) {
|
|||||||
|
|
||||||
SmallVector<BasicBlock*, 16> Preds(pred_begin(BB), pred_end(BB));
|
SmallVector<BasicBlock*, 16> Preds(pred_begin(BB), pred_end(BB));
|
||||||
while (!Preds.empty()) {
|
while (!Preds.empty()) {
|
||||||
BasicBlock *Pred = Preds.back();
|
BasicBlock *Pred = Preds.pop_back_val();
|
||||||
Preds.pop_back();
|
|
||||||
|
|
||||||
// See if the predecessor is a comparison with the same value.
|
// See if the predecessor is a comparison with the same value.
|
||||||
TerminatorInst *PTI = Pred->getTerminator();
|
TerminatorInst *PTI = Pred->getTerminator();
|
||||||
@ -1805,10 +1804,9 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
|
|||||||
// If we found some, do the transformation!
|
// If we found some, do the transformation!
|
||||||
if (!UncondBranchPreds.empty()) {
|
if (!UncondBranchPreds.empty()) {
|
||||||
while (!UncondBranchPreds.empty()) {
|
while (!UncondBranchPreds.empty()) {
|
||||||
BasicBlock *Pred = UncondBranchPreds.back();
|
BasicBlock *Pred = UncondBranchPreds.pop_back_val();
|
||||||
DOUT << "FOLDING: " << *BB
|
DOUT << "FOLDING: " << *BB
|
||||||
<< "INTO UNCOND BRANCH PRED: " << *Pred;
|
<< "INTO UNCOND BRANCH PRED: " << *Pred;
|
||||||
UncondBranchPreds.pop_back();
|
|
||||||
Instruction *UncondBranch = Pred->getTerminator();
|
Instruction *UncondBranch = Pred->getTerminator();
|
||||||
// Clone the return and add it to the end of the predecessor.
|
// Clone the return and add it to the end of the predecessor.
|
||||||
Instruction *NewRet = RI->clone();
|
Instruction *NewRet = RI->clone();
|
||||||
@ -1847,8 +1845,7 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
|
|||||||
// instruction. If any of them just select between returns, change the
|
// instruction. If any of them just select between returns, change the
|
||||||
// branch itself into a select/return pair.
|
// branch itself into a select/return pair.
|
||||||
while (!CondBranchPreds.empty()) {
|
while (!CondBranchPreds.empty()) {
|
||||||
BranchInst *BI = CondBranchPreds.back();
|
BranchInst *BI = CondBranchPreds.pop_back_val();
|
||||||
CondBranchPreds.pop_back();
|
|
||||||
|
|
||||||
// Check to see if the non-BB successor is also a return block.
|
// Check to see if the non-BB successor is also a return block.
|
||||||
if (isa<ReturnInst>(BI->getSuccessor(0)->getTerminator()) &&
|
if (isa<ReturnInst>(BI->getSuccessor(0)->getTerminator()) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user