diff options
author | Devang Patel <dpatel@apple.com> | 2010-10-07 23:29:37 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-10-07 23:29:37 +0000 |
commit | 57da4caa8562b9fcd0986d02c8ce22f13642e308 (patch) | |
tree | 9282a943437875b561d6474bff6f18d4bcf428ee | |
parent | f41f11c37e13586d363387269c8a8d08e00b417b (diff) | |
download | bcm5719-llvm-57da4caa8562b9fcd0986d02c8ce22f13642e308.tar.gz bcm5719-llvm-57da4caa8562b9fcd0986d02c8ce22f13642e308.zip |
Remove LoopIndexSplit pass. It is neither maintained nor used by anyone.
llvm-svn: 116004
43 files changed, 0 insertions, 3661 deletions
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h index 583536aa35c..673f126660c 100644 --- a/llvm/include/llvm/InitializePasses.h +++ b/llvm/include/llvm/InitializePasses.h @@ -124,7 +124,6 @@ void initializeLoaderPassPass(PassRegistry&); void initializeLoopDeletionPass(PassRegistry&); void initializeLoopDependenceAnalysisPass(PassRegistry&); void initializeLoopExtractorPass(PassRegistry&); -void initializeLoopIndexSplitPass(PassRegistry&); void initializeLoopInfoPass(PassRegistry&); void initializeLoopRotatePass(PassRegistry&); void initializeLoopSimplifyPass(PassRegistry&); diff --git a/llvm/include/llvm/LinkAllPasses.h b/llvm/include/llvm/LinkAllPasses.h index e0bde99097c..7af4465b401 100644 --- a/llvm/include/llvm/LinkAllPasses.h +++ b/llvm/include/llvm/LinkAllPasses.h @@ -90,7 +90,6 @@ namespace { (void) llvm::createLoopUnrollPass(); (void) llvm::createLoopUnswitchPass(); (void) llvm::createLoopRotatePass(); - (void) llvm::createLoopIndexSplitPass(); (void) llvm::createLowerInvokePass(); (void) llvm::createLowerSetJmpPass(); (void) llvm::createLowerSwitchPass(); diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h index 0c35d7e01fa..fa848459a76 100644 --- a/llvm/include/llvm/Transforms/Scalar.h +++ b/llvm/include/llvm/Transforms/Scalar.h @@ -131,13 +131,6 @@ Pass *createLoopRotatePass(); //===----------------------------------------------------------------------===// // -// LoopIndexSplit - This pass divides loop's iteration range by spliting loop -// such that each individual loop is executed efficiently. -// -Pass *createLoopIndexSplitPass(); - -//===----------------------------------------------------------------------===// -// // PromoteMemoryToRegister - This pass is used to promote memory references to // be register references. A simple example of the transformation performed by // this pass is: diff --git a/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp b/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp deleted file mode 100644 index f091a94bdda..00000000000 --- a/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp +++ /dev/null @@ -1,1270 +0,0 @@ -//===- LoopIndexSplit.cpp - Loop Index Splitting Pass ---------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements Loop Index Splitting Pass. This pass handles three -// kinds of loops. -// -// [1] A loop may be eliminated if the body is executed exactly once. -// For example, -// -// for (i = 0; i < N; ++i) { -// if (i == X) { -// body; -// } -// } -// -// is transformed to -// -// i = X; -// body; -// -// [2] A loop's iteration space may be shrunk if the loop body is executed -// for a proper sub-range of the loop's iteration space. For example, -// -// for (i = 0; i < N; ++i) { -// if (i > A && i < B) { -// ... -// } -// } -// -// is transformed to iterators from A to B, if A > 0 and B < N. -// -// [3] A loop may be split if the loop body is dominated by a branch. -// For example, -// -// for (i = LB; i < UB; ++i) { if (i < SV) A; else B; } -// -// is transformed into -// -// AEV = BSV = SV -// for (i = LB; i < min(UB, AEV); ++i) -// A; -// for (i = max(LB, BSV); i < UB; ++i); -// B; -// -//===----------------------------------------------------------------------===// - -#define DEBUG_TYPE "loop-index-split" -#include "llvm/Transforms/Scalar.h" -#include "llvm/IntrinsicInst.h" -#include "llvm/LLVMContext.h" -#include "llvm/Analysis/LoopPass.h" -#include "llvm/Analysis/ScalarEvolution.h" -#include "llvm/Analysis/Dominators.h" -#include "llvm/Transforms/Utils/BasicBlockUtils.h" -#include "llvm/Transforms/Utils/Cloning.h" -#include "llvm/Transforms/Utils/Local.h" -#include "llvm/ADT/DepthFirstIterator.h" -#include "llvm/ADT/Statistic.h" - -using namespace llvm; - -STATISTIC(NumIndexSplit, "Number of loop index split"); -STATISTIC(NumIndexSplitRemoved, "Number of loops eliminated by loop index split"); -STATISTIC(NumRestrictBounds, "Number of loop iteration space restricted"); - -namespace { - - class LoopIndexSplit : public LoopPass { - public: - static char ID; // Pass ID, replacement for typeid - LoopIndexSplit() : LoopPass(ID) {} - - // Index split Loop L. Return true if loop is split. - bool runOnLoop(Loop *L, LPPassManager &LPM); - - void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addPreserved<ScalarEvolution>(); - AU.addRequiredID(LCSSAID); - AU.addPreservedID(LCSSAID); - AU.addRequired<LoopInfo>(); - AU.addPreserved<LoopInfo>(); - AU.addRequiredID(LoopSimplifyID); - AU.addPreservedID(LoopSimplifyID); - AU.addRequired<DominatorTree>(); - AU.addRequired<DominanceFrontier>(); - AU.addPreserved<DominatorTree>(); - AU.addPreserved<DominanceFrontier>(); - } - - private: - /// processOneIterationLoop -- Eliminate loop if loop body is executed - /// only once. For example, - /// for (i = 0; i < N; ++i) { - /// if ( i == X) { - /// ... - /// } - /// } - /// - bool processOneIterationLoop(); - - // -- Routines used by updateLoopIterationSpace(); - - /// updateLoopIterationSpace -- Update loop's iteration space if loop - /// body is executed for certain IV range only. For example, - /// - /// for (i = 0; i < N; ++i) { - /// if ( i > A && i < B) { - /// ... - /// } - /// } - /// is transformed to iterators from A to B, if A > 0 and B < N. - /// - bool updateLoopIterationSpace(); - - /// restrictLoopBound - Op dominates loop body. Op compares an IV based value - /// with a loop invariant value. Update loop's lower and upper bound based on - /// the loop invariant value. - bool restrictLoopBound(ICmpInst &Op); - - // --- Routines used by splitLoop(). --- / - - bool splitLoop(); - - /// removeBlocks - Remove basic block DeadBB and all blocks dominated by - /// DeadBB. This routine is used to remove split condition's dead branch, - /// dominated by DeadBB. LiveBB dominates split conidition's other branch. - void removeBlocks(BasicBlock *DeadBB, Loop *LP, BasicBlock *LiveBB); - - /// moveExitCondition - Move exit condition EC into split condition block. - void moveExitCondition(BasicBlock *CondBB, BasicBlock *ActiveBB, - BasicBlock *ExitBB, ICmpInst *EC, ICmpInst *SC, - PHINode *IV, Instruction *IVAdd, Loop *LP, - unsigned); - - /// updatePHINodes - CFG has been changed. - /// Before - /// - ExitBB's single predecessor was Latch - /// - Latch's second successor was Header - /// Now - /// - ExitBB's single predecessor was Header - /// - Latch's one and only successor was Header - /// - /// Update ExitBB PHINodes' to reflect this change. - void updatePHINodes(BasicBlock *ExitBB, BasicBlock *Latch, - BasicBlock *Header, - PHINode *IV, Instruction *IVIncrement, Loop *LP); - - // --- Utility routines --- / - - /// cleanBlock - A block is considered clean if all non terminal - /// instructions are either PHINodes or IV based values. - bool cleanBlock(BasicBlock *BB); - - /// IVisLT - If Op is comparing IV based value with an loop invariant and - /// IV based value is less than the loop invariant then return the loop - /// invariant. Otherwise return NULL. - Value * IVisLT(ICmpInst &Op); - - /// IVisLE - If Op is comparing IV based value with an loop invariant and - /// IV based value is less than or equal to the loop invariant then - /// return the loop invariant. Otherwise return NULL. - Value * IVisLE(ICmpInst &Op); - - /// IVisGT - If Op is comparing IV based value with an loop invariant and - /// IV based value is greater than the loop invariant then return the loop - /// invariant. Otherwise return NULL. - Value * IVisGT(ICmpInst &Op); - - /// IVisGE - If Op is comparing IV based value with an loop invariant and - /// IV based value is greater than or equal to the loop invariant then - /// return the loop invariant. Otherwise return NULL. - Value * IVisGE(ICmpInst &Op); - - private: - - // Current Loop information. - Loop *L; - LPPassManager *LPM; - LoopInfo *LI; - DominatorTree *DT; - DominanceFrontier *DF; - - PHINode *IndVar; - ICmpInst *ExitCondition; - ICmpInst *SplitCondition; - Value *IVStartValue; - Value *IVExitValue; - Instruction *IVIncrement; - SmallPtrSet<Value *, 4> IVBasedValues; - }; -} - -char LoopIndexSplit::ID = 0; -INITIALIZE_PASS(LoopIndexSplit, "loop-index-split", - "Index Split Loops", false, false) - -Pass *llvm::createLoopIndexSplitPass() { - return new LoopIndexSplit(); -} - -// Index split Loop L. Return true if loop is split. -bool LoopIndexSplit::runOnLoop(Loop *IncomingLoop, LPPassManager &LPM_Ref) { - L = IncomingLoop; - LPM = &LPM_Ref; - - // If LoopSimplify form is not available, stay out of trouble. - if (!L->isLoopSimplifyForm()) - return false; - - // FIXME - Nested loops make dominator info updates tricky. - if (!L->getSubLoops().empty()) - return false; - - DT = &getAnalysis<DominatorTree>(); - LI = &getAnalysis<LoopInfo>(); - DF = &getAnalysis<DominanceFrontier>(); - - // Initialize loop data. - IndVar = L->getCanonicalInductionVariable(); - if (!IndVar) return false; - - bool P1InLoop = L->contains(IndVar->getIncomingBlock(1)); - IVStartValue = IndVar->getIncomingValue(!P1InLoop); - IVIncrement = dyn_cast<Instruction>(IndVar->getIncomingValue(P1InLoop)); - if (!IVIncrement) return false; - - IVBasedValues.clear(); - IVBasedValues.insert(IndVar); - IVBasedValues.insert(IVIncrement); - for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); - I != E; ++I) - for(BasicBlock::iterator BI = (*I)->begin(), BE = (*I)->end(); - BI != BE; ++BI) { - if (BinaryOperator *BO = dyn_cast<BinaryOperator>(BI)) - if (BO != IVIncrement - && (BO->getOpcode() == Instruction::Add - || BO->getOpcode() == Instruction::Sub)) - if (IVBasedValues.count(BO->getOperand(0)) - && L->isLoopInvariant(BO->getOperand(1))) - IVBasedValues.insert(BO); - } - - // Reject loop if loop exit condition is not suitable. - BasicBlock *ExitingBlock = L->getExitingBlock(); - if (!ExitingBlock) - return false; - BranchInst *EBR = dyn_cast<BranchInst>(ExitingBlock->getTerminator()); - if (!EBR) return false; - ExitCondition = dyn_cast<ICmpInst>(EBR->getCondition()); - if (!ExitCondition) return false; - if (ExitingBlock != L->getLoopLatch()) return false; - IVExitValue = ExitCondition->getOperand(1); - if (!L->isLoopInvariant(IVExitValue)) - IVExitValue = ExitCondition->getOperand(0); - if (!L->isLoopInvariant(IVExitValue)) - return false; - if (!IVBasedValues.count( - ExitCondition->getOperand(IVExitValue == ExitCondition->getOperand(0)))) - return false; - - // If start value is more then exit value where induction variable - // increments by 1 then we are potentially dealing with an infinite loop. - // Do not index split this loop. - if (ConstantInt *SV = dyn_cast<ConstantInt>(IVStartValue)) - if (ConstantInt *EV = dyn_cast<ConstantInt>(IVExitValue)) - if (SV->getSExtValue() > EV->getSExtValue()) - return false; - - if (processOneIterationLoop()) - return true; - - if (updateLoopIterationSpace()) - return true; - - if (splitLoop()) - return true; - - return false; -} - -// --- Helper routines --- -// isUsedOutsideLoop - Returns true iff V is used outside the loop L. -static bool isUsedOutsideLoop(Value *V, Loop *L) { - for(Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ++UI) - if (!L->contains(cast<Instruction>(*UI))) - return true; - return false; -} - -// Return V+1 -static Value *getPlusOne(Value *V, bool Sign, Instruction *InsertPt, - LLVMContext &Context) { - Constant *One = ConstantInt::get(V->getType(), 1, Sign); - return BinaryOperator::CreateAdd(V, One, "lsp", InsertPt); -} - -// Return V-1 -static Value *getMinusOne(Value *V, bool Sign, Instruction *InsertPt, - LLVMContext &Context) { - Constant *One = ConstantInt::get(V->getType(), 1, Sign); - return BinaryOperator::CreateSub(V, One, "lsp", InsertPt); -} - -// Return min(V1, V1) -static Value *getMin(Value *V1, Value *V2, bool Sign, Instruction *InsertPt) { - - Value *C = new ICmpInst(InsertPt, - Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT, - V1, V2, "lsp"); - return SelectInst::Create(C, V1, V2, "lsp", InsertPt); -} - -// Return max(V1, V2) -static Value *getMax(Value *V1, Value *V2, bool Sign, Instruction *InsertPt) { - - Value *C = new ICmpInst(InsertPt, - Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT, - V1, V2, "lsp"); - return SelectInst::Create(C, V2, V1, "lsp", InsertPt); -} - -/// processOneIterationLoop -- Eliminate loop if loop body is executed -/// only once. For example, -/// for (i = 0; i < N; ++i) { -/// if ( i == X) { -/// ... -/// } -/// } -/// -bool LoopIndexSplit::processOneIterationLoop() { - SplitCondition = NULL; - BasicBlock *Latch = L->getLoopLatch(); - BasicBlock *Header = L->getHeader(); - BranchInst *BR = dyn_cast<BranchInst>(Header->getTerminator()); - if (!BR) return false; - if (!isa<BranchInst>(Latch->getTerminator())) return false; - if (BR->isUnconditional()) return false; - SplitCondition = dyn_cast<ICmpInst>(BR->getCondition()); - if (!SplitCondition) return false; - if (SplitCondition == ExitCondition) return false; - if (SplitCondition->getPredicate() != ICmpInst::ICMP_EQ) return false; - if (BR->getOperand(1) != Latch) return false; - if (!IVBasedValues.count(SplitCondition->getOperand(0)) - && !IVBasedValues.count(SplitCondition->getOperand(1))) - return false; - - // If IV is used outside the loop then this loop traversal is required. - // FIXME: Calculate and use last IV value. - if (isUsedOutsideLoop(IVIncrement, L)) - return false; - - // If BR operands are not IV or not loop invariants then skip this loop. - Value *OPV = SplitCondition->getOperand(0); - Value *SplitValue = SplitCondition->getOperand(1); - if (!L->isLoopInvariant(SplitValue)) - std::swap(OPV, SplitValue); - if (!L->isLoopInvariant(SplitValue)) - return false; - Instruction *OPI = dyn_cast<Instruction>(OPV); - if (!OPI) - return false; - if (OPI->getParent() != Header || isUsedOutsideLoop(OPI, L)) - return false; - Value *StartValue = IVStartValue; - Value *ExitValue = IVExitValue;; - - if (OPV != IndVar) { - // If BR operand is IV based then use this operand to calculate - // effective conditions for loop body. - BinaryOperator *BOPV = dyn_cast<BinaryOperator>(OPV); - if (!BOPV) - return false; - if (BOPV->getOpcode() != Instruction::Add) - return false; - StartValue = BinaryOperator::CreateAdd(OPV, StartValue, "" , BR); - ExitValue = BinaryOperator::CreateAdd(OPV, ExitValue, "" , BR); - } - - if (!cleanBlock(Header)) - return false; - - if (!cleanBlock(Latch)) - return false; - - // If the merge point for BR is not loop latch then skip this loop. - if (BR->getSuccessor(0) != Latch) { - DominanceFrontier::iterator DF0 = DF->find(BR->getSuccessor(0)); - assert (DF0 != DF->end() && "Unable to find dominance frontier"); - if (!DF0->second.count(Latch)) - return false; - } - - if (BR->getSuccessor(1) != Latch) { - DominanceFrontier::iterator DF1 = DF->find(BR->getSuccessor(1)); - assert (DF1 != DF->end() && "Unable to find dominance frontier"); - if (!DF1->second.count(Latch)) - return false; - } - - // Now, Current loop L contains compare instruction - // that compares induction variable, IndVar, against loop invariant. And - // entire (i.e. meaningful) loop body is dominated by this compare - // instruction. In such case eliminate - // loop structure surrounding this loop body. For example, - // for (int i = start; i < end; ++i) { - // if ( i == somevalue) { - // loop_body - // } - // } - // can be transformed into - // if (somevalue >= start && somevalue < end) { - // i = somevalue; - // loop_body - // } - - // Replace index variable with split value in loop body. Loop body is executed - // only when index variable is equal to split value. - IndVar->replaceAllUsesWith(SplitValue); - - // Replace split condition in header. - // Transform - // SplitCondition : icmp eq i32 IndVar, SplitValue - // into - // c1 = icmp uge i32 SplitValue, StartValue - // c2 = icmp ult i32 SplitValue, ExitValue - // and i32 c1, c2 - Instruction *C1 = new ICmpInst(BR, ExitCondition->isSigned() ? - ICmpInst::ICMP_SGE : ICmpInst::ICMP_UGE, - SplitValue, StartValue, "lisplit"); - - CmpInst::Predicate C2P = ExitCondition->getPredicate(); - BranchInst *LatchBR = cast<BranchInst>(Latch->getTerminator()); - if (LatchBR->getOperand(1) != Header) - C2P = CmpInst::getInversePredicate(C2P); - Instruction *C2 = new ICmpInst(BR, C2P, SplitValue, ExitValue, "lisplit"); - Instruction *NSplitCond = BinaryOperator::CreateAnd(C1, C2, "lisplit", BR); - - SplitCondition->replaceAllUsesWith(NSplitCond); - SplitCondition->eraseFromParent(); - - // Remove Latch to Header edge. - BasicBlock *LatchSucc = NULL; - Header->removePredecessor(Latch); - for (succ_iterator SI = succ_begin(Latch), E = succ_end(Latch); - SI != E; ++SI) { - if (Header != *SI) - LatchSucc = *SI; - } - - // Clean up latch block. - Value *LatchBRCond = LatchBR->getCondition(); - LatchBR->setUnconditionalDest(LatchSucc); - RecursivelyDeleteTriviallyDeadInstructions(LatchBRCond); - - LPM->deleteLoopFromQueue(L); - - // Update Dominator Info. - // Only CFG change done is to remove Latch to Header edge. This - // does not change dominator tree because Latch did not dominate - // Header. - if (DF) { - DominanceFrontier::iterator HeaderDF = DF->find(Header); - if (HeaderDF != DF->end()) - DF->removeFromFrontier(HeaderDF, Header); - - DominanceFrontier::iterator LatchDF = DF->find(Latch); - if (LatchDF != DF->end()) - DF->removeFromFrontier(LatchDF, Header); - } - - ++NumIndexSplitRemoved; - return true; -} - -/// restrictLoopBound - Op dominates loop body. Op compares an IV based value -/// with a loop invariant value. Update loop's lower and upper bound based on -/// the loop invariant value. -bool LoopIndexSplit::restrictLoopBound(ICmpInst &Op) { - bool Sign = Op.isSigned(); - Instruction *PHTerm = L->getLoopPreheader()->getTerminator(); - - if (IVisGT(*ExitCondition) || IVisGE(*ExitCondition)) { - BranchInst *EBR = - cast<BranchInst>(ExitCondition->getParent()->getTerminator()); - ExitCondition->setPredicate(ExitCondition->getInversePredicate()); - BasicBlock *T = EBR->getSuccessor(0); - EBR->setSuccessor(0, EBR->getSuccessor(1)); - EBR->setSuccessor(1, T); - } - - LLVMContext &Context = Op.getContext(); - - // New upper and lower bounds. - Value *NLB = NULL; - Value *NUB = NULL; - if (Value *V = IVisLT(Op)) { - // Restrict upper bound. - if (IVisLE(*ExitCondition)) - V = getMinusOne(V, Sign, PHTerm, Context); - NUB = getMin(V, IVExitValue, Sign, PHTerm); - } else if (Value *V = IVisLE(Op)) { - // Restrict upper bound. - if (IVisLT(*ExitCondition)) - V = getPlusOne(V, Sign, PHTerm, Context); - NUB = getMin(V, IVExitValue, Sign, PHTerm); - } else if (Value *V = IVisGT(Op)) { - // Restrict lower bound. - V = getPlusOne(V, Sign, PHTerm, Context); - NLB = getMax(V, IVStartValue, Sign, PHTerm); - } else if (Value *V = IVisGE(Op)) - // Restrict lower bound. - NLB = getMax(V, IVStartValue, Sign, PHTerm); - - if (!NLB && !NUB) - return false; - - if (NLB) { - unsigned i = IndVar->getBasicBlockIndex(L->getLoopPreheader()); - IndVar->setIncomingValue(i, NLB); - } - - if (NUB) { - unsigned i = (ExitCondition->getOperand(0) != IVExitValue); - ExitCondition->setOperand(i, NUB); - } - return true; -} - -/// updateLoopIterationSpace -- Update loop's iteration space if loop -/// body is executed for certain IV range only. For example, -/// -/// for (i = 0; i < N; ++i) { -/// if ( i > A && i < B) { -/// ... -/// } -/// } -/// is transformed to iterators from A to B, if A > 0 and B < N. -/// -bool LoopIndexSplit::updateLoopIterationSpace() { - SplitCondition = NULL; - if (ExitCondition->getPredicate() == ICmpInst::ICMP_NE - || ExitCondition->getPredicate() == ICmpInst::ICMP_EQ) - return false; - BasicBlock *Latch = L->getLoopLatch(); - BasicBlock *Header = L->getHeader(); - BranchInst *BR = dyn_cast<BranchInst>(Header->getTerminator()); - if (!BR) return false; - if (!isa<BranchInst>(Latch->getTerminator())) return false; - if (BR->isUnconditional()) return false; - BinaryOperator *AND = dyn_cast<BinaryOperator>(BR->getCondition()); - if (!AND) return false; - if (AND->getOpcode() != Instruction::And) return false; - ICmpInst *Op0 = dyn_cast<ICmpInst>(AND->getOperand(0)); - ICmpInst *Op1 = dyn_cast<ICmpInst>(AND->getOperand(1)); - if (!Op0 || !Op1) - return false; - IVBasedValues.insert(AND); - IVBasedValues.insert(Op0); - IVBasedValues.insert(Op1); - if (!cleanBlock(Header)) return false; - BasicBlock *ExitingBlock = ExitCondition->getParent(); - if (!cleanBlock(ExitingBlock)) return false; - - // If the merge point for BR is not loop latch then skip this loop. - if (BR->getSuccessor(0) != Latch) { - DominanceFrontier::iterator DF0 = DF->find(BR->getSuccessor(0)); - assert (DF0 != DF->end() && "Unable to find dominance frontier"); - if (!DF0->second.count(Latch)) - return false; - } - - if (BR->getSuccessor(1) != Latch) { - DominanceFrontier::iterator DF1 = DF->find(BR->getSuccessor(1)); - assert (DF1 != DF->end() && "Unable to find dominance frontier"); - if (!DF1->second.count(Latch)) - return false; - } - - // Verify that loop exiting block has only two predecessor, where one pred - // is split condition block. The other predecessor will become exiting block's - // dominator after CFG is updated. TODO : Handle CFG's where exiting block has - // more then two predecessors. This requires extra work in updating dominator - // information. - BasicBlock *ExitingBBPred = NULL; - for (pred_iterator PI = pred_begin(ExitingBlock), PE = pred_end(ExitingBlock); - PI != PE; ++PI) { - BasicBlock *BB = *PI; - if (Header == BB) - continue; - if (ExitingBBPred) - return false; - else - ExitingBBPred = BB; - } - - if (!restrictLoopBound(*Op0)) - return false; - - if (!restrictLoopBound(*Op1)) - return false; - - // Update CFG. - if (BR->getSuccessor(0) == ExitingBlock) - BR->setUnconditionalDest(BR->getSuccessor(1)); - else - BR->setUnconditionalDest(BR->getSuccessor(0)); - - AND->eraseFromParent(); - if (Op0->use_empty()) - Op0->eraseFromParent(); - if (Op1->use_empty()) - Op1->eraseFromParent(); - - // Update dominator info. Now, ExitingBlock has only one predecessor, - // ExitingBBPred, and it is ExitingBlock's immediate dominator. - DT->changeImmediateDominator(ExitingBlock, ExitingBBPred); - - BasicBlock *ExitBlock = ExitingBlock->getTerminator()->getSuccessor(1); - if (L->contains(ExitBlock)) - ExitBlock = ExitingBlock->getTerminator()->getSuccessor(0); - - // If ExitingBlock is a member of the loop basic blocks' DF list then - // replace ExitingBlock with header and exit block in the DF list - DominanceFrontier::iterator ExitingBlockDF = DF->find(ExitingBlock); - for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); - I != E; ++I) { - BasicBlock *BB = *I; - if (BB == Header || BB == ExitingBlock) - continue; - DominanceFrontier::iterator BBDF = DF->find(BB); - DominanceFrontier::DomSetType::iterator DomSetI = BBDF->second.begin(); - DominanceFrontier::DomSetType::iterator DomSetE = BBDF->second.end(); - while (DomSetI != DomSetE) { - DominanceFrontier::DomSetType::iterator CurrentItr = DomSetI; - ++DomSetI; - BasicBlock *DFBB = *CurrentItr; - if (DFBB == ExitingBlock) { - BBDF->second.erase(DFBB); - for (DominanceFrontier::DomSetType::iterator - EBI = ExitingBlockDF->second.begin(), - EBE = ExitingBlockDF->second.end(); EBI != EBE; ++EBI) - BBDF->second.insert(*EBI); - } - } - } - ++NumRestrictBounds; - return true; -} - -/// removeBlocks - Remove basic block DeadBB and all blocks dominated by DeadBB. -/// This routine is used to remove split condition's dead branch, dominated by -/// DeadBB. LiveBB dominates split conidition's other branch. -void LoopIndexSplit::removeBlocks(BasicBlock *DeadBB, Loop *LP, - BasicBlock *LiveBB) { - - // First update DeadBB's dominance frontier. - SmallVector<BasicBlock *, 8> FrontierBBs; - DominanceFrontier::iterator DeadBBDF = DF->find(DeadBB); - if (DeadBBDF != DF->end()) { - SmallVector<BasicBlock *, 8> PredBlocks; - - DominanceFrontier::DomSetType DeadBBSet = DeadBBDF->second; - for (DominanceFrontier::DomSetType::iterator DeadBBSetI = DeadBBSet.begin(), - DeadBBSetE = DeadBBSet.end(); DeadBBSetI != DeadBBSetE; ++DeadBBSetI) - { - BasicBlock *FrontierBB = *DeadBBSetI; - FrontierBBs.push_back(FrontierBB); - - // Rremove any PHI incoming edge from blocks dominated by DeadBB. - PredBlocks.clear(); - for(pred_iterator PI = pred_begin(FrontierBB), PE = pred_end(FrontierBB); - PI != PE; ++PI) { - BasicBlock *P = *PI; - if (DT->dominates(DeadBB, P)) - PredBlocks.push_back(P); - } - - for(BasicBlock::iterator FBI = FrontierBB->begin(), FBE = FrontierBB->end(); - FBI != FBE; ++FBI) { - if (PHINode *PN = dyn_cast<PHINode>(FBI)) { - for(SmallVector<BasicBlock *, 8>::iterator PI = PredBlocks.begin(), - PE = PredBlocks.end(); PI != PE; ++PI) { - BasicBlock *P = *PI; - PN->removeIncomingValue(P); - } - } - else - break; - } - } - } - - // Now remove DeadBB and all nodes dominated by DeadBB in df order. - SmallVector<BasicBlock *, 32> WorkList; - DomTreeNode *DN = DT->getNode(DeadBB); - for (df_iterator<DomTreeNode*> DI = df_begin(DN), - E = df_end(DN); DI != E; ++DI) { - BasicBlock *BB = DI->getBlock(); - WorkList.push_back(BB); - BB->replaceAllUsesWith(UndefValue::get( - Type::getLabelTy(DeadBB->getContext()))); - } - - while (!WorkList.empty()) { - BasicBlock *BB = WorkList.pop_back_val(); - LPM->deleteSimpleAnalysisValue(BB, LP); - for(BasicBlock::iterator BBI = BB->begin(), BBE = BB->end(); - BBI != BBE; ) { - Instruction *I = BBI; - ++BBI; - I->replaceAllUsesWith(UndefValue::get(I->getType())); - LPM->deleteSimpleAnalysisValue(I, LP); - I->eraseFromParent(); - } - DT->eraseNode(BB); - DF->removeBlock(BB); - LI->removeBlock(BB); - BB->eraseFromParent(); - } - - // Update Frontier BBs' dominator info. - while (!FrontierBBs.empty()) { - BasicBlock *FBB = FrontierBBs.pop_back_val(); - BasicBlock *NewDominator = FBB->getSinglePredecessor(); - if (!NewDominator) { - pred_iterator PI = pred_begin(FBB), PE = pred_end(FBB); - NewDominator = *PI; - ++PI; - if (NewDominator != LiveBB) { - for(; PI != PE; ++PI) { - BasicBlock *P = *PI; - if (P == LiveBB) { - NewDominator = LiveBB; - break; - } - NewDominator = DT->findNearestCommonDominator(NewDominator, P); - } - } - } - assert (NewDominator && "Unable to fix dominator info."); - DT->changeImmediateDominator(FBB, NewDominator); - DF->changeImmediateDominator(FBB, NewDominator, DT); - } - -} - -// moveExitCondition - Move exit condition EC into split condition block CondBB. -void LoopIndexSplit::moveExitCondition(BasicBlock *CondBB, BasicBlock *ActiveBB, - BasicBlock *ExitBB, ICmpInst *EC, - ICmpInst *SC, PHINode *IV, - Instruction *IVAdd, Loop *LP, - unsigned ExitValueNum) { - - BasicBlock *ExitingBB = EC->getParent(); - Instruction *CurrentBR = CondBB->getTerminator(); - - // Move exit condition into split condition block. - EC->moveBefore(CurrentBR); - EC->setOperand(ExitValueNum == 0 ? 1 : 0, IV); - - // Move exiting block's branch into split condition block. Update its branch - // destination. - BranchInst *ExitingBR = cast<BranchInst>(ExitingBB->getTerminator()); - ExitingBR->moveBefore(CurrentBR); - BasicBlock *OrigDestBB = NULL; - if (ExitingBR->getSuccessor(0) == ExitBB) { - OrigDestBB = ExitingBR->getSuccessor(1); - ExitingBR->setSuccessor(1, ActiveBB); - } - else { - OrigDestBB = ExitingBR->getSuccessor(0); - ExitingBR->setSuccessor(0, ActiveBB); - } - - // Remove split condition and current split condition branch. - SC->eraseFromParent(); - CurrentBR->eraseFromParent(); - - // Connect exiting block to original destination. - BranchInst::Create(OrigDestBB, ExitingBB); - - // Update PHINodes - updatePHINodes(ExitBB, ExitingBB, CondBB, IV, IVAdd, LP); - - // Fix dominator info. - // ExitBB is now dominated by CondBB - DT->changeImmediateDominator(ExitBB, CondBB); - DF->changeImmediateDominator(ExitBB, CondBB, DT); - - // Blocks outside the loop may have been in the dominance frontier of blocks - // inside the condition; this is now impossible because the blocks inside the - // condition no loger dominate the exit. Remove the relevant blocks from - // the dominance frontiers. - for (Loop::block_iterator I = LP->block_begin(), E = LP->block_end(); - I != E; ++I) { - if (!DT->properlyDominates(CondBB, *I)) continue; - DominanceFrontier::iterator BBDF = DF->find(*I); - DominanceFrontier::DomSetType::iterator DomSetI = BBDF->second.begin(); - DominanceFrontier::DomSetType::iterator DomSetE = BBDF->second.end(); - while (DomSetI != DomSetE) { - DominanceFrontier::DomSetType::iterator CurrentItr = DomSetI; - ++DomSetI; - BasicBlock *DFBB = *CurrentItr; - if (!LP->contains(DFBB)) - BBDF->second.erase(DFBB); - } - } -} - -/// updatePHINodes - CFG has been changed. -/// Before -/// - ExitBB's single predecessor was Latch -/// - Latch's second successor was Header -/// Now -/// - ExitBB's single predecessor is Header -/// - Latch's one and only successor is Header -/// -/// Update ExitBB PHINodes' to reflect this change. -void LoopIndexSplit::updatePHINodes(BasicBlock *ExitBB, BasicBlock *Latch, - BasicBlock *Header, - PHINode *IV, Instruction *IVIncrement, - Loop *LP) { - - for (BasicBlock::iterator BI = ExitBB->begin(), BE = ExitBB->end(); - BI != BE; ) { - PHINode *PN = dyn_cast<PHINode>(BI); - ++BI; - if (!PN) - break; - - Value *V = PN->getIncomingValueForBlock(Latch); - if (PHINode *PHV = dyn_cast<PHINode>(V)) { - // PHV is in Latch. PHV has one use is in ExitBB PHINode. And one use - // in Header which is new incoming value for PN. - Value *NewV = NULL; - for (Value::use_iterator UI = PHV->use_begin(), E = PHV->use_end(); - UI != E; ++UI) - if (PHINode *U = dyn_cast<PHINode>(*UI)) - if (LP->contains(U)) { - NewV = U; - break; - } - - // Add incoming value from header only if PN has any use inside the loop. - if (NewV) - PN->addIncoming(NewV, Header); - - } else if (Instruction *PHI = dyn_cast<Instruction>(V)) { - // If this instruction is IVIncrement then IV is new incoming value - // from header otherwise this instruction must be incoming value from - // header because loop is in LCSSA form. - if (PHI == IVIncrement) - PN->addIncoming(IV, Header); - else - PN->addIncoming(V, Header); - } else - // Otherwise this is an incoming value from header because loop is in - // LCSSA form. - PN->addIncoming(V, Header); - - // Remove incoming value from Latch. - PN->removeIncomingValue(Latch); - } -} - -bool LoopIndexSplit::splitLoop() { - SplitCondition = NULL; - if (ExitCondition->getPredicate() == ICmpInst::ICMP_NE - || ExitCondition->getPredicate() == ICmpInst::ICMP_EQ) - return false; - BasicBlock *Header = L->getHeader(); - BasicBlock *Latch = L->getLoopLatch(); - BranchInst *SBR = NULL; // Split Condition Branch - BranchInst *EBR = cast<BranchInst>(ExitCondition->getParent()->getTerminator()); - // If Exiting block includes loop variant instructions then this - // loop may not be split safely. - BasicBlock *ExitingBlock = ExitCondition->getParent(); - if (!cleanBlock(ExitingBlock)) return false; - - LLVMContext &Context = Header->getContext(); - - for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); - I != E; ++I) { - BranchInst *BR = dyn_cast<BranchInst>((*I)->getTerminator()); - if (!BR || BR->isUnconditional()) continue; - ICmpInst *CI = dyn_cast<ICmpInst>(BR->getCondition()); - if (!CI || CI == ExitCondition - || CI->getPredicate() == ICmpInst::ICMP_NE - || CI->getPredicate() == ICmpInst::ICMP_EQ) - continue; - - // Unable to handle triangle loops at the moment. - // In triangle loop, split condition is in header and one of the - // the split destination is loop latch. If split condition is EQ - // then such loops are already handle in processOneIterationLoop(). - if (Header == (*I) - && (Latch == BR->getSuccessor(0) || Latch == BR->getSuccessor(1))) - continue; - - // If the block does not dominate the latch then this is not a diamond. - // Such loop may not benefit from index split. - if (!DT->dominates((*I), Latch)) - continue; - - // If split condition branches heads do not have single predecessor, - // SplitCondBlock, then is not possible to remove inactive branch. - if (!BR->getSuccessor(0)->getSinglePredecessor() - || !BR->getSuccessor(1)->getSinglePredecessor()) - return false; - - // If the merge point for BR is not loop latch then skip this condition. - if (BR->getSuccessor(0) != Latch) { - DominanceFrontier::iterator DF0 = DF->find(BR->getSuccessor(0)); - assert (DF0 != DF->end() && "Unable to find dominance frontier"); - if (!DF0->second.count(Latch)) - continue; - } - - if (BR->getSuccessor(1) != Latch) { - DominanceFrontier::iterator DF1 = DF->find(BR->getSuccessor(1)); - assert (DF1 != DF->end() && "Unable to find dominance frontier"); - if (!DF1->second.count(Latch)) - continue; - } - SplitCondition = CI; - SBR = BR; - break; - } - - if (!SplitCondition) - return false; - - // If the predicate sign does not match then skip. - if (ExitCondition->isSigned() != SplitCondition->isSigned()) - return false; - - unsigned EVOpNum = (ExitCondition->getOperand(1) == IVExitValue); - unsigned SVOpNum = IVBasedValues.count(SplitCondition->getOperand(0)); - Value *SplitValue = SplitCondition->getOperand(SVOpNum); - if (!L->isLoopInvariant(SplitValue)) - return false; - if (!IVBasedValues.count(SplitCondition->getOperand(!SVOpNum))) - return false; - - // Check for side effects. - for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); - I != E; ++I) { - BasicBlock *BB = *I; - - assert(DT->dominates(Header, BB)); - if (DT->properlyDominates(SplitCondition->getParent(), BB)) - continue; - - for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); - BI != BE; ++BI) { - Instruction *Inst = BI; - - if (!Inst->isSafeToSpeculativelyExecute() && !isa<PHINode>(Inst) - && !isa<BranchInst>(Inst) && !isa<DbgInfoIntrinsic>(Inst)) - return false; - } - } - - // Normalize loop conditions so that it is easier to calculate new loop - // bounds. - if (IVisGT(*ExitCondition) || IVisGE(*ExitCondition)) { - ExitCondition->setPredicate(ExitCondition->getInversePredicate()); - BasicBlock *T = EBR->getSuccessor(0); - EBR->setSuccessor(0, EBR->getSuccessor(1)); - EBR->setSuccessor(1, T); - } - - if (IVisGT(*SplitCondition) || IVisGE(*SplitCondition)) { - SplitCondition->setPredicate(SplitCondition->getInversePredicate()); - BasicBlock *T = SBR->getSuccessor(0); - SBR->setSuccessor(0, SBR->getSuccessor(1)); - SBR->setSuccessor(1, T); - } - - //[*] Calculate new loop bounds. - Value *AEV = SplitValue; - Value *BSV = SplitValue; - bool Sign = SplitCondition->isSigned(); - Instruction *PHTerm = L->getLoopPreheader()->getTerminator(); - - if (IVisLT(*ExitCondition)) { - if (IVisLT(*SplitCondition)) { - /* Do nothing */ - } - else if (IVisLE(*SplitCondition)) { - AEV = getPlusOne(SplitValue, Sign, PHTerm, Context); - BSV = getPlusOne(SplitValue, Sign, PHTerm, Context); - } else { - assert (0 && "Unexpected split condition!"); - } - } - else if (IVisLE(*ExitCondition)) { - if (IVisLT(*SplitCondition)) { - AEV = getMinusOne(SplitValue, Sign, PHTerm, Context); - } - else if (IVisLE(*SplitCondition)) { - BSV = getPlusOne(SplitValue, Sign, PHTerm, Context); - } else { - assert (0 && "Unexpected split condition!"); - } - } else { - assert (0 && "Unexpected exit condition!"); - } - AEV = getMin(AEV, IVExitValue, Sign, PHTerm); - BSV = getMax(BSV, IVStartValue, Sign, PHTerm); - - // [*] Clone Loop - ValueMap<const Value *, Value *> VMap; - Loop *BLoop = CloneLoop(L, LPM, LI, VMap, this); - Loop *ALoop = L; - - // [*] ALoop's exiting edge enters BLoop's header. - // ALoop's original exit block becomes BLoop's exit block. - PHINode *B_IndVar = cast<PHINode>(VMap[IndVar]); - BasicBlock *A_ExitingBlock = ExitCondition->getParent(); - BranchInst *A_ExitInsn = - dyn_cast<BranchInst>(A_ExitingBlock->getTerminator()); - assert (A_ExitInsn && "Unable to find suitable loop exit branch"); - BasicBlock *B_ExitBlock = A_ExitInsn->getSuccessor(1); - BasicBlock *B_Header = BLoop->getHeader(); - if (ALoop->contains(B_ExitBlock)) { - B_ExitBlock = A_ExitInsn->getSuccessor(0); - A_ExitInsn->setSuccessor(0, B_Header); - } else - A_ExitInsn->setSuccessor(1, B_Header); - - // [*] Update ALoop's exit value using new exit value. - ExitCondition->setOperand(EVOpNum, AEV); - - // [*] Update BLoop's header phi nodes. Remove incoming PHINode's from - // original loop's preheader. Add incoming PHINode values from - // ALoop's exiting block. Update BLoop header's dominator info. - - // Collect inverse map of Header PHINodes. - DenseMap<Value *, Value *> InverseMap; - for (BasicBlock::iterator BI = ALoop->getHeader()->begin(), - BE = ALoop->getHeader()->end(); BI != BE; ++BI) { - if (PHINode *PN = dyn_cast<PHINode>(BI)) { - PHINode *PNClone = cast<PHINode>(VMap[PN]); - InverseMap[PNClone] = PN; - } else - break; - } - - BasicBlock *A_Preheader = ALoop->getLoopPreheader(); - for (BasicBlock::iterator BI = B_Header->begin(), BE = B_Header->end(); - BI != BE; ++BI) { - if (PHINode *PN = dyn_cast<PHINode>(BI)) { - // Remove incoming value from original preheader. - PN->removeIncomingValue(A_Preheader); - - // Add incoming value from A_ExitingBlock. - if (PN == B_IndVar) - PN->addIncoming(BSV, A_ExitingBlock); - else { - PHINode *OrigPN = cast<PHINode>(InverseMap[PN]); - Value *V2 = NULL; - // If loop header is also loop exiting block then - // OrigPN is incoming value for B loop header. - if (A_ExitingBlock == ALoop->getHeader()) - V2 = OrigPN; - else - V2 = OrigPN->getIncomingValueForBlock(A_ExitingBlock); - PN->addIncoming(V2, A_ExitingBlock); - } - } else - break; - } - - DT->changeImmediateDominator(B_Header, A_ExitingBlock); - DF->changeImmediateDominator(B_Header, A_ExitingBlock, DT); - - // [*] Update BLoop's exit block. Its new predecessor is BLoop's exit - // block. Remove incoming PHINode values from ALoop's exiting block. - // Add new incoming values from BLoop's incoming exiting value. - // Update BLoop exit block's dominator info.. - BasicBlock *B_ExitingBlock = cast<BasicBlock>(VMap[A_ExitingBlock]); - for (BasicBlock::iterator BI = B_ExitBlock->begin(), BE = B_ExitBlock->end(); - BI != BE; ++BI) { - if (PHINode *PN = dyn_cast<PHINode>(BI)) { - PN->addIncoming(VMap[PN->getIncomingValueForBlock(A_ExitingBlock)], - B_ExitingBlock); - PN->removeIncomingValue(A_ExitingBlock); - } else - break; - } - - DT->changeImmediateDominator(B_ExitBlock, B_ExitingBlock); - DF->changeImmediateDominator(B_ExitBlock, B_ExitingBlock, DT); - - //[*] Split ALoop's exit edge. This creates a new block which - // serves two purposes. First one is to hold PHINode defnitions - // to ensure that ALoop's LCSSA form. Second use it to act - // as a preheader for BLoop. - BasicBlock *A_ExitBlock = SplitEdge(A_ExitingBlock, B_Header, this); - - //[*] Preserve ALoop's LCSSA form. Create new forwarding PHINodes - // in A_ExitBlock to redefine outgoing PHI definitions from ALoop. - for(BasicBlock::iterator BI = B_Header->begin(), BE = B_Header->end(); - BI != BE; ++BI) { - if (PHINode *PN = dyn_cast<PHINode>(BI)) { - Value *V1 = PN->getIncomingValueForBlock(A_ExitBlock); - PHINode *newPHI = PHINode::Create(PN->getType(), PN->getName()); - newPHI->addIncoming(V1, A_ExitingBlock); - A_ExitBlock->getInstList().push_front(newPHI); - PN->removeIncomingValue(A_ExitBlock); - PN->addIncoming(newPHI, A_ExitBlock); - } else - break; - } - - //[*] Eliminate split condition's inactive branch from ALoop. - BasicBlock *A_SplitCondBlock = SplitCondition->getParent(); - BranchInst *A_BR = cast<BranchInst>(A_SplitCondBlock->getTerminator()); - BasicBlock *A_InactiveBranch = NULL; - BasicBlock *A_ActiveBranch = NULL; - A_ActiveBranch = A_BR->getSuccessor(0); - A_InactiveBranch = A_BR->getSuccessor(1); - A_BR->setUnconditionalDest(A_ActiveBranch); - removeBlocks(A_InactiveBranch, L, A_ActiveBranch); - - //[*] Eliminate split condition's inactive branch in from BLoop. - BasicBlock *B_SplitCondBlock = cast<BasicBlock>(VMap[A_SplitCondBlock]); - BranchInst *B_BR = cast<BranchInst>(B_SplitCondBlock->getTerminator()); - BasicBlock *B_InactiveBranch = NULL; - BasicBlock *B_ActiveBranch = NULL; - B_ActiveBranch = B_BR->getSuccessor(1); - B_InactiveBranch = B_BR->getSuccessor(0); - B_BR->setUnconditionalDest(B_ActiveBranch); - removeBlocks(B_InactiveBranch, BLoop, B_ActiveBranch); - - BasicBlock *A_Header = ALoop->getHeader(); - if (A_ExitingBlock == A_Header) - return true; - - //[*] Move exit condition into split condition block to avoid - // executing dead loop iteration. - ICmpInst *B_ExitCondition = cast<ICmpInst>(VMap[ExitCondition]); - Instruction *B_IndVarIncrement = cast<Instruction>(VMap[IVIncrement]); - ICmpInst *B_SplitCondition = cast<ICmpInst>(VMap[SplitCondition]); - - moveExitCondition(A_SplitCondBlock, A_ActiveBranch, A_ExitBlock, ExitCondition, - cast<ICmpInst>(SplitCondition), IndVar, IVIncrement, - ALoop, EVOpNum); - - moveExitCondition(B_SplitCondBlock, B_ActiveBranch, - B_ExitBlock, B_ExitCondition, - B_SplitCondition, B_IndVar, B_IndVarIncrement, - BLoop, EVOpNum); - - ++NumIndexSplit; - return true; -} - -/// cleanBlock - A block is considered clean if all non terminal instructions -/// are either, PHINodes, IV based. -bool LoopIndexSplit::cleanBlock(BasicBlock *BB) { - Instruction *Terminator = BB->getTerminator(); - for(BasicBlock::iterator BI = BB->begin(), BE = BB->end(); - BI != BE; ++BI) { - Instruction *I = BI; - - if (isa<PHINode>(I) || I == Terminator || I == ExitCondition - || I == SplitCondition || IVBasedValues.count(I) - || isa<DbgInfoIntrinsic>(I)) - continue; - - if (I->mayHaveSideEffects()) - return false; - - // I is used only inside this block then it is OK. - bool usedOutsideBB = false; - for (Value::use_iterator UI = I->use_begin(), UE = I->use_end(); - UI != UE; ++UI) { - Instruction *U = cast<Instruction>(*UI); - if (U->getParent() != BB) - usedOutsideBB = true; - } - if (!usedOutsideBB) - continue; - - // Otherwise we have a instruction that may not allow loop spliting. - return false; - } - return true; -} - -/// IVisLT - If Op is comparing IV based value with an loop invariant and -/// IV based value is less than the loop invariant then return the loop -/// invariant. Otherwise return NULL. -Value * LoopIndexSplit::IVisLT(ICmpInst &Op) { - ICmpInst::Predicate P = Op.getPredicate(); - if ((P == ICmpInst::ICMP_SLT || P == ICmpInst::ICMP_ULT) - && IVBasedValues.count(Op.getOperand(0)) - && L->isLoopInvariant(Op.getOperand(1))) - return Op.getOperand(1); - - if ((P == ICmpInst::ICMP_SGT || P == ICmpInst::ICMP_UGT) - && IVBasedValues.count(Op.getOperand(1)) - && L->isLoopInvariant(Op.getOperand(0))) - return Op.getOperand(0); - - return NULL; -} - -/// IVisLE - If Op is comparing IV based value with an loop invariant and -/// IV based value is less than or equal to the loop invariant then -/// return the loop invariant. Otherwise return NULL. -Value * LoopIndexSplit::IVisLE(ICmpInst &Op) { - ICmpInst::Predicate P = Op.getPredicate(); - if ((P == ICmpInst::ICMP_SLE || P == ICmpInst::ICMP_ULE) - && IVBasedValues.count(Op.getOperand(0)) - && L->isLoopInvariant(Op.getOperand(1))) - return Op.getOperand(1); - - if ((P == ICmpInst::ICMP_SGE || P == ICmpInst::ICMP_UGE) - && IVBasedValues.count(Op.getOperand(1)) - && L->isLoopInvariant(Op.getOperand(0))) - return Op.getOperand(0); - - return NULL; -} - -/// IVisGT - If Op is comparing IV based value with an loop invariant and -/// IV based value is greater than the loop invariant then return the loop -/// invariant. Otherwise return NULL. -Value * LoopIndexSplit::IVisGT(ICmpInst &Op) { - ICmpInst::Predicate P = Op.getPredicate(); - if ((P == ICmpInst::ICMP_SGT || P == ICmpInst::ICMP_UGT) - && IVBasedValues.count(Op.getOperand(0)) - && L->isLoopInvariant(Op.getOperand(1))) - return Op.getOperand(1); - - if ((P == ICmpInst::ICMP_SLT || P == ICmpInst::ICMP_ULT) - && IVBasedValues.count(Op.getOperand(1)) - && L->isLoopInvariant(Op.getOperand(0))) - return Op.getOperand(0); - - return NULL; -} - -/// IVisGE - If Op is comparing IV based value with an loop invariant and -/// IV based value is greater than or equal to the loop invariant then -/// return the loop invariant. Otherwise return NULL. -Value * LoopIndexSplit::IVisGE(ICmpInst &Op) { - ICmpInst::Predicate P = Op.getPredicate(); - if ((P == ICmpInst::ICMP_SGE || P == ICmpInst::ICMP_UGE) - && IVBasedValues.count(Op.getOperand(0)) - && L->isLoopInvariant(Op.getOperand(1))) - return Op.getOperand(1); - - if ((P == ICmpInst::ICMP_SLE || P == ICmpInst::ICMP_ULE) - && IVBasedValues.count(Op.getOperand(1)) - && L->isLoopInvariant(Op.getOperand(0))) - return Op.getOperand(0); - - return NULL; -} - diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp index 20ef145bcb9..c0150935733 100644 --- a/llvm/lib/Transforms/Scalar/Scalar.cpp +++ b/llvm/lib/Transforms/Scalar/Scalar.cpp @@ -40,7 +40,6 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) { initializeJumpThreadingPass(Registry); initializeLICMPass(Registry); initializeLoopDeletionPass(Registry); - initializeLoopIndexSplitPass(Registry); initializeLoopRotatePass(Registry); initializeLoopStrengthReducePass(Registry); initializeLoopUnrollPass(Registry); @@ -100,10 +99,6 @@ void LLVMAddLoopDeletionPass(LLVMPassManagerRef PM) { unwrap(PM)->add(createLoopDeletionPass()); } -void LLVMAddLoopIndexSplitPass(LLVMPassManagerRef PM) { - unwrap(PM)->add(createLoopIndexSplitPass()); -} - void LLVMAddLoopRotatePass(LLVMPassManagerRef PM) { unwrap(PM)->add(createLoopRotatePass()); } diff --git a/llvm/test/Other/2008-08-14-PassManager.ll b/llvm/test/Other/2008-08-14-PassManager.ll deleted file mode 100644 index 8d6a6d825f1..00000000000 --- a/llvm/test/Other/2008-08-14-PassManager.ll +++ /dev/null @@ -1,5 +0,0 @@ -; RUN: opt < %s -loop-deletion -loop-index-split -disable-output -; PR2640 -define i32 @test1() { - ret i32 0 -} diff --git a/llvm/test/Transforms/IndVarSimplify/loop-invariant-step.ll b/llvm/test/Transforms/IndVarSimplify/loop-invariant-step.ll deleted file mode 100644 index 2d2d1fe264a..00000000000 --- a/llvm/test/Transforms/IndVarSimplify/loop-invariant-step.ll +++ /dev/null @@ -1,33 +0,0 @@ -; RUN: opt < %s -loop-index-split -instcombine -indvars -disable-output -; PR4455 - -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" - -declare i8* @fast_memcpy(i8*, i8*, i64) - -define void @dvdsub_decode() nounwind { -entry: ; preds = %bb1 - br label %LoopA - -LoopA: ; preds = %LoopA, %entry - %x1.0.i17 = phi i32 [ %t0, %LoopA ], [ 0, %entry ] ; <i32> [#uses=2] - %t0 = add i32 %x1.0.i17, 1 ; <i32> [#uses=1] - br i1 undef, label %LoopA, label %middle - -middle: ; preds = %LoopA - %t1 = sub i32 0, %x1.0.i17 ; <i32> [#uses=1] - %t2 = add i32 %t1, 1 ; <i32> [#uses=1] - br label %LoopB - -LoopB: ; preds = %LoopB, %bb.nph.i27 - %y.029.i = phi i32 [ 0, %middle ], [ %t7, %LoopB ] ; <i32> [#uses=2] - %t3 = mul i32 %y.029.i, %t2 ; <i32> [#uses=1] - %t4 = sext i32 %t3 to i64 ; <i64> [#uses=1] - %t5 = getelementptr i8* null, i64 %t4 ; <i8*> [#uses=1] - %t6 = call i8* @fast_memcpy(i8* %t5, i8* undef, i64 undef) nounwind ; <i8*> [#uses=0] - %t7 = add i32 %y.029.i, 1 ; <i32> [#uses=1] - br i1 undef, label %LoopB, label %exit - -exit: - ret void -} diff --git a/llvm/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll b/llvm/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll deleted file mode 100644 index d1fe48c2357..00000000000 --- a/llvm/test/Transforms/LICM/2009-03-25-AliasSetTracker.ll +++ /dev/null @@ -1,39 +0,0 @@ - -; RUN: opt < %s -licm -loop-index-split -instcombine -disable-output - - %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] } - %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 } -@"\01LC81" = external constant [4 x i8] ; <[4 x i8]*> [#uses=1] - -define fastcc void @hex_dump_internal(i8* %avcl, %struct.FILE* %f, i32 %level, i8* nocapture %buf, i32 %size) nounwind { -entry: - br i1 false, label %bb4, label %return - -bb4: ; preds = %bb30, %entry - br label %bb6 - -bb6: ; preds = %bb15, %bb4 - %j.0.reg2mem.0 = phi i32 [ %2, %bb15 ], [ 0, %bb4 ] ; <i32> [#uses=2] - %0 = icmp slt i32 %j.0.reg2mem.0, 0 ; <i1> [#uses=1] - br i1 %0, label %bb7, label %bb13 - -bb7: ; preds = %bb6 - br label %bb15 - -bb13: ; preds = %bb6 - %1 = tail call i32 @fwrite(i8* getelementptr ([4 x i8]* @"\01LC81", i32 0, i32 0), i32 1, i32 3, i8* null) nounwind ; <i32> [#uses=0] - br label %bb15 - -bb15: ; preds = %bb13, %bb7 - %2 = add i32 %j.0.reg2mem.0, 1 ; <i32> [#uses=2] - %3 = icmp sgt i32 %2, 15 ; <i1> [#uses=1] - br i1 %3, label %bb30, label %bb6 - -bb30: ; preds = %bb15 - br i1 false, label %bb4, label %return - -return: ; preds = %bb30, %entry - ret void -} - -declare i32 @fwrite(i8* nocapture, i32, i32, i8* nocapture) nounwind diff --git a/llvm/test/Transforms/LoopIndexSplit/2007-09-21-LoopBound.ll b/llvm/test/Transforms/LoopIndexSplit/2007-09-21-LoopBound.ll deleted file mode 100644 index d922ecbd4f5..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2007-09-21-LoopBound.ll +++ /dev/null @@ -1,63 +0,0 @@ -; PR1692 -; RUN: opt < %s -loop-index-split -disable-output - %struct.CLAUSE_HELP = type { i32, i32, i32, i32, i32*, i32, %struct.LIST_NODE*, %struct.LIST_NODE*, i32, i32, %struct.LITERAL_HELP**, i32, i32, i32, i32 } - %struct.LIST_NODE = type { %struct.LIST_NODE*, i8* } - %struct.LITERAL_HELP = type { i32, i32, i32, %struct.CLAUSE_HELP*, %struct.term* } - %struct.anon = type { %struct.LIST_NODE* } - %struct.st = type { %struct.subst*, %struct.LIST_NODE*, %struct.LIST_NODE*, i16, i16 } - %struct.subst = type { %struct.subst*, i32, %struct.term* } - %struct.term = type { i32, %struct.anon, %struct.LIST_NODE*, i32, i32 } - -define %struct.LIST_NODE* @inf_HyperResolvents(%struct.CLAUSE_HELP* %Clause, %struct.subst* %Subst, %struct.LIST_NODE* %Restlits, i32 %GlobalMaxVar, %struct.LIST_NODE* %FoundMap, i32 %StrictlyMaximal, { %struct.st*, [3001 x %struct.term*], [4000 x %struct.term*], i32 }* %Index, i32* %Flags, i32* %Precedence) { -entry: - br i1 false, label %cond_next44, label %bb37 - -bb37: ; preds = %entry - ret %struct.LIST_NODE* null - -cond_next44: ; preds = %entry - br i1 false, label %bb29.i, label %bb.i31 - -bb.i31: ; preds = %cond_next44 - ret %struct.LIST_NODE* null - -bb29.i: ; preds = %cond_next44 - br i1 false, label %cond_next89.i, label %bb34.i - -bb34.i: ; preds = %bb29.i - ret %struct.LIST_NODE* null - -cond_next89.i: ; preds = %bb29.i - br i1 false, label %clause_LiteralGetIndex.exit70.i, label %bb.i59.i - -bb.i59.i: ; preds = %cond_next89.i - ret %struct.LIST_NODE* null - -clause_LiteralGetIndex.exit70.i: ; preds = %cond_next89.i - br label %bb3.i.i - -bb3.i.i: ; preds = %bb3.i.i, %clause_LiteralGetIndex.exit70.i - br i1 false, label %bb40.i.i, label %bb3.i.i - -subst_Apply.exit.i.i: ; preds = %bb40.i.i - %tmp21.i.i = icmp sgt i32 %j.0.i.i, 0 ; <i1> [#uses=1] - br i1 %tmp21.i.i, label %cond_false.i47.i, label %cond_true24.i.i - -cond_true24.i.i: ; preds = %subst_Apply.exit.i.i - br label %cond_next37.i.i - -cond_false.i47.i: ; preds = %subst_Apply.exit.i.i - br label %cond_next37.i.i - -cond_next37.i.i: ; preds = %cond_false.i47.i, %cond_true24.i.i - %tmp39.i.i = add i32 %j.0.i.i, 1 ; <i32> [#uses=1] - br label %bb40.i.i - -bb40.i.i: ; preds = %cond_next37.i.i, %bb3.i.i - %j.0.i.i = phi i32 [ %tmp39.i.i, %cond_next37.i.i ], [ 0, %bb3.i.i ] ; <i32> [#uses=3] - %tmp43.i.i = icmp sgt i32 %j.0.i.i, 0 ; <i1> [#uses=1] - br i1 %tmp43.i.i, label %inf_CopyHyperElectron.exit.i, label %subst_Apply.exit.i.i - -inf_CopyHyperElectron.exit.i: ; preds = %bb40.i.i - ret %struct.LIST_NODE* null -} diff --git a/llvm/test/Transforms/LoopIndexSplit/2007-09-24-UpdateIterationSpace.ll b/llvm/test/Transforms/LoopIndexSplit/2007-09-24-UpdateIterationSpace.ll deleted file mode 100644 index 3ebd9b3401f..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2007-09-24-UpdateIterationSpace.ll +++ /dev/null @@ -1,57 +0,0 @@ - -; Update loop iteraton space to eliminate condition inside loop. -; RUN: opt < %s -loop-index-split -S | not grep bothcond -define void @test(float* %x, i32 %ndat, float** %y, float %xcen, i32 %xmin, i32 %xmax, float %sigmal, float %contribution) { -entry: - %tmp519 = icmp sgt i32 %xmin, %xmax ; <i1> [#uses=1] - br i1 %tmp519, label %return, label %bb.preheader - -bb.preheader: ; preds = %entry - %tmp3031 = fpext float %contribution to double ; <double> [#uses=1] - %tmp32 = fmul double %tmp3031, 5.000000e-01 ; <double> [#uses=1] - %tmp3839 = fpext float %sigmal to double ; <double> [#uses=1] - br label %bb - -bb: ; preds = %bb.preheader, %cond_next45 - %i.01.0 = phi i32 [ %tmp47, %cond_next45 ], [ 0, %bb.preheader ] ; <i32> [#uses=6] - %tmp2 = icmp sgt i32 %i.01.0, -1 ; <i1> [#uses=1] - %tmp6 = icmp slt i32 %i.01.0, %ndat ; <i1> [#uses=1] - %bothcond = and i1 %tmp2, %tmp6 ; <i1> [#uses=1] - br i1 %bothcond, label %cond_true9, label %cond_next45 - -cond_true9: ; preds = %bb - %tmp12 = getelementptr float* %x, i32 %i.01.0 ; <float*> [#uses=1] - %tmp13 = load float* %tmp12, align 4 ; <float> [#uses=1] - %tmp15 = fsub float %xcen, %tmp13 ; <float> [#uses=1] - %tmp16 = tail call float @fabsf( float %tmp15 ) ; <float> [#uses=1] - %tmp18 = fdiv float %tmp16, %sigmal ; <float> [#uses=1] - %tmp21 = load float** %y, align 4 ; <float*> [#uses=2] - %tmp27 = getelementptr float* %tmp21, i32 %i.01.0 ; <float*> [#uses=1] - %tmp28 = load float* %tmp27, align 4 ; <float> [#uses=1] - %tmp2829 = fpext float %tmp28 to double ; <double> [#uses=1] - %tmp34 = fsub float -0.000000e+00, %tmp18 ; <float> [#uses=1] - %tmp3435 = fpext float %tmp34 to double ; <double> [#uses=1] - %tmp36 = tail call double @exp( double %tmp3435 ) ; <double> [#uses=1] - %tmp37 = fmul double %tmp32, %tmp36 ; <double> [#uses=1] - %tmp40 = fdiv double %tmp37, %tmp3839 ; <double> [#uses=1] - %tmp41 = fadd double %tmp2829, %tmp40 ; <double> [#uses=1] - %tmp4142 = fptrunc double %tmp41 to float ; <float> [#uses=1] - %tmp44 = getelementptr float* %tmp21, i32 %i.01.0 ; <float*> [#uses=1] - store float %tmp4142, float* %tmp44, align 4 - br label %cond_next45 - -cond_next45: ; preds = %bb, %cond_true9 - %tmp47 = add i32 %i.01.0, 1 ; <i32> [#uses=2] - %tmp51 = icmp sgt i32 %tmp47, %xmax ; <i1> [#uses=1] - br i1 %tmp51, label %return.loopexit, label %bb - -return.loopexit: ; preds = %cond_next45 - br label %return - -return: ; preds = %return.loopexit, %entry - ret void -} - -declare float @fabsf(float) - -declare double @exp(double) diff --git a/llvm/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll b/llvm/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll deleted file mode 100644 index 8f4ee24c123..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2007-09-25-UpdateIterationSpace-2.ll +++ /dev/null @@ -1,60 +0,0 @@ -; PR714 -; Update loop iteraton space to eliminate condition inside loop. -; RUN: opt < %s -loop-index-split -S | not grep bothcond - -define void @test(float* %x, i32 %ndat, float** %y, float %xcen, i32 %xmin, i32 %xmax, float %sigmal, float %contribution) { -entry: - %tmp5310 = icmp sgt i32 %xmin, %xmax ; <i1> [#uses=1] - br i1 %tmp5310, label %return, label %bb.preheader - -bb.preheader: ; preds = %entry - %tmp3031 = fpext float %contribution to double ; <double> [#uses=1] - %tmp32 = fmul double %tmp3031, 5.000000e-01 ; <double> [#uses=1] - %tmp3839 = fpext float %sigmal to double ; <double> [#uses=1] - br label %bb - -bb: ; preds = %cond_next45, %bb.preheader - %k.06.0 = phi i32 [ 0, %bb.preheader ], [ %indvar.next, %cond_next45 ] ; <i32> [#uses=4] - %i.01.0 = add i32 %k.06.0, %xmin ; <i32> [#uses=4] - %tmp2 = icmp sgt i32 %i.01.0, -1 ; <i1> [#uses=1] - %tmp6 = icmp slt i32 %i.01.0, %ndat ; <i1> [#uses=1] - %bothcond = and i1 %tmp2, %tmp6 ; <i1> [#uses=1] - br i1 %bothcond, label %cond_true9, label %cond_next45 - -cond_true9: ; preds = %bb - %tmp12 = getelementptr float* %x, i32 %i.01.0 ; <float*> [#uses=1] - %tmp13 = load float* %tmp12, align 4 ; <float> [#uses=1] - %tmp15 = fsub float %xcen, %tmp13 ; <float> [#uses=1] - %tmp16 = tail call float @fabsf(float %tmp15) ; <float> [#uses=1] - %tmp18 = fdiv float %tmp16, %sigmal ; <float> [#uses=1] - %tmp21 = load float** %y, align 4 ; <float*> [#uses=2] - %tmp27 = getelementptr float* %tmp21, i32 %k.06.0 ; <float*> [#uses=1] - %tmp28 = load float* %tmp27, align 4 ; <float> [#uses=1] - %tmp2829 = fpext float %tmp28 to double ; <double> [#uses=1] - %tmp34 = fsub float -0.000000e+00, %tmp18 ; <float> [#uses=1] - %tmp3435 = fpext float %tmp34 to double ; <double> [#uses=1] - %tmp36 = tail call double @exp(double %tmp3435) ; <double> [#uses=1] - %tmp37 = fmul double %tmp32, %tmp36 ; <double> [#uses=1] - %tmp40 = fdiv double %tmp37, %tmp3839 ; <double> [#uses=1] - %tmp41 = fadd double %tmp2829, %tmp40 ; <double> [#uses=1] - %tmp4142 = fptrunc double %tmp41 to float ; <float> [#uses=1] - %tmp44 = getelementptr float* %tmp21, i32 %k.06.0 ; <float*> [#uses=1] - store float %tmp4142, float* %tmp44, align 4 - br label %cond_next45 - -cond_next45: ; preds = %cond_true9, %bb - %tmp47 = add i32 %i.01.0, 1 ; <i32> [#uses=1] - %tmp53 = icmp sgt i32 %tmp47, %xmax ; <i1> [#uses=1] - %indvar.next = add i32 %k.06.0, 1 ; <i32> [#uses=1] - br i1 %tmp53, label %return.loopexit, label %bb - -return.loopexit: ; preds = %cond_next45 - br label %return - -return: ; preds = %return.loopexit, %entry - ret void -} - -declare float @fabsf(float) - -declare double @exp(double) diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll b/llvm/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll deleted file mode 100644 index 1550bc7abb5..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll +++ /dev/null @@ -1,46 +0,0 @@ -; RUN: opt < %s -loop-index-split -disable-output -stats |& \ -; RUN: not grep "loop-index-split" - -; Induction variable decrement is not yet handled. -; pr1912.bc -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i686-apple-darwin9" - %struct.cset = type { i8*, i8, i8, i32, i8* } - %struct.parse = type { i8*, i8*, i32, i32*, i32, i32, i32, %struct.re_guts*, [10 x i32], [10 x i32] } - %struct.re_guts = type { i32, i32*, i32, i32, %struct.cset*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, i32, i32, [1 x i8] } - -define fastcc void @p_bracket(%struct.parse* %p) { -entry: - br i1 false, label %bb160, label %bb195 - -bb160: ; preds = %entry - br i1 false, label %bb.i169, label %bb9.i - -bb195: ; preds = %entry - ret void - -bb.i169: ; preds = %bb160 - br i1 false, label %bb372, label %bb565 - -bb9.i: ; preds = %bb160 - ret void - -bb372: ; preds = %bb418, %bb.i169 - %i1.0.reg2mem.0 = phi i32 [ %i1.0, %bb418 ], [ 0, %bb.i169 ] ; <i32> [#uses=2] - %tmp3.i.i.i170 = icmp ult i32 %i1.0.reg2mem.0, 128 ; <i1> [#uses=1] - br i1 %tmp3.i.i.i170, label %bb.i.i173, label %bb13.i.i - -bb.i.i173: ; preds = %bb372 - br label %bb418 - -bb13.i.i: ; preds = %bb372 - br label %bb418 - -bb418: ; preds = %bb13.i.i, %bb.i.i173 - %i1.0 = add i32 %i1.0.reg2mem.0, -1 ; <i32> [#uses=2] - %tmp420 = icmp sgt i32 %i1.0, -1 ; <i1> [#uses=1] - br i1 %tmp420, label %bb372, label %bb565 - -bb565: ; preds = %bb418, %bb.i169 - ret void -} diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-02-08-Crash.ll b/llvm/test/Transforms/LoopIndexSplit/2008-02-08-Crash.ll deleted file mode 100644 index 3cfd6c96b7b..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2008-02-08-Crash.ll +++ /dev/null @@ -1,48 +0,0 @@ -; RUN: opt < %s -loop-index-split -disable-output -; PR 1995 - -define void @add_blkdev_randomness(i32 %major) nounwind { -entry: - br label %bb - -bb: ; preds = %bb39, %entry - %A.0.reg2mem.0 = phi i32 [ undef, %entry ], [ %TEMP.0, %bb39 ] ; <i32> [#uses=1] - %D.0.reg2mem.0 = phi i32 [ undef, %entry ], [ %C.0.reg2mem.0, %bb39 ] ; <i32> [#uses=3] - %C.0.reg2mem.0 = phi i32 [ undef, %entry ], [ %tmp34, %bb39 ] ; <i32> [#uses=4] - %TEMP.1.reg2mem.0 = phi i32 [ undef, %entry ], [ %TEMP.0, %bb39 ] ; <i32> [#uses=1] - %i.0.reg2mem.0 = phi i32 [ 0, %entry ], [ %tmp38, %bb39 ] ; <i32> [#uses=3] - %B.0.reg2mem.0 = phi i32 [ undef, %entry ], [ %A.0.reg2mem.0, %bb39 ] ; <i32> [#uses=5] - %tmp1 = icmp slt i32 %i.0.reg2mem.0, 40 ; <i1> [#uses=1] - br i1 %tmp1, label %bb3, label %bb12 - -bb3: ; preds = %bb - %tmp6 = xor i32 %C.0.reg2mem.0, %D.0.reg2mem.0 ; <i32> [#uses=1] - %tmp8 = and i32 %B.0.reg2mem.0, %tmp6 ; <i32> [#uses=1] - %tmp10 = xor i32 %tmp8, %D.0.reg2mem.0 ; <i32> [#uses=1] - %tmp11 = add i32 %tmp10, 1518500249 ; <i32> [#uses=1] - br label %bb39 - -bb12: ; preds = %bb - %tmp14 = icmp slt i32 %i.0.reg2mem.0, 60 ; <i1> [#uses=1] - br i1 %tmp14, label %bb17, label %bb39 - -bb17: ; preds = %bb12 - %tmp20 = and i32 %B.0.reg2mem.0, %C.0.reg2mem.0 ; <i32> [#uses=1] - %tmp23 = xor i32 %B.0.reg2mem.0, %C.0.reg2mem.0 ; <i32> [#uses=1] - %tmp25 = and i32 %tmp23, %D.0.reg2mem.0 ; <i32> [#uses=1] - %tmp26 = add i32 %tmp20, -1894007588 ; <i32> [#uses=1] - %tmp27 = add i32 %tmp26, %tmp25 ; <i32> [#uses=1] - br label %bb39 - -bb39: ; preds = %bb12, %bb3, %bb17 - %TEMP.0 = phi i32 [ %tmp27, %bb17 ], [ %tmp11, %bb3 ], [ %TEMP.1.reg2mem.0, %bb12 ] ; <i32> [#uses=2] - %tmp31 = lshr i32 %B.0.reg2mem.0, 2 ; <i32> [#uses=1] - %tmp33 = shl i32 %B.0.reg2mem.0, 30 ; <i32> [#uses=1] - %tmp34 = or i32 %tmp31, %tmp33 ; <i32> [#uses=1] - %tmp38 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2] - %tmp41 = icmp slt i32 %tmp38, 80 ; <i1> [#uses=1] - br i1 %tmp41, label %bb, label %return - -return: ; preds = %bb39 - ret void -} diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-02-13-ExitValueNum.ll b/llvm/test/Transforms/LoopIndexSplit/2008-02-13-ExitValueNum.ll deleted file mode 100644 index 980a42f20aa..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2008-02-13-ExitValueNum.ll +++ /dev/null @@ -1,67 +0,0 @@ -; RUN: opt < %s -disable-output -loop-index-split -; PR 2011 - %struct.CLAUSE_HELP = type { i32, i32, i32, i32, i32*, i32, %struct.LIST_NODE*, %struct.LIST_NODE*, i32, i32, %struct.LITERAL_HELP**, i32, i32, i32, i32 } - %struct.LIST_NODE = type { %struct.LIST_NODE*, i8* } - %struct.LITERAL_HELP = type { i32, i32, i32, %struct.CLAUSE_HELP*, %struct.term* } - %struct.anon = type { %struct.LIST_NODE* } - %struct.st = type { %struct.subst*, %struct.LIST_NODE*, %struct.LIST_NODE*, i16, i16 } - %struct.subst = type { %struct.subst*, i32, %struct.term* } - %struct.term = type { i32, %struct.anon, %struct.LIST_NODE*, i32, i32 } - -define fastcc %struct.LIST_NODE* @inf_HyperResolvents(%struct.CLAUSE_HELP* %Clause, %struct.subst* %Subst, %struct.LIST_NODE* %Restlits, i32 %GlobalMaxVar, %struct.LIST_NODE* %FoundMap, i32 %StrictlyMaximal, { %struct.st*, [3001 x %struct.term*], [4000 x %struct.term*], i32 }* %Index, i32* %Flags, i32* %Precedence) nounwind { -entry: - br i1 false, label %bb960, label %bb885 - -bb885: ; preds = %entry - ret %struct.LIST_NODE* null - -bb960: ; preds = %entry - br i1 false, label %bb1097, label %bb1005.preheader - -bb1005.preheader: ; preds = %bb960 - ret %struct.LIST_NODE* null - -bb1097: ; preds = %bb960 - br i1 false, label %bb1269.preheader, label %bb1141.preheader - -bb1141.preheader: ; preds = %bb1097 - ret %struct.LIST_NODE* null - -bb1269.preheader: ; preds = %bb1097 - br i1 false, label %bb1318, label %bb1281 - -bb1281: ; preds = %bb1269.preheader - ret %struct.LIST_NODE* null - -bb1318: ; preds = %bb1269.preheader - br i1 false, label %bb1459, label %bb.nph52 - -bb.nph52: ; preds = %bb1318 - ret %struct.LIST_NODE* null - -bb1459: ; preds = %bb1318 - br i1 false, label %bb1553, label %bb.nph62 - -bb.nph62: ; preds = %bb1459 - ret %struct.LIST_NODE* null - -bb1553: ; preds = %bb1669, %bb1459 - %j295.0.reg2mem.0 = phi i32 [ %storemerge110, %bb1669 ], [ 0, %bb1459 ] ; <i32> [#uses=2] - %tmp1629 = icmp sgt i32 %j295.0.reg2mem.0, 0 ; <i1> [#uses=1] - br i1 %tmp1629, label %bb1649, label %bb1632 - -bb1632: ; preds = %bb1553 - br label %bb1669 - -bb1649: ; preds = %bb1553 - br label %bb1669 - -bb1669: ; preds = %bb1649, %bb1632 - %storemerge110 = add i32 %j295.0.reg2mem.0, 1 ; <i32> [#uses=2] - %tmp1672 = icmp sgt i32 %storemerge110, 0 ; <i1> [#uses=1] - br i1 %tmp1672, label %bb1678, label %bb1553 - -bb1678: ; preds = %bb1669 - ret %struct.LIST_NODE* null -} - diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatch.ll b/llvm/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatch.ll deleted file mode 100644 index 9351cafcf64..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatch.ll +++ /dev/null @@ -1,72 +0,0 @@ -; RUN: opt < %s -loop-index-split -disable-output -; PR 2011 - %struct.CLAUSE_HELP = type { i32, i32, i32, i32, i32*, i32, %struct.LIST_NODE*, %struct.LIST_NODE*, i32, i32, %struct.LITERAL_HELP**, i32, i32, i32, i32 } - %struct.LIST_NODE = type { %struct.LIST_NODE*, i8* } - %struct.LITERAL_HELP = type { i32, i32, i32, %struct.CLAUSE_HELP*, %struct.term* } - %struct.anon = type { %struct.LIST_NODE* } - %struct.st = type { %struct.subst*, %struct.LIST_NODE*, %struct.LIST_NODE*, i16, i16 } - %struct.subst = type { %struct.subst*, i32, %struct.term* } - %struct.term = type { i32, %struct.anon, %struct.LIST_NODE*, i32, i32 } - -define fastcc %struct.LIST_NODE* @inf_HyperResolvents(%struct.CLAUSE_HELP* %Clause, %struct.subst* %Subst, %struct.LIST_NODE* %Restlits, i32 %GlobalMaxVar, %struct.LIST_NODE* %FoundMap, i32 %StrictlyMaximal, { %struct.st*, [3001 x %struct.term*], [4000 x %struct.term*], i32 }* %Index, i32* %Flags, i32* %Precedence) nounwind { -entry: - br i1 false, label %bb960, label %bb885 - -bb885: ; preds = %entry - ret %struct.LIST_NODE* null - -bb960: ; preds = %entry - br i1 false, label %bb1097, label %bb1005.preheader - -bb1005.preheader: ; preds = %bb960 - ret %struct.LIST_NODE* null - -bb1097: ; preds = %bb960 - br i1 false, label %bb1269.preheader, label %bb1141.preheader - -bb1141.preheader: ; preds = %bb1097 - ret %struct.LIST_NODE* null - -bb1269.preheader: ; preds = %bb1097 - br i1 false, label %bb1318, label %bb1281 - -bb1281: ; preds = %bb1269.preheader - ret %struct.LIST_NODE* null - -bb1318: ; preds = %bb1269.preheader - br i1 false, label %bb1459, label %bb.nph52 - -bb.nph52: ; preds = %bb1318 - ret %struct.LIST_NODE* null - -bb1459: ; preds = %bb1318 - br i1 false, label %bb1553, label %bb.nph62 - -bb.nph62: ; preds = %bb1459 - ret %struct.LIST_NODE* null - -bb1553: ; preds = %bb1669, %bb1459 - %j295.0.reg2mem.0 = phi i32 [ %storemerge110, %bb1669 ], [ 0, %bb1459 ] ; <i32> [#uses=2] - br i1 false, label %bb1588, label %bb1616 - -bb1588: ; preds = %bb1553 - br label %bb1616 - -bb1616: ; preds = %bb1588, %bb1553 - %tmp1629 = icmp sgt i32 %j295.0.reg2mem.0, 0 ; <i1> [#uses=1] - br i1 %tmp1629, label %bb1649, label %bb1632 - -bb1632: ; preds = %bb1616 - br label %bb1669 - -bb1649: ; preds = %bb1616 - br label %bb1669 - -bb1669: ; preds = %bb1649, %bb1632 - %storemerge110 = add i32 %j295.0.reg2mem.0, 1 ; <i32> [#uses=2] - %tmp1672 = icmp sgt i32 %storemerge110, 0 ; <i1> [#uses=1] - br i1 %tmp1672, label %bb1678, label %bb1553 - -bb1678: ; preds = %bb1669 - ret %struct.LIST_NODE* null -} diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatchPHI.ll b/llvm/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatchPHI.ll deleted file mode 100644 index 6d6defa85de..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2008-02-13-LoopLatchPHI.ll +++ /dev/null @@ -1,74 +0,0 @@ -; RUN: opt < %s -loop-index-split -disable-output -; PR 2011 - %struct.CLAUSE_HELP = type { i32, i32, i32, i32, i32*, i32, %struct.LIST_NODE*, %struct.LIST_NODE*, i32, i32, %struct.LITERAL_HELP**, i32, i32, i32, i32 } - %struct.LIST_NODE = type { %struct.LIST_NODE*, i8* } - %struct.LITERAL_HELP = type { i32, i32, i32, %struct.CLAUSE_HELP*, %struct.term* } - %struct.anon = type { %struct.LIST_NODE* } - %struct.st = type { %struct.subst*, %struct.LIST_NODE*, %struct.LIST_NODE*, i16, i16 } - %struct.subst = type { %struct.subst*, i32, %struct.term* } - %struct.term = type { i32, %struct.anon, %struct.LIST_NODE*, i32, i32 } - -define fastcc %struct.LIST_NODE* @inf_HyperResolvents(%struct.CLAUSE_HELP* %Clause, %struct.subst* %Subst, %struct.LIST_NODE* %Restlits, i32 %GlobalMaxVar, %struct.LIST_NODE* %FoundMap, i32 %StrictlyMaximal, { %struct.st*, [3001 x %struct.term*], [4000 x %struct.term*], i32 }* %Index, i32* %Flags, i32* %Precedence) nounwind { -entry: - br i1 false, label %bb960, label %bb885 - -bb885: ; preds = %entry - ret %struct.LIST_NODE* null - -bb960: ; preds = %entry - br i1 false, label %bb1097, label %bb1005.preheader - -bb1005.preheader: ; preds = %bb960 - ret %struct.LIST_NODE* null - -bb1097: ; preds = %bb960 - br i1 false, label %bb1269.preheader, label %bb1141.preheader - -bb1141.preheader: ; preds = %bb1097 - ret %struct.LIST_NODE* null - -bb1269.preheader: ; preds = %bb1097 - br i1 false, label %bb1318, label %bb1281 - -bb1281: ; preds = %bb1269.preheader - ret %struct.LIST_NODE* null - -bb1318: ; preds = %bb1269.preheader - br i1 false, label %bb1459, label %bb.nph52 - -bb.nph52: ; preds = %bb1318 - ret %struct.LIST_NODE* null - -bb1459: ; preds = %bb1318 - br i1 false, label %bb1553, label %bb.nph62 - -bb.nph62: ; preds = %bb1459 - ret %struct.LIST_NODE* null - -bb1553: ; preds = %bb1669, %bb1459 - %j295.0.reg2mem.0 = phi i32 [ %storemerge110, %bb1669 ], [ 0, %bb1459 ] ; <i32> [#uses=2] - %Constraint403.2.reg2mem.0 = phi %struct.LIST_NODE* [ %Constraint403.1.reg2mem.0, %bb1669 ], [ null, %bb1459 ] ; <%struct.LIST_NODE*> [#uses=1] - br i1 false, label %bb1588, label %bb1616 - -bb1588: ; preds = %bb1553 - br label %bb1616 - -bb1616: ; preds = %bb1588, %bb1553 - %tmp1629 = icmp sgt i32 %j295.0.reg2mem.0, 0 ; <i1> [#uses=1] - br i1 %tmp1629, label %bb1649, label %bb1632 - -bb1632: ; preds = %bb1616 - br label %bb1669 - -bb1649: ; preds = %bb1616 - br label %bb1669 - -bb1669: ; preds = %bb1649, %bb1632 - %Constraint403.1.reg2mem.0 = phi %struct.LIST_NODE* [ null, %bb1632 ], [ %Constraint403.2.reg2mem.0, %bb1649 ] ; <%struct.LIST_NODE*> [#uses=1] - %storemerge110 = add i32 %j295.0.reg2mem.0, 1 ; <i32> [#uses=2] - %tmp1672 = icmp sgt i32 %storemerge110, 0 ; <i1> [#uses=1] - br i1 %tmp1672, label %bb1678, label %bb1553 - -bb1678: ; preds = %bb1669 - ret %struct.LIST_NODE* null -} diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-02-14-Crash.ll b/llvm/test/Transforms/LoopIndexSplit/2008-02-14-Crash.ll deleted file mode 100644 index f1a03e2f18a..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2008-02-14-Crash.ll +++ /dev/null @@ -1,464 +0,0 @@ -; RUN: opt < %s -loop-index-split -disable-output -; PR 2030 - %struct.FULL = type { i32, i32, [1000 x float*] } - -define i32 @matgen(%struct.FULL* %a, float** %x, float** %b, float** %bt, i32** %ipvt, i32 %test_case, i32 %scale) { -entry: - br i1 false, label %bb, label %entry.bb30_crit_edge - -entry.bb30_crit_edge: ; preds = %entry - br label %bb30 - -bb: ; preds = %entry - br label %bb14 - -bb6: ; preds = %bb14 - br label %bb14 - -bb14: ; preds = %bb6, %bb - br i1 false, label %bb6, label %bb22 - -bb22: ; preds = %bb14 - br label %bb30 - -bb30: ; preds = %bb22, %entry.bb30_crit_edge - switch i32 %test_case, label %bb648 [ - i32 1, label %bb30.bb32_crit_edge - i32 2, label %bb30.bb32_crit_edge1 - i32 3, label %bb30.bb32_crit_edge2 - i32 4, label %bb30.bb108_crit_edge - i32 5, label %bb30.bb108_crit_edge3 - i32 6, label %bb30.bb142_crit_edge - i32 7, label %bb30.bb142_crit_edge4 - i32 8, label %bb30.bb142_crit_edge5 - i32 9, label %bb234 - i32 10, label %bb292 - i32 11, label %bb353 - i32 12, label %bb419 - i32 13, label %bb485 - i32 14, label %bb567 - ] - -bb30.bb142_crit_edge5: ; preds = %bb30 - br label %bb142 - -bb30.bb142_crit_edge4: ; preds = %bb30 - br label %bb142 - -bb30.bb142_crit_edge: ; preds = %bb30 - br label %bb142 - -bb30.bb108_crit_edge3: ; preds = %bb30 - br label %bb108 - -bb30.bb108_crit_edge: ; preds = %bb30 - br label %bb108 - -bb30.bb32_crit_edge2: ; preds = %bb30 - br label %bb32 - -bb30.bb32_crit_edge1: ; preds = %bb30 - br label %bb32 - -bb30.bb32_crit_edge: ; preds = %bb30 - br label %bb32 - -bb32: ; preds = %bb30.bb32_crit_edge, %bb30.bb32_crit_edge1, %bb30.bb32_crit_edge2 - br i1 false, label %bb53, label %bb52 - -bb52: ; preds = %bb32 - br label %bb739 - -bb53: ; preds = %bb32 - br label %bb101 - -bb58: ; preds = %bb101 - br label %bb92 - -bb64: ; preds = %bb92 - br i1 false, label %bb64.bb87_crit_edge, label %bb72 - -bb64.bb87_crit_edge: ; preds = %bb64 - br label %bb87 - -bb72: ; preds = %bb64 - br i1 false, label %bb72.bb87_crit_edge, label %bb79 - -bb72.bb87_crit_edge: ; preds = %bb72 - br label %bb87 - -bb79: ; preds = %bb72 - br label %bb87 - -bb87: ; preds = %bb79, %bb72.bb87_crit_edge, %bb64.bb87_crit_edge - br label %bb92 - -bb92: ; preds = %bb87, %bb58 - br i1 false, label %bb64, label %bb98 - -bb98: ; preds = %bb92 - br label %bb101 - -bb101: ; preds = %bb98, %bb53 - br i1 false, label %bb58, label %bb107 - -bb107: ; preds = %bb101 - br label %bb651 - -bb108: ; preds = %bb30.bb108_crit_edge, %bb30.bb108_crit_edge3 - br i1 false, label %bb125, label %bb124 - -bb124: ; preds = %bb108 - br label %bb739 - -bb125: ; preds = %bb108 - br i1 false, label %bb138, label %bb139 - -bb138: ; preds = %bb125 - br label %bb140 - -bb139: ; preds = %bb125 - br label %bb140 - -bb140: ; preds = %bb139, %bb138 - br label %bb651 - -bb142: ; preds = %bb30.bb142_crit_edge, %bb30.bb142_crit_edge4, %bb30.bb142_crit_edge5 - br i1 false, label %bb161, label %bb160 - -bb160: ; preds = %bb142 - br label %bb739 - -bb161: ; preds = %bb142 - br i1 false, label %bb170, label %bb161.bb171_crit_edge - -bb161.bb171_crit_edge: ; preds = %bb161 - br label %bb171 - -bb170: ; preds = %bb161 - br label %bb171 - -bb171: ; preds = %bb170, %bb161.bb171_crit_edge - br i1 false, label %bb176, label %bb171.bb177_crit_edge - -bb171.bb177_crit_edge: ; preds = %bb171 - br label %bb177 - -bb176: ; preds = %bb171 - br label %bb177 - -bb177: ; preds = %bb176, %bb171.bb177_crit_edge - br label %bb227 - -bb178: ; preds = %bb227 - br label %bb218 - -bb184: ; preds = %bb218 - br i1 false, label %bb191, label %bb193 - -bb191: ; preds = %bb184 - br label %bb213 - -bb193: ; preds = %bb184 - br i1 false, label %bb200, label %bb203 - -bb200: ; preds = %bb193 - br label %bb213 - -bb203: ; preds = %bb193 - br i1 false, label %bb210, label %bb203.bb213_crit_edge - -bb203.bb213_crit_edge: ; preds = %bb203 - br label %bb213 - -bb210: ; preds = %bb203 - br label %bb213 - -bb213: ; preds = %bb210, %bb203.bb213_crit_edge, %bb200, %bb191 - br label %bb218 - -bb218: ; preds = %bb213, %bb178 - br i1 false, label %bb184, label %bb224 - -bb224: ; preds = %bb218 - br label %bb227 - -bb227: ; preds = %bb224, %bb177 - br i1 false, label %bb178, label %bb233 - -bb233: ; preds = %bb227 - br label %bb651 - -bb234: ; preds = %bb30 - br i1 false, label %bb253, label %bb252 - -bb252: ; preds = %bb234 - br label %bb739 - -bb253: ; preds = %bb234 - br label %bb285 - -bb258: ; preds = %bb285 - br label %bb276 - -bb264: ; preds = %bb276 - br label %bb276 - -bb276: ; preds = %bb264, %bb258 - br i1 false, label %bb264, label %bb282 - -bb282: ; preds = %bb276 - br label %bb285 - -bb285: ; preds = %bb282, %bb253 - br i1 false, label %bb258, label %bb291 - -bb291: ; preds = %bb285 - br label %bb651 - -bb292: ; preds = %bb30 - br i1 false, label %bb311, label %bb310 - -bb310: ; preds = %bb292 - br label %bb739 - -bb311: ; preds = %bb292 - br label %bb346 - -bb316: ; preds = %bb346 - br label %bb337 - -bb322: ; preds = %bb337 - br label %bb337 - -bb337: ; preds = %bb322, %bb316 - br i1 false, label %bb322, label %bb343 - -bb343: ; preds = %bb337 - br label %bb346 - -bb346: ; preds = %bb343, %bb311 - br i1 false, label %bb316, label %bb352 - -bb352: ; preds = %bb346 - br label %bb651 - -bb353: ; preds = %bb30 - br i1 false, label %bb372, label %bb371 - -bb371: ; preds = %bb353 - br label %bb739 - -bb372: ; preds = %bb353 - br label %bb412 - -bb377: ; preds = %bb412 - br label %bb403 - -bb383: ; preds = %bb403 - br i1 false, label %bb395, label %bb389 - -bb389: ; preds = %bb383 - br label %bb396 - -bb395: ; preds = %bb383 - br label %bb396 - -bb396: ; preds = %bb395, %bb389 - br label %bb403 - -bb403: ; preds = %bb396, %bb377 - br i1 false, label %bb383, label %bb409 - -bb409: ; preds = %bb403 - br label %bb412 - -bb412: ; preds = %bb409, %bb372 - br i1 false, label %bb377, label %bb418 - -bb418: ; preds = %bb412 - br label %bb651 - -bb419: ; preds = %bb30 - br i1 false, label %bb438, label %bb437 - -bb437: ; preds = %bb419 - br label %bb739 - -bb438: ; preds = %bb419 - br label %bb478 - -bb443: ; preds = %bb478 - br label %bb469 - -bb449: ; preds = %bb469 - br i1 false, label %bb461, label %bb455 - -bb455: ; preds = %bb449 - br label %bb462 - -bb461: ; preds = %bb449 - br label %bb462 - -bb462: ; preds = %bb461, %bb455 - br label %bb469 - -bb469: ; preds = %bb462, %bb443 - br i1 false, label %bb449, label %bb475 - -bb475: ; preds = %bb469 - br label %bb478 - -bb478: ; preds = %bb475, %bb438 - br i1 false, label %bb443, label %bb484 - -bb484: ; preds = %bb478 - br label %bb651 - -bb485: ; preds = %bb30 - br i1 false, label %bb504, label %bb503 - -bb503: ; preds = %bb485 - br label %bb739 - -bb504: ; preds = %bb485 - br label %bb560 - -bb513: ; preds = %bb560 - br label %bb551 - -bb519: ; preds = %bb551 - br i1 false, label %bb528, label %bb532 - -bb528: ; preds = %bb519 - br label %bb536 - -bb532: ; preds = %bb519 - br label %bb536 - -bb536: ; preds = %bb532, %bb528 - br label %bb551 - -bb551: ; preds = %bb536, %bb513 - br i1 false, label %bb519, label %bb557 - -bb557: ; preds = %bb551 - br label %bb560 - -bb560: ; preds = %bb557, %bb504 - br i1 false, label %bb513, label %bb566 - -bb566: ; preds = %bb560 - br label %bb651 - -bb567: ; preds = %bb30 - br i1 false, label %bb586, label %bb585 - -bb585: ; preds = %bb567 - br label %bb739 - -bb586: ; preds = %bb567 - br label %bb641 - -bb595: ; preds = %bb641 - br label %bb632 - -bb601: ; preds = %bb632 - %tmp604 = icmp sgt i32 %i.7, 0 ; <i1> [#uses=1] - br i1 %tmp604, label %bb607, label %bb611 - -bb607: ; preds = %bb601 - br label %bb615 - -bb611: ; preds = %bb601 - br label %bb615 - -bb615: ; preds = %bb611, %bb607 - %tmp629 = add i32 %i.7, 1 ; <i32> [#uses=1] - %tmp631 = getelementptr float* %col.7, i32 1 ; <float*> [#uses=1] - br label %bb632 - -bb632: ; preds = %bb615, %bb595 - %col.7 = phi float* [ null, %bb595 ], [ %tmp631, %bb615 ] ; <float*> [#uses=1] - %i.7 = phi i32 [ 0, %bb595 ], [ %tmp629, %bb615 ] ; <i32> [#uses=3] - %tmp635 = icmp slt i32 %i.7, 0 ; <i1> [#uses=1] - br i1 %tmp635, label %bb601, label %bb638 - -bb638: ; preds = %bb632 - br label %bb641 - -bb641: ; preds = %bb638, %bb586 - br i1 false, label %bb595, label %bb647 - -bb647: ; preds = %bb641 - br label %bb651 - -bb648: ; preds = %bb30 - br label %bb739 - -bb651: ; preds = %bb647, %bb566, %bb484, %bb418, %bb352, %bb291, %bb233, %bb140, %bb107 - br i1 false, label %bb658, label %bb651.bb661_crit_edge - -bb651.bb661_crit_edge: ; preds = %bb651 - br label %bb661 - -bb658: ; preds = %bb651 - br label %bb661 - -bb661: ; preds = %bb658, %bb651.bb661_crit_edge - br i1 false, label %bb666, label %bb661.bb686_crit_edge - -bb661.bb686_crit_edge: ; preds = %bb661 - br label %bb686 - -bb666: ; preds = %bb661 - br label %bb680 - -bb670: ; preds = %bb680 - br label %bb680 - -bb680: ; preds = %bb670, %bb666 - br i1 false, label %bb670, label %bb680.bb686_crit_edge - -bb680.bb686_crit_edge: ; preds = %bb680 - br label %bb686 - -bb686: ; preds = %bb680.bb686_crit_edge, %bb661.bb686_crit_edge - br i1 false, label %bb699, label %bb696 - -bb696: ; preds = %bb686 - br label %bb739 - -bb699: ; preds = %bb686 - br i1 false, label %bb712, label %bb709 - -bb709: ; preds = %bb699 - br label %bb739 - -bb712: ; preds = %bb699 - br i1 false, label %bb717, label %bb712.bb720_crit_edge - -bb712.bb720_crit_edge: ; preds = %bb712 - br label %bb720 - -bb717: ; preds = %bb712 - br label %bb720 - -bb720: ; preds = %bb717, %bb712.bb720_crit_edge - br i1 false, label %bb725, label %bb720.bb738_crit_edge - -bb720.bb738_crit_edge: ; preds = %bb720 - br label %bb738 - -bb725: ; preds = %bb720 - br label %bb738 - -bb738: ; preds = %bb725, %bb720.bb738_crit_edge - br label %bb739 - -bb739: ; preds = %bb738, %bb709, %bb696, %bb648, %bb585, %bb503, %bb437, %bb371, %bb310, %bb252, %bb160, %bb124, %bb52 - br label %return - -return: ; preds = %bb739 - ret i32 0 -} diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-03-24-ExitPhi.ll b/llvm/test/Transforms/LoopIndexSplit/2008-03-24-ExitPhi.ll deleted file mode 100644 index ca22e50eadf..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2008-03-24-ExitPhi.ll +++ /dev/null @@ -1,69 +0,0 @@ -; RUN: opt < %s -loop-index-split -disable-output -; Handle Exit block phis that do not have any use inside the loop. - - %struct.ATOM = type { double, double, double, double, double, double, i32, double, double, double, double, i8*, i8, [9 x i8], double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, [200 x i8*], [32 x i8*], [32 x i8], i32 } - %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } - %struct.__sFILEX = type opaque - %struct.__sbuf = type { i8*, i32 } - -define i32 @math([80 x i8]* %tokens, double* %fvalue, i32* %ivalue, %struct.FILE* %ip, %struct.FILE* %op, i32 %echo) nounwind { -entry: - br i1 false, label %bb.i, label %bb35.i -bb.i: ; preds = %entry - br i1 false, label %bb6.i, label %bb9.i -bb9.i: ; preds = %bb.i - ret i32 0 -bb35.i: ; preds = %entry - ret i32 0 -bb6.i: ; preds = %bb.i - br i1 false, label %a_l2_f.exit, label %bb16.i -bb16.i: ; preds = %bb6.i - ret i32 0 -a_l2_f.exit: ; preds = %bb6.i - br i1 false, label %bb7.i97, label %bb6.i71 -bb6.i71: ; preds = %a_l2_f.exit - ret i32 0 -bb7.i97: ; preds = %a_l2_f.exit - br i1 false, label %bb, label %bb18.i102 -bb18.i102: ; preds = %bb7.i97 - ret i32 0 -bb: ; preds = %bb7.i97 - br i1 false, label %bb38, label %AFOUND -bb38: ; preds = %bb - br i1 false, label %bb111, label %bb7.i120 -AFOUND: ; preds = %bb - ret i32 0 -bb7.i120: ; preds = %bb38 - ret i32 0 -bb111: ; preds = %bb38 - switch i32 0, label %bb574 [ - i32 1, label %bb158 - i32 0, label %bb166 - ] -bb158: ; preds = %bb111 - ret i32 0 -bb166: ; preds = %bb111 - ret i32 0 -bb574: ; preds = %bb111 - br i1 false, label %bb11.i249, label %bb600 -bb11.i249: ; preds = %bb574 - br i1 false, label %bb11.i265, label %bb596 -bb11.i265: ; preds = %bb590, %bb11.i249 - %i.1.reg2mem.0 = phi i32 [ %tmp589.reg2mem.0, %bb590 ], [ 0, %bb11.i249 ] ; <i32> [#uses=2] - %tmp13.i264 = icmp slt i32 %i.1.reg2mem.0, 1 ; <i1> [#uses=1] - br i1 %tmp13.i264, label %bb16.i267, label %bb30.i279 -bb16.i267: ; preds = %bb11.i265 - br label %bb590 -bb30.i279: ; preds = %bb11.i265 - br label %bb590 -bb590: ; preds = %bb30.i279, %bb16.i267 - %tmp5876282.reg2mem.0 = phi %struct.ATOM* [ null, %bb30.i279 ], [ null, %bb16.i267 ] ; <%struct.ATOM*> [#uses=1] - %tmp589.reg2mem.0 = add i32 %i.1.reg2mem.0, 1 ; <i32> [#uses=2] - %tmp593 = icmp slt i32 %tmp589.reg2mem.0, 0 ; <i1> [#uses=1] - br i1 %tmp593, label %bb11.i265, label %bb596 -bb596: ; preds = %bb590, %bb11.i249 - %ap.0.reg2mem.0 = phi %struct.ATOM* [ null, %bb11.i249 ], [ %tmp5876282.reg2mem.0, %bb590 ] ; <%struct.ATOM*> [#uses=0] - ret i32 0 -bb600: ; preds = %bb574 - ret i32 0 -} diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-05-19-IndVar.ll b/llvm/test/Transforms/LoopIndexSplit/2008-05-19-IndVar.ll deleted file mode 100644 index 7447e6d4d4f..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2008-05-19-IndVar.ll +++ /dev/null @@ -1,40 +0,0 @@ -; RUN: opt < %s -loop-index-split -stats -disable-output | not grep "loop-index-split" -;PR2294 -@g_2 = external global i16 ; <i16*> [#uses=4] -@g_5 = external global i32 ; <i32*> [#uses=1] -@.str = external constant [4 x i8] ; <[4 x i8]*> [#uses=1] - -declare void @func_1() nounwind - -define i32 @main() nounwind { -entry: - %tmp101.i = load i16* @g_2, align 2 ; <i16> [#uses=1] - %tmp112.i = icmp sgt i16 %tmp101.i, 0 ; <i1> [#uses=1] - br i1 %tmp112.i, label %bb.preheader.i, label %func_1.exit -bb.preheader.i: ; preds = %entry - %g_2.promoted.i = load i16* @g_2 ; <i16> [#uses=1] - br label %bb.i -bb.i: ; preds = %bb6.i, %bb.preheader.i - %g_2.tmp.0.i = phi i16 [ %g_2.promoted.i, %bb.preheader.i ], [ %tmp8.i, %bb6.i ] ; <i16> [#uses=2] - %tmp2.i = icmp eq i16 %g_2.tmp.0.i, 0 ; <i1> [#uses=1] - br i1 %tmp2.i, label %bb4.i, label %bb6.i -bb4.i: ; preds = %bb.i - %tmp5.i = volatile load i32* @g_5, align 4 ; <i32> [#uses=0] - br label %bb6.i -bb6.i: ; preds = %bb4.i, %bb.i - %tmp8.i = add i16 %g_2.tmp.0.i, 1 ; <i16> [#uses=3] - %tmp11.i = icmp sgt i16 %tmp8.i, 42 ; <i1> [#uses=1] - br i1 %tmp11.i, label %bb.i, label %return.loopexit.i -return.loopexit.i: ; preds = %bb6.i - %tmp8.i.lcssa = phi i16 [ %tmp8.i, %bb6.i ] ; <i16> [#uses=1] - store i16 %tmp8.i.lcssa, i16* @g_2 - br label %func_1.exit -func_1.exit: ; preds = %return.loopexit.i, %entry - %tmp1 = load i16* @g_2, align 2 ; <i16> [#uses=1] - %tmp12 = sext i16 %tmp1 to i32 ; <i32> [#uses=1] - %tmp3 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i32 %tmp12 ) nounwind ; <i32> [#uses=0] - ret i32 0 -} - -declare i32 @printf(i8*, ...) nounwind - diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-06-03-DomFrontier.ll b/llvm/test/Transforms/LoopIndexSplit/2008-06-03-DomFrontier.ll deleted file mode 100644 index 6f691de537b..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2008-06-03-DomFrontier.ll +++ /dev/null @@ -1,32 +0,0 @@ -; RUN: opt < %s -loop-rotate -loop-unswitch -loop-index-split -instcombine -disable-output -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i386-apple-darwin9" - %struct.__CFData = type opaque - %struct.__CFString = type opaque - -define %struct.__CFData* @WirelessCreatePSK(%struct.__CFString* %inPassphrase, %struct.__CFData* %inSSID) nounwind { -entry: - br label %bb52 - -bb52: ; preds = %bb142, %bb52, %entry - br i1 false, label %bb142, label %bb52 - -bb63: ; preds = %bb142, %bb131 - %t.0.reg2mem.0 = phi i32 [ %tmp133, %bb131 ], [ 0, %bb142 ] ; <i32> [#uses=2] - %tmp65 = icmp ult i32 %t.0.reg2mem.0, 16 ; <i1> [#uses=1] - br i1 %tmp65, label %bb68, label %bb89 - -bb68: ; preds = %bb63 - br label %bb131 - -bb89: ; preds = %bb63 - br label %bb131 - -bb131: ; preds = %bb89, %bb68 - %tmp133 = add i32 %t.0.reg2mem.0, 1 ; <i32> [#uses=2] - %tmp136 = icmp ult i32 %tmp133, 80 ; <i1> [#uses=1] - br i1 %tmp136, label %bb63, label %bb142 - -bb142: ; preds = %bb131, %bb52 - br i1 undef, label %bb63, label %bb52 -} diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-07-08-MisCompilation.ll b/llvm/test/Transforms/LoopIndexSplit/2008-07-08-MisCompilation.ll deleted file mode 100644 index 1fcd960e051..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2008-07-08-MisCompilation.ll +++ /dev/null @@ -1,25 +0,0 @@ -; RUN: opt < %s -loop-index-split -stats -disable-output | not grep "1 loop-index-split" -; PR 2487 -@g_6 = external global i32 ; <i32*> [#uses=1] - -define void @func_1() nounwind { -entry: - br label %bb - -bb: ; preds = %bb4, %entry - %l_3.0 = phi i8 [ 0, %entry ], [ %tmp6, %bb4 ] ; <i8> [#uses=2] - %tmp1 = icmp eq i8 %l_3.0, 0 ; <i1> [#uses=1] - br i1 %tmp1, label %bb3, label %bb4 - -bb3: ; preds = %bb - store i32 1, i32* @g_6, align 4 - br label %bb4 - -bb4: ; preds = %bb3, %bb - %tmp6 = add i8 %l_3.0, 1 ; <i8> [#uses=2] - %tmp9 = icmp sgt i8 %tmp6, -1 ; <i1> [#uses=1] - br i1 %tmp9, label %bb, label %return - -return: ; preds = %bb4 - ret void -} diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-09-17-IVUse.ll b/llvm/test/Transforms/LoopIndexSplit/2008-09-17-IVUse.ll deleted file mode 100644 index ee8e7a3eb86..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2008-09-17-IVUse.ll +++ /dev/null @@ -1,78 +0,0 @@ -; RUN: opt < %s -loop-index-split -stats -disable-output | not grep "loop-index-split" -; PR 2791 -@g_40 = common global i32 0 ; <i32*> [#uses=1] -@g_192 = common global i32 0 ; <i32*> [#uses=2] -@"\01LC" = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] - -define void @func_29() nounwind { -entry: - %0 = load i32* @g_40, align 4 ; <i32> [#uses=1] - %1 = icmp eq i32 %0, 0 ; <i1> [#uses=1] - %g_192.promoted = load i32* @g_192 ; <i32> [#uses=0] - br i1 %1, label %entry.split.us, label %entry.split - -entry.split.us: ; preds = %entry - br label %bb.us - -bb.us: ; preds = %bb5.us, %entry.split.us - %i.0.reg2mem.0.us = phi i32 [ 0, %entry.split.us ], [ %3, %bb5.us ] ; <i32> [#uses=2] - %2 = icmp eq i32 %i.0.reg2mem.0.us, 0 ; <i1> [#uses=1] - br i1 %2, label %bb1.us, label %bb5.us - -bb5.us: ; preds = %bb1.us, %bb4.us, %bb.us - %iftmp.0.0.us = phi i32 [ 0, %bb4.us ], [ 1, %bb.us ], [ 1, %bb1.us ] ; <i32> [#uses=1] - %3 = add i32 %i.0.reg2mem.0.us, 1 ; <i32> [#uses=3] - %4 = icmp ult i32 %3, 10 ; <i1> [#uses=1] - br i1 %4, label %bb.us, label %bb8.us - -bb4.us: ; preds = %bb1.us - br label %bb5.us - -bb1.us: ; preds = %bb.us - br i1 true, label %bb4.us, label %bb5.us - -bb8.us: ; preds = %bb5.us - %iftmp.0.0.lcssa.us = phi i32 [ %iftmp.0.0.us, %bb5.us ] ; <i32> [#uses=1] - %.lcssa.us = phi i32 [ %3, %bb5.us ] ; <i32> [#uses=1] - br label %bb8.split - -entry.split: ; preds = %entry - br label %bb - -bb: ; preds = %bb5, %entry.split - %i.0.reg2mem.0 = phi i32 [ 0, %entry.split ], [ %6, %bb5 ] ; <i32> [#uses=2] - %5 = icmp eq i32 %i.0.reg2mem.0, 0 ; <i1> [#uses=1] - br i1 %5, label %bb1, label %bb5 - -bb1: ; preds = %bb - br i1 false, label %bb4, label %bb5 - -bb4: ; preds = %bb1 - br label %bb5 - -bb5: ; preds = %bb1, %bb, %bb4 - %iftmp.0.0 = phi i32 [ 0, %bb4 ], [ 1, %bb ], [ 1, %bb1 ] ; <i32> [#uses=1] - %6 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=3] - %7 = icmp ult i32 %6, 10 ; <i1> [#uses=1] - br i1 %7, label %bb, label %bb8 - -bb8: ; preds = %bb5 - %iftmp.0.0.lcssa = phi i32 [ %iftmp.0.0, %bb5 ] ; <i32> [#uses=1] - %.lcssa = phi i32 [ %6, %bb5 ] ; <i32> [#uses=1] - br label %bb8.split - -bb8.split: ; preds = %bb8.us, %bb8 - %iftmp.0.0.lcssa.us-lcssa = phi i32 [ %iftmp.0.0.lcssa, %bb8 ], [ %iftmp.0.0.lcssa.us, %bb8.us ] ; <i32> [#uses=1] - %.lcssa.us-lcssa = phi i32 [ %.lcssa, %bb8 ], [ %.lcssa.us, %bb8.us ] ; <i32> [#uses=1] - store i32 %iftmp.0.0.lcssa.us-lcssa, i32* @g_192 - %8 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), i32 %.lcssa.us-lcssa ) nounwind ; <i32> [#uses=0] - ret void -} - -declare i32 @printf(i8*, ...) nounwind - -define i32 @main() nounwind { -entry: - call void @func_29( ) nounwind - ret i32 0 -} diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-09-20-Crash.ll b/llvm/test/Transforms/LoopIndexSplit/2008-09-20-Crash.ll deleted file mode 100644 index ef677369cc4..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2008-09-20-Crash.ll +++ /dev/null @@ -1,38 +0,0 @@ -; RUN: opt < %s -loop-index-split -disable-output -; PR 2805 -@g_330 = common global i32 0 ; <i32*> [#uses=1] - -define i32 @func_45(i32 %p_47) nounwind { -entry: - br label %bb - -bb: ; preds = %bb3, %entry - %p_47_addr.0.reg2mem.0 = phi i32 [ 0, %entry ], [ %2, %bb3 ] ; <i32> [#uses=2] - %0 = icmp eq i32 %p_47_addr.0.reg2mem.0, 0 ; <i1> [#uses=1] - br i1 %0, label %bb2, label %bb1 - -bb1: ; preds = %bb - %1 = tail call i32 (...)* @func_70( i32 1 ) nounwind ; <i32> [#uses=0] - br label %bb3 - -bb2: ; preds = %bb - store i32 1, i32* @g_330, align 4 - br label %bb3 - -bb3: ; preds = %bb2, %bb1 - %2 = add i32 %p_47_addr.0.reg2mem.0, 1 ; <i32> [#uses=3] - %3 = icmp ult i32 %2, 22 ; <i1> [#uses=1] - br i1 %3, label %bb, label %bb6 - -bb6: ; preds = %bb3 - %.lcssa = phi i32 [ %2, %bb3 ] ; <i32> [#uses=1] - %4 = tail call i32 (...)* @func_95( i32 %.lcssa ) nounwind ; <i32> [#uses=1] - %5 = tail call i32 (...)* @func_56( i32 %4 ) nounwind ; <i32> [#uses=0] - ret i32 undef -} - -declare i32 @func_70(...) - -declare i32 @func_95(...) - -declare i32 @func_56(...) diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-10-06-Crash.ll b/llvm/test/Transforms/LoopIndexSplit/2008-10-06-Crash.ll deleted file mode 100644 index cca54adb195..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2008-10-06-Crash.ll +++ /dev/null @@ -1,31 +0,0 @@ -; RUN: opt < %s -loop-index-split -disable-output - %struct.RExC_state_t = type { i32, i8*, %struct.regexp*, i8*, i8*, i8*, i32, %struct.regnode*, %struct.regnode*, i32, i32, i32, i32, i32, i32, i32, i32, i32 } - %struct.SV = type { i8*, i32, i32 } - %struct.reg_data = type { i32, i8*, [1 x i8*] } - %struct.reg_substr_data = type { [3 x %struct.reg_substr_datum] } - %struct.reg_substr_datum = type { i32, i32, %struct.SV*, %struct.SV* } - %struct.regexp = type { i32*, i32*, %struct.regnode*, %struct.reg_substr_data*, i8*, %struct.reg_data*, i8*, i32*, i32, i32, i32, i32, i32, i32, i32, i32, [1 x %struct.regnode] } - %struct.regnode = type { i8, i8, i16 } - -define fastcc %struct.regnode* @S_regclass(%struct.RExC_state_t* %pRExC_state) nounwind { -entry: - br label %bb439 - -bb439: ; preds = %bb444, %entry - %value23.16.reg2mem.0 = phi i32 [ %3, %bb444 ], [ 0, %entry ] ; <i32> [#uses=3] - %0 = icmp ugt i32 %value23.16.reg2mem.0, 31 ; <i1> [#uses=1] - %1 = icmp ne i32 %value23.16.reg2mem.0, 127 ; <i1> [#uses=1] - %2 = and i1 %0, %1 ; <i1> [#uses=1] - br i1 %2, label %bb443, label %bb444 - -bb443: ; preds = %bb439 - br label %bb444 - -bb444: ; preds = %bb443, %bb439 - %3 = add i32 %value23.16.reg2mem.0, 1 ; <i32> [#uses=2] - %4 = icmp ugt i32 %3, 255 ; <i1> [#uses=1] - br i1 %4, label %bb675, label %bb439 - -bb675: ; preds = %bb444 - unreachable -} diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-10-10-OneIteration.ll b/llvm/test/Transforms/LoopIndexSplit/2008-10-10-OneIteration.ll deleted file mode 100644 index 372fee51a09..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2008-10-10-OneIteration.ll +++ /dev/null @@ -1,66 +0,0 @@ -; RUN: opt < %s -loop-index-split -stats -disable-output |& grep "1 loop-index-split" -; PR 2869 - -@w = external global [2 x [2 x i32]] ; <[2 x [2 x i32]]*> [#uses=5] - -declare i32 @f() nounwind - -define i32 @main() noreturn nounwind { -entry: - br label %bb1.i.outer - -bb1.i.outer: ; preds = %bb5.i, %entry - %i.0.reg2mem.0.ph.i.ph = phi i32 [ 0, %entry ], [ %indvar.next1, %bb5.i ] ; <i32> [#uses=3] - br label %bb1.i - -bb1.i: ; preds = %bb3.i, %bb1.i.outer - %j.0.reg2mem.0.i = phi i32 [ 0, %bb1.i.outer ], [ %indvar.next, %bb3.i ] ; <i32> [#uses=3] - %0 = icmp eq i32 %i.0.reg2mem.0.ph.i.ph, %j.0.reg2mem.0.i ; <i1> [#uses=1] - br i1 %0, label %bb2.i, label %bb3.i - -bb2.i: ; preds = %bb1.i - %1 = getelementptr [2 x [2 x i32]]* @w, i32 0, i32 %i.0.reg2mem.0.ph.i.ph, i32 %j.0.reg2mem.0.i ; <i32*> [#uses=1] - store i32 1, i32* %1, align 4 - br label %bb3.i - -bb3.i: ; preds = %bb2.i, %bb1.i - %indvar.next = add i32 %j.0.reg2mem.0.i, 1 ; <i32> [#uses=2] - %exitcond = icmp eq i32 %indvar.next, 2 ; <i1> [#uses=1] - br i1 %exitcond, label %bb5.i, label %bb1.i - -bb5.i: ; preds = %bb3.i - %indvar.next1 = add i32 %i.0.reg2mem.0.ph.i.ph, 1 ; <i32> [#uses=2] - %exitcond2 = icmp eq i32 %indvar.next1, 2 ; <i1> [#uses=1] - br i1 %exitcond2, label %f.exit, label %bb1.i.outer - -f.exit: ; preds = %bb5.i - %2 = load i32* getelementptr ([2 x [2 x i32]]* @w, i32 0, i32 0, i32 0), align 4 ; <i32> [#uses=1] - %3 = icmp eq i32 %2, 1 ; <i1> [#uses=1] - br i1 %3, label %bb, label %bb3 - -bb: ; preds = %f.exit - %4 = load i32* getelementptr ([2 x [2 x i32]]* @w, i32 0, i32 1, i32 1), align 4 ; <i32> [#uses=1] - %5 = icmp eq i32 %4, 1 ; <i1> [#uses=1] - br i1 %5, label %bb1, label %bb3 - -bb1: ; preds = %bb - %6 = load i32* getelementptr ([2 x [2 x i32]]* @w, i32 0, i32 1, i32 0), align 4 ; <i32> [#uses=1] - %7 = icmp eq i32 %6, 0 ; <i1> [#uses=1] - br i1 %7, label %bb2, label %bb3 - -bb2: ; preds = %bb1 - %8 = load i32* getelementptr ([2 x [2 x i32]]* @w, i32 0, i32 0, i32 1), align 4 ; <i32> [#uses=1] - %9 = icmp eq i32 %8, 0 ; <i1> [#uses=1] - br i1 %9, label %bb4, label %bb3 - -bb3: ; preds = %bb2, %bb1, %bb, %f.exit - tail call void @abort() noreturn nounwind - unreachable - -bb4: ; preds = %bb2 - ret i32 0 -} - -declare void @abort() noreturn nounwind - -declare void @exit(i32) noreturn nounwind diff --git a/llvm/test/Transforms/LoopIndexSplit/2008-11-10-Sign.ll b/llvm/test/Transforms/LoopIndexSplit/2008-11-10-Sign.ll deleted file mode 100644 index 217ff52bb2c..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2008-11-10-Sign.ll +++ /dev/null @@ -1,69 +0,0 @@ -; RUN: opt < %s -loop-index-split -stats | not grep "loop-index-split" -; PR3029 - -@g_138 = common global i32 0 ; <i32*> [#uses=3] -@g_188 = common global i32 0 ; <i32*> [#uses=4] -@g_207 = common global i32 0 ; <i32*> [#uses=3] -@"\01LC" = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] -@g_102 = common global i32 0 ; <i32*> [#uses=0] - -define i32 @func_119() nounwind { -entry: - %0 = volatile load i32* @g_138, align 4 ; <i32> [#uses=1] - ret i32 %0 -} - -define void @func_110(i32 %p_111) nounwind { -entry: - %0 = load i32* @g_188, align 4 ; <i32> [#uses=1] - %1 = icmp ugt i32 %0, -1572397472 ; <i1> [#uses=1] - br i1 %1, label %bb, label %bb1 - -bb: ; preds = %entry - %2 = volatile load i32* @g_138, align 4 ; <i32> [#uses=0] - ret void - -bb1: ; preds = %entry - store i32 1, i32* @g_207, align 4 - ret void -} - -define void @func_34() nounwind { -entry: - store i32 0, i32* @g_188 - %g_188.promoted = load i32* @g_188 ; <i32> [#uses=1] - br label %bb - -bb: ; preds = %func_110.exit, %entry - %g_188.tmp.0 = phi i32 [ %g_188.promoted, %entry ], [ %2, %func_110.exit ] ; <i32> [#uses=2] - %0 = icmp ugt i32 %g_188.tmp.0, -1572397472 ; <i1> [#uses=1] - br i1 %0, label %bb.i, label %bb1.i - -bb.i: ; preds = %bb - %1 = volatile load i32* @g_138, align 4 ; <i32> [#uses=0] - br label %func_110.exit - -bb1.i: ; preds = %bb - store i32 1, i32* @g_207, align 4 - br label %func_110.exit - -func_110.exit: ; preds = %bb.i, %bb1.i - %2 = add i32 %g_188.tmp.0, 1 ; <i32> [#uses=3] - %3 = icmp sgt i32 %2, 1 ; <i1> [#uses=1] - br i1 %3, label %return, label %bb - -return: ; preds = %func_110.exit - %.lcssa = phi i32 [ %2, %func_110.exit ] ; <i32> [#uses=1] - store i32 %.lcssa, i32* @g_188 - ret void -} - -define i32 @main() nounwind { -entry: - call void @func_34() nounwind - %0 = load i32* @g_207, align 4 ; <i32> [#uses=1] - %1 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), i32 %0) nounwind ; <i32> [#uses=0] - ret i32 0 -} - -declare i32 @printf(i8*, ...) nounwind diff --git a/llvm/test/Transforms/LoopIndexSplit/2009-03-02-UpdateIterationSpace-crash.ll b/llvm/test/Transforms/LoopIndexSplit/2009-03-02-UpdateIterationSpace-crash.ll deleted file mode 100644 index 9acf3915c0a..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2009-03-02-UpdateIterationSpace-crash.ll +++ /dev/null @@ -1,64 +0,0 @@ -; RUN: opt < %s -loop-index-split -disable-output - %struct.CGPoint = type { double, double } - %struct.IBCFMutableDictionary = type { %struct.NSMutableArray, %struct.__CFDictionary*, %struct.NSSortDescriptor*, %struct.NSSortDescriptor* } - %struct.IBInspectorMode = type opaque - %struct.IBInspectorModeView = type { %struct.NSView, %struct.NSArray*, %struct.IBCFMutableDictionary*, %struct.IBInspectorMode*, %struct.IBInspectorMode*, %struct.IBInspectorMode*, %struct.objc_selector*, %struct.NSObject* } - %struct.NSArray = type { %struct.NSObject } - %struct.NSImage = type { %struct.NSObject, %struct.NSArray*, %struct.CGPoint, %struct.__imageFlags, %struct.NSObject*, %struct._NSImageAuxiliary* } - %struct.NSMutableArray = type { %struct.NSArray } - %struct.NSObject = type { %struct.objc_class* } - %struct.NSRect = type { %struct.CGPoint, %struct.CGPoint } - %struct.NSResponder = type { %struct.NSObject, %struct.NSObject* } - %struct.NSSortDescriptor = type { %struct.NSObject, i64, %struct.NSArray*, %struct.objc_selector*, %struct.NSObject* } - %struct.NSURL = type { %struct.NSObject, %struct.NSArray*, %struct.NSURL*, i8*, i8* } - %struct.NSView = type { %struct.NSResponder, %struct.NSRect, %struct.NSRect, %struct.NSObject*, %struct.NSObject*, %struct.NSWindow*, %struct.NSObject*, %struct.NSObject*, %struct.NSObject*, %struct.NSObject*, %struct._NSViewAuxiliary*, %struct._VFlags, %struct.__VFlags2 } - %struct.NSWindow = type { %struct.NSResponder, %struct.NSRect, %struct.NSObject*, %struct.NSObject*, %struct.NSResponder*, %struct.NSView*, %struct.NSView*, %struct.NSObject*, %struct.NSObject*, i32, i64, i32, %struct.NSArray*, %struct.NSObject*, i8, i8, i8, i8, i8*, i8*, %struct.NSImage*, i32, %struct.NSMutableArray*, %struct.NSURL*, %struct.CGPoint*, %struct.NSArray*, %struct.NSArray*, %struct.__wFlags, %struct.NSObject*, %struct.NSView*, %struct.NSWindowAuxiliary* } - %struct.NSWindowAuxiliary = type opaque - %struct._NSImageAuxiliary = type opaque - %struct._NSViewAuxiliary = type opaque - %struct._VFlags = type <{ i8, i8, i8, i8 }> - %struct.__CFDictionary = type opaque - %struct.__VFlags2 = type <{ i32 }> - %struct.__imageFlags = type <{ i8, [3 x i8] }> - %struct.__wFlags = type <{ i8, i8, i8, i8, i8, i8, i8, i8 }> - %struct.objc_class = type opaque - %struct.objc_selector = type opaque - -define %struct.NSArray* @"\01-[IBInspectorModeView calculateModeRects]"(%struct.IBInspectorModeView* %self, %struct.objc_selector* %_cmd) optsize ssp { -entry: - br i1 false, label %bb7, label %bb - -bb: ; preds = %entry - br i1 false, label %bb.nph, label %bb7.loopexit - -bb.nph: ; preds = %bb - br label %bb1 - -bb1: ; preds = %bb6, %bb.nph - %midx.01 = phi i64 [ %3, %bb6 ], [ 0, %bb.nph ] ; <i64> [#uses=3] - %0 = icmp sge i64 %midx.01, 0 ; <i1> [#uses=1] - %1 = icmp sle i64 %midx.01, 0 ; <i1> [#uses=1] - %2 = and i1 %0, %1 ; <i1> [#uses=1] - br i1 %2, label %bb4, label %bb5 - -bb4: ; preds = %bb1 - br label %bb5 - -bb5: ; preds = %bb4, %bb1 - %modeWidth.0 = phi double [ 0.000000e+00, %bb1 ], [ 0.000000e+00, %bb4 ] ; <double> [#uses=0] - %3 = add i64 %midx.01, 1 ; <i64> [#uses=1] - br label %bb6 - -bb6: ; preds = %bb5 - %4 = icmp slt i64 0, 0 ; <i1> [#uses=1] - br i1 %4, label %bb1, label %bb6.bb7.loopexit_crit_edge - -bb6.bb7.loopexit_crit_edge: ; preds = %bb6 - br label %bb7.loopexit - -bb7.loopexit: ; preds = %bb6.bb7.loopexit_crit_edge, %bb - br label %bb7 - -bb7: ; preds = %bb7.loopexit, %entry - ret %struct.NSArray* null -} diff --git a/llvm/test/Transforms/LoopIndexSplit/2009-03-30-undef.ll b/llvm/test/Transforms/LoopIndexSplit/2009-03-30-undef.ll deleted file mode 100644 index deef9412897..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/2009-03-30-undef.ll +++ /dev/null @@ -1,24 +0,0 @@ -; RUN: opt < %s -loop-index-split -S | not grep undef -define i32 @main() { -entry: - br label %header - -header: - %r = phi i32 [ 0, %entry ], [ %r3, %skip ] - %i = phi i32 [ 0, %entry ], [ %i1, %skip ] - %i99 = add i32 %i, 99 - %cond = icmp eq i32 %i99, 3 - br i1 %cond, label %body, label %skip - -body: - br label %skip - -skip: - %r3 = phi i32 [ %r, %header ], [ 3, %body ] - %i1 = add i32 %i, 1 - %exitcond = icmp eq i32 %i1, 10 - br i1 %exitcond, label %exit, label %header - -exit: - ret i32 %r3 -} diff --git a/llvm/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll b/llvm/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll deleted file mode 100644 index ad2b794218c..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll +++ /dev/null @@ -1,52 +0,0 @@ -; RUN: opt < %s -loop-index-split -disable-output - - %struct._edit_script = type { %struct._edit_script*, i32, i8 } - -define void @align_path(i8* %seq1, i8* %seq2, i32 %i1, i32 %j1, i32 %i2, i32 %j2, i32 %dist, %struct._edit_script** %head, %struct._edit_script** %tail, i32 %M, i32 %N) { -entry: - br label %bb354 - -bb354: ; preds = %bb511, %entry - br i1 false, label %bb495, label %bb368 - -bb368: ; preds = %bb354 - ret void - -bb495: ; preds = %bb495, %bb354 - br i1 false, label %bb511, label %bb495 - -bb511: ; preds = %bb495 - br i1 false, label %xmalloc.exit69, label %bb354 - -xmalloc.exit69: ; preds = %bb511 - br i1 false, label %bb556, label %bb542.preheader - -bb542.preheader: ; preds = %xmalloc.exit69 - ret void - -bb556: ; preds = %xmalloc.exit69 - br label %bb583 - -bb583: ; preds = %cond_next693, %bb556 - %k.4342.0 = phi i32 [ %tmp707, %cond_next693 ], [ 0, %bb556 ] ; <i32> [#uses=2] - %tmp586 = icmp eq i32 %k.4342.0, 0 ; <i1> [#uses=1] - br i1 %tmp586, label %cond_true589, label %cond_false608 - -cond_true589: ; preds = %bb583 - br label %cond_next693 - -cond_false608: ; preds = %bb583 - br i1 false, label %cond_next661, label %cond_next693 - -cond_next661: ; preds = %cond_false608 - br label %cond_next693 - -cond_next693: ; preds = %cond_next661, %cond_false608, %cond_true589 - %tmp705 = getelementptr i32* null, i32 0 ; <i32*> [#uses=0] - %tmp707 = add i32 %k.4342.0, 1 ; <i32> [#uses=2] - %tmp711 = icmp sgt i32 %tmp707, 0 ; <i1> [#uses=1] - br i1 %tmp711, label %bb726.preheader, label %bb583 - -bb726.preheader: ; preds = %cond_next693 - ret void -} diff --git a/llvm/test/Transforms/LoopIndexSplit/Crash-2007-12-03.ll b/llvm/test/Transforms/LoopIndexSplit/Crash-2007-12-03.ll deleted file mode 100644 index 187484ad0bd..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/Crash-2007-12-03.ll +++ /dev/null @@ -1,44 +0,0 @@ -; RUN: opt < %s -loop-index-split -disable-output -; PR1828.bc -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" -target triple = "i686-pc-linux-gnu" - %RPyOpaque_RuntimeTypeInfo = type opaque* - %arraytype_Char_1 = type { i32, [0 x i8] } - %arraytype_Signed = type { i32, [0 x i32] } - %functiontype_11 = type %structtype_object* () - %functiontype_360 = type %structtype_rpy_string* (%structtype_pypy.rlib.rbigint.rbigint*, %structtype_rpy_string*, %structtype_rpy_string*, %structtype_rpy_string*) - %structtype_list_18 = type { i32, %arraytype_Signed* } - %structtype_object = type { %structtype_object_vtable* } - %structtype_object_vtable = type { i32, i32, %RPyOpaque_RuntimeTypeInfo*, %arraytype_Char_1*, %functiontype_11* } - %structtype_pypy.rlib.rbigint.rbigint = type { %structtype_object, %structtype_list_18*, i32 } - %structtype_rpy_string = type { i32, %arraytype_Char_1 } - -define fastcc %structtype_rpy_string* @pypy__format(%structtype_pypy.rlib.rbigint.rbigint* %a_1, %structtype_rpy_string* %digits_0, %structtype_rpy_string* %prefix_3, %structtype_rpy_string* %suffix_0) { -block0: - br i1 false, label %block67, label %block13 - -block13: ; preds = %block0 - ret %structtype_rpy_string* null - -block31: ; preds = %block67, %block44 - ret %structtype_rpy_string* null - -block42: ; preds = %block67, %block44 - %j_167.reg2mem.0 = phi i32 [ %v63822, %block44 ], [ 0, %block67 ] ; <i32> [#uses=1] - %v63822 = add i32 %j_167.reg2mem.0, -1 ; <i32> [#uses=3] - %v63823 = icmp slt i32 %v63822, 0 ; <i1> [#uses=1] - br i1 %v63823, label %block46, label %block43 - -block43: ; preds = %block42 - br label %block44 - -block44: ; preds = %block46, %block43 - %v6377959 = icmp sgt i32 %v63822, 0 ; <i1> [#uses=1] - br i1 %v6377959, label %block42, label %block31 - -block46: ; preds = %block42 - br label %block44 - -block67: ; preds = %block0 - br i1 false, label %block42, label %block31 -} diff --git a/llvm/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll b/llvm/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll deleted file mode 100644 index 098e407a330..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll +++ /dev/null @@ -1,58 +0,0 @@ -; RUN: opt < %s -loop-index-split -disable-output - - %struct._edit_script = type { %struct._edit_script*, i32, i8 } - -define void @align_path(i8* %seq1, i8* %seq2, i32 %i1, i32 %j1, i32 %i2, i32 %j2, i32 %dist, %struct._edit_script** %head, %struct._edit_script** %tail, i32 %M, i32 %N) { -entry: - br label %bb354 - -bb354: ; preds = %bb511, %entry - br i1 false, label %bb495, label %bb368 - -bb368: ; preds = %bb354 - ret void - -bb495: ; preds = %bb495, %bb354 - br i1 false, label %bb511, label %bb495 - -bb511: ; preds = %bb495 - br i1 false, label %xmalloc.exit69, label %bb354 - -xmalloc.exit69: ; preds = %bb511 - br i1 false, label %bb556, label %bb542.preheader - -bb542.preheader: ; preds = %xmalloc.exit69 - ret void - -bb556: ; preds = %xmalloc.exit69 - br label %bb583 - -bb583: ; preds = %cond_next693, %bb556 - %k.4342.0 = phi i32 [ %tmp707, %cond_next693 ], [ 0, %bb556 ] ; <i32> [#uses=2] - %tmp586 = icmp eq i32 %k.4342.0, 0 ; <i1> [#uses=1] - br i1 %tmp586, label %cond_true589, label %cond_false608 - -cond_true589: ; preds = %bb583 - br label %cond_next693 - -cond_false608: ; preds = %bb583 - br i1 false, label %bb645, label %cond_next693 - -bb645: ; preds = %cond_false608 - br i1 false, label %bb684, label %cond_next661 - -cond_next661: ; preds = %bb645 - br i1 false, label %bb684, label %cond_next693 - -bb684: ; preds = %cond_next661, %bb645 - br label %cond_next693 - -cond_next693: ; preds = %bb684, %cond_next661, %cond_false608, %cond_true589 - %tmp705 = getelementptr i32* null, i32 0 ; <i32*> [#uses=0] - %tmp707 = add i32 %k.4342.0, 1 ; <i32> [#uses=2] - %tmp711 = icmp sgt i32 %tmp707, 0 ; <i1> [#uses=1] - br i1 %tmp711, label %bb726.preheader, label %bb583 - -bb726.preheader: ; preds = %cond_next693 - ret void -} diff --git a/llvm/test/Transforms/LoopIndexSplit/ExitCondition-2007-09-10.ll b/llvm/test/Transforms/LoopIndexSplit/ExitCondition-2007-09-10.ll deleted file mode 100644 index a04715a7e95..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/ExitCondition-2007-09-10.ll +++ /dev/null @@ -1,50 +0,0 @@ -; RUN: opt < %s -loop-index-split -disable-output - -@k = external global i32 ; <i32*> [#uses=2] - -define void @foobar(i32 %a, i32 %b) { -entry: - br label %bb - -bb: ; preds = %cond_next16, %entry - %i.01.0 = phi i32 [ 0, %entry ], [ %tmp18, %cond_next16 ] ; <i32> [#uses=5] - %tsum.18.0 = phi i32 [ 42, %entry ], [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=3] - %tmp1 = icmp slt i32 %i.01.0, 50 ; <i1> [#uses=1] - br i1 %tmp1, label %cond_true, label %cond_false - -cond_true: ; preds = %bb - %tmp4 = tail call i32 @foo( i32 %i.01.0 ) ; <i32> [#uses=1] - %tmp6 = add i32 %tmp4, %tsum.18.0 ; <i32> [#uses=2] - %tmp914 = load i32* @k, align 4 ; <i32> [#uses=1] - %tmp1015 = icmp eq i32 %tmp914, 0 ; <i1> [#uses=1] - br i1 %tmp1015, label %cond_next16, label %cond_true13 - -cond_false: ; preds = %bb - %tmp8 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0] - %tmp9 = load i32* @k, align 4 ; <i32> [#uses=1] - %tmp10 = icmp eq i32 %tmp9, 0 ; <i1> [#uses=1] - br i1 %tmp10, label %cond_next16, label %cond_true13 - -cond_true13: ; preds = %cond_false, %cond_true - %tsum.013.0 = phi i32 [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=1] - %tmp15 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0] - br label %cond_next16 - -cond_next16: ; preds = %cond_false, %cond_true, %cond_true13 - %tsum.013.1 = phi i32 [ %tsum.013.0, %cond_true13 ], [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=2] - %tmp18 = add i32 %i.01.0, 1 ; <i32> [#uses=3] - %tmp21 = icmp eq i32 %tmp18, 100 ; <i1> [#uses=1] - br i1 %tmp21, label %bb, label %bb24 - -bb24: ; preds = %cond_next16 - %tmp18.lcssa = phi i32 [ %tmp18, %cond_next16 ] ; <i32> [#uses=1] - %tsum.013.1.lcssa = phi i32 [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=1] - %tmp27 = tail call i32 @t( i32 %tmp18.lcssa, i32 %tsum.013.1.lcssa ) ; <i32> [#uses=0] - ret void -} - -declare i32 @foo(i32) - -declare i32 @bar(i32) - -declare i32 @t(i32, i32) diff --git a/llvm/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll b/llvm/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll deleted file mode 100644 index d18b3b71aed..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll +++ /dev/null @@ -1,67 +0,0 @@ -; Loop is elimianted -; RUN: opt < %s -loop-index-split -disable-output -stats |& \ -; RUN: grep "loop-index-split" | count 1 - %struct.anon = type { i32 } -@S1 = external global i32 ; <i32*> [#uses=1] -@W1 = external global i32 ; <i32*> [#uses=1] -@Y = weak global [100 x %struct.anon] zeroinitializer, align 32 ; <[100 x %struct.anon]*> [#uses=1] -@ti = external global i32 ; <i32*> [#uses=1] -@T2 = external global [100 x [100 x i32]] ; <[100 x [100 x i32]]*> [#uses=1] -@d = external global i32 ; <i32*> [#uses=1] -@T1 = external global i32 ; <i32*> [#uses=2] -@N2 = external global i32 ; <i32*> [#uses=2] - -define void @foo() { -entry: - %tmp = load i32* @S1, align 4 ; <i32> [#uses=4] - %tmp266 = load i32* @N2, align 4 ; <i32> [#uses=1] - %tmp288 = icmp ult i32 %tmp, %tmp266 ; <i1> [#uses=1] - br i1 %tmp288, label %bb.preheader, label %return - -bb.preheader: ; preds = %entry - %tmp1 = load i32* @W1, align 4 ; <i32> [#uses=1] - %tmp13 = load i32* @ti, align 4 ; <i32> [#uses=1] - %tmp18 = load i32* @d, align 4 ; <i32> [#uses=1] - %tmp26 = load i32* @N2, align 4 ; <i32> [#uses=2] - %T1.promoted = load i32* @T1 ; <i32> [#uses=1] - %tmp2 = add i32 %tmp, 1 ; <i32> [#uses=2] - %tmp4 = icmp ugt i32 %tmp2, %tmp26 ; <i1> [#uses=1] - %umax = select i1 %tmp4, i32 %tmp2, i32 %tmp26 ; <i32> [#uses=1] - %tmp5 = sub i32 0, %tmp ; <i32> [#uses=1] - %tmp6 = add i32 %umax, %tmp5 ; <i32> [#uses=1] - br label %bb - -bb: ; preds = %bb25, %bb.preheader - %indvar = phi i32 [ 0, %bb.preheader ], [ %indvar.next, %bb25 ] ; <i32> [#uses=2] - %T1.tmp.1 = phi i32 [ %T1.promoted, %bb.preheader ], [ %T1.tmp.0, %bb25 ] ; <i32> [#uses=3] - %tj.01.0 = add i32 %indvar, %tmp ; <i32> [#uses=3] - %tmp3 = icmp eq i32 %tj.01.0, %tmp1 ; <i1> [#uses=1] - br i1 %tmp3, label %cond_true, label %bb25 - -cond_true: ; preds = %bb - %tmp7 = getelementptr [100 x %struct.anon]* @Y, i32 0, i32 %tj.01.0, i32 0 ; <i32*> [#uses=1] - %tmp8 = load i32* %tmp7, align 4 ; <i32> [#uses=1] - %tmp9 = icmp sgt i32 %tmp8, 0 ; <i1> [#uses=1] - br i1 %tmp9, label %cond_true12, label %bb25 - -cond_true12: ; preds = %cond_true - %tmp16 = getelementptr [100 x [100 x i32]]* @T2, i32 0, i32 %tmp13, i32 %tj.01.0 ; <i32*> [#uses=1] - %tmp17 = load i32* %tmp16, align 4 ; <i32> [#uses=1] - %tmp19 = mul i32 %tmp18, %tmp17 ; <i32> [#uses=1] - %tmp21 = add i32 %tmp19, %T1.tmp.1 ; <i32> [#uses=1] - br label %bb25 - -bb25: ; preds = %cond_true12, %cond_true, %bb - %T1.tmp.0 = phi i32 [ %T1.tmp.1, %bb ], [ %T1.tmp.1, %cond_true ], [ %tmp21, %cond_true12 ] ; <i32> [#uses=2] - %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2] - %exitcond = icmp ne i32 %indvar.next, %tmp6 ; <i1> [#uses=1] - br i1 %exitcond, label %bb, label %return.loopexit - -return.loopexit: ; preds = %bb25 - %T1.tmp.0.lcssa = phi i32 [ %T1.tmp.0, %bb25 ] ; <i32> [#uses=1] - store i32 %T1.tmp.0.lcssa, i32* @T1 - br label %return - -return: ; preds = %return.loopexit, %entry - ret void -} diff --git a/llvm/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll b/llvm/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll deleted file mode 100644 index ff73a5b44b3..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll +++ /dev/null @@ -1,69 +0,0 @@ -; Loop is elimianted. Save last value assignment. -; RUN: opt < %s -loop-index-split -disable-output -stats |& \ -; RUN: grep "loop-index-split" | count 1 - - %struct.anon = type { i32 } -@S1 = external global i32 ; <i32*> [#uses=1] -@W1 = external global i32 ; <i32*> [#uses=1] -@Y = weak global [100 x %struct.anon] zeroinitializer, align 32 ; <[100 x %struct.anon]*> [#uses=1] -@ti = external global i32 ; <i32*> [#uses=1] -@T2 = external global [100 x [100 x i32]] ; <[100 x [100 x i32]]*> [#uses=1] -@d = external global i32 ; <i32*> [#uses=1] -@T1 = external global i32 ; <i32*> [#uses=2] -@N1 = external global i32 ; <i32*> [#uses=2] - -define void @foo() { -entry: - %tmp = load i32* @S1, align 4 ; <i32> [#uses=4] - %tmp266 = load i32* @N1, align 4 ; <i32> [#uses=1] - %tmp288 = icmp ult i32 %tmp, %tmp266 ; <i1> [#uses=1] - br i1 %tmp288, label %bb.preheader, label %return - -bb.preheader: ; preds = %entry - %tmp1 = load i32* @W1, align 4 ; <i32> [#uses=1] - %tmp13 = load i32* @ti, align 4 ; <i32> [#uses=1] - %tmp18 = load i32* @d, align 4 ; <i32> [#uses=1] - %tmp26 = load i32* @N1, align 4 ; <i32> [#uses=2] - %T1.promoted = load i32* @T1 ; <i32> [#uses=1] - %tmp2 = add i32 %tmp, 1 ; <i32> [#uses=2] - %tmp4 = icmp ugt i32 %tmp2, %tmp26 ; <i1> [#uses=1] - %umax = select i1 %tmp4, i32 %tmp2, i32 %tmp26 ; <i32> [#uses=1] - %tmp5 = sub i32 0, %tmp ; <i32> [#uses=1] - %tmp6 = add i32 %umax, %tmp5 ; <i32> [#uses=1] - br label %bb - -bb: ; preds = %bb25, %bb.preheader - %indvar = phi i32 [ 0, %bb.preheader ], [ %indvar.next, %bb25 ] ; <i32> [#uses=2] - %T1.tmp.1 = phi i32 [ %T1.promoted, %bb.preheader ], [ %T1.tmp.0, %bb25 ] ; <i32> [#uses=3] - %tj.01.0 = add i32 %indvar, %tmp ; <i32> [#uses=3] - %tmp24 = add i32 %tj.01.0, 1 ; <i32> [#uses=1] - %tmp3 = icmp eq i32 %tmp24, %tmp1 ; <i1> [#uses=1] - br i1 %tmp3, label %cond_true, label %bb25 - -cond_true: ; preds = %bb - %tmp7 = getelementptr [100 x %struct.anon]* @Y, i32 0, i32 %tj.01.0, i32 0 ; <i32*> [#uses=1] - %tmp8 = load i32* %tmp7, align 4 ; <i32> [#uses=1] - %tmp9 = icmp sgt i32 %tmp8, 0 ; <i1> [#uses=1] - br i1 %tmp9, label %cond_true12, label %bb25 - -cond_true12: ; preds = %cond_true - %tmp16 = getelementptr [100 x [100 x i32]]* @T2, i32 0, i32 %tmp13, i32 %tj.01.0 ; <i32*> [#uses=1] - %tmp17 = load i32* %tmp16, align 4 ; <i32> [#uses=1] - %tmp19 = mul i32 %tmp18, %tmp17 ; <i32> [#uses=1] - %tmp21 = add i32 %tmp19, %T1.tmp.1 ; <i32> [#uses=1] - br label %bb25 - -bb25: ; preds = %cond_true12, %cond_true, %bb - %T1.tmp.0 = phi i32 [ %T1.tmp.1, %bb ], [ %T1.tmp.1, %cond_true ], [ %tmp21, %cond_true12 ] ; <i32> [#uses=2] - %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2] - %exitcond = icmp ne i32 %indvar.next, %tmp6 ; <i1> [#uses=1] - br i1 %exitcond, label %bb, label %return.loopexit - -return.loopexit: ; preds = %bb25 - %T1.tmp.0.lcssa = phi i32 [ %T1.tmp.0, %bb25 ] ; <i32> [#uses=1] - store i32 %T1.tmp.0.lcssa, i32* @T1 - br label %return - -return: ; preds = %return.loopexit, %entry - ret void -} diff --git a/llvm/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll b/llvm/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll deleted file mode 100644 index 6adb2687768..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll +++ /dev/null @@ -1,34 +0,0 @@ -; Loop is elimianted. Save last value assignments, including induction variable. -; RUN: opt < %s -loop-index-split -disable-output -stats | not grep "loop-index-split" - -declare i32 @foo(i32) -declare i32 @bar(i32, i32) - -define void @foobar(i32 %a, i32 %b) { -entry: - br label %bb - -bb: ; preds = %cond_next, %entry - %i.01.0 = phi i32 [ 0, %entry ], [ %tmp8, %cond_next ] ; <i32> [#uses=3] - %tsum.16.0 = phi i32 [ 42, %entry ], [ %tsum.0, %cond_next ] ; <i32> [#uses=2] - %tmp1 = icmp eq i32 %i.01.0, 50 ; <i1> [#uses=1] - br i1 %tmp1, label %cond_true, label %cond_next - -cond_true: ; preds = %bb - %tmp4 = tail call i32 @foo( i32 %i.01.0 ) ; <i32> [#uses=1] - %tmp6 = add i32 %tmp4, %tsum.16.0 ; <i32> [#uses=1] - br label %cond_next - -cond_next: ; preds = %bb, %cond_true - %tsum.0 = phi i32 [ %tmp6, %cond_true ], [ %tsum.16.0, %bb ] ; <i32> [#uses=2] - %tmp8 = add i32 %i.01.0, 1 ; <i32> [#uses=3] - %tmp11 = icmp slt i32 %tmp8, 100 ; <i1> [#uses=1] - br i1 %tmp11, label %bb, label %bb14 - -bb14: ; preds = %cond_next - %tmp8.lcssa = phi i32 [ %tmp8, %cond_next ] ; <i32> [#uses=1] - %tsum.0.lcssa = phi i32 [ %tsum.0, %cond_next ] ; <i32> [#uses=1] - %tmp17 = tail call i32 @bar( i32 %tmp8.lcssa, i32 %tsum.0.lcssa ) ; <i32> [#uses=0] - ret void -} - diff --git a/llvm/test/Transforms/LoopIndexSplit/PR3913.ll b/llvm/test/Transforms/LoopIndexSplit/PR3913.ll deleted file mode 100644 index a2bf57c0516..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/PR3913.ll +++ /dev/null @@ -1,24 +0,0 @@ -; RUN: opt < %s -loop-index-split -S | not grep "icmp ne" - -define i32 @main() { -entry: - br label %header - -header: - %r = phi i32 [ 0, %entry ], [ %r3, %skip ] - %i = phi i32 [ 0, %entry ], [ %i1, %skip ] - %cond = icmp eq i32 %i, 99 - br i1 %cond, label %body, label %skip - -body: - br label %skip - -skip: - %r3 = phi i32 [ %r, %header ], [ 3, %body ] - %i1 = add i32 %i, 1 - %exitcond = icmp eq i32 %i1, 10 - br i1 %exitcond, label %exit, label %header - -exit: - ret i32 %r3 -} diff --git a/llvm/test/Transforms/LoopIndexSplit/PR4174-2.ll b/llvm/test/Transforms/LoopIndexSplit/PR4174-2.ll deleted file mode 100644 index cc17bc0a933..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/PR4174-2.ll +++ /dev/null @@ -1,38 +0,0 @@ -; RUN: llvm-as < %s | opt -loop-index-split | llvm-dis | not grep clone - -declare void @f() - -define fastcc i32 @main() nounwind { -entry: - br label %bb1552 - -bb1552: - %j295.0.reg2mem.0 = phi i32 [ %storemerge110, %bb1669 ], [ 0, %entry ] - br label %bb1553 - -bb1553: - call void @f() - %tmp1628 = icmp sgt i32 %j295.0.reg2mem.0, -3 - br i1 %tmp1628, label %bb1588, label %bb1616 - -bb1588: - br label %bb1616 - -bb1616: - %tmp1629 = icmp sgt i32 %j295.0.reg2mem.0, -3 - br i1 %tmp1629, label %bb1649, label %bb1632 - -bb1632: - br label %bb1669 - -bb1649: - br label %bb1669 - -bb1669: - %storemerge110 = add i32 %j295.0.reg2mem.0, 1 - %tmp1672 = icmp sgt i32 %storemerge110, 3 - br i1 %tmp1672, label %bb1678, label %bb1552 - -bb1678: - ret i32 0 -} diff --git a/llvm/test/Transforms/LoopIndexSplit/PR4174.ll b/llvm/test/Transforms/LoopIndexSplit/PR4174.ll deleted file mode 100644 index e8f5a737f05..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/PR4174.ll +++ /dev/null @@ -1,23 +0,0 @@ -; RUN: llvm-as < %s | opt -loop-index-split | llvm-dis | not grep clone - -declare void @f() - -define i32 @main() { -entry: - br label %head -head: - %i = phi i32 [0, %entry], [%i1, %tail] - call void @f() - %splitcond = icmp slt i32 %i, 2 - br i1 %splitcond, label %yes, label %no -yes: - br label %tail -no: - br label %tail -tail: - %i1 = add i32 %i, 1 - %exitcond = icmp slt i32 %i1, 4 - br i1 %exitcond, label %head, label %exit -exit: - ret i32 0 -} diff --git a/llvm/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll b/llvm/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll deleted file mode 100644 index fc7d9e9862c..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll +++ /dev/null @@ -1,52 +0,0 @@ -; Split loop. Save last value. -; RUN: opt < %s -loop-index-split -disable-output -stats |& \ -; RUN: grep "loop-index-split" | count 1 - -@k = external global i32 ; <i32*> [#uses=2] - -define void @foobar(i32 %a, i32 %b) { -entry: - br label %bb - -bb: ; preds = %cond_next16, %entry - %i.01.0 = phi i32 [ 0, %entry ], [ %tmp18, %cond_next16 ] ; <i32> [#uses=5] - %tsum.18.0 = phi i32 [ 42, %entry ], [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=3] - %tmp1 = icmp slt i32 %i.01.0, 50 ; <i1> [#uses=1] - br i1 %tmp1, label %cond_true, label %cond_false - -cond_true: ; preds = %bb - %tmp4 = tail call i32 @foo( i32 %i.01.0 ) ; <i32> [#uses=1] - %tmp6 = add i32 %tmp4, %tsum.18.0 ; <i32> [#uses=2] - %tmp914 = load i32* @k, align 4 ; <i32> [#uses=1] - %tmp1015 = icmp eq i32 %tmp914, 0 ; <i1> [#uses=1] - br i1 %tmp1015, label %cond_next16, label %cond_true13 - -cond_false: ; preds = %bb - %tmp8 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0] - %tmp9 = load i32* @k, align 4 ; <i32> [#uses=1] - %tmp10 = icmp eq i32 %tmp9, 0 ; <i1> [#uses=1] - br i1 %tmp10, label %cond_next16, label %cond_true13 - -cond_true13: ; preds = %cond_false, %cond_true - %tsum.013.0 = phi i32 [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=1] - %tmp15 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0] - br label %cond_next16 - -cond_next16: ; preds = %cond_false, %cond_true, %cond_true13 - %tsum.013.1 = phi i32 [ %tsum.013.0, %cond_true13 ], [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=2] - %tmp18 = add i32 %i.01.0, 1 ; <i32> [#uses=3] - %tmp21 = icmp slt i32 %tmp18, 100 ; <i1> [#uses=1] - br i1 %tmp21, label %bb, label %bb24 - -bb24: ; preds = %cond_next16 - %tmp18.lcssa = phi i32 [ %tmp18, %cond_next16 ] ; <i32> [#uses=1] - %tsum.013.1.lcssa = phi i32 [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=1] - %tmp27 = tail call i32 @t( i32 %tmp18.lcssa, i32 %tsum.013.1.lcssa ) ; <i32> [#uses=0] - ret void -} - -declare i32 @foo(i32) - -declare i32 @bar(i32) - -declare i32 @t(i32, i32) diff --git a/llvm/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24.ll b/llvm/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24.ll deleted file mode 100644 index f61d9671409..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/SplitValue-2007-08-24.ll +++ /dev/null @@ -1,52 +0,0 @@ -; Split loop. Save last value. Split value is off by one in this example. -; RUN: opt < %s -loop-index-split -disable-output -stats |& \ -; RUN: grep "loop-index-split" | count 1 - -@k = external global i32 ; <i32*> [#uses=2] - -define void @foobar(i32 %a, i32 %b) { -entry: - br label %bb - -bb: ; preds = %cond_next16, %entry - %i.01.0 = phi i32 [ 0, %entry ], [ %tmp18, %cond_next16 ] ; <i32> [#uses=5] - %tsum.18.0 = phi i32 [ 42, %entry ], [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=3] - %tmp1 = icmp sgt i32 %i.01.0, 50 ; <i1> [#uses=1] - br i1 %tmp1, label %cond_true, label %cond_false - -cond_true: ; preds = %bb - %tmp4 = tail call i32 @foo( i32 %i.01.0 ) ; <i32> [#uses=1] - %tmp6 = add i32 %tmp4, %tsum.18.0 ; <i32> [#uses=2] - %tmp914 = load i32* @k, align 4 ; <i32> [#uses=1] - %tmp1015 = icmp eq i32 %tmp914, 0 ; <i1> [#uses=1] - br i1 %tmp1015, label %cond_next16, label %cond_true13 - -cond_false: ; preds = %bb - %tmp8 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0] - %tmp9 = load i32* @k, align 4 ; <i32> [#uses=1] - %tmp10 = icmp eq i32 %tmp9, 0 ; <i1> [#uses=1] - br i1 %tmp10, label %cond_next16, label %cond_true13 - -cond_true13: ; preds = %cond_false, %cond_true - %tsum.013.0 = phi i32 [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=1] - %tmp15 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0] - br label %cond_next16 - -cond_next16: ; preds = %cond_false, %cond_true, %cond_true13 - %tsum.013.1 = phi i32 [ %tsum.013.0, %cond_true13 ], [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=2] - %tmp18 = add i32 %i.01.0, 1 ; <i32> [#uses=3] - %tmp21 = icmp slt i32 %tmp18, 100 ; <i1> [#uses=1] - br i1 %tmp21, label %bb, label %bb24 - -bb24: ; preds = %cond_next16 - %tmp18.lcssa = phi i32 [ %tmp18, %cond_next16 ] ; <i32> [#uses=1] - %tsum.013.1.lcssa = phi i32 [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=1] - %tmp27 = tail call i32 @t( i32 %tmp18.lcssa, i32 %tsum.013.1.lcssa ) ; <i32> [#uses=0] - ret void -} - -declare i32 @foo(i32) - -declare i32 @bar(i32) - -declare i32 @t(i32, i32) diff --git a/llvm/test/Transforms/LoopIndexSplit/UpperBound-2007-08-24.ll b/llvm/test/Transforms/LoopIndexSplit/UpperBound-2007-08-24.ll deleted file mode 100644 index 17f75d7509e..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/UpperBound-2007-08-24.ll +++ /dev/null @@ -1,52 +0,0 @@ -; Split loop. Split value is a constant and greater then exit value. -; Check whether optimizer inserts proper checkfor split value or not. -; RUN: opt < %s -loop-index-split -S | grep select - -@k = external global i32 ; <i32*> [#uses=2] - -define void @foobar(i32 %a, i32 %b) { -entry: - br label %bb - -bb: ; preds = %cond_next16, %entry - %i.01.0 = phi i32 [ 0, %entry ], [ %tmp18, %cond_next16 ] ; <i32> [#uses=5] - %tsum.18.0 = phi i32 [ 42, %entry ], [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=3] - %tmp1 = icmp slt i32 %i.01.0, 500 ; <i1> [#uses=1] - br i1 %tmp1, label %cond_true, label %cond_false - -cond_true: ; preds = %bb - %tmp4 = tail call i32 @foo( i32 %i.01.0 ) ; <i32> [#uses=1] - %tmp6 = add i32 %tmp4, %tsum.18.0 ; <i32> [#uses=2] - %tmp914 = load i32* @k, align 4 ; <i32> [#uses=1] - %tmp1015 = icmp eq i32 %tmp914, 0 ; <i1> [#uses=1] - br i1 %tmp1015, label %cond_next16, label %cond_true13 - -cond_false: ; preds = %bb - %tmp8 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0] - %tmp9 = load i32* @k, align 4 ; <i32> [#uses=1] - %tmp10 = icmp eq i32 %tmp9, 0 ; <i1> [#uses=1] - br i1 %tmp10, label %cond_next16, label %cond_true13 - -cond_true13: ; preds = %cond_false, %cond_true - %tsum.013.0 = phi i32 [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=1] - %tmp15 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0] - br label %cond_next16 - -cond_next16: ; preds = %cond_false, %cond_true, %cond_true13 - %tsum.013.1 = phi i32 [ %tsum.013.0, %cond_true13 ], [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=2] - %tmp18 = add i32 %i.01.0, 1 ; <i32> [#uses=3] - %tmp21 = icmp slt i32 %tmp18, 100 ; <i1> [#uses=1] - br i1 %tmp21, label %bb, label %bb24 - -bb24: ; preds = %cond_next16 - %tmp18.lcssa = phi i32 [ %tmp18, %cond_next16 ] ; <i32> [#uses=1] - %tsum.013.1.lcssa = phi i32 [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=1] - %tmp27 = tail call i32 @t( i32 %tmp18.lcssa, i32 %tsum.013.1.lcssa ) ; <i32> [#uses=0] - ret void -} - -declare i32 @foo(i32) - -declare i32 @bar(i32) - -declare i32 @t(i32, i32) diff --git a/llvm/test/Transforms/LoopIndexSplit/dg.exp b/llvm/test/Transforms/LoopIndexSplit/dg.exp deleted file mode 100644 index f2005891a59..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/dg.exp +++ /dev/null @@ -1,3 +0,0 @@ -load_lib llvm.exp - -RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]] diff --git a/llvm/test/Transforms/LoopIndexSplit/non-iv-cmp-operand.ll b/llvm/test/Transforms/LoopIndexSplit/non-iv-cmp-operand.ll deleted file mode 100644 index 6eed98177d0..00000000000 --- a/llvm/test/Transforms/LoopIndexSplit/non-iv-cmp-operand.ll +++ /dev/null @@ -1,195 +0,0 @@ -; RUN: opt < %s -inline -reassociate -loop-rotate -loop-index-split -indvars -simplifycfg -verify -; PR4471 - -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" - %struct.CUMULATIVE_ARGS = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 } - %struct.VEC_basic_block_base = type { i32, i32, [1 x %struct.basic_block_def*] } - %struct.VEC_basic_block_gc = type { %struct.VEC_basic_block_base } - %struct.VEC_edge_base = type { i32, i32, [1 x %struct.edge_def*] } - %struct.VEC_edge_gc = type { %struct.VEC_edge_base } - %struct.VEC_rtx_base = type { i32, i32, [1 x %struct.rtx_def*] } - %struct.VEC_rtx_gc = type { %struct.VEC_rtx_base } - %struct.VEC_temp_slot_p_base = type { i32, i32, [1 x %struct.temp_slot*] } - %struct.VEC_temp_slot_p_gc = type { %struct.VEC_temp_slot_p_base } - %struct.VEC_tree_base = type { i32, i32, [1 x %struct.tree_node*] } - %struct.VEC_tree_gc = type { %struct.VEC_tree_base } - %struct.__sbuf = type { i8*, i32 } - %struct._obstack_chunk = type { i8*, %struct._obstack_chunk*, [4 x i8] } - %struct.basic_block_def = type { %struct.tree_node*, %struct.VEC_edge_gc*, %struct.VEC_edge_gc*, i8*, %struct.loop*, [2 x %struct.et_node*], %struct.basic_block_def*, %struct.basic_block_def*, %struct.basic_block_il_dependent, %struct.tree_node*, %struct.edge_prediction*, i64, i32, i32, i32, i32 } - %struct.basic_block_il_dependent = type { %struct.rtl_bb_info* } - %struct.bitmap_element_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, i32, [2 x i64] } - %struct.bitmap_head_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, i32, %struct.bitmap_obstack* } - %struct.bitmap_obstack = type { %struct.bitmap_element_def*, %struct.bitmap_head_def*, %struct.obstack } - %struct.block_symbol = type { [3 x %struct.rtunion], %struct.object_block*, i64 } - %struct.case_node = type { %struct.case_node*, %struct.case_node*, %struct.case_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node* } - %struct.control_flow_graph = type { %struct.basic_block_def*, %struct.basic_block_def*, %struct.VEC_basic_block_gc*, i32, i32, i32, %struct.VEC_basic_block_gc*, i32 } - %struct.edge_def = type { %struct.basic_block_def*, %struct.basic_block_def*, %struct.edge_def_insns, i8*, %struct.__sbuf*, i32, i32, i64, i32 } - %struct.edge_def_insns = type { %struct.rtx_def* } - %struct.edge_prediction = type opaque - %struct.eh_status = type opaque - %struct.emit_status = type { i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack*, i32, %struct.__sbuf, i32, i8*, %struct.rtx_def** } - %struct.et_node = type opaque - %struct.expr_status = type { i32, i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def* } - %struct.function = type { %struct.eh_status*, %struct.expr_status*, %struct.emit_status*, %struct.varasm_status*, %struct.control_flow_graph*, %struct.tree_node*, %struct.function*, i32, i32, i32, i32, %struct.rtx_def*, %struct.CUMULATIVE_ARGS, %struct.rtx_def*, %struct.rtx_def*, %struct.initial_value_struct*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, i64, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.VEC_temp_slot_p_gc*, %struct.temp_slot*, %struct.var_refs_queue*, i32, i32, i32, i32, %struct.machine_function*, i32, i32, %struct.language_function*, %struct.htab*, %struct.rtx_def*, i32, i32, %struct.__sbuf, %struct.VEC_tree_gc*, %struct.tree_node*, i8*, i8*, i8*, i8*, i8*, %struct.tree_node*, i8, i8, i8, i8, i8 } - %struct.htab = type { i32 (i8*)*, i32 (i8*, i8*)*, void (i8*)*, i8**, i64, i64, i64, i32, i32, i8* (i64, i64)*, void (i8*)*, i8*, i8* (i8*, i64, i64)*, void (i8*, i8*)*, i32 } - %struct.initial_value_struct = type opaque - %struct.lang_decl = type opaque - %struct.language_function = type opaque - %struct.loop = type opaque - %struct.machine_function = type { %struct.stack_local_entry*, i8*, %struct.rtx_def*, i32, i32, [4 x i32], i32, i32, i32 } - %struct.object_block = type { %struct.section*, i32, i64, %struct.VEC_rtx_gc*, %struct.VEC_rtx_gc* } - %struct.obstack = type { i64, %struct._obstack_chunk*, i8*, i8*, i8*, i64, i32, %struct._obstack_chunk* (i8*, i64)*, void (i8*, %struct._obstack_chunk*)*, i8*, i8 } - %struct.omp_clause_subcode = type { i32 } - %struct.rtl_bb_info = type { %struct.rtx_def*, %struct.rtx_def*, %struct.bitmap_head_def*, %struct.bitmap_head_def*, %struct.rtx_def*, %struct.rtx_def*, i32 } - %struct.rtunion = type { i8* } - %struct.rtx_def = type { i16, i8, i8, %struct.u } - %struct.section = type { %struct.unnamed_section } - %struct.sequence_stack = type { %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack* } - %struct.stack_local_entry = type opaque - %struct.temp_slot = type opaque - %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %union.tree_ann_d*, i8, i8, i8, i8 } - %struct.tree_decl_common = type { %struct.tree_decl_minimal, %struct.tree_node*, i8, i8, i8, i8, %struct.tree_decl_u1, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_decl* } - %struct.tree_decl_minimal = type { %struct.tree_common, %struct.__sbuf, i32, %struct.tree_node*, %struct.tree_node* } - %struct.tree_decl_non_common = type { %struct.tree_decl_with_vis, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node* } - %struct.tree_decl_u1 = type { i64 } - %struct.tree_decl_with_rtl = type { %struct.tree_decl_common, %struct.rtx_def* } - %struct.tree_decl_with_vis = type { %struct.tree_decl_with_rtl, %struct.tree_node*, %struct.tree_node*, i8, i8, i8 } - %struct.tree_function_decl = type { %struct.tree_decl_non_common, i8, i8, %struct.function* } - %struct.tree_node = type { %struct.tree_function_decl } - %struct.u = type { %struct.block_symbol } - %struct.unnamed_section = type { %struct.omp_clause_subcode, void (i8*)*, i8*, %struct.section* } - %struct.var_refs_queue = type { %struct.rtx_def*, i32, i32, %struct.var_refs_queue* } - %struct.varasm_status = type opaque - %union.tree_ann_d = type opaque - -define void @emit_case_bit_tests(%struct.tree_node* %index_type, %struct.tree_node* %index_expr, %struct.tree_node* %minval, %struct.tree_node* %range, %struct.case_node* %nodes, %struct.rtx_def* %default_label) nounwind { -entry: - br label %bb17 - -bb: ; preds = %bb17 - %0 = call i64 @tree_low_cst(%struct.tree_node* undef, i32 1) nounwind ; <i64> [#uses=1] - %1 = trunc i64 %0 to i32 ; <i32> [#uses=1] - br label %bb15 - -bb10: ; preds = %bb15 - %2 = icmp ugt i32 %j.0, 63 ; <i1> [#uses=1] - br i1 %2, label %bb11, label %bb12 - -bb11: ; preds = %bb10 - %3 = zext i32 0 to i64 ; <i64> [#uses=0] - br label %bb14 - -bb12: ; preds = %bb10 - %4 = or i64 undef, undef ; <i64> [#uses=0] - br label %bb14 - -bb14: ; preds = %bb12, %bb11 - %5 = add i32 %j.0, 1 ; <i32> [#uses=1] - br label %bb15 - -bb15: ; preds = %bb14, %bb - %j.0 = phi i32 [ %1, %bb ], [ %5, %bb14 ] ; <i32> [#uses=3] - %6 = icmp ugt i32 %j.0, undef ; <i1> [#uses=1] - br i1 %6, label %bb16, label %bb10 - -bb16: ; preds = %bb15 - br label %bb17 - -bb17: ; preds = %bb16, %entry - br i1 undef, label %bb18, label %bb - -bb18: ; preds = %bb17 - unreachable -} - -declare i64 @tree_low_cst(%struct.tree_node*, i32) - -define void @expand_case(%struct.tree_node* %exp) nounwind { -entry: - br i1 undef, label %bb2, label %bb - -bb: ; preds = %entry - unreachable - -bb2: ; preds = %entry - br i1 undef, label %bb3, label %bb4 - -bb3: ; preds = %bb2 - unreachable - -bb4: ; preds = %bb2 - br i1 undef, label %bb127, label %bb5 - -bb5: ; preds = %bb4 - br i1 undef, label %bb6, label %bb7 - -bb6: ; preds = %bb5 - unreachable - -bb7: ; preds = %bb5 - br i1 undef, label %bb9, label %bb8 - -bb8: ; preds = %bb7 - unreachable - -bb9: ; preds = %bb7 - br i1 undef, label %bb11, label %bb10 - -bb10: ; preds = %bb9 - unreachable - -bb11: ; preds = %bb9 - br i1 undef, label %bb37, label %bb21 - -bb21: ; preds = %bb11 - unreachable - -bb37: ; preds = %bb11 - br i1 undef, label %bb38, label %bb39 - -bb38: ; preds = %bb37 - ret void - -bb39: ; preds = %bb37 - br i1 undef, label %bb59, label %bb40 - -bb40: ; preds = %bb39 - br i1 undef, label %bb41, label %bb59 - -bb41: ; preds = %bb40 - br i1 undef, label %bb42, label %bb59 - -bb42: ; preds = %bb41 - br i1 undef, label %bb43, label %bb59 - -bb43: ; preds = %bb42 - br i1 undef, label %bb59, label %bb44 - -bb44: ; preds = %bb43 - br i1 undef, label %bb56, label %bb58 - -bb56: ; preds = %bb44 - unreachable - -bb58: ; preds = %bb44 - call void @emit_case_bit_tests(%struct.tree_node* undef, %struct.tree_node* undef, %struct.tree_node* null, %struct.tree_node* undef, %struct.case_node* undef, %struct.rtx_def* undef) nounwind - br i1 undef, label %bb126, label %bb125 - -bb59: ; preds = %bb43, %bb42, %bb41, %bb40, %bb39 - br i1 undef, label %bb70, label %bb60 - -bb60: ; preds = %bb59 - unreachable - -bb70: ; preds = %bb59 - unreachable - -bb125: ; preds = %bb58 - unreachable - -bb126: ; preds = %bb58 - unreachable - -bb127: ; preds = %bb4 - ret void -} |