[llvm-commits] [llvm] r53163 [6/7] - in /llvm/branches/non-call-eh: ./ autoconf/ bindings/ocaml/llvm/ docs/ docs/CommandGuide/ docs/tutorial/ examples/BrainF/ examples/Fibonacci/ examples/HowToUseJIT/ examples/ModuleMaker/ examples/ParallelJIT/ include/llvm-c/ include/llvm/ include/llvm/ADT/ include/llvm/Analysis/ include/llvm/Bitcode/ include/llvm/CodeGen/ include/llvm/Debugger/ include/llvm/ExecutionEngine/ include/llvm/Support/ include/llvm/System/ include/llvm/Target/ include/llvm/Transforms/ include/llvm/Transform...
Nick Lewycky
nicholas at mxc.ca
Sun Jul 6 13:45:51 PDT 2008
Modified: llvm/branches/non-call-eh/lib/Transforms/Scalar/TailDuplication.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Scalar/TailDuplication.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Scalar/TailDuplication.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Scalar/TailDuplication.cpp Sun Jul 6 15:45:41 2008
@@ -32,15 +32,18 @@
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/Statistic.h"
+#include "llvm/ADT/SmallPtrSet.h"
#include <map>
using namespace llvm;
STATISTIC(NumEliminated, "Number of unconditional branches eliminated");
+static cl::opt<unsigned>
+TailDupThreshold("taildup-threshold",
+ cl::desc("Max block size to tail duplicate"),
+ cl::init(1), cl::Hidden);
+
namespace {
- cl::opt<unsigned>
- Threshold("taildup-threshold", cl::desc("Max block size to tail duplicate"),
- cl::init(6), cl::Hidden);
class VISIBILITY_HIDDEN TailDup : public FunctionPass {
bool runOnFunction(Function &F);
public:
@@ -48,28 +51,35 @@
TailDup() : FunctionPass((intptr_t)&ID) {}
private:
- inline bool shouldEliminateUnconditionalBranch(TerminatorInst *TI);
+ inline bool shouldEliminateUnconditionalBranch(TerminatorInst *, unsigned);
inline void eliminateUnconditionalBranch(BranchInst *BI);
+ SmallPtrSet<BasicBlock*, 4> CycleDetector;
};
- char TailDup::ID = 0;
- RegisterPass<TailDup> X("tailduplicate", "Tail Duplication");
}
+char TailDup::ID = 0;
+static RegisterPass<TailDup> X("tailduplicate", "Tail Duplication");
+
// Public interface to the Tail Duplication pass
FunctionPass *llvm::createTailDuplicationPass() { return new TailDup(); }
/// runOnFunction - Top level algorithm - Loop over each unconditional branch in
-/// the function, eliminating it if it looks attractive enough.
-///
+/// the function, eliminating it if it looks attractive enough. CycleDetector
+/// prevents infinite loops by checking that we aren't redirecting a branch to
+/// a place it already pointed to earlier; see PR 2323.
bool TailDup::runOnFunction(Function &F) {
bool Changed = false;
- for (Function::iterator I = F.begin(), E = F.end(); I != E; )
- if (shouldEliminateUnconditionalBranch(I->getTerminator())) {
+ CycleDetector.clear();
+ for (Function::iterator I = F.begin(), E = F.end(); I != E; ) {
+ if (shouldEliminateUnconditionalBranch(I->getTerminator(),
+ TailDupThreshold)) {
eliminateUnconditionalBranch(cast<BranchInst>(I->getTerminator()));
Changed = true;
} else {
++I;
+ CycleDetector.clear();
}
+ }
return Changed;
}
@@ -82,7 +92,8 @@
/// We don't count PHI nodes in the count since they will be removed when the
/// contents of the block are copied over.
///
-bool TailDup::shouldEliminateUnconditionalBranch(TerminatorInst *TI) {
+bool TailDup::shouldEliminateUnconditionalBranch(TerminatorInst *TI,
+ unsigned Threshold) {
BranchInst *BI = dyn_cast<BranchInst>(TI);
if (!BI || !BI->isUnconditional()) return false; // Not an uncond branch!
@@ -101,18 +112,13 @@
if (!DTI->use_empty())
return false;
- // Do not bother working on dead blocks...
- pred_iterator PI = pred_begin(Dest), PE = pred_end(Dest);
- if (PI == PE && Dest != Dest->getParent()->begin())
- return false; // It's just a dead block, ignore it...
-
- // Also, do not bother with blocks with only a single predecessor: simplify
+ // Do not bother with blocks with only a single predecessor: simplify
// CFG will fold these two blocks together!
+ pred_iterator PI = pred_begin(Dest), PE = pred_end(Dest);
++PI;
if (PI == PE) return false; // Exactly one predecessor!
- BasicBlock::iterator I = Dest->begin();
- while (isa<PHINode>(*I)) ++I;
+ BasicBlock::iterator I = Dest->getFirstNonPHI();
for (unsigned Size = 0; I != Dest->end(); ++I) {
if (Size == Threshold) return false; // The block is too large.
@@ -120,6 +126,13 @@
// Don't tail duplicate call instructions. They are very large compared to
// other instructions.
if (isa<CallInst>(I) || isa<InvokeInst>(I)) return false;
+
+ // Allso alloca and malloc.
+ if (isa<AllocationInst>(I)) return false;
+
+ // Some vector instructions can expand into a number of instructions.
+ if (isa<ShuffleVectorInst>(I) || isa<ExtractElementInst>(I) ||
+ isa<InsertElementInst>(I)) return false;
// Only count instructions that are not debugger intrinsics.
if (!isa<DbgInfoIntrinsic>(I)) ++Size;
@@ -138,7 +151,7 @@
if (TooMany-- == 0) return false;
}
- // Finally, if this unconditional branch is a fall-through, be careful about
+ // If this unconditional branch is a fall-through, be careful about
// tail duplicating it. In particular, we don't want to taildup it if the
// original block will still be there after taildup is completed: doing so
// would eliminate the fall-through, requiring unconditional branches.
@@ -168,6 +181,11 @@
}
}
+ // Finally, check that we haven't redirected to this target block earlier;
+ // there are cases where we loop forever if we don't check this (PR 2323).
+ if (!CycleDetector.insert(Dest))
+ return false;
+
return true;
}
@@ -235,8 +253,7 @@
// If there are non-phi instructions in DestBlock that have no operands
// defined in DestBlock, and if the instruction has no side effects, we can
// move the instruction to DomBlock instead of duplicating it.
- BasicBlock::iterator BBI = DestBlock->begin();
- while (isa<PHINode>(BBI)) ++BBI;
+ BasicBlock::iterator BBI = DestBlock->getFirstNonPHI();
while (!isa<TerminatorInst>(BBI)) {
Instruction *I = BBI++;
Modified: llvm/branches/non-call-eh/lib/Transforms/Scalar/TailRecursionElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Scalar/TailRecursionElimination.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Scalar/TailRecursionElimination.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Scalar/TailRecursionElimination.cpp Sun Jul 6 15:45:41 2008
@@ -80,10 +80,11 @@
bool CanMoveAboveCall(Instruction *I, CallInst *CI);
Value *CanTransformAccumulatorRecursion(Instruction *I, CallInst *CI);
};
- char TailCallElim::ID = 0;
- RegisterPass<TailCallElim> X("tailcallelim", "Tail Call Elimination");
}
+char TailCallElim::ID = 0;
+static RegisterPass<TailCallElim> X("tailcallelim", "Tail Call Elimination");
+
// Public interface to the TailCallElimination pass
FunctionPass *llvm::createTailCallEliminationPass() {
return new TailCallElim();
@@ -184,8 +185,10 @@
if (!FunctionContainsEscapingAllocas)
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- if (CallInst *CI = dyn_cast<CallInst>(I))
+ if (CallInst *CI = dyn_cast<CallInst>(I)) {
CI->setTailCall();
+ MadeChange = true;
+ }
return MadeChange;
}
@@ -400,7 +403,8 @@
Instruction *InsertPos = OldEntry->begin();
for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
I != E; ++I) {
- PHINode *PN = PHINode::Create(I->getType(), I->getName()+".tr", InsertPos);
+ PHINode *PN = PHINode::Create(I->getType(),
+ I->getName() + ".tr", InsertPos);
I->replaceAllUsesWith(PN); // Everyone use the PHI node now!
PN->addIncoming(I, NewEntry);
ArgumentPHIs.push_back(PN);
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/BasicBlockUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/BasicBlockUtils.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/BasicBlockUtils.cpp Sun Jul 6 15:45:41 2008
@@ -17,6 +17,7 @@
#include "llvm/Instructions.h"
#include "llvm/Constant.h"
#include "llvm/Type.h"
+#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/Dominators.h"
#include <algorithm>
@@ -160,7 +161,6 @@
while (isa<PHINode>(SplitIt))
++SplitIt;
BasicBlock *New = Old->splitBasicBlock(SplitIt, Old->getName()+".split");
- New->setUnwindDest(Old->getUnwindDest());
// The new block lives in whichever loop the old one did.
if (Loop *L = LI.getLoopFor(Old))
@@ -187,3 +187,99 @@
return New;
}
+
+
+/// SplitBlockPredecessors - This method transforms BB by introducing a new
+/// basic block into the function, and moving some of the predecessors of BB to
+/// be predecessors of the new block. The new predecessors are indicated by the
+/// Preds array, which has NumPreds elements in it. The new block is given a
+/// suffix of 'Suffix'.
+///
+/// This currently updates the LLVM IR, AliasAnalysis, DominatorTree and
+/// DominanceFrontier, but no other analyses.
+BasicBlock *llvm::SplitBlockPredecessors(BasicBlock *BB,
+ BasicBlock *const *Preds,
+ unsigned NumPreds, const char *Suffix,
+ Pass *P) {
+ // Create new basic block, insert right before the original block.
+ BasicBlock *NewBB =
+ BasicBlock::Create(BB->getName()+Suffix, BB->getParent(), BB);
+
+ // The new block unconditionally branches to the old block.
+ BranchInst *BI = BranchInst::Create(BB, NewBB);
+
+ // Move the edges from Preds to point to NewBB instead of BB.
+ for (unsigned i = 0; i != NumPreds; ++i)
+ Preds[i]->getTerminator()->replaceUsesOfWith(BB, NewBB);
+
+ // Update dominator tree and dominator frontier if available.
+ DominatorTree *DT = P ? P->getAnalysisToUpdate<DominatorTree>() : 0;
+ if (DT)
+ DT->splitBlock(NewBB);
+ if (DominanceFrontier *DF = P ? P->getAnalysisToUpdate<DominanceFrontier>():0)
+ DF->splitBlock(NewBB);
+ AliasAnalysis *AA = P ? P->getAnalysisToUpdate<AliasAnalysis>() : 0;
+
+
+ // Insert a new PHI node into NewBB for every PHI node in BB and that new PHI
+ // node becomes an incoming value for BB's phi node. However, if the Preds
+ // list is empty, we need to insert dummy entries into the PHI nodes in BB to
+ // account for the newly created predecessor.
+ if (NumPreds == 0) {
+ // Insert dummy values as the incoming value.
+ for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ++I)
+ cast<PHINode>(I)->addIncoming(UndefValue::get(I->getType()), NewBB);
+ return NewBB;
+ }
+
+ // Otherwise, create a new PHI node in NewBB for each PHI node in BB.
+ for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ) {
+ PHINode *PN = cast<PHINode>(I++);
+
+ // Check to see if all of the values coming in are the same. If so, we
+ // don't need to create a new PHI node.
+ Value *InVal = PN->getIncomingValueForBlock(Preds[0]);
+ for (unsigned i = 1; i != NumPreds; ++i)
+ if (InVal != PN->getIncomingValueForBlock(Preds[i])) {
+ InVal = 0;
+ break;
+ }
+
+ if (InVal) {
+ // If all incoming values for the new PHI would be the same, just don't
+ // make a new PHI. Instead, just remove the incoming values from the old
+ // PHI.
+ for (unsigned i = 0; i != NumPreds; ++i)
+ PN->removeIncomingValue(Preds[i], false);
+ } else {
+ // If the values coming into the block are not the same, we need a PHI.
+ // Create the new PHI node, insert it into NewBB at the end of the block
+ PHINode *NewPHI =
+ PHINode::Create(PN->getType(), PN->getName()+".ph", BI);
+ if (AA) AA->copyValue(PN, NewPHI);
+
+ // Move all of the PHI values for 'Preds' to the new PHI.
+ for (unsigned i = 0; i != NumPreds; ++i) {
+ Value *V = PN->removeIncomingValue(Preds[i], false);
+ NewPHI->addIncoming(V, Preds[i]);
+ }
+ InVal = NewPHI;
+ }
+
+ // Add an incoming value to the PHI node in the loop for the preheader
+ // edge.
+ PN->addIncoming(InVal, NewBB);
+
+ // Check to see if we can eliminate this phi node.
+ if (Value *V = PN->hasConstantValue(DT != 0)) {
+ Instruction *I = dyn_cast<Instruction>(V);
+ if (!I || DT == 0 || DT->dominates(I, PN)) {
+ PN->replaceAllUsesWith(V);
+ if (AA) AA->deleteValue(PN);
+ PN->eraseFromParent();
+ }
+ }
+ }
+
+ return NewBB;
+}
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/BasicInliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/BasicInliner.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/BasicInliner.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/BasicInliner.cpp Sun Jul 6 15:45:41 2008
@@ -26,11 +26,9 @@
using namespace llvm;
-namespace {
- cl::opt<unsigned>
- BasicInlineThreshold("inline-threshold", cl::Hidden, cl::init(200),
- cl::desc("Control the amount of basic inlining to perform (default = 200)"));
-}
+static cl::opt<unsigned>
+BasicInlineThreshold("inline-threshold", cl::Hidden, cl::init(200),
+ cl::desc("Control the amount of basic inlining to perform (default = 200)"));
namespace llvm {
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/BreakCriticalEdges.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/BreakCriticalEdges.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/BreakCriticalEdges.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/BreakCriticalEdges.cpp Sun Jul 6 15:45:41 2008
@@ -48,14 +48,14 @@
AU.addPreservedID(LoopSimplifyID);
}
};
-
- char BreakCriticalEdges::ID = 0;
- RegisterPass<BreakCriticalEdges> X("break-crit-edges",
- "Break critical edges in CFG");
}
+char BreakCriticalEdges::ID = 0;
+static RegisterPass<BreakCriticalEdges>
+X("break-crit-edges", "Break critical edges in CFG");
+
// Publically exposed interface to pass...
-const PassInfo *llvm::BreakCriticalEdgesID = X.getPassInfo();
+const PassInfo *const llvm::BreakCriticalEdgesID = &X;
FunctionPass *llvm::createBreakCriticalEdgesPass() {
return new BreakCriticalEdges();
}
@@ -235,9 +235,12 @@
DominanceFrontier::iterator I = DF->find(DestBB);
if (I != DF->end()) {
DF->addBasicBlock(NewBB, I->second);
- // However NewBB's frontier does not include DestBB.
- DominanceFrontier::iterator NF = DF->find(NewBB);
- DF->removeFromFrontier(NF, DestBB);
+
+ if (I->second.count(DestBB)) {
+ // However NewBB's frontier does not include DestBB.
+ DominanceFrontier::iterator NF = DF->find(NewBB);
+ DF->removeFromFrontier(NF, DestBB);
+ }
}
else
DF->addBasicBlock(NewBB, DominanceFrontier::DomSetType());
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/CloneFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/CloneFunction.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/CloneFunction.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/CloneFunction.cpp Sun Jul 6 15:45:41 2008
@@ -17,6 +17,7 @@
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Instructions.h"
+#include "llvm/GlobalVariable.h"
#include "llvm/Function.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/Compiler.h"
@@ -33,7 +34,6 @@
ClonedCodeInfo *CodeInfo) {
BasicBlock *NewBB = BasicBlock::Create("", F);
if (BB->hasName()) NewBB->setName(BB->getName()+NameSuffix);
- NewBB->setUnwindDest(const_cast<BasicBlock*>(BB->getUnwindDest()));
NewBB->setDoesNotThrow(BB->doesNotThrow());
bool hasCalls = false, hasDynamicAllocas = false, hasStaticAllocas = false;
@@ -81,11 +81,8 @@
assert(ValueMap.count(I) && "No mapping from source argument specified!");
#endif
- // Clone the parameter attributes
- NewFunc->setParamAttrs(OldFunc->getParamAttrs());
-
- // Clone the calling convention
- NewFunc->setCallingConv(OldFunc->getCallingConv());
+ // Clone any attributes.
+ NewFunc->copyAttributesFrom(OldFunc);
// Loop over all of the basic blocks in the function, cloning them as
// appropriate. Note that we save BE this way in order to handle cloning of
@@ -108,15 +105,10 @@
// references as we go. This uses ValueMap to do all the hard work.
//
for (Function::iterator BB = cast<BasicBlock>(ValueMap[OldFunc->begin()]),
- BE = NewFunc->end(); BB != BE; ++BB) {
- // Fix up the unwind destination.
- if (BasicBlock *UnwindDest = BB->getUnwindDest())
- BB->setUnwindDest(cast<BasicBlock>(ValueMap[UnwindDest]));
-
+ BE = NewFunc->end(); BB != BE; ++BB)
// Loop over all instructions, fixing each one as we find it...
for (BasicBlock::iterator II = BB->begin(); II != BB->end(); ++II)
RemapInstruction(II, ValueMap);
- }
}
/// CloneFunction - Return a copy of the specified function, but without
@@ -309,13 +301,20 @@
else
return 0; // All operands not constant!
-
if (const CmpInst *CI = dyn_cast<CmpInst>(I))
return ConstantFoldCompareInstOperands(CI->getPredicate(),
&Ops[0], Ops.size(), TD);
- else
- return ConstantFoldInstOperands(I->getOpcode(), I->getType(),
- &Ops[0], Ops.size(), TD);
+
+ if (const LoadInst *LI = dyn_cast<LoadInst>(I))
+ if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[0]))
+ if (!LI->isVolatile() && CE->getOpcode() == Instruction::GetElementPtr)
+ if (GlobalVariable *GV = dyn_cast<GlobalVariable>(CE->getOperand(0)))
+ if (GV->isConstant() && !GV->isDeclaration())
+ return ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(),
+ CE);
+
+ return ConstantFoldInstOperands(I->getOpcode(), I->getType(), &Ops[0],
+ Ops.size(), TD);
}
/// CloneAndPruneFunctionInto - This works exactly like CloneFunctionInto,
@@ -338,8 +337,8 @@
E = OldFunc->arg_end(); II != E; ++II)
assert(ValueMap.count(II) && "No mapping from source argument specified!");
#endif
-
- PruningFunctionCloner PFC(NewFunc, OldFunc, ValueMap, Returns,
+
+ PruningFunctionCloner PFC(NewFunc, OldFunc, ValueMap, Returns,
NameSuffix, CodeInfo, TD);
// Clone the entry block, and anything recursively reachable from it.
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/CloneLoop.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/CloneLoop.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/CloneLoop.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/CloneLoop.cpp Sun Jul 6 15:45:41 2008
@@ -130,10 +130,6 @@
for(SmallVector<BasicBlock *, 16>::iterator NBItr = NewBlocks.begin(),
NBE = NewBlocks.end(); NBItr != NBE; ++NBItr) {
BasicBlock *NB = *NBItr;
-
- if (BasicBlock *UnwindDest = NB->getUnwindDest())
- NB->setUnwindDest(cast<BasicBlock>(ValueMap[UnwindDest]));
-
for(BasicBlock::iterator BI = NB->begin(), BE = NB->end();
BI != BE; ++BI) {
Instruction *Insn = BI;
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/CloneModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/CloneModule.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/CloneModule.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/CloneModule.cpp Sun Jul 6 15:45:41 2008
@@ -65,10 +65,7 @@
Function *NF =
Function::Create(cast<FunctionType>(I->getType()->getElementType()),
GlobalValue::ExternalLinkage, I->getName(), New);
- NF->setCallingConv(I->getCallingConv());
- NF->setParamAttrs(I->getParamAttrs());
- if (I->hasCollector())
- NF->setCollector(I->getCollector());
+ NF->copyAttributesFrom(I);
ValueMap[I]= NF;
}
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/CloneTrace.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/CloneTrace.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/CloneTrace.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/CloneTrace.cpp Sun Jul 6 15:45:41 2008
@@ -68,11 +68,6 @@
//Second loop to do the remapping
for (std::vector<BasicBlock *>::const_iterator BB = clonedTrace.begin(),
BE = clonedTrace.end(); BB != BE; ++BB) {
-
- //Remap the unwind destination
- if (BasicBlock *UnwindDest = (*BB)->getUnwindDest())
- (*BB)->setUnwindDest(cast<BasicBlock>(ValueMap[UnwindDest]));
-
for (BasicBlock::iterator I = (*BB)->begin(); I != (*BB)->end(); ++I) {
//Loop over all the operands of the instruction
for (unsigned op=0, E = I->getNumOperands(); op != E; ++op) {
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/CodeExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/CodeExtractor.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/CodeExtractor.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/CodeExtractor.cpp Sun Jul 6 15:45:41 2008
@@ -126,8 +126,7 @@
// containing PHI nodes merging values from outside of the region, and a
// second that contains all of the code for the block and merges back any
// incoming values from inside of the region.
- BasicBlock::iterator AfterPHIs = Header->begin();
- while (isa<PHINode>(AfterPHIs)) ++AfterPHIs;
+ BasicBlock::iterator AfterPHIs = Header->getFirstNonPHI();
BasicBlock *NewBB = Header->splitBasicBlock(AfterPHIs,
Header->getName()+".ce");
@@ -551,18 +550,18 @@
ReturnInst::Create(Constant::getNullValue(OldFnRetTy), TheSwitch);
}
- TheSwitch->getParent()->getInstList().erase(TheSwitch);
+ TheSwitch->eraseFromParent();
break;
case 1:
// Only a single destination, change the switch into an unconditional
// branch.
BranchInst::Create(TheSwitch->getSuccessor(1), TheSwitch);
- TheSwitch->getParent()->getInstList().erase(TheSwitch);
+ TheSwitch->eraseFromParent();
break;
case 2:
BranchInst::Create(TheSwitch->getSuccessor(1), TheSwitch->getSuccessor(2),
call, TheSwitch);
- TheSwitch->getParent()->getInstList().erase(TheSwitch);
+ TheSwitch->eraseFromParent();
break;
default:
// Otherwise, make the default destination of the switch instruction be one
@@ -641,7 +640,8 @@
Function *oldFunction = header->getParent();
// This takes place of the original loop
- BasicBlock *codeReplacer = BasicBlock::Create("codeRepl", oldFunction, header);
+ BasicBlock *codeReplacer = BasicBlock::Create("codeRepl", oldFunction,
+ header);
// The new function needs a root node because other nodes can branch to the
// head of the region, but the entry node of a function cannot have preds.
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/DemoteRegToStack.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/DemoteRegToStack.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/DemoteRegToStack.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/DemoteRegToStack.cpp Sun Jul 6 15:45:41 2008
@@ -127,17 +127,13 @@
for (unsigned i = 0, e = P->getNumIncomingValues(); i < e; ++i) {
if (InvokeInst *II = dyn_cast<InvokeInst>(P->getIncomingValue(i))) {
assert(II->getParent() != P->getIncomingBlock(i) &&
- "Invoke edge not supported yet");
+ "Invoke edge not supported yet"); II=II;
}
new StoreInst(P->getIncomingValue(i), Slot,
P->getIncomingBlock(i)->getTerminator());
}
// Insert load in place of the phi and replace all uses.
- BasicBlock::iterator InsertPt;
- for (InsertPt = P->getParent()->getInstList().begin();
- isa<PHINode>(InsertPt); ++InsertPt)
- ; /*noop */
Value *V = new LoadInst(Slot, P->getName()+".reload", P);
P->replaceAllUsesWith(V);
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/InlineCost.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/InlineCost.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/InlineCost.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/InlineCost.cpp Sun Jul 6 15:45:41 2008
@@ -173,7 +173,7 @@
// make it almost guaranteed to be inlined.
//
if (Callee->hasInternalLinkage() && Callee->hasOneUse())
- InlineCost -= 30000;
+ InlineCost -= 15000;
// If this function uses the coldcc calling convention, prefer not to inline
// it.
@@ -236,7 +236,7 @@
// Don't inline into something too big, which would make it bigger.
//
- InlineCost += Caller->size()/20;
+ InlineCost += Caller->size()/15;
// Look at the size of the callee. Each instruction counts as 5.
InlineCost += CalleeFI.NumInsts*5;
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/InlineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/InlineFunction.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/InlineFunction.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/InlineFunction.cpp Sun Jul 6 15:45:41 2008
@@ -119,7 +119,7 @@
BranchInst::Create(InvokeDest, UI);
// Delete the unwind instruction!
- UI->getParent()->getInstList().pop_back();
+ UI->eraseFromParent();
// Update any PHI nodes in the exceptional block to indicate that
// there is now a new entry in them.
@@ -203,7 +203,6 @@
BasicBlock *OrigBB = TheCall->getParent();
Function *Caller = OrigBB->getParent();
- BasicBlock *UnwindBB = OrigBB->getUnwindDest();
// GC poses two hazards to inlining, which only occur when the callee has GC:
// 1. If the caller has no GC, then the callee's GC must be propagated to the
@@ -230,8 +229,7 @@
{ // Scope to destroy ValueMap after cloning.
DenseMap<const Value*, Value*> ValueMap;
- assert(std::distance(CalledFunc->arg_begin(), CalledFunc->arg_end()) ==
- std::distance(CS.arg_begin(), CS.arg_end()) &&
+ assert(CalledFunc->arg_size() == CS.arg_size() &&
"No varargs calls can be inlined!");
// Calculate the vector of arguments to pass into the function cloner, which
@@ -419,18 +417,6 @@
}
}
- // If we are inlining a function that unwinds into a BB with an unwind dest,
- // turn the inlined unwinds into branches to the unwind dest.
- if (InlinedFunctionInfo.ContainsUnwinds && UnwindBB && isa<CallInst>(TheCall))
- for (Function::iterator BB = FirstNewBlock, E = Caller->end();
- BB != E; ++BB) {
- TerminatorInst *Term = BB->getTerminator();
- if (isa<UnwindInst>(Term)) {
- BranchInst::Create(UnwindBB, Term);
- BB->getInstList().erase(Term);
- }
- }
-
// If we are inlining for an invoke instruction, we must make sure to rewrite
// any inlined 'unwind' instructions into branches to the invoke exception
// destination, and call instructions into invoke instructions.
@@ -456,8 +442,9 @@
// uses of the returned value.
if (!TheCall->use_empty()) {
ReturnInst *R = Returns[0];
- if (R->getNumOperands() > 1) {
- // Multiple return values.
+ if (isa<StructType>(TheCall->getType()) &&
+ TheCall->getType() != R->getOperand(0)->getType()) {
+ // Multiple-value return statements.
while (!TheCall->use_empty()) {
GetResultInst *GR = cast<GetResultInst>(TheCall->use_back());
Value *RV = R->getOperand(GR->getIndex());
@@ -468,10 +455,10 @@
TheCall->replaceAllUsesWith(R->getReturnValue());
}
// Since we are now done with the Call/Invoke, we can delete it.
- TheCall->getParent()->getInstList().erase(TheCall);
+ TheCall->eraseFromParent();
// Since we are now done with the return instruction, delete it also.
- Returns[0]->getParent()->getInstList().erase(Returns[0]);
+ Returns[0]->eraseFromParent();
// We are now done with the inlining.
return true;
@@ -522,6 +509,13 @@
// any users of the original call/invoke instruction.
const Type *RTy = CalledFunc->getReturnType();
const StructType *STy = dyn_cast<StructType>(RTy);
+
+ // We do special handling for multiple-value return statements. If this is
+ // a plain aggregate return, don't do the special handling.
+ if (!Returns.empty() && Returns[0]->getNumOperands() != 0 &&
+ Returns[0]->getOperand(0)->getType() == STy)
+ STy = 0;
+
if (Returns.size() > 1 || STy) {
// The PHI node should go at the front of the new basic block to merge all
// possible incoming values.
@@ -545,7 +539,8 @@
GR->eraseFromParent();
}
} else {
- PHINode *PHI = PHINode::Create(RTy, TheCall->getName(), AfterCallBB->begin());
+ PHINode *PHI = PHINode::Create(RTy, TheCall->getName(),
+ AfterCallBB->begin());
PHIs.push_back(PHI);
// Anything that used the result of the function call should now use the
// PHI node as their operand.
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/LCSSA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/LCSSA.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/LCSSA.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/LCSSA.cpp Sun Jul 6 15:45:41 2008
@@ -17,8 +17,8 @@
// else else
// X2 = ... X2 = ...
// X3 = phi(X1, X2) X3 = phi(X1, X2)
-// ... = X3 + 4 X4 = phi(X3)
-// ... = X4 + 4
+// ... = X3 + 4 X4 = phi(X3)
+// ... = X4 + 4
//
// This is still valid LLVM; the extra phi nodes are purely redundant, and will
// be trivially eliminated by InstCombine. The major benefit of this
@@ -87,20 +87,20 @@
SetVector<Instruction*> &AffectedValues);
Value *GetValueForBlock(DomTreeNode *BB, Instruction *OrigInst,
- std::map<DomTreeNode*, Value*> &Phis);
+ DenseMap<DomTreeNode*, Value*> &Phis);
/// inLoop - returns true if the given block is within the current loop
bool inLoop(BasicBlock* B) {
return std::binary_search(LoopBlocks.begin(), LoopBlocks.end(), B);
}
};
-
- char LCSSA::ID = 0;
- RegisterPass<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass");
}
+
+char LCSSA::ID = 0;
+static RegisterPass<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass");
LoopPass *llvm::createLCSSAPass() { return new LCSSA(); }
-const PassInfo *llvm::LCSSAID = X.getPassInfo();
+const PassInfo *const llvm::LCSSAID = &X;
/// runOnFunction - Process all loops in the function, inner-most out.
bool LCSSA::runOnLoop(Loop *L, LPPassManager &LPM) {
@@ -143,7 +143,7 @@
++NumLCSSA; // We are applying the transformation
// Keep track of the blocks that have the value available already.
- std::map<DomTreeNode*, Value*> Phis;
+ DenseMap<DomTreeNode*, Value*> Phis;
DomTreeNode *InstrNode = DT->getNode(Instr->getParent());
@@ -217,7 +217,27 @@
}
if (*BB != UserBB && !inLoop(UserBB)) {
- AffectedValues.insert(I);
+ const StructType *STy = dyn_cast<StructType>(I->getType());
+ if (STy) {
+ // I is a call or an invoke that returns multiple values.
+ // These values are accessible through getresult only.
+ // If the getresult value is not in the BB then move it
+ // immediately here. It will be processed in next iteration.
+ BasicBlock::iterator InsertPoint;
+ if (InvokeInst *II = dyn_cast<InvokeInst>(I)) {
+ InsertPoint = II->getNormalDest()->getFirstNonPHI();
+ } else {
+ InsertPoint = I;
+ InsertPoint++;
+ }
+ for (Value::use_iterator TmpI = I->use_begin(),
+ TmpE = I->use_end(); TmpI != TmpE; ++TmpI) {
+ GetResultInst *GR = cast<GetResultInst>(TmpI);
+ if (GR->getParent() != *BB)
+ GR->moveBefore(InsertPoint);
+ }
+ } else
+ AffectedValues.insert(I);
break;
}
}
@@ -227,14 +247,13 @@
/// GetValueForBlock - Get the value to use within the specified basic block.
/// available values are in Phis.
Value *LCSSA::GetValueForBlock(DomTreeNode *BB, Instruction *OrigInst,
- std::map<DomTreeNode*, Value*> &Phis) {
+ DenseMap<DomTreeNode*, Value*> &Phis) {
// If there is no dominator info for this BB, it is unreachable.
if (BB == 0)
return UndefValue::get(OrigInst->getType());
// If we have already computed this value, return the previously computed val.
- Value *&V = Phis[BB];
- if (V) return V;
+ if (Phis.count(BB)) return Phis[BB];
DomTreeNode *IDom = BB->getIDom();
@@ -252,17 +271,19 @@
if (!inLoop(IDom->getBlock())) {
// Idom is not in the loop, we must still be "below" the exit block and must
// be fully dominated by the value live in the idom.
- return V = GetValueForBlock(IDom, OrigInst, Phis);
+ Value* val = GetValueForBlock(IDom, OrigInst, Phis);
+ Phis.insert(std::make_pair(BB, val));
+ return val;
}
BasicBlock *BBN = BB->getBlock();
// Otherwise, the idom is the loop, so we need to insert a PHI node. Do so
// now, then get values to fill in the incoming values for the PHI.
- PHINode *PN = PHINode::Create(OrigInst->getType(), OrigInst->getName()+".lcssa",
- BBN->begin());
+ PHINode *PN = PHINode::Create(OrigInst->getType(),
+ OrigInst->getName() + ".lcssa", BBN->begin());
PN->reserveOperandSpace(std::distance(pred_begin(BBN), pred_end(BBN)));
- V = PN;
+ Phis.insert(std::make_pair(BB, PN));
// Fill in the incoming values for the block.
for (pred_iterator PI = pred_begin(BBN), E = pred_end(BBN); PI != E; ++PI)
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/Local.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/Local.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/Local.cpp Sun Jul 6 15:45:41 2008
@@ -159,7 +159,7 @@
BranchInst::Create(SI->getSuccessor(1), SI->getSuccessor(0), Cond, SI);
// Delete the old switch...
- SI->getParent()->getInstList().erase(SI);
+ SI->eraseFromParent();
return true;
}
}
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/LoopSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/LoopSimplify.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/LoopSimplify.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/LoopSimplify.cpp Sun Jul 6 15:45:41 2008
@@ -41,6 +41,7 @@
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/LoopInfo.h"
+#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/Compiler.h"
#include "llvm/ADT/SetOperations.h"
@@ -72,6 +73,7 @@
AU.addPreserved<LoopInfo>();
AU.addPreserved<DominatorTree>();
AU.addPreserved<DominanceFrontier>();
+ AU.addPreserved<AliasAnalysis>();
AU.addPreservedID(BreakCriticalEdgesID); // No critical edges added.
}
@@ -86,24 +88,22 @@
private:
bool ProcessLoop(Loop *L);
- BasicBlock *SplitBlockPredecessors(BasicBlock *BB, const char *Suffix,
- const std::vector<BasicBlock*> &Preds);
BasicBlock *RewriteLoopExitBlock(Loop *L, BasicBlock *Exit);
void InsertPreheaderForLoop(Loop *L);
Loop *SeparateNestedLoop(Loop *L);
void InsertUniqueBackedgeBlock(Loop *L);
void PlaceSplitBlockCarefully(BasicBlock *NewBB,
- std::vector<BasicBlock*> &SplitPreds,
+ SmallVectorImpl<BasicBlock*> &SplitPreds,
Loop *L);
};
-
- char LoopSimplify::ID = 0;
- RegisterPass<LoopSimplify>
- X("loopsimplify", "Canonicalize natural loops", true);
}
+char LoopSimplify::ID = 0;
+static RegisterPass<LoopSimplify>
+X("loopsimplify", "Canonicalize natural loops", true);
+
// Publically exposed interface to pass...
-const PassInfo *llvm::LoopSimplifyID = X.getPassInfo();
+const PassInfo *const llvm::LoopSimplifyID = &X;
FunctionPass *llvm::createLoopSimplifyPass() { return new LoopSimplify(); }
/// runOnFunction - Run down all loops in the CFG (recursively, but we could do
@@ -126,17 +126,18 @@
if (LI->getLoopFor(BB)) continue;
bool BlockUnreachable = false;
+ TerminatorInst *TI = BB->getTerminator();
// Check to see if any successors of this block are non-loop-header loops
// that are not the header.
- for (succ_iterator I = succ_begin(BB), E = succ_end(BB); I != E; ++I) {
+ for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) {
// If this successor is not in a loop, BB is clearly ok.
- Loop *L = LI->getLoopFor(*I);
+ Loop *L = LI->getLoopFor(TI->getSuccessor(i));
if (!L) continue;
// If the succ is the loop header, and if L is a top-level loop, then this
// is an entrance into a loop through the header, which is also ok.
- if (L->getHeader() == *I && L->getParentLoop() == 0)
+ if (L->getHeader() == TI->getSuccessor(i) && L->getParentLoop() == 0)
continue;
// Otherwise, this is an entrance into a loop from some place invalid.
@@ -154,11 +155,10 @@
// loop by replacing the terminator.
// Remove PHI entries from the successors.
- for (succ_iterator I = succ_begin(BB), E = succ_end(BB); I != E; ++I)
- (*I)->removePredecessor(BB);
+ for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i)
+ TI->getSuccessor(i)->removePredecessor(BB);
// Add a new unreachable instruction before the old terminator.
- TerminatorInst *TI = BB->getTerminator();
new UnreachableInst(TI);
// Delete the dead terminator.
@@ -253,111 +253,12 @@
for (BasicBlock::iterator I = L->getHeader()->begin();
(PN = dyn_cast<PHINode>(I++)); )
if (Value *V = PN->hasConstantValue()) {
- PN->replaceAllUsesWith(V);
- PN->eraseFromParent();
- }
-
- return Changed;
-}
-
-/// SplitBlockPredecessors - Split the specified block into two blocks. We want
-/// to move the predecessors specified in the Preds list to point to the new
-/// block, leaving the remaining predecessors pointing to BB. This method
-/// updates the SSA PHINode's and AliasAnalysis, but no other analyses.
-///
-BasicBlock *LoopSimplify::SplitBlockPredecessors(BasicBlock *BB,
- const char *Suffix,
- const std::vector<BasicBlock*> &Preds) {
-
- // Create new basic block, insert right before the original block...
- BasicBlock *NewBB =
- BasicBlock::Create(BB->getName()+Suffix, BB->getParent(), BB);
-
- // The preheader first gets an unconditional branch to the loop header...
- BranchInst *BI = BranchInst::Create(BB, NewBB);
-
- // For every PHI node in the block, insert a PHI node into NewBB where the
- // incoming values from the out of loop edges are moved to NewBB. We have two
- // possible cases here. If the loop is dead, we just insert dummy entries
- // into the PHI nodes for the new edge. If the loop is not dead, we move the
- // incoming edges in BB into new PHI nodes in NewBB.
- //
- if (Preds.empty()) { // Is the loop obviously dead?
- for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- // Insert dummy values as the incoming value...
- PN->addIncoming(Constant::getNullValue(PN->getType()), NewBB);
+ if (AA) AA->deleteValue(PN);
+ PN->replaceAllUsesWith(V);
+ PN->eraseFromParent();
}
- return NewBB;
- }
-
- // Check to see if the values being merged into the new block need PHI
- // nodes. If so, insert them.
- for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ) {
- PHINode *PN = cast<PHINode>(I);
- ++I;
-
- // Check to see if all of the values coming in are the same. If so, we
- // don't need to create a new PHI node.
- Value *InVal = PN->getIncomingValueForBlock(Preds[0]);
- for (unsigned i = 1, e = Preds.size(); i != e; ++i)
- if (InVal != PN->getIncomingValueForBlock(Preds[i])) {
- InVal = 0;
- break;
- }
- // If the values coming into the block are not the same, we need a PHI.
- if (InVal == 0) {
- // Create the new PHI node, insert it into NewBB at the end of the block
- PHINode *NewPHI =
- PHINode::Create(PN->getType(), PN->getName()+".ph", BI);
- if (AA) AA->copyValue(PN, NewPHI);
-
- // Move all of the edges from blocks outside the loop to the new PHI
- for (unsigned i = 0, e = Preds.size(); i != e; ++i) {
- Value *V = PN->removeIncomingValue(Preds[i], false);
- NewPHI->addIncoming(V, Preds[i]);
- }
- InVal = NewPHI;
- } else {
- // Remove all of the edges coming into the PHI nodes from outside of the
- // block.
- for (unsigned i = 0, e = Preds.size(); i != e; ++i)
- PN->removeIncomingValue(Preds[i], false);
- }
-
- // Add an incoming value to the PHI node in the loop for the preheader
- // edge.
- PN->addIncoming(InVal, NewBB);
-
- // Can we eliminate this phi node now?
- if (Value *V = PN->hasConstantValue(true)) {
- Instruction *I = dyn_cast<Instruction>(V);
- // If I is in NewBB, the Dominator call will fail, because NewBB isn't
- // registered in DominatorTree yet. Handle this case explicitly.
- if (!I || (I->getParent() != NewBB &&
- getAnalysis<DominatorTree>().dominates(I, PN))) {
- PN->replaceAllUsesWith(V);
- if (AA) AA->deleteValue(PN);
- BB->getInstList().erase(PN);
- }
- }
- }
-
- // Now that the PHI nodes are updated, actually move the edges from
- // Preds to point to NewBB instead of BB.
- //
- for (unsigned i = 0, e = Preds.size(); i != e; ++i) {
- TerminatorInst *TI = Preds[i]->getTerminator();
- for (unsigned s = 0, e = TI->getNumSuccessors(); s != e; ++s)
- if (TI->getSuccessor(s) == BB)
- TI->setSuccessor(s, NewBB);
-
- if (Preds[i]->getUnwindDest() == BB)
- Preds[i]->setUnwindDest(NewBB);
- }
-
- return NewBB;
+ return Changed;
}
/// InsertPreheaderForLoop - Once we discover that a loop doesn't have a
@@ -368,7 +269,7 @@
BasicBlock *Header = L->getHeader();
// Compute the set of predecessors of the loop that are not in the loop.
- std::vector<BasicBlock*> OutsideBlocks;
+ SmallVector<BasicBlock*, 8> OutsideBlocks;
for (pred_iterator PI = pred_begin(Header), PE = pred_end(Header);
PI != PE; ++PI)
if (!L->contains(*PI)) // Coming in from outside the loop?
@@ -376,7 +277,8 @@
// Split out the loop pre-header.
BasicBlock *NewBB =
- SplitBlockPredecessors(Header, ".preheader", OutsideBlocks);
+ SplitBlockPredecessors(Header, &OutsideBlocks[0], OutsideBlocks.size(),
+ ".preheader", this);
//===--------------------------------------------------------------------===//
@@ -387,10 +289,6 @@
if (Loop *Parent = L->getParentLoop())
Parent->addBasicBlockToLoop(NewBB, LI->getBase());
- DT->splitBlock(NewBB);
- if (DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>())
- DF->splitBlock(NewBB);
-
// Make sure that NewBB is put someplace intelligent, which doesn't mess up
// code layout too horribly.
PlaceSplitBlockCarefully(NewBB, OutsideBlocks, L);
@@ -400,13 +298,15 @@
/// blocks. This method is used to split exit blocks that have predecessors
/// outside of the loop.
BasicBlock *LoopSimplify::RewriteLoopExitBlock(Loop *L, BasicBlock *Exit) {
- std::vector<BasicBlock*> LoopBlocks;
+ SmallVector<BasicBlock*, 8> LoopBlocks;
for (pred_iterator I = pred_begin(Exit), E = pred_end(Exit); I != E; ++I)
if (L->contains(*I))
LoopBlocks.push_back(*I);
assert(!LoopBlocks.empty() && "No edges coming in from outside the loop?");
- BasicBlock *NewBB = SplitBlockPredecessors(Exit, ".loopexit", LoopBlocks);
+ BasicBlock *NewBB = SplitBlockPredecessors(Exit, &LoopBlocks[0],
+ LoopBlocks.size(), ".loopexit",
+ this);
// Update Loop Information - we know that the new block will be in whichever
// loop the Exit block is in. Note that it may not be in that immediate loop,
@@ -419,11 +319,6 @@
if (SuccLoop)
SuccLoop->addBasicBlockToLoop(NewBB, LI->getBase());
- // Update Dominator Information
- DT->splitBlock(NewBB);
- if (DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>())
- DF->splitBlock(NewBB);
-
return NewBB;
}
@@ -476,7 +371,7 @@
// right after some 'outside block' block. This prevents the preheader from
// being placed inside the loop body, e.g. when the loop hasn't been rotated.
void LoopSimplify::PlaceSplitBlockCarefully(BasicBlock *NewBB,
- std::vector<BasicBlock*>&SplitPreds,
+ SmallVectorImpl<BasicBlock*> &SplitPreds,
Loop *L) {
// Check to see if NewBB is already well placed.
Function::iterator BBI = NewBB; --BBI;
@@ -534,19 +429,16 @@
// Pull out all predecessors that have varying values in the loop. This
// handles the case when a PHI node has multiple instances of itself as
// arguments.
- std::vector<BasicBlock*> OuterLoopPreds;
+ SmallVector<BasicBlock*, 8> OuterLoopPreds;
for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
if (PN->getIncomingValue(i) != PN ||
!L->contains(PN->getIncomingBlock(i)))
OuterLoopPreds.push_back(PN->getIncomingBlock(i));
BasicBlock *Header = L->getHeader();
- BasicBlock *NewBB = SplitBlockPredecessors(Header, ".outer", OuterLoopPreds);
-
- // Update dominator information
- DT->splitBlock(NewBB);
- if (DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>())
- DF->splitBlock(NewBB);
+ BasicBlock *NewBB = SplitBlockPredecessors(Header, &OuterLoopPreds[0],
+ OuterLoopPreds.size(),
+ ".outer", this);
// Make sure that NewBB is put someplace intelligent, which doesn't mess up
// code layout too horribly.
@@ -568,8 +460,9 @@
// L is now a subloop of our outer loop.
NewOuter->addChildLoop(L);
- for (unsigned i = 0, e = L->getBlocks().size(); i != e; ++i)
- NewOuter->addBlockEntry(L->getBlocks()[i]);
+ for (Loop::block_iterator I = L->block_begin(), E = L->block_end();
+ I != E; ++I)
+ NewOuter->addBlockEntry(*I);
// Determine which blocks should stay in L and which should be moved out to
// the Outer loop now.
@@ -686,15 +579,12 @@
}
// Now that all of the PHI nodes have been inserted and adjusted, modify the
- // backedge blocks to branch to the BEBlock instead of the header.
+ // backedge blocks to just to the BEBlock instead of the header.
for (unsigned i = 0, e = BackedgeBlocks.size(); i != e; ++i) {
TerminatorInst *TI = BackedgeBlocks[i]->getTerminator();
for (unsigned Op = 0, e = TI->getNumSuccessors(); Op != e; ++Op)
if (TI->getSuccessor(Op) == Header)
TI->setSuccessor(Op, BEBlock);
-
- if (BackedgeBlocks[i]->getUnwindDest() == Header)
- BackedgeBlocks[i]->setUnwindDest(BEBlock);
}
//===--- Update all analyses which we must preserve now -----------------===//
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/LowerAllocations.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/LowerAllocations.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/LowerAllocations.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/LowerAllocations.cpp Sun Jul 6 15:45:41 2008
@@ -66,14 +66,14 @@
///
bool runOnBasicBlock(BasicBlock &BB);
};
-
- char LowerAllocations::ID = 0;
- RegisterPass<LowerAllocations>
- X("lowerallocs", "Lower allocations from instructions to calls");
}
+char LowerAllocations::ID = 0;
+static RegisterPass<LowerAllocations>
+X("lowerallocs", "Lower allocations from instructions to calls");
+
// Publically exposed interface to pass...
-const PassInfo *llvm::LowerAllocationsID = X.getPassInfo();
+const PassInfo *const llvm::LowerAllocationsID = &X;
// createLowerAllocationsPass - Interface to this file...
Pass *llvm::createLowerAllocationsPass(bool LowerMallocArgToInteger) {
return new LowerAllocations(LowerMallocArgToInteger);
@@ -131,11 +131,11 @@
} else {
Value *Scale = MI->getOperand(0);
if (Scale->getType() != IntPtrTy)
- Scale = CastInst::createIntegerCast(Scale, IntPtrTy, false /*ZExt*/,
+ Scale = CastInst::CreateIntegerCast(Scale, IntPtrTy, false /*ZExt*/,
"", I);
// Multiply it by the array size if necessary...
- MallocArg = BinaryOperator::create(Instruction::Mul, Scale,
+ MallocArg = BinaryOperator::Create(Instruction::Mul, Scale,
MallocArg, "", I);
}
}
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/LowerInvoke.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/LowerInvoke.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/LowerInvoke.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/LowerInvoke.cpp Sun Jul 6 15:45:41 2008
@@ -98,13 +98,13 @@
AllocaInst *InvokeNum, SwitchInst *CatchSwitch);
bool insertExpensiveEHSupport(Function &F);
};
-
- char LowerInvoke::ID = 0;
- RegisterPass<LowerInvoke>
- X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators");
}
-const PassInfo *llvm::LowerInvokePassID = X.getPassInfo();
+char LowerInvoke::ID = 0;
+static RegisterPass<LowerInvoke>
+X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators");
+
+const PassInfo *const llvm::LowerInvokePassID = &X;
// Public Interface To the LowerInvoke pass.
FunctionPass *llvm::createLowerInvokePass(const TargetLowering *TLI) {
@@ -282,8 +282,7 @@
// location afterward.
new StoreInst(InvokeNoC, InvokeNum, true, II); // volatile
- BasicBlock::iterator NI = II->getNormalDest()->begin();
- while (isa<PHINode>(NI)) ++NI;
+ BasicBlock::iterator NI = II->getNormalDest()->getFirstNonPHI();
// nonvolatile.
new StoreInst(Constant::getNullValue(Type::Int32Ty), InvokeNum, false, NI);
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/LowerSwitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/LowerSwitch.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/LowerSwitch.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/LowerSwitch.cpp Sun Jul 6 15:45:41 2008
@@ -77,14 +77,14 @@
return CI1->getValue().slt(CI2->getValue());
}
};
-
- char LowerSwitch::ID = 0;
- RegisterPass<LowerSwitch>
- X("lowerswitch", "Lower SwitchInst's to branches");
}
+char LowerSwitch::ID = 0;
+static RegisterPass<LowerSwitch>
+X("lowerswitch", "Lower SwitchInst's to branches");
+
// Publically exposed interface to pass...
-const PassInfo *llvm::LowerSwitchID = X.getPassInfo();
+const PassInfo *const llvm::LowerSwitchID = &X;
// createLowerSwitchPass - Interface to this file...
FunctionPass *llvm::createLowerSwitchPass() {
return new LowerSwitch();
@@ -202,7 +202,7 @@
} else {
// Emit V-Lo <=u Hi-Lo
Constant* NegLo = ConstantExpr::getNeg(Leaf.Low);
- Instruction* Add = BinaryOperator::createAdd(Val, NegLo,
+ Instruction* Add = BinaryOperator::CreateAdd(Val, NegLo,
Val->getName()+".off",
NewLeaf);
Constant *UpperBound = ConstantExpr::getAdd(NegLo, Leaf.High);
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/Mem2Reg.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/Mem2Reg.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/Mem2Reg.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/Mem2Reg.cpp Sun Jul 6 15:45:41 2008
@@ -48,11 +48,11 @@
AU.addPreservedID(LowerAllocationsID);
}
};
-
- char PromotePass::ID = 0;
- RegisterPass<PromotePass> X("mem2reg", "Promote Memory to Register");
} // end of anonymous namespace
+char PromotePass::ID = 0;
+static RegisterPass<PromotePass> X("mem2reg", "Promote Memory to Register");
+
bool PromotePass::runOnFunction(Function &F) {
std::vector<AllocaInst*> Allocas;
@@ -84,7 +84,7 @@
}
// Publically exposed interface to pass...
-const PassInfo *llvm::PromoteMemoryToRegisterID = X.getPassInfo();
+const PassInfo *const llvm::PromoteMemoryToRegisterID = &X;
// createPromoteMemoryToRegister - Provide an entry point to create this pass.
//
FunctionPass *llvm::createPromoteMemoryToRegisterPass() {
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/SimplifyCFG.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/SimplifyCFG.cpp Sun Jul 6 15:45:41 2008
@@ -23,12 +23,15 @@
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/ADT/Statistic.h"
#include <algorithm>
#include <functional>
#include <set>
#include <map>
using namespace llvm;
+STATISTIC(NumSpeculations, "Number of speculative executed instructions");
+
/// SafeToMergeTerminators - Return true if it is safe to merge these two
/// terminator instructions together.
///
@@ -80,63 +83,93 @@
static bool CanPropagatePredecessorsForPHIs(BasicBlock *BB, BasicBlock *Succ) {
assert(*succ_begin(BB) == Succ && "Succ is not successor of BB!");
- // Check to see if one of the predecessors of BB is already a predecessor of
- // Succ. If so, we cannot do the transformation if there are any PHI nodes
- // with incompatible values coming in from the two edges!
- //
- if (isa<PHINode>(Succ->front())) {
- SmallPtrSet<BasicBlock*, 16> BBPreds(pred_begin(BB), pred_end(BB));
- for (pred_iterator PI = pred_begin(Succ), PE = pred_end(Succ);
- PI != PE; ++PI)
- if (BBPreds.count(*PI)) {
- // Loop over all of the PHI nodes checking to see if there are
- // incompatible values coming in.
- for (BasicBlock::iterator I = Succ->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- // Loop up the entries in the PHI node for BB and for *PI if the
- // values coming in are non-equal, we cannot merge these two blocks
- // (instead we should insert a conditional move or something, then
- // merge the blocks).
- if (PN->getIncomingValueForBlock(BB) !=
- PN->getIncomingValueForBlock(*PI))
- return false; // Values are not equal...
+ DOUT << "Looking to fold " << BB->getNameStart() << " into "
+ << Succ->getNameStart() << "\n";
+ // Shortcut, if there is only a single predecessor is must be BB and merging
+ // is always safe
+ if (Succ->getSinglePredecessor()) return true;
+
+ typedef SmallPtrSet<Instruction*, 16> InstrSet;
+ InstrSet BBPHIs;
+
+ // Make a list of all phi nodes in BB
+ BasicBlock::iterator BBI = BB->begin();
+ while (isa<PHINode>(*BBI)) BBPHIs.insert(BBI++);
+
+ // Make a list of the predecessors of BB
+ typedef SmallPtrSet<BasicBlock*, 16> BlockSet;
+ BlockSet BBPreds(pred_begin(BB), pred_end(BB));
+
+ // Use that list to make another list of common predecessors of BB and Succ
+ BlockSet CommonPreds;
+ for (pred_iterator PI = pred_begin(Succ), PE = pred_end(Succ);
+ PI != PE; ++PI)
+ if (BBPreds.count(*PI))
+ CommonPreds.insert(*PI);
+
+ // Shortcut, if there are no common predecessors, merging is always safe
+ if (CommonPreds.begin() == CommonPreds.end())
+ return true;
+
+ // Look at all the phi nodes in Succ, to see if they present a conflict when
+ // merging these blocks
+ for (BasicBlock::iterator I = Succ->begin(); isa<PHINode>(I); ++I) {
+ PHINode *PN = cast<PHINode>(I);
+
+ // If the incoming value from BB is again a PHINode in
+ // BB which has the same incoming value for *PI as PN does, we can
+ // merge the phi nodes and then the blocks can still be merged
+ PHINode *BBPN = dyn_cast<PHINode>(PN->getIncomingValueForBlock(BB));
+ if (BBPN && BBPN->getParent() == BB) {
+ for (BlockSet::iterator PI = CommonPreds.begin(), PE = CommonPreds.end();
+ PI != PE; PI++) {
+ if (BBPN->getIncomingValueForBlock(*PI)
+ != PN->getIncomingValueForBlock(*PI)) {
+ DOUT << "Can't fold, phi node " << *PN->getNameStart() << " in "
+ << Succ->getNameStart() << " is conflicting with "
+ << BBPN->getNameStart() << " with regard to common predecessor "
+ << (*PI)->getNameStart() << "\n";
+ return false;
+ }
+ }
+ // Remove this phinode from the list of phis in BB, since it has been
+ // handled.
+ BBPHIs.erase(BBPN);
+ } else {
+ Value* Val = PN->getIncomingValueForBlock(BB);
+ for (BlockSet::iterator PI = CommonPreds.begin(), PE = CommonPreds.end();
+ PI != PE; PI++) {
+ // See if the incoming value for the common predecessor is equal to the
+ // one for BB, in which case this phi node will not prevent the merging
+ // of the block.
+ if (Val != PN->getIncomingValueForBlock(*PI)) {
+ DOUT << "Can't fold, phi node " << *PN->getNameStart() << " in "
+ << Succ->getNameStart() << " is conflicting with regard to common "
+ << "predecessor " << (*PI)->getNameStart() << "\n";
+ return false;
}
}
- }
-
- // Finally, if BB has PHI nodes that are used by things other than the PHIs in
- // Succ and Succ has predecessors that are not Succ and not Pred, we cannot
- // fold these blocks, as we don't know whether BB dominates Succ or not to
- // update the PHI nodes correctly.
- if (!isa<PHINode>(BB->begin()) || Succ->getSinglePredecessor()) return true;
-
- // If the predecessors of Succ are only BB, handle it.
- bool IsSafe = true;
- for (pred_iterator PI = pred_begin(Succ), E = pred_end(Succ); PI != E; ++PI)
- if (*PI != BB) {
- IsSafe = false;
- break;
}
- if (IsSafe) return true;
-
- // If the PHI nodes in BB are only used by instructions in Succ, we are ok if
- // BB and Succ have no common predecessors.
- for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- for (Value::use_iterator UI = PN->use_begin(), E = PN->use_end(); UI != E;
- ++UI)
- if (cast<Instruction>(*UI)->getParent() != Succ)
+ }
+
+ // If there are any other phi nodes in BB that don't have a phi node in Succ
+ // to merge with, they must be moved to Succ completely. However, for any
+ // predecessors of Succ, branches will be added to the phi node that just
+ // point to itself. So, for any common predecessors, this must not cause
+ // conflicts.
+ for (InstrSet::iterator I = BBPHIs.begin(), E = BBPHIs.end();
+ I != E; I++) {
+ PHINode *PN = cast<PHINode>(*I);
+ for (BlockSet::iterator PI = CommonPreds.begin(), PE = CommonPreds.end();
+ PI != PE; PI++)
+ if (PN->getIncomingValueForBlock(*PI) != PN) {
+ DOUT << "Can't fold, phi node " << *PN->getNameStart() << " in "
+ << BB->getNameStart() << " is conflicting with regard to common "
+ << "predecessor " << (*PI)->getNameStart() << "\n";
return false;
+ }
}
-
- // Scan the predecessor sets of BB and Succ, making sure there are no common
- // predecessors. Common predecessors would cause us to build a phi node with
- // differing incoming values, which is not legal.
- SmallPtrSet<BasicBlock*, 16> BBPreds(pred_begin(BB), pred_end(BB));
- for (pred_iterator PI = pred_begin(Succ), E = pred_end(Succ); PI != E; ++PI)
- if (BBPreds.count(*PI))
- return false;
-
+
return true;
}
@@ -145,11 +178,8 @@
/// branch. If possible, eliminate BB.
static bool TryToSimplifyUncondBranchFromEmptyBlock(BasicBlock *BB,
BasicBlock *Succ) {
- // If our successor has PHI nodes, then we need to update them to include
- // entries for BB's predecessors, not for BB itself. Be careful though,
- // if this transformation fails (returns true) then we cannot do this
- // transformation!
- //
+ // Check to see if merging these blocks would cause conflicts for any of the
+ // phi nodes in BB or Succ. If not, we can safely merge.
if (!CanPropagatePredecessorsForPHIs(BB, Succ)) return false;
DOUT << "Killing Trivial BB: \n" << *BB;
@@ -171,6 +201,11 @@
if (isa<PHINode>(OldVal) && cast<PHINode>(OldVal)->getParent() == BB) {
PHINode *OldValPN = cast<PHINode>(OldVal);
for (unsigned i = 0, e = OldValPN->getNumIncomingValues(); i != e; ++i)
+ // Note that, since we are merging phi nodes and BB and Succ might
+ // have common predecessors, we could end up with a phi node with
+ // identical incoming branches. This will be cleaned up later (and
+ // will trigger asserts if we try to clean it up now, without also
+ // simplifying the corresponding conditional branch).
PN->addIncoming(OldValPN->getIncomingValue(i),
OldValPN->getIncomingBlock(i));
} else {
@@ -193,19 +228,21 @@
// users of the PHI nodes.
PN->eraseFromParent();
} else {
- // The instruction is alive, so this means that Succ must have
- // *ONLY* had BB as a predecessor, and the PHI node is still valid
- // now. Simply move it into Succ, because we know that BB
- // strictly dominated Succ.
+ // The instruction is alive, so this means that BB must dominate all
+ // predecessors of Succ (Since all uses of the PN are after its
+ // definition, so in Succ or a block dominated by Succ. If a predecessor
+ // of Succ would not be dominated by BB, PN would violate the def before
+ // use SSA demand). Therefore, we can simply move the phi node to the
+ // next block.
Succ->getInstList().splice(Succ->begin(),
BB->getInstList(), BB->begin());
// We need to add new entries for the PHI node to account for
// predecessors of Succ that the PHI node does not take into
- // account. At this point, since we know that BB dominated succ,
- // this means that we should any newly added incoming edges should
- // use the PHI node as the value for these edges, because they are
- // loop back edges.
+ // account. At this point, since we know that BB dominated succ and all
+ // of its predecessors, this means that we should any newly added
+ // incoming edges should use the PHI node itself as the value for these
+ // edges, because they are loop back edges.
for (unsigned i = 0, e = OldSuccPreds.size(); i != e; ++i)
if (OldSuccPreds[i] != BB)
PN->addIncoming(PN, OldSuccPreds[i]);
@@ -377,8 +414,8 @@
// Okay, we can only really hoist these out if their operands are not
// defined in the conditional region.
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (!DominatesMergePoint(I->getOperand(i), BB, 0))
+ for (User::op_iterator i = I->op_begin(), e = I->op_end(); i != e; ++i)
+ if (!DominatesMergePoint(*i, BB, 0))
return false;
// Okay, it's safe to do this! Remember this instruction.
AggressiveInsts->insert(I);
@@ -481,8 +518,8 @@
}
// Add operands of dead instruction to worklist.
- for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (Instruction *OpI = dyn_cast<Instruction>(I->getOperand(i)))
+ for (User::op_iterator i = I->op_begin(), e = I->op_end(); i != e; ++i)
+ if (Instruction *OpI = dyn_cast<Instruction>(*i))
InstrsToInspect.push_back(OpI);
// Remove dead instruction.
@@ -802,7 +839,8 @@
AddPredecessorToBlock(NewSuccessors[i], Pred, BB);
// Now that the successors are updated, create the new Switch instruction.
- SwitchInst *NewSI = SwitchInst::Create(CV, PredDefault, PredCases.size(), PTI);
+ SwitchInst *NewSI = SwitchInst::Create(CV, PredDefault,
+ PredCases.size(), PTI);
for (unsigned i = 0, e = PredCases.size(); i != e; ++i)
NewSI->addCase(PredCases[i].first, PredCases[i].second);
@@ -920,6 +958,129 @@
return true;
}
+/// SpeculativelyExecuteBB - Given a conditional branch that goes to BB1
+/// and an BB2 and the only successor of BB1 is BB2, hoist simple code
+/// (for now, restricted to a single instruction that's side effect free) from
+/// the BB1 into the branch block to speculatively execute it.
+static bool SpeculativelyExecuteBB(BranchInst *BI, BasicBlock *BB1) {
+ // Only speculatively execution a single instruction (not counting the
+ // terminator) for now.
+ BasicBlock::iterator BBI = BB1->begin();
+ ++BBI; // must have at least a terminator
+ if (BBI == BB1->end()) return false; // only one inst
+ ++BBI;
+ if (BBI != BB1->end()) return false; // more than 2 insts.
+
+ // Be conservative for now. FP select instruction can often be expensive.
+ Value *BrCond = BI->getCondition();
+ if (isa<Instruction>(BrCond) &&
+ cast<Instruction>(BrCond)->getOpcode() == Instruction::FCmp)
+ return false;
+
+ // If BB1 is actually on the false edge of the conditional branch, remember
+ // to swap the select operands later.
+ bool Invert = false;
+ if (BB1 != BI->getSuccessor(0)) {
+ assert(BB1 == BI->getSuccessor(1) && "No edge from 'if' block?");
+ Invert = true;
+ }
+
+ // Turn
+ // BB:
+ // %t1 = icmp
+ // br i1 %t1, label %BB1, label %BB2
+ // BB1:
+ // %t3 = add %t2, c
+ // br label BB2
+ // BB2:
+ // =>
+ // BB:
+ // %t1 = icmp
+ // %t4 = add %t2, c
+ // %t3 = select i1 %t1, %t2, %t3
+ Instruction *I = BB1->begin();
+ switch (I->getOpcode()) {
+ default: return false; // Not safe / profitable to hoist.
+ case Instruction::Add:
+ case Instruction::Sub:
+ case Instruction::And:
+ case Instruction::Or:
+ case Instruction::Xor:
+ case Instruction::Shl:
+ case Instruction::LShr:
+ case Instruction::AShr:
+ if (!I->getOperand(0)->getType()->isInteger())
+ // FP arithmetic might trap. Not worth doing for vector ops.
+ return false;
+ break; // These are all cheap and non-trapping instructions.
+ }
+
+ // Can we speculatively execute the instruction? And what is the value
+ // if the condition is false? Consider the phi uses, if the incoming value
+ // from the "if" block are all the same V, then V is the value of the
+ // select if the condition is false.
+ BasicBlock *BIParent = BI->getParent();
+ SmallVector<PHINode*, 4> PHIUses;
+ Value *FalseV = NULL;
+ for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
+ UI != E; ++UI) {
+ PHINode *PN = dyn_cast<PHINode>(UI);
+ if (!PN)
+ continue;
+ PHIUses.push_back(PN);
+ Value *PHIV = PN->getIncomingValueForBlock(BIParent);
+ if (!FalseV)
+ FalseV = PHIV;
+ else if (FalseV != PHIV)
+ return false; // Don't know the value when condition is false.
+ }
+ if (!FalseV) // Can this happen?
+ return false;
+
+ // Do not hoist the instruction if any of its operands are defined but not
+ // used in this BB. The transformation will prevent the operand from
+ // being sunk into the use block.
+ for (User::op_iterator i = I->op_begin(), e = I->op_end(); i != e; ++i) {
+ Instruction *OpI = dyn_cast<Instruction>(*i);
+ if (OpI && OpI->getParent() == BIParent &&
+ !OpI->isUsedInBasicBlock(BIParent))
+ return false;
+ }
+
+ // If we get here, we can hoist the instruction. Try to place it before the
+ // icmp instruction preceeding the conditional branch.
+ BasicBlock::iterator InsertPos = BI;
+ if (InsertPos != BIParent->begin())
+ --InsertPos;
+ if (InsertPos == BrCond && !isa<PHINode>(BrCond))
+ BIParent->getInstList().splice(InsertPos, BB1->getInstList(), I);
+ else
+ BIParent->getInstList().splice(BI, BB1->getInstList(), I);
+
+ // Create a select whose true value is the speculatively executed value and
+ // false value is the previously determined FalseV.
+ SelectInst *SI;
+ if (Invert)
+ SI = SelectInst::Create(BrCond, FalseV, I,
+ FalseV->getName() + "." + I->getName(), BI);
+ else
+ SI = SelectInst::Create(BrCond, I, FalseV,
+ I->getName() + "." + FalseV->getName(), BI);
+
+ // Make the PHI node use the select for all incoming values for "then" and
+ // "if" blocks.
+ for (unsigned i = 0, e = PHIUses.size(); i != e; ++i) {
+ PHINode *PN = PHIUses[i];
+ for (unsigned j = 0, ee = PN->getNumIncomingValues(); j != ee; ++j)
+ if (PN->getIncomingBlock(j) == BB1 ||
+ PN->getIncomingBlock(j) == BIParent)
+ PN->setIncomingValue(j, SI);
+ }
+
+ ++NumSpeculations;
+ return true;
+}
+
/// BlockIsSimpleEnoughToThreadThrough - Return true if we can thread a branch
/// across this block.
static bool BlockIsSimpleEnoughToThreadThrough(BasicBlock *BB) {
@@ -1011,11 +1172,12 @@
if (BBI->hasName()) N->setName(BBI->getName()+".c");
// Update operands due to translation.
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
+ for (User::op_iterator i = N->op_begin(), e = N->op_end();
+ i != e; ++i) {
std::map<Value*, Value*>::iterator PI =
- TranslateMap.find(N->getOperand(i));
+ TranslateMap.find(*i);
if (PI != TranslateMap.end())
- N->setOperand(i, PI->second);
+ *i = PI->second;
}
// Check for trivial simplification.
@@ -1165,6 +1327,105 @@
return true;
}
+/// SimplifyCondBranchToTwoReturns - If we found a conditional branch that goes
+/// to two returning blocks, try to merge them together into one return,
+/// introducing a select if the return values disagree.
+static bool SimplifyCondBranchToTwoReturns(BranchInst *BI) {
+ assert(BI->isConditional() && "Must be a conditional branch");
+ BasicBlock *TrueSucc = BI->getSuccessor(0);
+ BasicBlock *FalseSucc = BI->getSuccessor(1);
+ ReturnInst *TrueRet = cast<ReturnInst>(TrueSucc->getTerminator());
+ ReturnInst *FalseRet = cast<ReturnInst>(FalseSucc->getTerminator());
+
+ // Check to ensure both blocks are empty (just a return) or optionally empty
+ // with PHI nodes. If there are other instructions, merging would cause extra
+ // computation on one path or the other.
+ BasicBlock::iterator BBI = TrueRet;
+ if (BBI != TrueSucc->begin() && !isa<PHINode>(--BBI))
+ return false; // Not empty with optional phi nodes.
+ BBI = FalseRet;
+ if (BBI != FalseSucc->begin() && !isa<PHINode>(--BBI))
+ return false; // Not empty with optional phi nodes.
+
+ // Okay, we found a branch that is going to two return nodes. If
+ // there is no return value for this function, just change the
+ // branch into a return.
+ if (FalseRet->getNumOperands() == 0) {
+ TrueSucc->removePredecessor(BI->getParent());
+ FalseSucc->removePredecessor(BI->getParent());
+ ReturnInst::Create(0, BI);
+ BI->eraseFromParent();
+ return true;
+ }
+
+ // Otherwise, build up the result values for the new return.
+ SmallVector<Value*, 4> TrueResult;
+ SmallVector<Value*, 4> FalseResult;
+
+ for (unsigned i = 0, e = TrueRet->getNumOperands(); i != e; ++i) {
+ // Otherwise, figure out what the true and false return values are
+ // so we can insert a new select instruction.
+ Value *TrueValue = TrueRet->getOperand(i);
+ Value *FalseValue = FalseRet->getOperand(i);
+
+ // Unwrap any PHI nodes in the return blocks.
+ if (PHINode *TVPN = dyn_cast<PHINode>(TrueValue))
+ if (TVPN->getParent() == TrueSucc)
+ TrueValue = TVPN->getIncomingValueForBlock(BI->getParent());
+ if (PHINode *FVPN = dyn_cast<PHINode>(FalseValue))
+ if (FVPN->getParent() == FalseSucc)
+ FalseValue = FVPN->getIncomingValueForBlock(BI->getParent());
+
+ // In order for this transformation to be safe, we must be able to
+ // unconditionally execute both operands to the return. This is
+ // normally the case, but we could have a potentially-trapping
+ // constant expression that prevents this transformation from being
+ // safe.
+ if (ConstantExpr *TCV = dyn_cast<ConstantExpr>(TrueValue))
+ if (TCV->canTrap())
+ return false;
+ if (ConstantExpr *FCV = dyn_cast<ConstantExpr>(FalseValue))
+ if (FCV->canTrap())
+ return false;
+
+ TrueResult.push_back(TrueValue);
+ FalseResult.push_back(FalseValue);
+ }
+
+ // Okay, we collected all the mapped values and checked them for sanity, and
+ // defined to really do this transformation. First, update the CFG.
+ TrueSucc->removePredecessor(BI->getParent());
+ FalseSucc->removePredecessor(BI->getParent());
+
+ // Insert select instructions where needed.
+ Value *BrCond = BI->getCondition();
+ for (unsigned i = 0, e = TrueRet->getNumOperands(); i != e; ++i) {
+ // Insert a select if the results differ.
+ if (TrueResult[i] == FalseResult[i] || isa<UndefValue>(FalseResult[i]))
+ continue;
+ if (isa<UndefValue>(TrueResult[i])) {
+ TrueResult[i] = FalseResult[i];
+ continue;
+ }
+
+ TrueResult[i] = SelectInst::Create(BrCond, TrueResult[i],
+ FalseResult[i], "retval", BI);
+ }
+
+ Value *RI = ReturnInst::Create(&TrueResult[0], TrueResult.size(), BI);
+
+ DOUT << "\nCHANGING BRANCH TO TWO RETURNS INTO SELECT:"
+ << "\n " << *BI << "NewRet = " << *RI
+ << "TRUEBLOCK: " << *TrueSucc << "FALSEBLOCK: "<< *FalseSucc;
+
+ BI->eraseFromParent();
+
+ if (Instruction *BrCondI = dyn_cast<Instruction>(BrCond))
+ ErasePossiblyDeadInstructionTree(BrCondI);
+ return true;
+}
+
+
namespace {
/// ConstantIntOrdering - This class implements a stable ordering of constant
/// integers that does not depend on their address. This is important for
@@ -1243,8 +1504,6 @@
SmallVector<BasicBlock*, 8> UncondBranchPreds;
SmallVector<BranchInst*, 8> CondBranchPreds;
for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) {
- if ((*PI)->getUnwindDest() == BB) continue;
-
TerminatorInst *PTI = (*PI)->getTerminator();
if (BranchInst *BI = dyn_cast<BranchInst>(PTI)) {
if (BI->isUnconditional())
@@ -1268,10 +1527,12 @@
// If the return instruction returns a value, and if the value was a
// PHI node in "BB", propagate the right value into the return.
- if (NewRet->getNumOperands() == 1)
- if (PHINode *PN = dyn_cast<PHINode>(NewRet->getOperand(0)))
+ for (User::op_iterator i = NewRet->op_begin(), e = NewRet->op_end();
+ i != e; ++i)
+ if (PHINode *PN = dyn_cast<PHINode>(*i))
if (PN->getParent() == BB)
- NewRet->setOperand(0, PN->getIncomingValueForBlock(Pred));
+ *i = PN->getIncomingValueForBlock(Pred);
+
// Update any PHI nodes in the returning block to realize that we no
// longer branch to them.
BB->removePredecessor(Pred);
@@ -1292,73 +1553,12 @@
while (!CondBranchPreds.empty()) {
BranchInst *BI = CondBranchPreds.back();
CondBranchPreds.pop_back();
- BasicBlock *TrueSucc = BI->getSuccessor(0);
- BasicBlock *FalseSucc = BI->getSuccessor(1);
- BasicBlock *OtherSucc = TrueSucc == BB ? FalseSucc : TrueSucc;
// Check to see if the non-BB successor is also a return block.
- if (isa<ReturnInst>(OtherSucc->getTerminator())) {
- // Check to see if there are only PHI instructions in this block.
- BasicBlock::iterator OSI = OtherSucc->getTerminator();
- if (OSI == OtherSucc->begin() || isa<PHINode>(--OSI)) {
- // Okay, we found a branch that is going to two return nodes. If
- // there is no return value for this function, just change the
- // branch into a return.
- if (RI->getNumOperands() == 0) {
- TrueSucc->removePredecessor(BI->getParent());
- FalseSucc->removePredecessor(BI->getParent());
- ReturnInst::Create(0, BI);
- BI->getParent()->getInstList().erase(BI);
- return true;
- }
-
- // Otherwise, figure out what the true and false return values are
- // so we can insert a new select instruction.
- Value *TrueValue = TrueSucc->getTerminator()->getOperand(0);
- Value *FalseValue = FalseSucc->getTerminator()->getOperand(0);
-
- // Unwrap any PHI nodes in the return blocks.
- if (PHINode *TVPN = dyn_cast<PHINode>(TrueValue))
- if (TVPN->getParent() == TrueSucc)
- TrueValue = TVPN->getIncomingValueForBlock(BI->getParent());
- if (PHINode *FVPN = dyn_cast<PHINode>(FalseValue))
- if (FVPN->getParent() == FalseSucc)
- FalseValue = FVPN->getIncomingValueForBlock(BI->getParent());
-
- // In order for this transformation to be safe, we must be able to
- // unconditionally execute both operands to the return. This is
- // normally the case, but we could have a potentially-trapping
- // constant expression that prevents this transformation from being
- // safe.
- if ((!isa<ConstantExpr>(TrueValue) ||
- !cast<ConstantExpr>(TrueValue)->canTrap()) &&
- (!isa<ConstantExpr>(TrueValue) ||
- !cast<ConstantExpr>(TrueValue)->canTrap())) {
- TrueSucc->removePredecessor(BI->getParent());
- FalseSucc->removePredecessor(BI->getParent());
-
- // Insert a new select instruction.
- Value *NewRetVal;
- Value *BrCond = BI->getCondition();
- if (TrueValue != FalseValue)
- NewRetVal = SelectInst::Create(BrCond, TrueValue,
- FalseValue, "retval", BI);
- else
- NewRetVal = TrueValue;
-
- DOUT << "\nCHANGING BRANCH TO TWO RETURNS INTO SELECT:"
- << "\n " << *BI << "Select = " << *NewRetVal
- << "TRUEBLOCK: " << *TrueSucc << "FALSEBLOCK: "<< *FalseSucc;
-
- ReturnInst::Create(NewRetVal, BI);
- BI->eraseFromParent();
- if (Instruction *BrCondI = dyn_cast<Instruction>(BrCond))
- if (isInstructionTriviallyDead(BrCondI))
- BrCondI->eraseFromParent();
- return true;
- }
- }
- }
+ if (isa<ReturnInst>(BI->getSuccessor(0)->getTerminator()) &&
+ isa<ReturnInst>(BI->getSuccessor(1)->getTerminator()) &&
+ SimplifyCondBranchToTwoReturns(BI))
+ return true;
}
}
} else if (isa<UnwindInst>(BB->begin())) {
@@ -1370,14 +1570,8 @@
SmallVector<BasicBlock*, 8> Preds(pred_begin(BB), pred_end(BB));
while (!Preds.empty()) {
BasicBlock *Pred = Preds.back();
-
- if (Pred->getUnwindDest() == BB) {
- Pred->setUnwindDest(NULL);
- Changed = true;
- }
-
if (BranchInst *BI = dyn_cast<BranchInst>(Pred->getTerminator())) {
- if (BI->isUnconditional() && BI->getSuccessor(0) == BB) {
+ if (BI->isUnconditional()) {
Pred->getInstList().pop_back(); // nuke uncond branch
new UnwindInst(Pred); // Use unwind.
Changed = true;
@@ -1392,7 +1586,8 @@
// Insert the call now...
SmallVector<Value*,8> Args(II->op_begin()+3, II->op_end());
CallInst *CI = CallInst::Create(II->getCalledValue(),
- Args.begin(), Args.end(), II->getName(), BI);
+ Args.begin(), Args.end(),
+ II->getName(), BI);
CI->setCallingConv(II->getCallingConv());
CI->setParamAttrs(II->getParamAttrs());
// If the invoke produced a value, the Call now does instead
@@ -1427,8 +1622,7 @@
}
} else if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator())) {
if (BI->isUnconditional()) {
- BasicBlock::iterator BBI = BB->begin(); // Skip over phi nodes...
- while (isa<PHINode>(*BBI)) ++BBI;
+ BasicBlock::iterator BBI = BB->getFirstNonPHI();
BasicBlock *Succ = BI->getSuccessor(0);
if (BBI->isTerminator() && // Terminator is the only non-phi instruction!
@@ -1481,7 +1675,7 @@
// Invert the predecessors condition test (xor it with true),
// which allows us to write this code once.
Value *NewCond =
- BinaryOperator::createNot(PBI->getCondition(),
+ BinaryOperator::CreateNot(PBI->getCondition(),
PBI->getCondition()->getName()+".not", PBI);
PBI->setCondition(NewCond);
BasicBlock *OldTrue = PBI->getSuccessor(0);
@@ -1502,7 +1696,7 @@
PBI->getSuccessor(0) == TrueDest ?
Instruction::Or : Instruction::And;
Value *NewCond =
- BinaryOperator::create(Opcode, PBI->getCondition(),
+ BinaryOperator::Create(Opcode, PBI->getCondition(),
New, "bothcond", PBI);
PBI->setCondition(NewCond);
if (PBI->getSuccessor(0) == BB) {
@@ -1541,8 +1735,8 @@
// that merges in the constant and simplify the block result.
if (BlockIsSimpleEnoughToThreadThrough(BB)) {
PHINode *NewPN = PHINode::Create(Type::Int1Ty,
- BI->getCondition()->getName()+".pr",
- BB->begin());
+ BI->getCondition()->getName()
+ + ".pr", BB->begin());
for (PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
if ((PBI = dyn_cast<BranchInst>((*PI)->getTerminator())) &&
PBI != BI && PBI->isConditional() &&
@@ -1624,17 +1818,17 @@
// Make sure we get to CommonDest on True&True directions.
Value *PBICond = PBI->getCondition();
if (PBIOp)
- PBICond = BinaryOperator::createNot(PBICond,
+ PBICond = BinaryOperator::CreateNot(PBICond,
PBICond->getName()+".not",
PBI);
Value *BICond = BI->getCondition();
if (BIOp)
- BICond = BinaryOperator::createNot(BICond,
+ BICond = BinaryOperator::CreateNot(BICond,
BICond->getName()+".not",
PBI);
// Merge the conditions.
Value *Cond =
- BinaryOperator::createOr(PBICond, BICond, "brmerge", PBI);
+ BinaryOperator::CreateOr(PBICond, BICond, "brmerge", PBI);
// Modify PBI to branch on the new condition to the new dests.
PBI->setCondition(Cond);
@@ -1802,7 +1996,6 @@
BasicBlock *OnlySucc = 0;
if (OnlyPred && OnlyPred != BB && // Don't break self loops
- OnlyPred->getUnwindDest() != BB &&
OnlyPred->getTerminator()->getOpcode() != Instruction::Invoke) {
// Check to see if there is only one distinct successor...
succ_iterator SI(succ_begin(OnlyPred)), SE(succ_end(OnlyPred));
@@ -1814,8 +2007,7 @@
}
}
- if (OnlySucc && (BB->getUnwindDest() == OnlyPred->getUnwindDest() ||
- !BB->getUnwindDest() || !OnlyPred->getUnwindDest())) {
+ if (OnlySucc) {
DOUT << "Merging: " << *BB << "into: " << *OnlyPred;
// Resolve any PHI nodes at the start of the block. They are all
@@ -1835,10 +2027,6 @@
// Move all definitions in the successor to the predecessor.
OnlyPred->getInstList().splice(OnlyPred->end(), BB->getInstList());
- // Move the unwind destination block
- if (!OnlyPred->getUnwindDest() && BB->getUnwindDest())
- OnlyPred->setUnwindDest(BB->getUnwindDest());
-
// Make all PHI nodes that referred to BB now refer to Pred as their
// source.
BB->replaceAllUsesWith(OnlyPred);
@@ -1869,6 +2057,24 @@
// so see if there is any identical code in the "then" and "else"
// blocks. If so, we can hoist it up to the branching block.
Changed |= HoistThenElseCodeToIf(BI);
+ } else {
+ OnlySucc = NULL;
+ for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB);
+ SI != SE; ++SI) {
+ if (!OnlySucc)
+ OnlySucc = *SI;
+ else if (*SI != OnlySucc) {
+ OnlySucc = 0; // There are multiple distinct successors!
+ break;
+ }
+ }
+
+ if (OnlySucc == OtherBB) {
+ // If BB's only successor is the other successor of the predecessor,
+ // i.e. a triangle, see if we can hoist any code from this block up
+ // to the "if" block.
+ Changed |= SpeculativelyExecuteBB(BI, BB);
+ }
}
}
@@ -1894,7 +2100,8 @@
if (!TrueWhenEqual) std::swap(DefaultBB, EdgeBB);
// Create the new switch instruction now.
- SwitchInst *New = SwitchInst::Create(CompVal, DefaultBB,Values.size(),BI);
+ SwitchInst *New = SwitchInst::Create(CompVal, DefaultBB,
+ Values.size(), BI);
// Add all of the 'cases' to the switch instruction.
for (unsigned i = 0, e = Values.size(); i != e; ++i)
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp Sun Jul 6 15:45:41 2008
@@ -28,8 +28,6 @@
static RegisterPass<UnifyFunctionExitNodes>
X("mergereturn", "Unify function exit nodes");
-int UnifyFunctionExitNodes::stub;
-
Pass *llvm::createUnifyFunctionExitNodesPass() {
return new UnifyFunctionExitNodes();
}
Added: llvm/branches/non-call-eh/lib/Transforms/Utils/UnrollLoop.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/UnrollLoop.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/UnrollLoop.cpp (added)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/UnrollLoop.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,371 @@
+//===-- UnrollLoop.cpp - Loop unrolling utilities -------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements some loop unrolling utilities. It does not define any
+// actual pass or policy, but provides a single function to perform loop
+// unrolling.
+//
+// It works best when loops have been canonicalized by the -indvars pass,
+// allowing it to determine the trip counts of loops easily.
+//
+// The process of unrolling can produce extraneous basic blocks linked with
+// unconditional branches. This will be corrected in the future.
+//===----------------------------------------------------------------------===//
+
+#define DEBUG_TYPE "loop-unroll"
+#include "llvm/Transforms/Utils/UnrollLoop.h"
+#include "llvm/BasicBlock.h"
+#include "llvm/ADT/Statistic.h"
+#include "llvm/Analysis/ConstantFolding.h"
+#include "llvm/Analysis/LoopPass.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/Transforms/Utils/Cloning.h"
+#include "llvm/Transforms/Utils/Local.h"
+
+using namespace llvm;
+
+/* TODO: Should these be here or in LoopUnroll? */
+STATISTIC(NumCompletelyUnrolled, "Number of loops completely unrolled");
+STATISTIC(NumUnrolled, "Number of loops unrolled (completely or otherwise)");
+
+/// RemapInstruction - Convert the instruction operands from referencing the
+/// current values into those specified by ValueMap.
+static inline void RemapInstruction(Instruction *I,
+ DenseMap<const Value *, Value*> &ValueMap) {
+ for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) {
+ Value *Op = I->getOperand(op);
+ DenseMap<const Value *, Value*>::iterator It = ValueMap.find(Op);
+ if (It != ValueMap.end()) Op = It->second;
+ I->setOperand(op, Op);
+ }
+}
+
+/// FoldBlockIntoPredecessor - Folds a basic block into its predecessor if it
+/// only has one predecessor, and that predecessor only has one successor.
+/// The LoopInfo Analysis that is passed will be kept consistent.
+/// Returns the new combined block.
+static BasicBlock *FoldBlockIntoPredecessor(BasicBlock *BB, LoopInfo* LI) {
+ // Merge basic blocks into their predecessor if there is only one distinct
+ // pred, and if there is only one distinct successor of the predecessor, and
+ // if there are no PHI nodes.
+ BasicBlock *OnlyPred = BB->getSinglePredecessor();
+ if (!OnlyPred) return 0;
+
+ if (OnlyPred->getTerminator()->getNumSuccessors() != 1)
+ return 0;
+
+ DOUT << "Merging: " << *BB << "into: " << *OnlyPred;
+
+ // Resolve any PHI nodes at the start of the block. They are all
+ // guaranteed to have exactly one entry if they exist, unless there are
+ // multiple duplicate (but guaranteed to be equal) entries for the
+ // incoming edges. This occurs when there are multiple edges from
+ // OnlyPred to OnlySucc.
+ //
+ while (PHINode *PN = dyn_cast<PHINode>(&BB->front())) {
+ PN->replaceAllUsesWith(PN->getIncomingValue(0));
+ BB->getInstList().pop_front(); // Delete the phi node...
+ }
+
+ // Delete the unconditional branch from the predecessor...
+ OnlyPred->getInstList().pop_back();
+
+ // Move all definitions in the successor to the predecessor...
+ OnlyPred->getInstList().splice(OnlyPred->end(), BB->getInstList());
+
+ // Make all PHI nodes that referred to BB now refer to Pred as their
+ // source...
+ BB->replaceAllUsesWith(OnlyPred);
+
+ std::string OldName = BB->getName();
+
+ // Erase basic block from the function...
+ LI->removeBlock(BB);
+ BB->eraseFromParent();
+
+ // Inherit predecessor's name if it exists...
+ if (!OldName.empty() && !OnlyPred->hasName())
+ OnlyPred->setName(OldName);
+
+ return OnlyPred;
+}
+
+/// Unroll the given loop by Count. The loop must be in LCSSA form. Returns true
+/// if unrolling was succesful, or false if the loop was unmodified. Unrolling
+/// can only fail when the loop's latch block is not terminated by a conditional
+/// branch instruction. However, if the trip count (and multiple) are not known,
+/// loop unrolling will mostly produce more code that is no faster.
+///
+/// The LoopInfo Analysis that is passed will be kept consistent.
+///
+/// If a LoopPassManager is passed in, and the loop is fully removed, it will be
+/// removed from the LoopPassManager as well. LPM can also be NULL.
+bool llvm::UnrollLoop(Loop *L, unsigned Count, LoopInfo* LI, LPPassManager* LPM) {
+ assert(L->isLCSSAForm());
+
+ BasicBlock *Header = L->getHeader();
+ BasicBlock *LatchBlock = L->getLoopLatch();
+ BranchInst *BI = dyn_cast<BranchInst>(LatchBlock->getTerminator());
+
+ if (!BI || BI->isUnconditional()) {
+ // The loop-rotate pass can be helpful to avoid this in many cases.
+ DOUT << " Can't unroll; loop not terminated by a conditional branch.\n";
+ return false;
+ }
+
+ // Find trip count
+ unsigned TripCount = L->getSmallConstantTripCount();
+ // Find trip multiple if count is not available
+ unsigned TripMultiple = 1;
+ if (TripCount == 0)
+ TripMultiple = L->getSmallConstantTripMultiple();
+
+ if (TripCount != 0)
+ DOUT << " Trip Count = " << TripCount << "\n";
+ if (TripMultiple != 1)
+ DOUT << " Trip Multiple = " << TripMultiple << "\n";
+
+ // Effectively "DCE" unrolled iterations that are beyond the tripcount
+ // and will never be executed.
+ if (TripCount != 0 && Count > TripCount)
+ Count = TripCount;
+
+ assert(Count > 0);
+ assert(TripMultiple > 0);
+ assert(TripCount == 0 || TripCount % TripMultiple == 0);
+
+ // Are we eliminating the loop control altogether?
+ bool CompletelyUnroll = Count == TripCount;
+
+ // If we know the trip count, we know the multiple...
+ unsigned BreakoutTrip = 0;
+ if (TripCount != 0) {
+ BreakoutTrip = TripCount % Count;
+ TripMultiple = 0;
+ } else {
+ // Figure out what multiple to use.
+ BreakoutTrip = TripMultiple =
+ (unsigned)GreatestCommonDivisor64(Count, TripMultiple);
+ }
+
+ if (CompletelyUnroll) {
+ DOUT << "COMPLETELY UNROLLING loop %" << Header->getName()
+ << " with trip count " << TripCount << "!\n";
+ } else {
+ DOUT << "UNROLLING loop %" << Header->getName()
+ << " by " << Count;
+ if (TripMultiple == 0 || BreakoutTrip != TripMultiple) {
+ DOUT << " with a breakout at trip " << BreakoutTrip;
+ } else if (TripMultiple != 1) {
+ DOUT << " with " << TripMultiple << " trips per branch";
+ }
+ DOUT << "!\n";
+ }
+
+ std::vector<BasicBlock*> LoopBlocks = L->getBlocks();
+
+ bool ContinueOnTrue = L->contains(BI->getSuccessor(0));
+ BasicBlock *LoopExit = BI->getSuccessor(ContinueOnTrue);
+
+ // For the first iteration of the loop, we should use the precloned values for
+ // PHI nodes. Insert associations now.
+ typedef DenseMap<const Value*, Value*> ValueMapTy;
+ ValueMapTy LastValueMap;
+ std::vector<PHINode*> OrigPHINode;
+ for (BasicBlock::iterator I = Header->begin(); isa<PHINode>(I); ++I) {
+ PHINode *PN = cast<PHINode>(I);
+ OrigPHINode.push_back(PN);
+ if (Instruction *I =
+ dyn_cast<Instruction>(PN->getIncomingValueForBlock(LatchBlock)))
+ if (L->contains(I->getParent()))
+ LastValueMap[I] = I;
+ }
+
+ std::vector<BasicBlock*> Headers;
+ std::vector<BasicBlock*> Latches;
+ Headers.push_back(Header);
+ Latches.push_back(LatchBlock);
+
+ for (unsigned It = 1; It != Count; ++It) {
+ char SuffixBuffer[100];
+ sprintf(SuffixBuffer, ".%d", It);
+
+ std::vector<BasicBlock*> NewBlocks;
+
+ for (std::vector<BasicBlock*>::iterator BB = LoopBlocks.begin(),
+ E = LoopBlocks.end(); BB != E; ++BB) {
+ ValueMapTy ValueMap;
+ BasicBlock *New = CloneBasicBlock(*BB, ValueMap, SuffixBuffer);
+ Header->getParent()->getBasicBlockList().push_back(New);
+
+ // Loop over all of the PHI nodes in the block, changing them to use the
+ // incoming values from the previous block.
+ if (*BB == Header)
+ for (unsigned i = 0, e = OrigPHINode.size(); i != e; ++i) {
+ PHINode *NewPHI = cast<PHINode>(ValueMap[OrigPHINode[i]]);
+ Value *InVal = NewPHI->getIncomingValueForBlock(LatchBlock);
+ if (Instruction *InValI = dyn_cast<Instruction>(InVal))
+ if (It > 1 && L->contains(InValI->getParent()))
+ InVal = LastValueMap[InValI];
+ ValueMap[OrigPHINode[i]] = InVal;
+ New->getInstList().erase(NewPHI);
+ }
+
+ // Update our running map of newest clones
+ LastValueMap[*BB] = New;
+ for (ValueMapTy::iterator VI = ValueMap.begin(), VE = ValueMap.end();
+ VI != VE; ++VI)
+ LastValueMap[VI->first] = VI->second;
+
+ L->addBasicBlockToLoop(New, LI->getBase());
+
+ // Add phi entries for newly created values to all exit blocks except
+ // the successor of the latch block. The successor of the exit block will
+ // be updated specially after unrolling all the way.
+ if (*BB != LatchBlock)
+ for (Value::use_iterator UI = (*BB)->use_begin(), UE = (*BB)->use_end();
+ UI != UE;) {
+ Instruction *UseInst = cast<Instruction>(*UI);
+ ++UI;
+ if (isa<PHINode>(UseInst) && !L->contains(UseInst->getParent())) {
+ PHINode *phi = cast<PHINode>(UseInst);
+ Value *Incoming = phi->getIncomingValueForBlock(*BB);
+ phi->addIncoming(Incoming, New);
+ }
+ }
+
+ // Keep track of new headers and latches as we create them, so that
+ // we can insert the proper branches later.
+ if (*BB == Header)
+ Headers.push_back(New);
+ if (*BB == LatchBlock) {
+ Latches.push_back(New);
+
+ // Also, clear out the new latch's back edge so that it doesn't look
+ // like a new loop, so that it's amenable to being merged with adjacent
+ // blocks later on.
+ TerminatorInst *Term = New->getTerminator();
+ assert(L->contains(Term->getSuccessor(!ContinueOnTrue)));
+ assert(Term->getSuccessor(ContinueOnTrue) == LoopExit);
+ Term->setSuccessor(!ContinueOnTrue, NULL);
+ }
+
+ NewBlocks.push_back(New);
+ }
+
+ // Remap all instructions in the most recent iteration
+ for (unsigned i = 0; i < NewBlocks.size(); ++i)
+ for (BasicBlock::iterator I = NewBlocks[i]->begin(),
+ E = NewBlocks[i]->end(); I != E; ++I)
+ RemapInstruction(I, LastValueMap);
+ }
+
+ // The latch block exits the loop. If there are any PHI nodes in the
+ // successor blocks, update them to use the appropriate values computed as the
+ // last iteration of the loop.
+ if (Count != 1) {
+ SmallPtrSet<PHINode*, 8> Users;
+ for (Value::use_iterator UI = LatchBlock->use_begin(),
+ UE = LatchBlock->use_end(); UI != UE; ++UI)
+ if (PHINode *phi = dyn_cast<PHINode>(*UI))
+ Users.insert(phi);
+
+ BasicBlock *LastIterationBB = cast<BasicBlock>(LastValueMap[LatchBlock]);
+ for (SmallPtrSet<PHINode*,8>::iterator SI = Users.begin(), SE = Users.end();
+ SI != SE; ++SI) {
+ PHINode *PN = *SI;
+ Value *InVal = PN->removeIncomingValue(LatchBlock, false);
+ // If this value was defined in the loop, take the value defined by the
+ // last iteration of the loop.
+ if (Instruction *InValI = dyn_cast<Instruction>(InVal)) {
+ if (L->contains(InValI->getParent()))
+ InVal = LastValueMap[InVal];
+ }
+ PN->addIncoming(InVal, LastIterationBB);
+ }
+ }
+
+ // Now, if we're doing complete unrolling, loop over the PHI nodes in the
+ // original block, setting them to their incoming values.
+ if (CompletelyUnroll) {
+ BasicBlock *Preheader = L->getLoopPreheader();
+ for (unsigned i = 0, e = OrigPHINode.size(); i != e; ++i) {
+ PHINode *PN = OrigPHINode[i];
+ PN->replaceAllUsesWith(PN->getIncomingValueForBlock(Preheader));
+ Header->getInstList().erase(PN);
+ }
+ }
+
+ // Now that all the basic blocks for the unrolled iterations are in place,
+ // set up the branches to connect them.
+ for (unsigned i = 0, e = Latches.size(); i != e; ++i) {
+ // The original branch was replicated in each unrolled iteration.
+ BranchInst *Term = cast<BranchInst>(Latches[i]->getTerminator());
+
+ // The branch destination.
+ unsigned j = (i + 1) % e;
+ BasicBlock *Dest = Headers[j];
+ bool NeedConditional = true;
+
+ // For a complete unroll, make the last iteration end with a branch
+ // to the exit block.
+ if (CompletelyUnroll && j == 0) {
+ Dest = LoopExit;
+ NeedConditional = false;
+ }
+
+ // If we know the trip count or a multiple of it, we can safely use an
+ // unconditional branch for some iterations.
+ if (j != BreakoutTrip && (TripMultiple == 0 || j % TripMultiple != 0)) {
+ NeedConditional = false;
+ }
+
+ if (NeedConditional) {
+ // Update the conditional branch's successor for the following
+ // iteration.
+ Term->setSuccessor(!ContinueOnTrue, Dest);
+ } else {
+ Term->setUnconditionalDest(Dest);
+ // Merge adjacent basic blocks, if possible.
+ if (BasicBlock *Fold = FoldBlockIntoPredecessor(Dest, LI)) {
+ std::replace(Latches.begin(), Latches.end(), Dest, Fold);
+ std::replace(Headers.begin(), Headers.end(), Dest, Fold);
+ }
+ }
+ }
+
+ // At this point, the code is well formed. We now do a quick sweep over the
+ // inserted code, doing constant propagation and dead code elimination as we
+ // go.
+ const std::vector<BasicBlock*> &NewLoopBlocks = L->getBlocks();
+ for (std::vector<BasicBlock*>::const_iterator BB = NewLoopBlocks.begin(),
+ BBE = NewLoopBlocks.end(); BB != BBE; ++BB)
+ for (BasicBlock::iterator I = (*BB)->begin(), E = (*BB)->end(); I != E; ) {
+ Instruction *Inst = I++;
+
+ if (isInstructionTriviallyDead(Inst))
+ (*BB)->getInstList().erase(Inst);
+ else if (Constant *C = ConstantFoldInstruction(Inst)) {
+ Inst->replaceAllUsesWith(C);
+ (*BB)->getInstList().erase(Inst);
+ }
+ }
+
+ NumCompletelyUnrolled += CompletelyUnroll;
+ ++NumUnrolled;
+ // Remove the loop from the LoopPassManager if it's completely removed.
+ if (CompletelyUnroll && LPM != NULL)
+ LPM->deleteLoopFromQueue(L);
+
+ // If we didn't completely unroll the loop, it should still be in LCSSA form.
+ if (!CompletelyUnroll)
+ assert(L->isLCSSAForm());
+
+ return true;
+}
Modified: llvm/branches/non-call-eh/lib/Transforms/Utils/ValueMapper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/Transforms/Utils/ValueMapper.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/Transforms/Utils/ValueMapper.cpp (original)
+++ llvm/branches/non-call-eh/lib/Transforms/Utils/ValueMapper.cpp Sun Jul 6 15:45:41 2008
@@ -36,38 +36,40 @@
isa<UndefValue>(C))
return VMSlot = C; // Primitive constants map directly
else if (ConstantArray *CA = dyn_cast<ConstantArray>(C)) {
- for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i) {
- Value *MV = MapValue(CA->getOperand(i), VM);
- if (MV != CA->getOperand(i)) {
+ for (User::op_iterator b = CA->op_begin(), i = b, e = CA->op_end();
+ i != e; ++i) {
+ Value *MV = MapValue(*i, VM);
+ if (MV != *i) {
// This array must contain a reference to a global, make a new array
// and return it.
//
std::vector<Constant*> Values;
Values.reserve(CA->getNumOperands());
- for (unsigned j = 0; j != i; ++j)
- Values.push_back(CA->getOperand(j));
+ for (User::op_iterator j = b; j != i; ++j)
+ Values.push_back(cast<Constant>(*j));
Values.push_back(cast<Constant>(MV));
for (++i; i != e; ++i)
- Values.push_back(cast<Constant>(MapValue(CA->getOperand(i), VM)));
+ Values.push_back(cast<Constant>(MapValue(*i, VM)));
return VM[V] = ConstantArray::get(CA->getType(), Values);
}
}
return VM[V] = C;
} else if (ConstantStruct *CS = dyn_cast<ConstantStruct>(C)) {
- for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i) {
- Value *MV = MapValue(CS->getOperand(i), VM);
- if (MV != CS->getOperand(i)) {
+ for (User::op_iterator b = CS->op_begin(), i = b, e = CS->op_end();
+ i != e; ++i) {
+ Value *MV = MapValue(*i, VM);
+ if (MV != *i) {
// This struct must contain a reference to a global, make a new struct
// and return it.
//
std::vector<Constant*> Values;
Values.reserve(CS->getNumOperands());
- for (unsigned j = 0; j != i; ++j)
- Values.push_back(CS->getOperand(j));
+ for (User::op_iterator j = b; j != i; ++j)
+ Values.push_back(cast<Constant>(*j));
Values.push_back(cast<Constant>(MV));
for (++i; i != e; ++i)
- Values.push_back(cast<Constant>(MapValue(CS->getOperand(i), VM)));
+ Values.push_back(cast<Constant>(MapValue(*i, VM)));
return VM[V] = ConstantStruct::get(CS->getType(), Values);
}
}
@@ -75,23 +77,24 @@
} else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
std::vector<Constant*> Ops;
- for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i)
- Ops.push_back(cast<Constant>(MapValue(CE->getOperand(i), VM)));
+ for (User::op_iterator i = CE->op_begin(), e = CE->op_end(); i != e; ++i)
+ Ops.push_back(cast<Constant>(MapValue(*i, VM)));
return VM[V] = CE->getWithOperands(Ops);
} else if (ConstantVector *CP = dyn_cast<ConstantVector>(C)) {
- for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) {
- Value *MV = MapValue(CP->getOperand(i), VM);
- if (MV != CP->getOperand(i)) {
+ for (User::op_iterator b = CP->op_begin(), i = b, e = CP->op_end();
+ i != e; ++i) {
+ Value *MV = MapValue(*i, VM);
+ if (MV != *i) {
// This vector value must contain a reference to a global, make a new
// vector constant and return it.
//
std::vector<Constant*> Values;
Values.reserve(CP->getNumOperands());
- for (unsigned j = 0; j != i; ++j)
- Values.push_back(CP->getOperand(j));
+ for (User::op_iterator j = b; j != i; ++j)
+ Values.push_back(cast<Constant>(*j));
Values.push_back(cast<Constant>(MV));
for (++i; i != e; ++i)
- Values.push_back(cast<Constant>(MapValue(CP->getOperand(i), VM)));
+ Values.push_back(cast<Constant>(MapValue(*i, VM)));
return VM[V] = ConstantVector::get(Values);
}
}
@@ -109,10 +112,9 @@
/// current values into those specified by ValueMap.
///
void llvm::RemapInstruction(Instruction *I, ValueMapTy &ValueMap) {
- for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) {
- const Value *Op = I->getOperand(op);
- Value *V = MapValue(Op, ValueMap);
+ for (User::op_iterator op = I->op_begin(), E = I->op_end(); op != E; ++op) {
+ Value *V = MapValue(*op, ValueMap);
assert(V && "Referenced value not in value map!");
- I->setOperand(op, V);
+ *op = V;
}
}
Modified: llvm/branches/non-call-eh/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/AsmWriter.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/AsmWriter.cpp Sun Jul 6 15:45:41 2008
@@ -539,7 +539,7 @@
Out << "zeroinitializer";
} else if (const ConstantArray *CA = dyn_cast<ConstantArray>(CV)) {
// As a special case, print the array as a string if it is an array of
- // ubytes or an array of sbytes with positive values.
+ // i8 with ConstantInt values.
//
const Type *ETy = CA->getType()->getElementType();
if (CA->isString()) {
@@ -624,6 +624,12 @@
Out << ", ";
}
+ if (CE->hasIndices()) {
+ const SmallVector<unsigned, 4> &Indices = CE->getIndices();
+ for (unsigned i = 0, e = Indices.size(); i != e; ++i)
+ Out << ", " << Indices[i];
+ }
+
if (CE->isCast()) {
Out << " to ";
printTypeInt(Out, CE->getType(), TypeTable);
@@ -930,6 +936,7 @@
} else {
switch (GV->getLinkage()) {
case GlobalValue::InternalLinkage: Out << "internal "; break;
+ case GlobalValue::CommonLinkage: Out << "common "; break;
case GlobalValue::LinkOnceLinkage: Out << "linkonce "; break;
case GlobalValue::WeakLinkage: Out << "weak "; break;
case GlobalValue::AppendingLinkage: Out << "appending "; break;
@@ -972,7 +979,11 @@
}
void AssemblyWriter::printAlias(const GlobalAlias *GA) {
- Out << getLLVMName(GA->getName(), GlobalPrefix) << " = ";
+ // Don't crash when dumping partially built GA
+ if (!GA->hasName())
+ Out << "<<nameless>> = ";
+ else
+ Out << getLLVMName(GA->getName(), GlobalPrefix) << " = ";
switch (GA->getVisibility()) {
default: assert(0 && "Invalid visibility style!");
case GlobalValue::DefaultVisibility: break;
@@ -1049,6 +1060,7 @@
case GlobalValue::InternalLinkage: Out << "internal "; break;
case GlobalValue::LinkOnceLinkage: Out << "linkonce "; break;
case GlobalValue::WeakLinkage: Out << "weak "; break;
+ case GlobalValue::CommonLinkage: Out << "common "; break;
case GlobalValue::AppendingLinkage: Out << "appending "; break;
case GlobalValue::DLLImportLinkage: Out << "dllimport "; break;
case GlobalValue::DLLExportLinkage: Out << "dllexport "; break;
@@ -1131,7 +1143,7 @@
if (F->isDeclaration()) {
Out << "\n";
} else {
- Out << " {\n";
+ Out << " {";
// Output all of its basic blocks... for the function
for (Function::const_iterator I = F->begin(), E = F->end(); I != E; ++I)
@@ -1185,28 +1197,24 @@
if (BB->getParent() == 0)
Out << "\t\t; Error: Block without parent!";
- else {
- if (BB != &BB->getParent()->getEntryBlock()) { // Not the entry block?
- // Output predecessors for the block...
- Out << "\t\t;";
- pred_const_iterator PI = pred_begin(BB), PE = pred_end(BB);
-
- if (PI == PE) {
- Out << " No predecessors!";
- } else {
- Out << " preds =";
+ else if (BB != &BB->getParent()->getEntryBlock()) { // Not the entry block?
+ // Output predecessors for the block...
+ Out << "\t\t;";
+ pred_const_iterator PI = pred_begin(BB), PE = pred_end(BB);
+
+ if (PI == PE) {
+ Out << " No predecessors!";
+ } else {
+ Out << " preds =";
+ writeOperand(*PI, false);
+ for (++PI; PI != PE; ++PI) {
+ Out << ',';
writeOperand(*PI, false);
- for (++PI; PI != PE; ++PI) {
- Out << ',';
- writeOperand(*PI, false);
- }
}
}
}
- if (BB->hasName() || !BB->use_empty() || BB->getUnwindDest() ||
- BB != &BB->getParent()->getEntryBlock())
- Out << "\n";
+ Out << "\n";
if (AnnotationWriter) AnnotationWriter->emitBasicBlockStartAnnot(BB, Out);
@@ -1264,11 +1272,8 @@
Out << I.getOpcodeName();
// Print out the compare instruction predicates
- if (const FCmpInst *FCI = dyn_cast<FCmpInst>(&I)) {
- Out << " " << getPredicateText(FCI->getPredicate());
- } else if (const ICmpInst *ICI = dyn_cast<ICmpInst>(&I)) {
- Out << " " << getPredicateText(ICI->getPredicate());
- }
+ if (const CmpInst *CI = dyn_cast<CmpInst>(&I))
+ Out << " " << getPredicateText(CI->getPredicate());
// Print out the type of the operands...
const Value *Operand = I.getNumOperands() ? I.getOperand(0) : 0;
@@ -1306,6 +1311,15 @@
} else if (const GetResultInst *GRI = dyn_cast<GetResultInst>(&I)) {
writeOperand(I.getOperand(0), true);
Out << ", " << GRI->getIndex();
+ } else if (const ExtractValueInst *EVI = dyn_cast<ExtractValueInst>(&I)) {
+ writeOperand(I.getOperand(0), true);
+ for (const unsigned *i = EVI->idx_begin(), *e = EVI->idx_end(); i != e; ++i)
+ Out << ", " << *i;
+ } else if (const InsertValueInst *IVI = dyn_cast<InsertValueInst>(&I)) {
+ writeOperand(I.getOperand(0), true); Out << ',';
+ writeOperand(I.getOperand(1), true);
+ for (const unsigned *i = IVI->idx_begin(), *e = IVI->idx_end(); i != e; ++i)
+ Out << ", " << *i;
} else if (isa<ReturnInst>(I) && !Operand) {
Out << " void";
} else if (const CallInst *CI = dyn_cast<CallInst>(&I)) {
Modified: llvm/branches/non-call-eh/lib/VMCore/AutoUpgrade.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/AutoUpgrade.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/AutoUpgrade.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/AutoUpgrade.cpp Sun Jul 6 15:45:41 2008
@@ -39,6 +39,30 @@
Module *M = F->getParent();
switch (Name[5]) {
default: break;
+ case 'a':
+ // This upgrades the llvm.atomic.lcs, llvm.atomic.las, and llvm.atomic.lss
+ // to their new function name
+ if (Name.compare(5,8,"atomic.l",8) == 0) {
+ if (Name.compare(12,3,"lcs",3) == 0) {
+ std::string::size_type delim = Name.find('.',12);
+ F->setName("llvm.atomic.cmp.swap"+Name.substr(delim));
+ NewFn = F;
+ return true;
+ }
+ else if (Name.compare(12,3,"las",3) == 0) {
+ std::string::size_type delim = Name.find('.',12);
+ F->setName("llvm.atomic.load.add"+Name.substr(delim));
+ NewFn = F;
+ return true;
+ }
+ else if (Name.compare(12,3,"lss",3) == 0) {
+ std::string::size_type delim = Name.find('.',12);
+ F->setName("llvm.atomic.load.sub"+Name.substr(delim));
+ NewFn = F;
+ return true;
+ }
+ }
+ break;
case 'b':
// This upgrades the name of the llvm.bswap intrinsic function to only use
// a single type name for overloading. We only care about the old format
@@ -122,7 +146,7 @@
if (Name.compare(5,10,"x86.mmx.ps",10) == 0 &&
(Name.compare(13,4,"psll", 4) == 0 ||
Name.compare(13,4,"psra", 4) == 0 ||
- Name.compare(13,4,"psrl", 4) == 0)) {
+ Name.compare(13,4,"psrl", 4) == 0) && Name[17] != 'i') {
const llvm::Type *VT = VectorType::get(IntegerType::get(64), 1);
@@ -148,8 +172,16 @@
VT,
(Type *)0));
return true;
- } else if (Name.compare(5,16,"x86.sse2.movl.dq",16) == 0) {
- // Calls to this intrinsic are transformed into ShuffleVector's.
+ } else if (Name.compare(5,17,"x86.sse2.loadh.pd",17) == 0 ||
+ Name.compare(5,17,"x86.sse2.loadl.pd",17) == 0 ||
+ Name.compare(5,16,"x86.sse2.movl.dq",16) == 0 ||
+ Name.compare(5,15,"x86.sse2.movs.d",15) == 0 ||
+ Name.compare(5,16,"x86.sse2.shuf.pd",16) == 0 ||
+ Name.compare(5,18,"x86.sse2.unpckh.pd",18) == 0 ||
+ Name.compare(5,18,"x86.sse2.unpckl.pd",18) == 0 ||
+ Name.compare(5,20,"x86.sse2.punpckh.qdq",20) == 0 ||
+ Name.compare(5,20,"x86.sse2.punpckl.qdq",20) == 0) {
+ // Calls to these intrinsics are transformed into ShuffleVector's.
NewFn = 0;
return true;
}
@@ -184,23 +216,92 @@
assert(F && "CallInst has no function associated with it.");
if (!NewFn) {
- if (strcmp(F->getNameStart(), "llvm.x86.sse2.movl.dq") == 0) {
+ bool isLoadH = false, isLoadL = false, isMovL = false;
+ bool isMovSD = false, isShufPD = false;
+ bool isUnpckhPD = false, isUnpcklPD = false;
+ bool isPunpckhQPD = false, isPunpcklQPD = false;
+ if (strcmp(F->getNameStart(), "llvm.x86.sse2.loadh.pd") == 0)
+ isLoadH = true;
+ else if (strcmp(F->getNameStart(), "llvm.x86.sse2.loadl.pd") == 0)
+ isLoadL = true;
+ else if (strcmp(F->getNameStart(), "llvm.x86.sse2.movl.dq") == 0)
+ isMovL = true;
+ else if (strcmp(F->getNameStart(), "llvm.x86.sse2.movs.d") == 0)
+ isMovSD = true;
+ else if (strcmp(F->getNameStart(), "llvm.x86.sse2.shuf.pd") == 0)
+ isShufPD = true;
+ else if (strcmp(F->getNameStart(), "llvm.x86.sse2.unpckh.pd") == 0)
+ isUnpckhPD = true;
+ else if (strcmp(F->getNameStart(), "llvm.x86.sse2.unpckl.pd") == 0)
+ isUnpcklPD = true;
+ else if (strcmp(F->getNameStart(), "llvm.x86.sse2.punpckh.qdq") == 0)
+ isPunpckhQPD = true;
+ else if (strcmp(F->getNameStart(), "llvm.x86.sse2.punpckl.qdq") == 0)
+ isPunpcklQPD = true;
+
+ if (isLoadH || isLoadL || isMovL || isMovSD || isShufPD ||
+ isUnpckhPD || isUnpcklPD || isPunpckhQPD || isPunpcklQPD) {
std::vector<Constant*> Idxs;
- Constant *Zero = ConstantInt::get(Type::Int32Ty, 0);
- Idxs.push_back(Zero);
- Idxs.push_back(Zero);
- Idxs.push_back(Zero);
- Idxs.push_back(Zero);
- Value *ZeroV = ConstantVector::get(Idxs);
-
- Idxs.clear();
- Idxs.push_back(ConstantInt::get(Type::Int32Ty, 4));
- Idxs.push_back(ConstantInt::get(Type::Int32Ty, 5));
- Idxs.push_back(ConstantInt::get(Type::Int32Ty, 2));
- Idxs.push_back(ConstantInt::get(Type::Int32Ty, 3));
- Value *Mask = ConstantVector::get(Idxs);
- ShuffleVectorInst *SI = new ShuffleVectorInst(ZeroV, CI->getOperand(1),
- Mask, "upgraded", CI);
+ Value *Op0 = CI->getOperand(1);
+ ShuffleVectorInst *SI = NULL;
+ if (isLoadH || isLoadL) {
+ Value *Op1 = UndefValue::get(Op0->getType());
+ Value *Addr = new BitCastInst(CI->getOperand(2),
+ PointerType::getUnqual(Type::DoubleTy),
+ "upgraded.", CI);
+ Value *Load = new LoadInst(Addr, "upgraded.", false, 8, CI);
+ Value *Idx = ConstantInt::get(Type::Int32Ty, 0);
+ Op1 = InsertElementInst::Create(Op1, Load, Idx, "upgraded.", CI);
+
+ if (isLoadH) {
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, 0));
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, 2));
+ } else {
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, 2));
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, 1));
+ }
+ Value *Mask = ConstantVector::get(Idxs);
+ SI = new ShuffleVectorInst(Op0, Op1, Mask, "upgraded.", CI);
+ } else if (isMovL) {
+ Constant *Zero = ConstantInt::get(Type::Int32Ty, 0);
+ Idxs.push_back(Zero);
+ Idxs.push_back(Zero);
+ Idxs.push_back(Zero);
+ Idxs.push_back(Zero);
+ Value *ZeroV = ConstantVector::get(Idxs);
+
+ Idxs.clear();
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, 4));
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, 5));
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, 2));
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, 3));
+ Value *Mask = ConstantVector::get(Idxs);
+ SI = new ShuffleVectorInst(ZeroV, Op0, Mask, "upgraded.", CI);
+ } else if (isMovSD ||
+ isUnpckhPD || isUnpcklPD || isPunpckhQPD || isPunpcklQPD) {
+ Value *Op1 = CI->getOperand(2);
+ if (isMovSD) {
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, 2));
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, 1));
+ } else if (isUnpckhPD || isPunpckhQPD) {
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, 1));
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, 3));
+ } else {
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, 0));
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, 2));
+ }
+ Value *Mask = ConstantVector::get(Idxs);
+ SI = new ShuffleVectorInst(Op0, Op1, Mask, "upgraded.", CI);
+ } else if (isShufPD) {
+ Value *Op1 = CI->getOperand(2);
+ unsigned MaskVal = cast<ConstantInt>(CI->getOperand(3))->getZExtValue();
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, MaskVal & 1));
+ Idxs.push_back(ConstantInt::get(Type::Int32Ty, ((MaskVal >> 1) & 1)+2));
+ Value *Mask = ConstantVector::get(Idxs);
+ SI = new ShuffleVectorInst(Op0, Op1, Mask, "upgraded.", CI);
+ }
+
+ assert(SI && "Unexpected!");
// Handle any uses of the old CallInst.
if (!CI->use_empty())
@@ -233,7 +334,7 @@
// Cast the second parameter to the correct type.
BitCastInst *BC = new BitCastInst(CI->getOperand(2),
NewFn->getFunctionType()->getParamType(1),
- "upgraded", CI);
+ "upgraded.", CI);
Operands[1] = BC;
// Construct a new CallInst
@@ -272,7 +373,7 @@
bool DestSExt = F->getParamAttrs().paramHasAttr(0, ParamAttr::SExt);
// Construct an appropriate cast from the new return type to the old.
- CastInst *RetCast = CastInst::create(
+ CastInst *RetCast = CastInst::Create(
CastInst::getCastOpcode(NewCI, SrcSExt,
F->getReturnType(),
DestSExt),
@@ -314,3 +415,27 @@
}
}
+/// This is an auto-upgrade hook for mutiple-value return statements.
+/// This function auto-upgrades all such return statements in the given
+/// function to use aggregate return values built with insertvalue
+/// instructions.
+void llvm::UpgradeMultipleReturnValues(Function *CurrentFunction) {
+ for (Function::iterator I = CurrentFunction->begin(),
+ E = CurrentFunction->end(); I != E; ++I) {
+ BasicBlock *BB = I;
+ if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
+ unsigned NumVals = RI->getNumOperands();
+ if (NumVals > 1) {
+ std::vector<const Type *> Types(NumVals);
+ for (unsigned i = 0; i != NumVals; ++i)
+ Types[i] = RI->getOperand(i)->getType();
+ const Type *ReturnType = StructType::get(Types);
+ Value *RV = UndefValue::get(ReturnType);
+ for (unsigned i = 0; i != NumVals; ++i)
+ RV = InsertValueInst::Create(RV, RI->getOperand(i), i, "mrv", RI);
+ ReturnInst::Create(RV, RI);
+ RI->eraseFromParent();
+ }
+ }
+ }
+}
Modified: llvm/branches/non-call-eh/lib/VMCore/BasicBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/BasicBlock.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/BasicBlock.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/BasicBlock.cpp Sun Jul 6 15:45:41 2008
@@ -74,8 +74,8 @@
BasicBlock::BasicBlock(const std::string &Name, Function *NewParent,
- BasicBlock *InsertBefore, BasicBlock *Dest)
- : User(Type::LabelTy, Value::BasicBlockVal, &unwindDest, 0/*FIXME*/), Parent(0) {
+ BasicBlock *InsertBefore)
+ : User(Type::LabelTy, Value::BasicBlockVal, OpList?, NumOps?), Parent(0) {
// Make sure that we get added to a function
LeakDetector::addGarbageObject(this);
@@ -91,8 +91,6 @@
}
setName(Name);
- unwindDest.init(NULL, this);
- setUnwindDest(Dest);
}
@@ -122,22 +120,21 @@
}
const BasicBlock *BasicBlock::getUnwindDest() const {
- return cast_or_null<const BasicBlock>(unwindDest.get());
+ return getOperand(0);
}
/// getUnwindDest - Returns the BasicBlock that flow will enter if an unwind
/// instruction occurs in this block. May be null, in which case unwinding
/// exits the function.
BasicBlock *BasicBlock::getUnwindDest() {
- return cast_or_null<BasicBlock>(unwindDest.get());
+ return getOperand(0);
}
/// setUnwindDest - Set which BasicBlock flow will enter if an unwind is
/// executed within this block. It may be set to null to indicate that
/// unwinding will exit the function.
void BasicBlock::setUnwindDest(BasicBlock *dest) {
- NumOperands = unwindDest ? 1 : 0;
- unwindDest.set(dest);
+ setOperand(0, dest);
}
/// doesNotThrow - Determine whether the block may not unwind.
@@ -180,19 +177,17 @@
return dyn_cast<TerminatorInst>(&InstList.back());
}
-Instruction* BasicBlock::getFirstNonPHI()
-{
- BasicBlock::iterator i = begin();
- // All valid basic blocks should have a terminator,
- // which is not a PHINode. If we have invalid basic
- // block we'll get assert when dereferencing past-the-end
- // iterator.
- while (isa<PHINode>(i)) ++i;
- return &*i;
+Instruction* BasicBlock::getFirstNonPHI() {
+ BasicBlock::iterator i = begin();
+ // All valid basic blocks should have a terminator,
+ // which is not a PHINode. If we have an invalid basic
+ // block we'll get an assertion failure when dereferencing
+ // a past-the-end iterator.
+ while (isa<PHINode>(i)) ++i;
+ return &*i;
}
void BasicBlock::dropAllReferences() {
- setUnwindDest(NULL);
for(iterator I = begin(), E = end(); I != E; ++I)
I->dropAllReferences();
}
@@ -214,8 +209,7 @@
/// called while the predecessor still refers to this block.
///
void BasicBlock::removePredecessor(BasicBlock *Pred,
- bool DontDeleteUselessPHIs,
- bool OnlyDeleteOne) {
+ bool DontDeleteUselessPHIs) {
assert((hasNUsesOrMore(16)||// Reduce cost of this assertion for complex CFGs.
find(pred_begin(this), pred_end(this), Pred) != pred_end(this)) &&
"removePredecessor: BB is not a predecessor!");
@@ -250,11 +244,7 @@
// Yup, loop through and nuke the PHI nodes
while (PHINode *PN = dyn_cast<PHINode>(&front())) {
// Remove the predecessor first.
- if (OnlyDeleteOne) {
- int idx = PN->getBasicBlockIndex(Pred);
- PN->removeIncomingValue(idx, !DontDeleteUselessPHIs);
- } else
- PN->removeIncomingValue(Pred, !DontDeleteUselessPHIs);
+ PN->removeIncomingValue(Pred, !DontDeleteUselessPHIs);
// If the PHI _HAD_ two uses, replace PHI node with its now *single* value
if (max_idx == 2) {
@@ -275,12 +265,7 @@
PHINode *PN;
for (iterator II = begin(); (PN = dyn_cast<PHINode>(II)); ) {
++II;
- if (OnlyDeleteOne) {
- int idx = PN->getBasicBlockIndex(Pred);
- PN->removeIncomingValue(idx, false);
- } else
- PN->removeIncomingValue(Pred, false);
-
+ PN->removeIncomingValue(Pred, false);
// If all incoming values to the Phi are the same, we can replace the Phi
// with that value.
Value* PNV = 0;
@@ -309,7 +294,7 @@
assert(I != InstList.end() &&
"Trying to get me to create degenerate basic block!");
- BasicBlock *New = new(0/*FIXME*/) BasicBlock(BBName, getParent(), getNext());
+ BasicBlock *New = BasicBlock::Create(BBName, getParent(), getNext());
// Move all of the specified instructions from the original basic block into
// the new basic block.
Modified: llvm/branches/non-call-eh/lib/VMCore/ConstantFold.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/ConstantFold.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/ConstantFold.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/ConstantFold.cpp Sun Jul 6 15:45:41 2008
@@ -332,10 +332,10 @@
if (const ConstantVector *CVal = dyn_cast<ConstantVector>(Val)) {
if (const ConstantInt *CIdx = dyn_cast<ConstantInt>(Idx)) {
- return const_cast<Constant*>(CVal->getOperand(CIdx->getZExtValue()));
+ return CVal->getOperand(CIdx->getZExtValue());
} else if (isa<UndefValue>(Idx)) {
// ee({w,x,y,z}, undef) -> w (an arbitrary value).
- return const_cast<Constant*>(CVal->getOperand(0));
+ return CVal->getOperand(0);
}
}
return 0;
@@ -394,6 +394,7 @@
}
return ConstantVector::get(Ops);
}
+
return 0;
}
@@ -401,7 +402,7 @@
/// return the specified element value. Otherwise return null.
static Constant *GetVectorElement(const Constant *C, unsigned EltNo) {
if (const ConstantVector *CV = dyn_cast<ConstantVector>(C))
- return const_cast<Constant*>(CV->getOperand(EltNo));
+ return CV->getOperand(EltNo);
const Type *EltTy = cast<VectorType>(C->getType())->getElementType();
if (isa<ConstantAggregateZero>(C))
@@ -447,6 +448,115 @@
return ConstantVector::get(&Result[0], Result.size());
}
+Constant *llvm::ConstantFoldExtractValueInstruction(const Constant *Agg,
+ const unsigned *Idxs,
+ unsigned NumIdx) {
+ // Base case: no indices, so return the entire value.
+ if (NumIdx == 0)
+ return const_cast<Constant *>(Agg);
+
+ if (isa<UndefValue>(Agg)) // ev(undef, x) -> undef
+ return UndefValue::get(ExtractValueInst::getIndexedType(Agg->getType(),
+ Idxs,
+ Idxs + NumIdx));
+
+ if (isa<ConstantAggregateZero>(Agg)) // ev(0, x) -> 0
+ return
+ Constant::getNullValue(ExtractValueInst::getIndexedType(Agg->getType(),
+ Idxs,
+ Idxs + NumIdx));
+
+ // Otherwise recurse.
+ return ConstantFoldExtractValueInstruction(Agg->getOperand(*Idxs),
+ Idxs+1, NumIdx-1);
+}
+
+Constant *llvm::ConstantFoldInsertValueInstruction(const Constant *Agg,
+ const Constant *Val,
+ const unsigned *Idxs,
+ unsigned NumIdx) {
+ // Base case: no indices, so replace the entire value.
+ if (NumIdx == 0)
+ return const_cast<Constant *>(Val);
+
+ if (isa<UndefValue>(Agg)) {
+ // Insertion of constant into aggregate undef
+ // Optimize away insertion of undef
+ if (isa<UndefValue>(Val))
+ return const_cast<Constant*>(Agg);
+ // Otherwise break the aggregate undef into multiple undefs and do
+ // the insertion
+ const CompositeType *AggTy = cast<CompositeType>(Agg->getType());
+ unsigned numOps;
+ if (const ArrayType *AR = dyn_cast<ArrayType>(AggTy))
+ numOps = AR->getNumElements();
+ else
+ numOps = cast<StructType>(AggTy)->getNumElements();
+ std::vector<Constant*> Ops(numOps);
+ for (unsigned i = 0; i < numOps; ++i) {
+ const Type *MemberTy = AggTy->getTypeAtIndex(i);
+ const Constant *Op =
+ (*Idxs == i) ?
+ ConstantFoldInsertValueInstruction(UndefValue::get(MemberTy),
+ Val, Idxs+1, NumIdx-1) :
+ UndefValue::get(MemberTy);
+ Ops[i] = const_cast<Constant*>(Op);
+ }
+ if (isa<StructType>(AggTy))
+ return ConstantStruct::get(Ops);
+ else
+ return ConstantArray::get(cast<ArrayType>(AggTy), Ops);
+ }
+ if (isa<ConstantAggregateZero>(Agg)) {
+ // Insertion of constant into aggregate zero
+ // Optimize away insertion of zero
+ if (Val->isNullValue())
+ return const_cast<Constant*>(Agg);
+ // Otherwise break the aggregate zero into multiple zeros and do
+ // the insertion
+ const CompositeType *AggTy = cast<CompositeType>(Agg->getType());
+ unsigned numOps;
+ if (const ArrayType *AR = dyn_cast<ArrayType>(AggTy))
+ numOps = AR->getNumElements();
+ else
+ numOps = cast<StructType>(AggTy)->getNumElements();
+ std::vector<Constant*> Ops(numOps);
+ for (unsigned i = 0; i < numOps; ++i) {
+ const Type *MemberTy = AggTy->getTypeAtIndex(i);
+ const Constant *Op =
+ (*Idxs == i) ?
+ ConstantFoldInsertValueInstruction(Constant::getNullValue(MemberTy),
+ Val, Idxs+1, NumIdx-1) :
+ Constant::getNullValue(MemberTy);
+ Ops[i] = const_cast<Constant*>(Op);
+ }
+ if (isa<StructType>(AggTy))
+ return ConstantStruct::get(Ops);
+ else
+ return ConstantArray::get(cast<ArrayType>(AggTy), Ops);
+ }
+ if (isa<ConstantStruct>(Agg) || isa<ConstantArray>(Agg)) {
+ // Insertion of constant into aggregate constant
+ std::vector<Constant*> Ops(Agg->getNumOperands());
+ for (unsigned i = 0; i < Agg->getNumOperands(); ++i) {
+ const Constant *Op =
+ (*Idxs == i) ?
+ ConstantFoldInsertValueInstruction(Agg->getOperand(i),
+ Val, Idxs+1, NumIdx-1) :
+ Agg->getOperand(i);
+ Ops[i] = const_cast<Constant*>(Op);
+ }
+ Constant *C;
+ if (isa<StructType>(Agg->getType()))
+ C = ConstantStruct::get(Ops);
+ else
+ C = ConstantArray::get(cast<ArrayType>(Agg->getType()), Ops);
+ return C;
+ }
+
+ return 0;
+}
+
/// EvalVectorOp - Given two vector constants and a function pointer, apply the
/// function pointer to each element pair, producing a new ConstantVector
/// constant. Either or both of V1 and V2 may be NULL, meaning a
@@ -1222,9 +1332,9 @@
if (const ConstantVector *CP2 = dyn_cast<ConstantVector>(C2)) {
if (pred == FCmpInst::FCMP_OEQ || pred == FCmpInst::FCMP_UEQ) {
for (unsigned i = 0, e = CP1->getNumOperands(); i != e; ++i) {
- Constant *C= ConstantExpr::getFCmp(FCmpInst::FCMP_OEQ,
- const_cast<Constant*>(CP1->getOperand(i)),
- const_cast<Constant*>(CP2->getOperand(i)));
+ Constant *C = ConstantExpr::getFCmp(FCmpInst::FCMP_OEQ,
+ CP1->getOperand(i),
+ CP2->getOperand(i));
if (ConstantInt *CB = dyn_cast<ConstantInt>(C))
return CB;
}
@@ -1233,8 +1343,8 @@
} else if (pred == ICmpInst::ICMP_EQ) {
for (unsigned i = 0, e = CP1->getNumOperands(); i != e; ++i) {
Constant *C = ConstantExpr::getICmp(ICmpInst::ICMP_EQ,
- const_cast<Constant*>(CP1->getOperand(i)),
- const_cast<Constant*>(CP2->getOperand(i)));
+ CP1->getOperand(i),
+ CP2->getOperand(i));
if (ConstantInt *CB = dyn_cast<ConstantInt>(C))
return CB;
}
@@ -1408,8 +1518,7 @@
const PointerType *Ptr = cast<PointerType>(C->getType());
const Type *Ty = GetElementPtrInst::getIndexedType(Ptr,
(Value **)Idxs,
- (Value **)Idxs+NumIdx,
- true);
+ (Value **)Idxs+NumIdx);
assert(Ty != 0 && "Invalid indices for GEP!");
return UndefValue::get(PointerType::get(Ty, Ptr->getAddressSpace()));
}
@@ -1426,8 +1535,7 @@
const PointerType *Ptr = cast<PointerType>(C->getType());
const Type *Ty = GetElementPtrInst::getIndexedType(Ptr,
(Value**)Idxs,
- (Value**)Idxs+NumIdx,
- true);
+ (Value**)Idxs+NumIdx);
assert(Ty != 0 && "Invalid indices for GEP!");
return
ConstantPointerNull::get(PointerType::get(Ty,Ptr->getAddressSpace()));
Modified: llvm/branches/non-call-eh/lib/VMCore/ConstantFold.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/ConstantFold.h?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/ConstantFold.h (original)
+++ llvm/branches/non-call-eh/lib/VMCore/ConstantFold.h Sun Jul 6 15:45:41 2008
@@ -41,6 +41,13 @@
Constant *ConstantFoldShuffleVectorInstruction(const Constant *V1,
const Constant *V2,
const Constant *Mask);
+ Constant *ConstantFoldExtractValueInstruction(const Constant *Agg,
+ const unsigned *Idxs,
+ unsigned NumIdx);
+ Constant *ConstantFoldInsertValueInstruction(const Constant *Agg,
+ const Constant *Val,
+ const unsigned* Idxs,
+ unsigned NumIdx);
Constant *ConstantFoldBinaryInstruction(unsigned Opcode, const Constant *V1,
const Constant *V2);
Constant *ConstantFoldCompareInstruction(unsigned short predicate,
Modified: llvm/branches/non-call-eh/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/Constants.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/Constants.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/Constants.cpp Sun Jul 6 15:45:41 2008
@@ -354,7 +354,9 @@
ConstantArray::ConstantArray(const ArrayType *T,
const std::vector<Constant*> &V)
- : Constant(T, ConstantArrayVal, new Use[V.size()], V.size()) {
+ : Constant(T, ConstantArrayVal,
+ OperandTraits<ConstantArray>::op_end(this) - V.size(),
+ V.size()) {
assert(V.size() == T->getNumElements() &&
"Invalid initializer vector for constant array");
Use *OL = OperandList;
@@ -365,17 +367,16 @@
(T->isAbstract() &&
C->getType()->getTypeID() == T->getElementType()->getTypeID())) &&
"Initializer for array element doesn't match array element type!");
- OL->init(C, this);
+ *OL = C;
}
}
-ConstantArray::~ConstantArray() {
- delete [] OperandList;
-}
ConstantStruct::ConstantStruct(const StructType *T,
const std::vector<Constant*> &V)
- : Constant(T, ConstantStructVal, new Use[V.size()], V.size()) {
+ : Constant(T, ConstantStructVal,
+ OperandTraits<ConstantStruct>::op_end(this) - V.size(),
+ V.size()) {
assert(V.size() == T->getNumElements() &&
"Invalid initializer vector for constant structure");
Use *OL = OperandList;
@@ -388,18 +389,16 @@
T->getElementType(I-V.begin())->getTypeID() ==
C->getType()->getTypeID())) &&
"Initializer for struct element doesn't match struct element type!");
- OL->init(C, this);
+ *OL = C;
}
}
-ConstantStruct::~ConstantStruct() {
- delete [] OperandList;
-}
-
ConstantVector::ConstantVector(const VectorType *T,
const std::vector<Constant*> &V)
- : Constant(T, ConstantVectorVal, new Use[V.size()], V.size()) {
+ : Constant(T, ConstantVectorVal,
+ OperandTraits<ConstantVector>::op_end(this) - V.size(),
+ V.size()) {
Use *OL = OperandList;
for (std::vector<Constant*>::const_iterator I = V.begin(), E = V.end();
I != E; ++I, ++OL) {
@@ -408,14 +407,12 @@
(T->isAbstract() &&
C->getType()->getTypeID() == T->getElementType()->getTypeID())) &&
"Initializer for vector element doesn't match vector element type!");
- OL->init(C, this);
+ *OL = C;
}
}
-ConstantVector::~ConstantVector() {
- delete [] OperandList;
-}
+namespace llvm {
// We declare several classes private to this file, so use an anonymous
// namespace
namespace {
@@ -424,49 +421,54 @@
/// behind the scenes to implement unary constant exprs.
class VISIBILITY_HIDDEN UnaryConstantExpr : public ConstantExpr {
void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- Use Op;
public:
// allocate space for exactly one operand
void *operator new(size_t s) {
return User::operator new(s, 1);
}
UnaryConstantExpr(unsigned Opcode, Constant *C, const Type *Ty)
- : ConstantExpr(Ty, Opcode, &Op, 1), Op(C, this) {}
+ : ConstantExpr(Ty, Opcode, &Op<0>(), 1) {
+ Op<0>() = C;
+ }
+ /// Transparently provide more efficient getOperand methods.
+ DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
};
/// BinaryConstantExpr - This class is private to Constants.cpp, and is used
/// behind the scenes to implement binary constant exprs.
class VISIBILITY_HIDDEN BinaryConstantExpr : public ConstantExpr {
void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- Use Ops[2];
public:
// allocate space for exactly two operands
void *operator new(size_t s) {
return User::operator new(s, 2);
}
BinaryConstantExpr(unsigned Opcode, Constant *C1, Constant *C2)
- : ConstantExpr(C1->getType(), Opcode, Ops, 2) {
- Ops[0].init(C1, this);
- Ops[1].init(C2, this);
+ : ConstantExpr(C1->getType(), Opcode, &Op<0>(), 2) {
+ Op<0>() = C1;
+ Op<1>() = C2;
}
+ /// Transparently provide more efficient getOperand methods.
+ DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
};
/// SelectConstantExpr - This class is private to Constants.cpp, and is used
/// behind the scenes to implement select constant exprs.
class VISIBILITY_HIDDEN SelectConstantExpr : public ConstantExpr {
void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- Use Ops[3];
public:
// allocate space for exactly three operands
void *operator new(size_t s) {
return User::operator new(s, 3);
}
SelectConstantExpr(Constant *C1, Constant *C2, Constant *C3)
- : ConstantExpr(C2->getType(), Instruction::Select, Ops, 3) {
- Ops[0].init(C1, this);
- Ops[1].init(C2, this);
- Ops[2].init(C3, this);
+ : ConstantExpr(C2->getType(), Instruction::Select, &Op<0>(), 3) {
+ Op<0>() = C1;
+ Op<1>() = C2;
+ Op<2>() = C3;
}
+ /// Transparently provide more efficient getOperand methods.
+ DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
};
/// ExtractElementConstantExpr - This class is private to
@@ -474,7 +476,6 @@
/// extractelement constant exprs.
class VISIBILITY_HIDDEN ExtractElementConstantExpr : public ConstantExpr {
void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- Use Ops[2];
public:
// allocate space for exactly two operands
void *operator new(size_t s) {
@@ -482,10 +483,12 @@
}
ExtractElementConstantExpr(Constant *C1, Constant *C2)
: ConstantExpr(cast<VectorType>(C1->getType())->getElementType(),
- Instruction::ExtractElement, Ops, 2) {
- Ops[0].init(C1, this);
- Ops[1].init(C2, this);
+ Instruction::ExtractElement, &Op<0>(), 2) {
+ Op<0>() = C1;
+ Op<1>() = C2;
}
+ /// Transparently provide more efficient getOperand methods.
+ DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
};
/// InsertElementConstantExpr - This class is private to
@@ -493,7 +496,6 @@
/// insertelement constant exprs.
class VISIBILITY_HIDDEN InsertElementConstantExpr : public ConstantExpr {
void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- Use Ops[3];
public:
// allocate space for exactly three operands
void *operator new(size_t s) {
@@ -501,11 +503,13 @@
}
InsertElementConstantExpr(Constant *C1, Constant *C2, Constant *C3)
: ConstantExpr(C1->getType(), Instruction::InsertElement,
- Ops, 3) {
- Ops[0].init(C1, this);
- Ops[1].init(C2, this);
- Ops[2].init(C3, this);
+ &Op<0>(), 3) {
+ Op<0>() = C1;
+ Op<1>() = C2;
+ Op<2>() = C3;
}
+ /// Transparently provide more efficient getOperand methods.
+ DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
};
/// ShuffleVectorConstantExpr - This class is private to
@@ -513,7 +517,6 @@
/// shufflevector constant exprs.
class VISIBILITY_HIDDEN ShuffleVectorConstantExpr : public ConstantExpr {
void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- Use Ops[3];
public:
// allocate space for exactly three operands
void *operator new(size_t s) {
@@ -521,32 +524,81 @@
}
ShuffleVectorConstantExpr(Constant *C1, Constant *C2, Constant *C3)
: ConstantExpr(C1->getType(), Instruction::ShuffleVector,
- Ops, 3) {
- Ops[0].init(C1, this);
- Ops[1].init(C2, this);
- Ops[2].init(C3, this);
+ &Op<0>(), 3) {
+ Op<0>() = C1;
+ Op<1>() = C2;
+ Op<2>() = C3;
+ }
+ /// Transparently provide more efficient getOperand methods.
+ DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
+};
+
+/// ExtractValueConstantExpr - This class is private to
+/// Constants.cpp, and is used behind the scenes to implement
+/// extractvalue constant exprs.
+class VISIBILITY_HIDDEN ExtractValueConstantExpr : public ConstantExpr {
+ void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
+public:
+ // allocate space for exactly one operand
+ void *operator new(size_t s) {
+ return User::operator new(s, 1);
+ }
+ ExtractValueConstantExpr(Constant *Agg,
+ const SmallVector<unsigned, 4> &IdxList,
+ const Type *DestTy)
+ : ConstantExpr(DestTy, Instruction::ExtractValue, &Op<0>(), 1),
+ Indices(IdxList) {
+ Op<0>() = Agg;
}
+
+ /// Indices - These identify which value to extract.
+ const SmallVector<unsigned, 4> Indices;
+
+ /// Transparently provide more efficient getOperand methods.
+ DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
};
+/// InsertValueConstantExpr - This class is private to
+/// Constants.cpp, and is used behind the scenes to implement
+/// insertvalue constant exprs.
+class VISIBILITY_HIDDEN InsertValueConstantExpr : public ConstantExpr {
+ void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
+public:
+ // allocate space for exactly one operand
+ void *operator new(size_t s) {
+ return User::operator new(s, 2);
+ }
+ InsertValueConstantExpr(Constant *Agg, Constant *Val,
+ const SmallVector<unsigned, 4> &IdxList,
+ const Type *DestTy)
+ : ConstantExpr(DestTy, Instruction::InsertValue, &Op<0>(), 2),
+ Indices(IdxList) {
+ Op<0>() = Agg;
+ Op<1>() = Val;
+ }
+
+ /// Indices - These identify the position for the insertion.
+ const SmallVector<unsigned, 4> Indices;
+
+ /// Transparently provide more efficient getOperand methods.
+ DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
+};
+
+
/// GetElementPtrConstantExpr - This class is private to Constants.cpp, and is
/// used behind the scenes to implement getelementpr constant exprs.
class VISIBILITY_HIDDEN GetElementPtrConstantExpr : public ConstantExpr {
GetElementPtrConstantExpr(Constant *C, const std::vector<Constant*> &IdxList,
- const Type *DestTy)
- : ConstantExpr(DestTy, Instruction::GetElementPtr,
- new Use[IdxList.size()+1], IdxList.size()+1) {
- OperandList[0].init(C, this);
- for (unsigned i = 0, E = IdxList.size(); i != E; ++i)
- OperandList[i+1].init(IdxList[i], this);
- }
+ const Type *DestTy);
public:
- static GetElementPtrConstantExpr *Create(Constant *C, const std::vector<Constant*> &IdxList,
- const Type *DestTy) {
- return new(IdxList.size() + 1/*FIXME*/) GetElementPtrConstantExpr(C, IdxList, DestTy);
- }
- ~GetElementPtrConstantExpr() {
- delete [] OperandList;
+ static GetElementPtrConstantExpr *Create(Constant *C,
+ const std::vector<Constant*>&IdxList,
+ const Type *DestTy) {
+ return new(IdxList.size() + 1)
+ GetElementPtrConstantExpr(C, IdxList, DestTy);
}
+ /// Transparently provide more efficient getOperand methods.
+ DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
};
// CompareConstantExpr - This class is private to Constants.cpp, and is used
@@ -559,17 +611,86 @@
return User::operator new(s, 2);
}
unsigned short predicate;
- Use Ops[2];
- CompareConstantExpr(Instruction::OtherOps opc, unsigned short pred,
- Constant* LHS, Constant* RHS)
- : ConstantExpr(Type::Int1Ty, opc, Ops, 2), predicate(pred) {
- OperandList[0].init(LHS, this);
- OperandList[1].init(RHS, this);
+ CompareConstantExpr(const Type *ty, Instruction::OtherOps opc,
+ unsigned short pred, Constant* LHS, Constant* RHS)
+ : ConstantExpr(ty, opc, &Op<0>(), 2), predicate(pred) {
+ Op<0>() = LHS;
+ Op<1>() = RHS;
}
+ /// Transparently provide more efficient getOperand methods.
+ DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
};
} // end anonymous namespace
+template <>
+struct OperandTraits<UnaryConstantExpr> : FixedNumOperandTraits<1> {
+};
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(UnaryConstantExpr, Value)
+
+template <>
+struct OperandTraits<BinaryConstantExpr> : FixedNumOperandTraits<2> {
+};
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BinaryConstantExpr, Value)
+
+template <>
+struct OperandTraits<SelectConstantExpr> : FixedNumOperandTraits<3> {
+};
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SelectConstantExpr, Value)
+
+template <>
+struct OperandTraits<ExtractElementConstantExpr> : FixedNumOperandTraits<2> {
+};
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ExtractElementConstantExpr, Value)
+
+template <>
+struct OperandTraits<InsertElementConstantExpr> : FixedNumOperandTraits<3> {
+};
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(InsertElementConstantExpr, Value)
+
+template <>
+struct OperandTraits<ShuffleVectorConstantExpr> : FixedNumOperandTraits<3> {
+};
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ShuffleVectorConstantExpr, Value)
+
+template <>
+struct OperandTraits<ExtractValueConstantExpr> : FixedNumOperandTraits<1> {
+};
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ExtractValueConstantExpr, Value)
+
+template <>
+struct OperandTraits<InsertValueConstantExpr> : FixedNumOperandTraits<2> {
+};
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(InsertValueConstantExpr, Value)
+
+template <>
+struct OperandTraits<GetElementPtrConstantExpr> : VariadicOperandTraits<1> {
+};
+
+GetElementPtrConstantExpr::GetElementPtrConstantExpr
+ (Constant *C,
+ const std::vector<Constant*> &IdxList,
+ const Type *DestTy)
+ : ConstantExpr(DestTy, Instruction::GetElementPtr,
+ OperandTraits<GetElementPtrConstantExpr>::op_end(this)
+ - (IdxList.size()+1),
+ IdxList.size()+1) {
+ OperandList[0] = C;
+ for (unsigned i = 0, E = IdxList.size(); i != E; ++i)
+ OperandList[i+1] = IdxList[i];
+}
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GetElementPtrConstantExpr, Value)
+
+
+template <>
+struct OperandTraits<CompareConstantExpr> : FixedNumOperandTraits<2> {
+};
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CompareConstantExpr, Value)
+
+
+} // End llvm namespace
+
// Utility function for determining if a ConstantExpr is a CastOp or not. This
// can't be inline because we don't want to #include Instruction.h into
@@ -582,6 +703,19 @@
return getOpcode() == Instruction::ICmp || getOpcode() == Instruction::FCmp;
}
+bool ConstantExpr::hasIndices() const {
+ return getOpcode() == Instruction::ExtractValue ||
+ getOpcode() == Instruction::InsertValue;
+}
+
+const SmallVector<unsigned, 4> &ConstantExpr::getIndices() const {
+ if (const ExtractValueConstantExpr *EVCE =
+ dyn_cast<ExtractValueConstantExpr>(this))
+ return EVCE->Indices;
+
+ return cast<InsertValueConstantExpr>(this)->Indices;
+}
+
/// ConstantExpr::get* - Return some common constants without having to
/// specify the full Instruction::OPCODE identifier.
///
@@ -632,7 +766,10 @@
return get(Instruction::Xor, C1, C2);
}
unsigned ConstantExpr::getPredicate() const {
- assert(getOpcode() == Instruction::FCmp || getOpcode() == Instruction::ICmp);
+ assert(getOpcode() == Instruction::FCmp ||
+ getOpcode() == Instruction::ICmp ||
+ getOpcode() == Instruction::VFCmp ||
+ getOpcode() == Instruction::VICmp);
return ((const CompareConstantExpr*)this)->predicate;
}
Constant *ConstantExpr::getShl(Constant *C1, Constant *C2) {
@@ -689,11 +826,24 @@
Op1 = (OpNo == 1) ? Op : getOperand(1);
Op2 = (OpNo == 2) ? Op : getOperand(2);
return ConstantExpr::getShuffleVector(Op0, Op1, Op2);
+ case Instruction::InsertValue: {
+ const SmallVector<unsigned, 4> &Indices = getIndices();
+ Op0 = (OpNo == 0) ? Op : getOperand(0);
+ Op1 = (OpNo == 1) ? Op : getOperand(1);
+ return ConstantExpr::getInsertValue(Op0, Op1,
+ &Indices[0], Indices.size());
+ }
+ case Instruction::ExtractValue: {
+ assert(OpNo == 0 && "ExtractaValue has only one operand!");
+ const SmallVector<unsigned, 4> &Indices = getIndices();
+ return
+ ConstantExpr::getExtractValue(Op, &Indices[0], Indices.size());
+ }
case Instruction::GetElementPtr: {
SmallVector<Constant*, 8> Ops;
- Ops.resize(getNumOperands());
+ Ops.resize(getNumOperands()-1);
for (unsigned i = 1, e = getNumOperands(); i != e; ++i)
- Ops[i] = getOperand(i);
+ Ops[i-1] = getOperand(i);
if (OpNo == 0)
return ConstantExpr::getGetElementPtr(Op, &Ops[0], Ops.size());
Ops[OpNo-1] = Op;
@@ -744,6 +894,16 @@
return ConstantExpr::getExtractElement(Ops[0], Ops[1]);
case Instruction::ShuffleVector:
return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]);
+ case Instruction::InsertValue: {
+ const SmallVector<unsigned, 4> &Indices = getIndices();
+ return ConstantExpr::getInsertValue(Ops[0], Ops[1],
+ &Indices[0], Indices.size());
+ }
+ case Instruction::ExtractValue: {
+ const SmallVector<unsigned, 4> &Indices = getIndices();
+ return ConstantExpr::getExtractValue(Ops[0],
+ &Indices[0], Indices.size());
+ }
case Instruction::GetElementPtr:
return ConstantExpr::getGetElementPtr(Ops[0], &Ops[1], Ops.size()-1);
case Instruction::ICmp:
@@ -815,17 +975,29 @@
//===----------------------------------------------------------------------===//
// Factory Function Implementation
+
+// The number of operands for each ConstantCreator::create method is
+// determined by the ConstantTraits template.
// ConstantCreator - A class that is used to create constants by
// ValueMap*. This class should be partially specialized if there is
// something strange that needs to be done to interface to the ctor for the
// constant.
//
namespace llvm {
+ template<class ValType>
+ struct ConstantTraits;
+
+ template<typename T, typename Alloc>
+ struct VISIBILITY_HIDDEN ConstantTraits< std::vector<T, Alloc> > {
+ static unsigned uses(const std::vector<T, Alloc>& v) {
+ return v.size();
+ }
+ };
+
template<class ConstantClass, class TypeClass, class ValType>
struct VISIBILITY_HIDDEN ConstantCreator {
static ConstantClass *create(const TypeClass *Ty, const ValType &V) {
- unsigned FIXME = 0; // = traits<ValType>::uses(V)
- return new(FIXME) ConstantClass(Ty, V);
+ return new(ConstantTraits<ValType>::uses(V)) ConstantClass(Ty, V);
}
};
@@ -1206,8 +1378,9 @@
std::string ConstantArray::getAsString() const {
assert(isString() && "Not a string!");
std::string Result;
+ Result.reserve(getNumOperands());
for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
- Result += (char)cast<ConstantInt>(getOperand(i))->getZExtValue();
+ Result.push_back((char)cast<ConstantInt>(getOperand(i))->getZExtValue());
return Result;
}
@@ -1441,22 +1614,33 @@
//---- ConstantExpr::get() implementations...
//
+namespace {
+
struct ExprMapKeyType {
- explicit ExprMapKeyType(unsigned opc, std::vector<Constant*> ops,
- unsigned short pred = 0) : opcode(opc), predicate(pred), operands(ops) { }
+ typedef SmallVector<unsigned, 4> IndexList;
+
+ ExprMapKeyType(unsigned opc,
+ const std::vector<Constant*> &ops,
+ unsigned short pred = 0,
+ const IndexList &inds = IndexList())
+ : opcode(opc), predicate(pred), operands(ops), indices(inds) {}
uint16_t opcode;
uint16_t predicate;
std::vector<Constant*> operands;
+ IndexList indices;
bool operator==(const ExprMapKeyType& that) const {
return this->opcode == that.opcode &&
this->predicate == that.predicate &&
this->operands == that.operands;
+ this->indices == that.indices;
}
bool operator<(const ExprMapKeyType & that) const {
return this->opcode < that.opcode ||
(this->opcode == that.opcode && this->predicate < that.predicate) ||
(this->opcode == that.opcode && this->predicate == that.predicate &&
- this->operands < that.operands);
+ this->operands < that.operands) ||
+ (this->opcode == that.opcode && this->predicate == that.predicate &&
+ this->operands == that.operands && this->indices < that.indices);
}
bool operator!=(const ExprMapKeyType& that) const {
@@ -1464,6 +1648,8 @@
}
};
+}
+
namespace llvm {
template<>
struct ConstantCreator<ConstantExpr, Type, ExprMapKeyType> {
@@ -1485,6 +1671,11 @@
if (V.opcode == Instruction::ShuffleVector)
return new ShuffleVectorConstantExpr(V.operands[0], V.operands[1],
V.operands[2]);
+ if (V.opcode == Instruction::InsertValue)
+ return new InsertValueConstantExpr(V.operands[0], V.operands[1],
+ V.indices, Ty);
+ if (V.opcode == Instruction::ExtractValue)
+ return new ExtractValueConstantExpr(V.operands[0], V.indices, Ty);
if (V.opcode == Instruction::GetElementPtr) {
std::vector<Constant*> IdxList(V.operands.begin()+1, V.operands.end());
return GetElementPtrConstantExpr::Create(V.operands[0], IdxList, Ty);
@@ -1494,10 +1685,16 @@
// value and it is combined with the instruction opcode by multiplying
// the opcode by one hundred. We must decode this to get the predicate.
if (V.opcode == Instruction::ICmp)
- return new CompareConstantExpr(Instruction::ICmp, V.predicate,
+ return new CompareConstantExpr(Ty, Instruction::ICmp, V.predicate,
V.operands[0], V.operands[1]);
if (V.opcode == Instruction::FCmp)
- return new CompareConstantExpr(Instruction::FCmp, V.predicate,
+ return new CompareConstantExpr(Ty, Instruction::FCmp, V.predicate,
+ V.operands[0], V.operands[1]);
+ if (V.opcode == Instruction::VICmp)
+ return new CompareConstantExpr(Ty, Instruction::VICmp, V.predicate,
+ V.operands[0], V.operands[1]);
+ if (V.opcode == Instruction::VFCmp)
+ return new CompareConstantExpr(Ty, Instruction::VFCmp, V.predicate,
V.operands[0], V.operands[1]);
assert(0 && "Invalid ConstantExpr!");
return 0;
@@ -1557,7 +1754,9 @@
for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i)
Operands.push_back(cast<Constant>(CE->getOperand(i)));
return ExprMapKeyType(CE->getOpcode(), Operands,
- CE->isCompare() ? CE->getPredicate() : 0);
+ CE->isCompare() ? CE->getPredicate() : 0,
+ CE->hasIndices() ?
+ CE->getIndices() : SmallVector<unsigned, 4>());
}
static ManagedStatic<ValueMap<ExprMapKeyType, Type,
@@ -1890,7 +2089,9 @@
Constant *ConstantExpr::getGetElementPtrTy(const Type *ReqTy, Constant *C,
Value* const *Idxs,
unsigned NumIdx) {
- assert(GetElementPtrInst::getIndexedType(C->getType(), Idxs, Idxs+NumIdx, true) &&
+ assert(GetElementPtrInst::getIndexedType(C->getType(), Idxs,
+ Idxs+NumIdx) ==
+ cast<PointerType>(ReqTy)->getElementType() &&
"GEP indices invalid!");
if (Constant *FC = ConstantFoldGetElementPtr(C, (Constant**)Idxs, NumIdx))
@@ -1912,7 +2113,7 @@
unsigned NumIdx) {
// Get the result type of the getelementptr!
const Type *Ty =
- GetElementPtrInst::getIndexedType(C->getType(), Idxs, Idxs+NumIdx, true);
+ GetElementPtrInst::getIndexedType(C->getType(), Idxs, Idxs+NumIdx);
assert(Ty && "GEP indices invalid!");
unsigned As = cast<PointerType>(C->getType())->getAddressSpace();
return getGetElementPtrTy(PointerType::get(Ty, As), C, Idxs, NumIdx);
@@ -1959,6 +2160,79 @@
return ExprConstants->getOrCreate(Type::Int1Ty, Key);
}
+Constant *
+ConstantExpr::getVICmp(unsigned short pred, Constant* LHS, Constant* RHS) {
+ assert(isa<VectorType>(LHS->getType()) &&
+ "Tried to create vicmp operation on non-vector type!");
+ assert(LHS->getType() == RHS->getType());
+ assert(pred >= ICmpInst::FIRST_ICMP_PREDICATE &&
+ pred <= ICmpInst::LAST_ICMP_PREDICATE && "Invalid VICmp Predicate");
+
+ const VectorType *VTy = cast<VectorType>(LHS->getType());
+ const Type *EltTy = VTy->getElementType();
+ unsigned NumElts = VTy->getNumElements();
+
+ SmallVector<Constant *, 8> Elts;
+ for (unsigned i = 0; i != NumElts; ++i) {
+ Constant *FC = ConstantFoldCompareInstruction(pred, LHS->getOperand(i),
+ RHS->getOperand(i));
+ if (FC) {
+ uint64_t Val = cast<ConstantInt>(FC)->getZExtValue();
+ if (Val != 0ULL)
+ Elts.push_back(ConstantInt::getAllOnesValue(EltTy));
+ else
+ Elts.push_back(ConstantInt::get(EltTy, 0ULL));
+ }
+ }
+ if (Elts.size() == NumElts)
+ return ConstantVector::get(&Elts[0], Elts.size());
+
+ // Look up the constant in the table first to ensure uniqueness
+ std::vector<Constant*> ArgVec;
+ ArgVec.push_back(LHS);
+ ArgVec.push_back(RHS);
+ // Get the key type with both the opcode and predicate
+ const ExprMapKeyType Key(Instruction::VICmp, ArgVec, pred);
+ return ExprConstants->getOrCreate(LHS->getType(), Key);
+}
+
+Constant *
+ConstantExpr::getVFCmp(unsigned short pred, Constant* LHS, Constant* RHS) {
+ assert(isa<VectorType>(LHS->getType()) &&
+ "Tried to create vfcmp operation on non-vector type!");
+ assert(LHS->getType() == RHS->getType());
+ assert(pred <= FCmpInst::LAST_FCMP_PREDICATE && "Invalid VFCmp Predicate");
+
+ const VectorType *VTy = cast<VectorType>(LHS->getType());
+ unsigned NumElts = VTy->getNumElements();
+ const Type *EltTy = VTy->getElementType();
+ const Type *REltTy = IntegerType::get(EltTy->getPrimitiveSizeInBits());
+ const Type *ResultTy = VectorType::get(REltTy, NumElts);
+
+ SmallVector<Constant *, 8> Elts;
+ for (unsigned i = 0; i != NumElts; ++i) {
+ Constant *FC = ConstantFoldCompareInstruction(pred, LHS->getOperand(i),
+ RHS->getOperand(i));
+ if (FC) {
+ uint64_t Val = cast<ConstantInt>(FC)->getZExtValue();
+ if (Val != 0ULL)
+ Elts.push_back(ConstantInt::getAllOnesValue(REltTy));
+ else
+ Elts.push_back(ConstantInt::get(REltTy, 0ULL));
+ }
+ }
+ if (Elts.size() == NumElts)
+ return ConstantVector::get(&Elts[0], Elts.size());
+
+ // Look up the constant in the table first to ensure uniqueness
+ std::vector<Constant*> ArgVec;
+ ArgVec.push_back(LHS);
+ ArgVec.push_back(RHS);
+ // Get the key type with both the opcode and predicate
+ const ExprMapKeyType Key(Instruction::VFCmp, ArgVec, pred);
+ return ExprConstants->getOrCreate(ResultTy, Key);
+}
+
Constant *ConstantExpr::getExtractElementTy(const Type *ReqTy, Constant *Val,
Constant *Idx) {
if (Constant *FC = ConstantFoldExtractElementInstruction(Val, Idx))
@@ -2022,6 +2296,67 @@
return getShuffleVectorTy(V1->getType(), V1, V2, Mask);
}
+Constant *ConstantExpr::getInsertValueTy(const Type *ReqTy, Constant *Agg,
+ Constant *Val,
+ const unsigned *Idxs, unsigned NumIdx) {
+ assert(ExtractValueInst::getIndexedType(Agg->getType(), Idxs,
+ Idxs+NumIdx) == Val->getType() &&
+ "insertvalue indices invalid!");
+ assert(Agg->getType() == ReqTy &&
+ "insertvalue type invalid!");
+ assert(Agg->getType()->isFirstClassType() &&
+ "Non-first-class type for constant InsertValue expression");
+ if (Constant *FC = ConstantFoldInsertValueInstruction(Agg, Val, Idxs, NumIdx))
+ return FC; // Fold a few common cases...
+ // Look up the constant in the table first to ensure uniqueness
+ std::vector<Constant*> ArgVec;
+ ArgVec.push_back(Agg);
+ ArgVec.push_back(Val);
+ SmallVector<unsigned, 4> Indices(Idxs, Idxs + NumIdx);
+ const ExprMapKeyType Key(Instruction::InsertValue, ArgVec, 0, Indices);
+ return ExprConstants->getOrCreate(ReqTy, Key);
+}
+
+Constant *ConstantExpr::getInsertValue(Constant *Agg, Constant *Val,
+ const unsigned *IdxList, unsigned NumIdx) {
+ assert(Agg->getType()->isFirstClassType() &&
+ "Tried to create insertelement operation on non-first-class type!");
+
+ const Type *ReqTy = Agg->getType();
+ const Type *ValTy =
+ ExtractValueInst::getIndexedType(Agg->getType(), IdxList, IdxList+NumIdx);
+ assert(ValTy == Val->getType() && "insertvalue indices invalid!");
+ return getInsertValueTy(ReqTy, Agg, Val, IdxList, NumIdx);
+}
+
+Constant *ConstantExpr::getExtractValueTy(const Type *ReqTy, Constant *Agg,
+ const unsigned *Idxs, unsigned NumIdx) {
+ assert(ExtractValueInst::getIndexedType(Agg->getType(), Idxs,
+ Idxs+NumIdx) == ReqTy &&
+ "extractvalue indices invalid!");
+ assert(Agg->getType()->isFirstClassType() &&
+ "Non-first-class type for constant extractvalue expression");
+ if (Constant *FC = ConstantFoldExtractValueInstruction(Agg, Idxs, NumIdx))
+ return FC; // Fold a few common cases...
+ // Look up the constant in the table first to ensure uniqueness
+ std::vector<Constant*> ArgVec;
+ ArgVec.push_back(Agg);
+ SmallVector<unsigned, 4> Indices(Idxs, Idxs + NumIdx);
+ const ExprMapKeyType Key(Instruction::ExtractValue, ArgVec, 0, Indices);
+ return ExprConstants->getOrCreate(ReqTy, Key);
+}
+
+Constant *ConstantExpr::getExtractValue(Constant *Agg,
+ const unsigned *IdxList, unsigned NumIdx) {
+ assert(Agg->getType()->isFirstClassType() &&
+ "Tried to create extractelement operation on non-first-class type!");
+
+ const Type *ReqTy =
+ ExtractValueInst::getIndexedType(Agg->getType(), IdxList, IdxList+NumIdx);
+ assert(ReqTy && "extractvalue indices invalid!");
+ return getExtractValueTy(ReqTy, Agg, IdxList, NumIdx);
+}
+
Constant *ConstantExpr::getZeroValueForNegationExpr(const Type *Ty) {
if (const VectorType *PTy = dyn_cast<VectorType>(Ty))
if (PTy->getElementType()->isFloatingPoint()) {
@@ -2247,6 +2582,22 @@
}
Replacement = ConstantExpr::getGetElementPtr(Pointer,
&Indices[0], Indices.size());
+ } else if (getOpcode() == Instruction::ExtractValue) {
+ Constant *Agg = getOperand(0);
+ if (Agg == From) Agg = To;
+
+ const SmallVector<unsigned, 4> &Indices = getIndices();
+ Replacement = ConstantExpr::getExtractValue(Agg,
+ &Indices[0], Indices.size());
+ } else if (getOpcode() == Instruction::InsertValue) {
+ Constant *Agg = getOperand(0);
+ Constant *Val = getOperand(1);
+ if (Agg == From) Agg = To;
+ if (Val == From) Val = To;
+
+ const SmallVector<unsigned, 4> &Indices = getIndices();
+ Replacement = ConstantExpr::getInsertValue(Agg, Val,
+ &Indices[0], Indices.size());
} else if (isCast()) {
assert(getOperand(0) == From && "Cast only has one use!");
Replacement = ConstantExpr::getCast(getOpcode(), To, getType());
@@ -2308,43 +2659,3 @@
// Delete the old constant!
destroyConstant();
}
-
-
-/// getStringValue - Turn an LLVM constant pointer that eventually points to a
-/// global into a string value. Return an empty string if we can't do it.
-/// Parameter Chop determines if the result is chopped at the first null
-/// terminator.
-///
-std::string Constant::getStringValue(bool Chop, unsigned Offset) {
- if (GlobalVariable *GV = dyn_cast<GlobalVariable>(this)) {
- if (GV->hasInitializer() && isa<ConstantArray>(GV->getInitializer())) {
- ConstantArray *Init = cast<ConstantArray>(GV->getInitializer());
- if (Init->isString()) {
- std::string Result = Init->getAsString();
- if (Offset < Result.size()) {
- // If we are pointing INTO The string, erase the beginning...
- Result.erase(Result.begin(), Result.begin()+Offset);
-
- // Take off the null terminator, and any string fragments after it.
- if (Chop) {
- std::string::size_type NullPos = Result.find_first_of((char)0);
- if (NullPos != std::string::npos)
- Result.erase(Result.begin()+NullPos, Result.end());
- }
- return Result;
- }
- }
- }
- } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(this)) {
- if (CE->getOpcode() == Instruction::GetElementPtr) {
- // Turn a gep into the specified offset.
- if (CE->getNumOperands() == 3 &&
- cast<Constant>(CE->getOperand(1))->isNullValue() &&
- isa<ConstantInt>(CE->getOperand(2))) {
- Offset += cast<ConstantInt>(CE->getOperand(2))->getZExtValue();
- return CE->getOperand(0)->getStringValue(Chop, Offset);
- }
- }
- }
- return "";
-}
Modified: llvm/branches/non-call-eh/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/Core.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/Core.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/Core.cpp Sun Jul 6 15:45:41 2008
@@ -20,6 +20,7 @@
#include "llvm/TypeSymbolTable.h"
#include "llvm/ModuleProvider.h"
#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/CallSite.h"
#include <cassert>
#include <cstdlib>
#include <cstring>
@@ -89,18 +90,13 @@
return static_cast<LLVMTypeKind>(unwrap(Ty)->getTypeID());
}
-void LLVMRefineAbstractType(LLVMTypeRef AbstractType, LLVMTypeRef ConcreteType){
- DerivedType *Ty = unwrap<DerivedType>(AbstractType);
- Ty->refineAbstractTypeTo(unwrap(ConcreteType));
-}
-
/*--.. Operations on integer types .........................................--*/
-LLVMTypeRef LLVMInt1Type() { return (LLVMTypeRef) Type::Int1Ty; }
-LLVMTypeRef LLVMInt8Type() { return (LLVMTypeRef) Type::Int8Ty; }
-LLVMTypeRef LLVMInt16Type() { return (LLVMTypeRef) Type::Int16Ty; }
-LLVMTypeRef LLVMInt32Type() { return (LLVMTypeRef) Type::Int32Ty; }
-LLVMTypeRef LLVMInt64Type() { return (LLVMTypeRef) Type::Int64Ty; }
+LLVMTypeRef LLVMInt1Type(void) { return (LLVMTypeRef) Type::Int1Ty; }
+LLVMTypeRef LLVMInt8Type(void) { return (LLVMTypeRef) Type::Int8Ty; }
+LLVMTypeRef LLVMInt16Type(void) { return (LLVMTypeRef) Type::Int16Ty; }
+LLVMTypeRef LLVMInt32Type(void) { return (LLVMTypeRef) Type::Int32Ty; }
+LLVMTypeRef LLVMInt64Type(void) { return (LLVMTypeRef) Type::Int64Ty; }
LLVMTypeRef LLVMIntType(unsigned NumBits) {
return wrap(IntegerType::get(NumBits));
@@ -112,11 +108,11 @@
/*--.. Operations on real types ............................................--*/
-LLVMTypeRef LLVMFloatType() { return (LLVMTypeRef) Type::FloatTy; }
-LLVMTypeRef LLVMDoubleType() { return (LLVMTypeRef) Type::DoubleTy; }
-LLVMTypeRef LLVMX86FP80Type() { return (LLVMTypeRef) Type::X86_FP80Ty; }
-LLVMTypeRef LLVMFP128Type() { return (LLVMTypeRef) Type::FP128Ty; }
-LLVMTypeRef LLVMPPCFP128Type() { return (LLVMTypeRef) Type::PPC_FP128Ty; }
+LLVMTypeRef LLVMFloatType(void) { return (LLVMTypeRef) Type::FloatTy; }
+LLVMTypeRef LLVMDoubleType(void) { return (LLVMTypeRef) Type::DoubleTy; }
+LLVMTypeRef LLVMX86FP80Type(void) { return (LLVMTypeRef) Type::X86_FP80Ty; }
+LLVMTypeRef LLVMFP128Type(void) { return (LLVMTypeRef) Type::FP128Ty; }
+LLVMTypeRef LLVMPPCFP128Type(void) { return (LLVMTypeRef) Type::PPC_FP128Ty; }
/*--.. Operations on function types ........................................--*/
@@ -208,10 +204,10 @@
/*--.. Operations on other types ...........................................--*/
-LLVMTypeRef LLVMVoidType() { return (LLVMTypeRef) Type::VoidTy; }
-LLVMTypeRef LLVMLabelType() { return (LLVMTypeRef) Type::LabelTy; }
+LLVMTypeRef LLVMVoidType(void) { return (LLVMTypeRef) Type::VoidTy; }
+LLVMTypeRef LLVMLabelType(void) { return (LLVMTypeRef) Type::LabelTy; }
-LLVMTypeRef LLVMOpaqueType() {
+LLVMTypeRef LLVMOpaqueType(void) {
return wrap(llvm::OpaqueType::get());
}
@@ -745,7 +741,7 @@
unsigned LLVMCountParams(LLVMValueRef FnRef) {
// This function is strictly redundant to
// LLVMCountParamTypes(LLVMGetElementType(LLVMTypeOf(FnRef)))
- return unwrap<Function>(FnRef)->getArgumentList().size();
+ return unwrap<Function>(FnRef)->arg_size();
}
void LLVMGetParams(LLVMValueRef FnRef, LLVMValueRef *ParamRefs) {
@@ -798,6 +794,19 @@
return wrap(--I);
}
+void LLVMAddParamAttr(LLVMValueRef Arg, LLVMParamAttr PA) {
+ unwrap<Argument>(Arg)->addAttr(PA);
+}
+
+void LLVMRemoveParamAttr(LLVMValueRef Arg, LLVMParamAttr PA) {
+ unwrap<Argument>(Arg)->removeAttr(PA);
+}
+
+void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned align) {
+ unwrap<Argument>(Arg)->addAttr(
+ ParamAttr::constructAlignmentFromInt(align));
+}
+
/*--.. Operations on basic blocks ..........................................--*/
LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB) {
@@ -817,7 +826,7 @@
}
unsigned LLVMCountBasicBlocks(LLVMValueRef FnRef) {
- return unwrap<Function>(FnRef)->getBasicBlockList().size();
+ return unwrap<Function>(FnRef)->size();
}
void LLVMGetBasicBlocks(LLVMValueRef FnRef, LLVMBasicBlockRef *BasicBlocksRefs){
@@ -936,6 +945,28 @@
assert(0 && "LLVMSetInstructionCallConv applies only to call and invoke!");
}
+void LLVMAddInstrParamAttr(LLVMValueRef Instr, unsigned index,
+ LLVMParamAttr PA) {
+ CallSite Call = CallSite(unwrap<Instruction>(Instr));
+ Call.setParamAttrs(
+ Call.getParamAttrs().addAttr(index, PA));
+}
+
+void LLVMRemoveInstrParamAttr(LLVMValueRef Instr, unsigned index,
+ LLVMParamAttr PA) {
+ CallSite Call = CallSite(unwrap<Instruction>(Instr));
+ Call.setParamAttrs(
+ Call.getParamAttrs().removeAttr(index, PA));
+}
+
+void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index,
+ unsigned align) {
+ CallSite Call = CallSite(unwrap<Instruction>(Instr));
+ Call.setParamAttrs(
+ Call.getParamAttrs().addAttr(index,
+ ParamAttr::constructAlignmentFromInt(align)));
+}
+
/*--.. Operations on phi nodes .............................................--*/
void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues,
@@ -960,7 +991,7 @@
/*===-- Instruction builders ----------------------------------------------===*/
-LLVMBuilderRef LLVMCreateBuilder() {
+LLVMBuilderRef LLVMCreateBuilder(void) {
return wrap(new IRBuilder());
}
Modified: llvm/branches/non-call-eh/lib/VMCore/Dominators.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/Dominators.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/Dominators.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/Dominators.cpp Sun Jul 6 15:45:41 2008
@@ -14,12 +14,9 @@
//
//===----------------------------------------------------------------------===//
-#define DEBUG_TYPE "domtree"
-
#include "llvm/Analysis/Dominators.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Debug.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/ADT/SmallPtrSet.h"
@@ -61,7 +58,6 @@
bool DominatorTree::runOnFunction(Function &F) {
DT->recalculate(F);
- DEBUG(DT->dump());
return false;
}
@@ -71,7 +67,7 @@
char DominanceFrontier::ID = 0;
static RegisterPass<DominanceFrontier>
-G("domfrontier", "Dominance Frontier Construction", false, true);
+G("domfrontier", "Dominance Frontier Construction", true, true);
// NewBB is split and now it has one successor. Update dominace frontier to
// reflect this change.
@@ -290,3 +286,4 @@
void DominanceFrontierBase::dump() {
print (llvm::cerr);
}
+
Modified: llvm/branches/non-call-eh/lib/VMCore/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/Function.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/Function.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/Function.cpp Sun Jul 6 15:45:41 2008
@@ -106,10 +106,22 @@
/// it in its containing function.
bool Argument::hasStructRetAttr() const {
if (!isa<PointerType>(getType())) return false;
- if (this != getParent()->arg_begin()) return false; // StructRet param must be first param
+ if (this != getParent()->arg_begin())
+ return false; // StructRet param must be first param
return getParent()->paramHasAttr(1, ParamAttr::StructRet);
}
+/// addAttr - Add a ParamAttr to an argument
+void Argument::addAttr(ParameterAttributes attr) {
+ getParent()->setParamAttrs(
+ getParent()->getParamAttrs().addAttr(getArgNo() + 1, attr));
+}
+
+/// removeAttr - Remove a ParamAttr from an argument
+void Argument::removeAttr(ParameterAttributes attr) {
+ getParent()->setParamAttrs(
+ getParent()->getParamAttrs().removeAttr(getArgNo() + 1, attr));
+}
@@ -228,6 +240,12 @@
setParamAttrs(PAL);
}
+void Function::addParamAttr(unsigned i, ParameterAttributes attr) {
+ PAListPtr PAL = getParamAttrs();
+ PAL = PAL.addAttr(i, attr);
+ setParamAttrs(PAL);
+}
+
// Maintain the collector name for each function in an on-the-side table. This
// saves allocating an additional word in Function for programs which do not use
// GC (i.e., most programs) at the cost of increased overhead for clients which
@@ -266,6 +284,18 @@
}
}
+/// copyAttributesFrom - copy all additional attributes (those not needed to
+/// create a Function) from the Function Src to this one.
+void Function::copyAttributesFrom(const GlobalValue *Src) {
+ assert(isa<Function>(Src) && "Expected a Function!");
+ GlobalValue::copyAttributesFrom(Src);
+ const Function *SrcF = cast<Function>(Src);
+ setCallingConv(SrcF->getCallingConv());
+ setParamAttrs(SrcF->getParamAttrs());
+ if (SrcF->hasCollector())
+ setCollector(SrcF->getCollector());
+}
+
/// getIntrinsicID - This method returns the ID number of the specified
/// function, or Intrinsic::not_intrinsic if the function is not an
/// intrinsic, or if the pointer is null. This value is always defined to be
@@ -306,7 +336,7 @@
std::string Result(Table[id]);
for (unsigned i = 0; i < numTys; ++i)
if (Tys[i])
- Result += "." + MVT::getValueTypeString(MVT::getValueType(Tys[i]));
+ Result += "." + MVT::getMVT(Tys[i]).getMVTString();
return Result;
}
@@ -346,28 +376,4 @@
getType(id, Tys, numTys)));
}
-Value *IntrinsicInst::StripPointerCasts(Value *Ptr) {
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ptr)) {
- if (CE->getOpcode() == Instruction::BitCast) {
- if (isa<PointerType>(CE->getOperand(0)->getType()))
- return StripPointerCasts(CE->getOperand(0));
- } else if (CE->getOpcode() == Instruction::GetElementPtr) {
- for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i)
- if (!CE->getOperand(i)->isNullValue())
- return Ptr;
- return StripPointerCasts(CE->getOperand(0));
- }
- return Ptr;
- }
-
- if (BitCastInst *CI = dyn_cast<BitCastInst>(Ptr)) {
- if (isa<PointerType>(CI->getOperand(0)->getType()))
- return StripPointerCasts(CI->getOperand(0));
- } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr)) {
- if (GEP->hasAllZeroIndices())
- return StripPointerCasts(GEP->getOperand(0));
- }
- return Ptr;
-}
-
// vim: sw=2 ai
Modified: llvm/branches/non-call-eh/lib/VMCore/Globals.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/Globals.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/Globals.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/Globals.cpp Sun Jul 6 15:45:41 2008
@@ -79,7 +79,16 @@
assert(0 && "You can't GV->destroyConstant()!");
abort();
}
-
+
+/// copyAttributesFrom - copy all additional attributes (those not needed to
+/// create a GlobalValue) from the GlobalValue Src to this one.
+void GlobalValue::copyAttributesFrom(const GlobalValue *Src) {
+ setAlignment(Src->getAlignment());
+ setSection(Src->getSection());
+ setVisibility(Src->getVisibility());
+}
+
+
//===----------------------------------------------------------------------===//
// GlobalVariable Implementation
//===----------------------------------------------------------------------===//
@@ -89,14 +98,13 @@
Module *ParentModule, bool ThreadLocal,
unsigned AddressSpace)
: GlobalValue(PointerType::get(Ty, AddressSpace), Value::GlobalVariableVal,
- &Initializer, InitVal != 0, Link, Name),
+ OperandTraits<GlobalVariable>::op_begin(this),
+ InitVal != 0, Link, Name),
isConstantGlobal(constant), isThreadLocalSymbol(ThreadLocal) {
if (InitVal) {
assert(InitVal->getType() == Ty &&
"Initializer should be the same type as the GlobalVariable!");
- Initializer.init(InitVal, this);
- } else {
- Initializer.init(0, this);
+ Op<0>() = InitVal;
}
LeakDetector::addGarbageObject(this);
@@ -110,14 +118,13 @@
GlobalVariable *Before, bool ThreadLocal,
unsigned AddressSpace)
: GlobalValue(PointerType::get(Ty, AddressSpace), Value::GlobalVariableVal,
- &Initializer, InitVal != 0, Link, Name),
+ OperandTraits<GlobalVariable>::op_begin(this),
+ InitVal != 0, Link, Name),
isConstantGlobal(constant), isThreadLocalSymbol(ThreadLocal) {
if (InitVal) {
assert(InitVal->getType() == Ty &&
"Initializer should be the same type as the GlobalVariable!");
- Initializer.init(InitVal, this);
- } else {
- Initializer.init(0, this);
+ Op<0>() = InitVal;
}
LeakDetector::addGarbageObject(this);
@@ -162,6 +169,16 @@
this->setOperand(0, cast<Constant>(To));
}
+/// copyAttributesFrom - copy all additional attributes (those not needed to
+/// create a GlobalVariable) from the GlobalVariable Src to this one.
+void GlobalVariable::copyAttributesFrom(const GlobalValue *Src) {
+ assert(isa<GlobalVariable>(Src) && "Expected a GlobalVariable!");
+ GlobalValue::copyAttributesFrom(Src);
+ const GlobalVariable *SrcVar = cast<GlobalVariable>(Src);
+ setThreadLocal(SrcVar->isThreadLocal());
+}
+
+
//===----------------------------------------------------------------------===//
// GlobalAlias Implementation
//===----------------------------------------------------------------------===//
@@ -169,12 +186,12 @@
GlobalAlias::GlobalAlias(const Type *Ty, LinkageTypes Link,
const std::string &Name, Constant* aliasee,
Module *ParentModule)
- : GlobalValue(Ty, Value::GlobalAliasVal, &Aliasee, 1, Link, Name) {
+ : GlobalValue(Ty, Value::GlobalAliasVal, &Op<0>(), 1, Link, Name) {
LeakDetector::addGarbageObject(this);
if (aliasee)
assert(aliasee->getType() == Ty && "Alias and aliasee types should match!");
- Aliasee.init(aliasee, this);
+ Op<0>() = aliasee;
if (ParentModule)
ParentModule->getAliasList().push_back(this);
Modified: llvm/branches/non-call-eh/lib/VMCore/InlineAsm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/InlineAsm.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/InlineAsm.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/InlineAsm.cpp Sun Jul 6 15:45:41 2008
@@ -183,15 +183,18 @@
if (Constraints.empty() && !ConstStr.empty()) return false;
unsigned NumOutputs = 0, NumInputs = 0, NumClobbers = 0;
+ unsigned NumIndirect = 0;
for (unsigned i = 0, e = Constraints.size(); i != e; ++i) {
switch (Constraints[i].Type) {
case InlineAsm::isOutput:
+ if ((NumInputs-NumIndirect) != 0 || NumClobbers != 0)
+ return false; // outputs before inputs and clobbers.
if (!Constraints[i].isIndirect) {
- if (NumInputs || NumClobbers) return false; // outputs come first.
++NumOutputs;
break;
}
+ ++NumIndirect;
// FALLTHROUGH for Indirect Outputs.
case InlineAsm::isInput:
if (NumClobbers) return false; // inputs before clobbers.
@@ -202,11 +205,20 @@
break;
}
}
-
- if (NumOutputs > 1) return false; // Only one result allowed so far.
- if ((Ty->getReturnType() != Type::VoidTy) != NumOutputs)
- return false; // NumOutputs = 1 iff has a result type.
+ switch (NumOutputs) {
+ case 0:
+ if (Ty->getReturnType() != Type::VoidTy) return false;
+ break;
+ case 1:
+ if (isa<StructType>(Ty->getReturnType())) return false;
+ break;
+ default:
+ const StructType *STy = dyn_cast<StructType>(Ty->getReturnType());
+ if (STy == 0 || STy->getNumElements() != NumOutputs)
+ return false;
+ break;
+ }
if (Ty->getNumParams() != NumInputs) return false;
return true;
Modified: llvm/branches/non-call-eh/lib/VMCore/Instruction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/Instruction.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/Instruction.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/Instruction.cpp Sun Jul 6 15:45:41 2008
@@ -68,6 +68,12 @@
getParent()->getInstList().erase(this);
}
+/// insertBefore - Insert an unlinked instructions into a basic block
+/// immediately before the specified instruction.
+void Instruction::insertBefore(Instruction *InsertPos) {
+ InsertPos->getParent()->getInstList().insert(InsertPos, this);
+}
+
/// moveBefore - Unlink this instruction from its current basic block and
/// insert it into the basic block that MovePos lives in, right before
/// MovePos.
@@ -128,6 +134,8 @@
// Other instructions...
case ICmp: return "icmp";
case FCmp: return "fcmp";
+ case VICmp: return "vicmp";
+ case VFCmp: return "vfcmp";
case PHI: return "phi";
case Select: return "select";
case Call: return "call";
@@ -139,6 +147,8 @@
case InsertElement: return "insertelement";
case ShuffleVector: return "shufflevector";
case GetResult: return "getresult";
+ case ExtractValue: return "extractvalue";
+ case InsertValue: return "insertvalue";
default: return "<Invalid operator> ";
}
@@ -219,7 +229,23 @@
return false;
}
-
+/// mayReadFromMemory - Return true if this instruction may read memory.
+///
+bool Instruction::mayReadFromMemory() const {
+ switch (getOpcode()) {
+ default: return false;
+ case Instruction::Free:
+ case Instruction::VAArg:
+ case Instruction::Load:
+ return true;
+ case Instruction::Call:
+ return !cast<CallInst>(this)->doesNotAccessMemory();
+ case Instruction::Invoke:
+ return !cast<InvokeInst>(this)->doesNotAccessMemory();
+ case Instruction::Store:
+ return cast<StoreInst>(this)->isVolatile();
+ }
+}
/// mayWriteToMemory - Return true if this instruction may modify memory.
///
@@ -227,12 +253,13 @@
switch (getOpcode()) {
default: return false;
case Instruction::Free:
- case Instruction::Invoke:
case Instruction::Store:
case Instruction::VAArg:
return true;
case Instruction::Call:
return !cast<CallInst>(this)->onlyReadsMemory();
+ case Instruction::Invoke:
+ return !cast<InvokeInst>(this)->onlyReadsMemory();
case Instruction::Load:
return cast<LoadInst>(this)->isVolatile();
}
Modified: llvm/branches/non-call-eh/lib/VMCore/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/Instructions.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/Instructions.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/Instructions.cpp Sun Jul 6 15:45:41 2008
@@ -12,7 +12,6 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/BasicBlock.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
@@ -92,6 +91,13 @@
cast<InvokeInst>(I)->setDoesNotThrow(doesNotThrow);
}
+bool CallSite::hasArgument(const Value *Arg) const {
+ for (arg_iterator AI = this->arg_begin(), E = this->arg_end(); AI != E; ++AI)
+ if (AI->get() == Arg)
+ return true;
+ return false;
+}
+
//===----------------------------------------------------------------------===//
// TerminatorInst Class
//===----------------------------------------------------------------------===//
@@ -100,28 +106,32 @@
TerminatorInst::~TerminatorInst() {
}
+//===----------------------------------------------------------------------===//
+// UnaryInstruction Class
+//===----------------------------------------------------------------------===//
+
// Out of line virtual method, so the vtable, etc has a home.
UnaryInstruction::~UnaryInstruction() {
}
-
//===----------------------------------------------------------------------===//
// PHINode Class
//===----------------------------------------------------------------------===//
PHINode::PHINode(const PHINode &PN)
: Instruction(PN.getType(), Instruction::PHI,
- new Use[PN.getNumOperands()], PN.getNumOperands()),
+ allocHungoffUses(PN.getNumOperands()), PN.getNumOperands()),
ReservedSpace(PN.getNumOperands()) {
Use *OL = OperandList;
for (unsigned i = 0, e = PN.getNumOperands(); i != e; i+=2) {
- OL[i].init(PN.getOperand(i), this);
- OL[i+1].init(PN.getOperand(i+1), this);
+ OL[i] = PN.getOperand(i);
+ OL[i+1] = PN.getOperand(i+1);
}
}
PHINode::~PHINode() {
- delete [] OperandList;
+ if (OperandList)
+ dropHungoffUses(OperandList);
}
// removeIncomingValue - Remove an incoming value. This is useful if a
@@ -164,8 +174,9 @@
/// 3. If NumOps == NumOperands, trim the reserved space.
///
void PHINode::resizeOperands(unsigned NumOps) {
+ unsigned e = getNumOperands();
if (NumOps == 0) {
- NumOps = (getNumOperands())*3/2;
+ NumOps = e*3/2;
if (NumOps < 4) NumOps = 4; // 4 op PHI nodes are VERY common.
} else if (NumOps*2 > NumOperands) {
// No resize needed.
@@ -177,14 +188,11 @@
}
ReservedSpace = NumOps;
- Use *NewOps = new Use[NumOps];
Use *OldOps = OperandList;
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
- NewOps[i].init(OldOps[i], this);
- OldOps[i].set(0);
- }
- delete [] OldOps;
+ Use *NewOps = allocHungoffUses(NumOps);
+ std::copy(OldOps, OldOps + e, NewOps);
OperandList = NewOps;
+ if (OldOps) Use::zap(OldOps, OldOps + e, true);
}
/// hasConstantValue - If the specified PHI node always merges together the same
@@ -241,13 +249,12 @@
//===----------------------------------------------------------------------===//
CallInst::~CallInst() {
- delete [] OperandList;
}
void CallInst::init(Value *Func, Value* const *Params, unsigned NumParams) {
- NumOperands = NumParams+1;
- Use *OL = OperandList = new Use[NumParams+1];
- OL[0].init(Func, this);
+ assert(NumOperands == NumParams+1 && "NumOperands not set up?");
+ Use *OL = OperandList;
+ OL[0] = Func;
const FunctionType *FTy =
cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
@@ -260,16 +267,16 @@
assert((i >= FTy->getNumParams() ||
FTy->getParamType(i) == Params[i]->getType()) &&
"Calling a function with a bad signature!");
- OL[i+1].init(Params[i], this);
+ OL[i+1] = Params[i];
}
}
void CallInst::init(Value *Func, Value *Actual1, Value *Actual2) {
- NumOperands = 3;
- Use *OL = OperandList = new Use[3];
- OL[0].init(Func, this);
- OL[1].init(Actual1, this);
- OL[2].init(Actual2, this);
+ assert(NumOperands == 3 && "NumOperands not set up?");
+ Use *OL = OperandList;
+ OL[0] = Func;
+ OL[1] = Actual1;
+ OL[2] = Actual2;
const FunctionType *FTy =
cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
@@ -287,10 +294,10 @@
}
void CallInst::init(Value *Func, Value *Actual) {
- NumOperands = 2;
- Use *OL = OperandList = new Use[2];
- OL[0].init(Func, this);
- OL[1].init(Actual, this);
+ assert(NumOperands == 2 && "NumOperands not set up?");
+ Use *OL = OperandList;
+ OL[0] = Func;
+ OL[1] = Actual;
const FunctionType *FTy =
cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
@@ -305,9 +312,9 @@
}
void CallInst::init(Value *Func) {
- NumOperands = 1;
- Use *OL = OperandList = new Use[1];
- OL[0].init(Func, this);
+ assert(NumOperands == 1 && "NumOperands not set up?");
+ Use *OL = OperandList;
+ OL[0] = Func;
const FunctionType *FTy =
cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
@@ -320,7 +327,9 @@
Instruction *InsertBefore)
: Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
->getElementType())->getReturnType(),
- Instruction::Call, 0, 0, InsertBefore) {
+ Instruction::Call,
+ OperandTraits<CallInst>::op_end(this) - 2,
+ 2, InsertBefore) {
init(Func, Actual);
setName(Name);
}
@@ -329,7 +338,9 @@
BasicBlock *InsertAtEnd)
: Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
->getElementType())->getReturnType(),
- Instruction::Call, 0, 0, InsertAtEnd) {
+ Instruction::Call,
+ OperandTraits<CallInst>::op_end(this) - 2,
+ 2, InsertAtEnd) {
init(Func, Actual);
setName(Name);
}
@@ -337,7 +348,9 @@
Instruction *InsertBefore)
: Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
->getElementType())->getReturnType(),
- Instruction::Call, 0, 0, InsertBefore) {
+ Instruction::Call,
+ OperandTraits<CallInst>::op_end(this) - 1,
+ 1, InsertBefore) {
init(Func);
setName(Name);
}
@@ -346,20 +359,29 @@
BasicBlock *InsertAtEnd)
: Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
->getElementType())->getReturnType(),
- Instruction::Call, 0, 0, InsertAtEnd) {
+ Instruction::Call,
+ OperandTraits<CallInst>::op_end(this) - 1,
+ 1, InsertAtEnd) {
init(Func);
setName(Name);
}
CallInst::CallInst(const CallInst &CI)
- : Instruction(CI.getType(), Instruction::Call, new Use[CI.getNumOperands()],
+ : Instruction(CI.getType(), Instruction::Call,
+ OperandTraits<CallInst>::op_end(this) - CI.getNumOperands(),
CI.getNumOperands()) {
setParamAttrs(CI.getParamAttrs());
SubclassData = CI.SubclassData;
Use *OL = OperandList;
Use *InOL = CI.OperandList;
for (unsigned i = 0, e = CI.getNumOperands(); i != e; ++i)
- OL[i].init(InOL[i], this);
+ OL[i] = InOL[i];
+}
+
+void CallInst::addParamAttr(unsigned i, ParameterAttributes attr) {
+ PAListPtr PAL = getParamAttrs();
+ PAL = PAL.addAttr(i, attr);
+ setParamAttrs(PAL);
}
bool CallInst::paramHasAttr(unsigned i, ParameterAttributes attr) const {
@@ -384,17 +406,13 @@
// InvokeInst Implementation
//===----------------------------------------------------------------------===//
-InvokeInst::~InvokeInst() {
- delete [] OperandList;
-}
-
void InvokeInst::init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
Value* const *Args, unsigned NumArgs) {
- NumOperands = 3+NumArgs;
- Use *OL = OperandList = new Use[3+NumArgs];
- OL[0].init(Fn, this);
- OL[1].init(IfNormal, this);
- OL[2].init(IfException, this);
+ assert(NumOperands == 3+NumArgs && "NumOperands not set up?");
+ Use *OL = OperandList;
+ OL[0] = Fn;
+ OL[1] = IfNormal;
+ OL[2] = IfException;
const FunctionType *FTy =
cast<FunctionType>(cast<PointerType>(Fn->getType())->getElementType());
FTy = FTy; // silence warning.
@@ -408,18 +426,20 @@
FTy->getParamType(i) == Args[i]->getType()) &&
"Invoking a function with a bad signature!");
- OL[i+3].init(Args[i], this);
+ OL[i+3] = Args[i];
}
}
InvokeInst::InvokeInst(const InvokeInst &II)
: TerminatorInst(II.getType(), Instruction::Invoke,
- new Use[II.getNumOperands()], II.getNumOperands()) {
+ OperandTraits<InvokeInst>::op_end(this)
+ - II.getNumOperands(),
+ II.getNumOperands()) {
setParamAttrs(II.getParamAttrs());
SubclassData = II.SubclassData;
Use *OL = OperandList, *InOL = II.OperandList;
for (unsigned i = 0, e = II.getNumOperands(); i != e; ++i)
- OL[i].init(InOL[i], this);
+ OL[i] = InOL[i];
}
BasicBlock *InvokeInst::getSuccessorV(unsigned idx) const {
@@ -440,6 +460,12 @@
return false;
}
+void InvokeInst::addParamAttr(unsigned i, ParameterAttributes attr) {
+ PAListPtr PAL = getParamAttrs();
+ PAL = PAL.addAttr(i, attr);
+ setParamAttrs(PAL);
+}
+
void InvokeInst::setDoesNotThrow(bool doesNotThrow) {
PAListPtr PAL = getParamAttrs();
if (doesNotThrow)
@@ -456,45 +482,52 @@
ReturnInst::ReturnInst(const ReturnInst &RI)
: TerminatorInst(Type::VoidTy, Instruction::Ret,
- &RetVal, RI.getNumOperands()) {
+ OperandTraits<ReturnInst>::op_end(this)
+ - RI.getNumOperands(),
+ RI.getNumOperands()) {
unsigned N = RI.getNumOperands();
- if (N == 1)
- RetVal.init(RI.RetVal, this);
+ if (N == 1)
+ Op<0>() = RI.Op<0>();
else if (N) {
- Use *OL = OperandList = new Use[N];
+ Use *OL = OperandList;
for (unsigned i = 0; i < N; ++i)
- OL[i].init(RI.getOperand(i), this);
+ OL[i] = RI.getOperand(i);
}
}
ReturnInst::ReturnInst(Value *retVal, Instruction *InsertBefore)
- : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, 0, InsertBefore) {
+ : TerminatorInst(Type::VoidTy, Instruction::Ret,
+ OperandTraits<ReturnInst>::op_end(this) - (retVal != 0),
+ retVal != 0, InsertBefore) {
if (retVal)
init(&retVal, 1);
}
ReturnInst::ReturnInst(Value *retVal, BasicBlock *InsertAtEnd)
- : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, 0, InsertAtEnd) {
+ : TerminatorInst(Type::VoidTy, Instruction::Ret,
+ OperandTraits<ReturnInst>::op_end(this) - (retVal != 0),
+ retVal != 0, InsertAtEnd) {
if (retVal)
init(&retVal, 1);
}
ReturnInst::ReturnInst(BasicBlock *InsertAtEnd)
- : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, 0, InsertAtEnd) {
+ : TerminatorInst(Type::VoidTy, Instruction::Ret,
+ OperandTraits<ReturnInst>::op_end(this),
+ 0, InsertAtEnd) {
}
ReturnInst::ReturnInst(Value * const* retVals, unsigned N,
Instruction *InsertBefore)
- : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, N, InsertBefore) {
+ : TerminatorInst(Type::VoidTy, Instruction::Ret,
+ OperandTraits<ReturnInst>::op_end(this) - N,
+ N, InsertBefore) {
if (N != 0)
init(retVals, N);
}
ReturnInst::ReturnInst(Value * const* retVals, unsigned N,
BasicBlock *InsertAtEnd)
- : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, N, InsertAtEnd) {
- if (N != 0)
- init(retVals, N);
-}
-ReturnInst::ReturnInst(Value * const* retVals, unsigned N)
- : TerminatorInst(Type::VoidTy, Instruction::Ret, &RetVal, N) {
+ : TerminatorInst(Type::VoidTy, Instruction::Ret,
+ OperandTraits<ReturnInst>::op_end(this) - N,
+ N, InsertAtEnd) {
if (N != 0)
init(retVals, N);
}
@@ -507,16 +540,16 @@
Value *V = *retVals;
if (V->getType() == Type::VoidTy)
return;
- RetVal.init(V, this);
+ Op<0>() = V;
return;
}
- Use *OL = OperandList = new Use[NumOperands];
+ Use *OL = OperandList;
for (unsigned i = 0; i < NumOperands; ++i) {
Value *V = *retVals++;
assert(!isa<BasicBlock>(V) &&
"Cannot return basic block. Probably using the incorrect ctor");
- OL[i].init(V, this);
+ OL[i] = V;
}
}
@@ -537,8 +570,6 @@
}
ReturnInst::~ReturnInst() {
- if (NumOperands > 1)
- delete [] OperandList;
}
//===----------------------------------------------------------------------===//
@@ -603,33 +634,41 @@
}
BranchInst::BranchInst(BasicBlock *IfTrue, Instruction *InsertBefore)
- : TerminatorInst(Type::VoidTy, Instruction::Br, Ops, 1, InsertBefore) {
+ : TerminatorInst(Type::VoidTy, Instruction::Br,
+ OperandTraits<BranchInst>::op_end(this) - 1,
+ 1, InsertBefore) {
assert(IfTrue != 0 && "Branch destination may not be null!");
- Ops[0].init(reinterpret_cast<Value*>(IfTrue), this);
+ Op<0>() = IfTrue;
}
BranchInst::BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
Instruction *InsertBefore)
-: TerminatorInst(Type::VoidTy, Instruction::Br, Ops, 3, InsertBefore) {
- Ops[0].init(reinterpret_cast<Value*>(IfTrue), this);
- Ops[1].init(reinterpret_cast<Value*>(IfFalse), this);
- Ops[2].init(Cond, this);
+ : TerminatorInst(Type::VoidTy, Instruction::Br,
+ OperandTraits<BranchInst>::op_end(this) - 3,
+ 3, InsertBefore) {
+ Op<0>() = IfTrue;
+ Op<1>() = IfFalse;
+ Op<2>() = Cond;
#ifndef NDEBUG
AssertOK();
#endif
}
BranchInst::BranchInst(BasicBlock *IfTrue, BasicBlock *InsertAtEnd)
- : TerminatorInst(Type::VoidTy, Instruction::Br, Ops, 1, InsertAtEnd) {
+ : TerminatorInst(Type::VoidTy, Instruction::Br,
+ OperandTraits<BranchInst>::op_end(this) - 1,
+ 1, InsertAtEnd) {
assert(IfTrue != 0 && "Branch destination may not be null!");
- Ops[0].init(reinterpret_cast<Value*>(IfTrue), this);
+ Op<0>() = IfTrue;
}
BranchInst::BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
BasicBlock *InsertAtEnd)
- : TerminatorInst(Type::VoidTy, Instruction::Br, Ops, 3, InsertAtEnd) {
- Ops[0].init(reinterpret_cast<Value*>(IfTrue), this);
- Ops[1].init(reinterpret_cast<Value*>(IfFalse), this);
- Ops[2].init(Cond, this);
+ : TerminatorInst(Type::VoidTy, Instruction::Br,
+ OperandTraits<BranchInst>::op_end(this) - 3,
+ 3, InsertAtEnd) {
+ Op<0>() = IfTrue;
+ Op<1>() = IfFalse;
+ Op<2>() = Cond;
#ifndef NDEBUG
AssertOK();
#endif
@@ -637,12 +676,14 @@
BranchInst::BranchInst(const BranchInst &BI) :
- TerminatorInst(Type::VoidTy, Instruction::Br, Ops, BI.getNumOperands()) {
- OperandList[0].init(BI.getOperand(0), this);
+ TerminatorInst(Type::VoidTy, Instruction::Br,
+ OperandTraits<BranchInst>::op_end(this) - BI.getNumOperands(),
+ BI.getNumOperands()) {
+ OperandList[0] = BI.getOperand(0);
if (BI.getNumOperands() != 1) {
assert(BI.getNumOperands() == 3 && "BR can have 1 or 3 operands!");
- OperandList[1].init(BI.getOperand(1), this);
- OperandList[2].init(BI.getOperand(2), this);
+ OperandList[1] = BI.getOperand(1);
+ OperandList[2] = BI.getOperand(2);
}
}
@@ -869,18 +910,24 @@
StoreInst::StoreInst(Value *val, Value *addr, Instruction *InsertBefore)
- : Instruction(Type::VoidTy, Store, Ops, 2, InsertBefore) {
- Ops[0].init(val, this);
- Ops[1].init(addr, this);
+ : Instruction(Type::VoidTy, Store,
+ OperandTraits<StoreInst>::op_begin(this),
+ OperandTraits<StoreInst>::operands(this),
+ InsertBefore) {
+ Op<0>() = val;
+ Op<1>() = addr;
setVolatile(false);
setAlignment(0);
AssertOK();
}
StoreInst::StoreInst(Value *val, Value *addr, BasicBlock *InsertAtEnd)
- : Instruction(Type::VoidTy, Store, Ops, 2, InsertAtEnd) {
- Ops[0].init(val, this);
- Ops[1].init(addr, this);
+ : Instruction(Type::VoidTy, Store,
+ OperandTraits<StoreInst>::op_begin(this),
+ OperandTraits<StoreInst>::operands(this),
+ InsertAtEnd) {
+ Op<0>() = val;
+ Op<1>() = addr;
setVolatile(false);
setAlignment(0);
AssertOK();
@@ -888,9 +935,12 @@
StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
Instruction *InsertBefore)
- : Instruction(Type::VoidTy, Store, Ops, 2, InsertBefore) {
- Ops[0].init(val, this);
- Ops[1].init(addr, this);
+ : Instruction(Type::VoidTy, Store,
+ OperandTraits<StoreInst>::op_begin(this),
+ OperandTraits<StoreInst>::operands(this),
+ InsertBefore) {
+ Op<0>() = val;
+ Op<1>() = addr;
setVolatile(isVolatile);
setAlignment(0);
AssertOK();
@@ -898,9 +948,12 @@
StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
unsigned Align, Instruction *InsertBefore)
- : Instruction(Type::VoidTy, Store, Ops, 2, InsertBefore) {
- Ops[0].init(val, this);
- Ops[1].init(addr, this);
+ : Instruction(Type::VoidTy, Store,
+ OperandTraits<StoreInst>::op_begin(this),
+ OperandTraits<StoreInst>::operands(this),
+ InsertBefore) {
+ Op<0>() = val;
+ Op<1>() = addr;
setVolatile(isVolatile);
setAlignment(Align);
AssertOK();
@@ -908,9 +961,12 @@
StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
unsigned Align, BasicBlock *InsertAtEnd)
- : Instruction(Type::VoidTy, Store, Ops, 2, InsertAtEnd) {
- Ops[0].init(val, this);
- Ops[1].init(addr, this);
+ : Instruction(Type::VoidTy, Store,
+ OperandTraits<StoreInst>::op_begin(this),
+ OperandTraits<StoreInst>::operands(this),
+ InsertAtEnd) {
+ Op<0>() = val;
+ Op<1>() = addr;
setVolatile(isVolatile);
setAlignment(Align);
AssertOK();
@@ -918,9 +974,12 @@
StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
BasicBlock *InsertAtEnd)
- : Instruction(Type::VoidTy, Store, Ops, 2, InsertAtEnd) {
- Ops[0].init(val, this);
- Ops[1].init(addr, this);
+ : Instruction(Type::VoidTy, Store,
+ OperandTraits<StoreInst>::op_begin(this),
+ OperandTraits<StoreInst>::operands(this),
+ InsertAtEnd) {
+ Op<0>() = val;
+ Op<1>() = addr;
setVolatile(isVolatile);
setAlignment(0);
AssertOK();
@@ -939,42 +998,56 @@
return cast<PointerType>(Val->getType())->getAddressSpace();
}
-void GetElementPtrInst::init(Value *Ptr, Value* const *Idx, unsigned NumIdx) {
- NumOperands = 1+NumIdx;
- Use *OL = OperandList = new Use[NumOperands];
- OL[0].init(Ptr, this);
+void GetElementPtrInst::init(Value *Ptr, Value* const *Idx, unsigned NumIdx,
+ const std::string &Name) {
+ assert(NumOperands == 1+NumIdx && "NumOperands not initialized?");
+ Use *OL = OperandList;
+ OL[0] = Ptr;
for (unsigned i = 0; i != NumIdx; ++i)
- OL[i+1].init(Idx[i], this);
+ OL[i+1] = Idx[i];
+
+ setName(Name);
}
-void GetElementPtrInst::init(Value *Ptr, Value *Idx) {
- NumOperands = 2;
- Use *OL = OperandList = new Use[2];
- OL[0].init(Ptr, this);
- OL[1].init(Idx, this);
+void GetElementPtrInst::init(Value *Ptr, Value *Idx, const std::string &Name) {
+ assert(NumOperands == 2 && "NumOperands not initialized?");
+ Use *OL = OperandList;
+ OL[0] = Ptr;
+ OL[1] = Idx;
+
+ setName(Name);
+}
+
+GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI)
+ : Instruction(GEPI.getType(), GetElementPtr,
+ OperandTraits<GetElementPtrInst>::op_end(this)
+ - GEPI.getNumOperands(),
+ GEPI.getNumOperands()) {
+ Use *OL = OperandList;
+ Use *GEPIOL = GEPI.OperandList;
+ for (unsigned i = 0, E = NumOperands; i != E; ++i)
+ OL[i] = GEPIOL[i];
}
GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx,
const std::string &Name, Instruction *InBe)
: Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(),Idx)),
retrieveAddrSpace(Ptr)),
- GetElementPtr, 0, 0, InBe) {
- init(Ptr, Idx);
- setName(Name);
+ GetElementPtr,
+ OperandTraits<GetElementPtrInst>::op_end(this) - 2,
+ 2, InBe) {
+ init(Ptr, Idx, Name);
}
GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx,
const std::string &Name, BasicBlock *IAE)
: Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(),Idx)),
retrieveAddrSpace(Ptr)),
- GetElementPtr, 0, 0, IAE) {
- init(Ptr, Idx);
- setName(Name);
-}
-
-GetElementPtrInst::~GetElementPtrInst() {
- delete[] OperandList;
+ GetElementPtr,
+ OperandTraits<GetElementPtrInst>::op_end(this) - 2,
+ 2, IAE) {
+ init(Ptr, Idx, Name);
}
// getIndexedType - Returns the type of the element that would be loaded with
@@ -985,41 +1058,31 @@
//
const Type* GetElementPtrInst::getIndexedType(const Type *Ptr,
Value* const *Idxs,
- unsigned NumIdx,
- bool AllowCompositeLeaf) {
- if (!isa<PointerType>(Ptr)) return 0; // Type isn't a pointer type!
+ unsigned NumIdx) {
+ const PointerType *PTy = dyn_cast<PointerType>(Ptr);
+ if (!PTy) return 0; // Type isn't a pointer type!
+ const Type *Agg = PTy->getElementType();
// Handle the special case of the empty set index set...
- if (NumIdx == 0) {
- if (AllowCompositeLeaf ||
- cast<PointerType>(Ptr)->getElementType()->isFirstClassType())
- return cast<PointerType>(Ptr)->getElementType();
- else
- return 0;
- }
-
- unsigned CurIdx = 0;
- while (const CompositeType *CT = dyn_cast<CompositeType>(Ptr)) {
- if (NumIdx == CurIdx) {
- if (AllowCompositeLeaf || CT->isFirstClassType()) return Ptr;
- return 0; // Can't load a whole structure or array!?!?
- }
+ if (NumIdx == 0)
+ return Agg;
- Value *Index = Idxs[CurIdx++];
- if (isa<PointerType>(CT) && CurIdx != 1)
- return 0; // Can only index into pointer types at the first index!
+ unsigned CurIdx = 1;
+ for (; CurIdx != NumIdx; ++CurIdx) {
+ const CompositeType *CT = dyn_cast<CompositeType>(Agg);
+ if (!CT || isa<PointerType>(CT)) return 0;
+ Value *Index = Idxs[CurIdx];
if (!CT->indexValid(Index)) return 0;
- Ptr = CT->getTypeAtIndex(Index);
+ Agg = CT->getTypeAtIndex(Index);
// If the new type forwards to another type, then it is in the middle
// of being refined to another type (and hence, may have dropped all
// references to what it was using before). So, use the new forwarded
// type.
- if (const Type * Ty = Ptr->getForwardedType()) {
- Ptr = Ty;
- }
+ if (const Type *Ty = Agg->getForwardedType())
+ Agg = Ty;
}
- return CurIdx == NumIdx ? Ptr : 0;
+ return CurIdx == NumIdx ? Agg : 0;
}
const Type* GetElementPtrInst::getIndexedType(const Type *Ptr, Value *Idx) {
@@ -1067,11 +1130,13 @@
const std::string &Name,
Instruction *InsertBef)
: Instruction(cast<VectorType>(Val->getType())->getElementType(),
- ExtractElement, Ops, 2, InsertBef) {
+ ExtractElement,
+ OperandTraits<ExtractElementInst>::op_begin(this),
+ 2, InsertBef) {
assert(isValidOperands(Val, Index) &&
"Invalid extractelement instruction operands!");
- Ops[0].init(Val, this);
- Ops[1].init(Index, this);
+ Op<0>() = Val;
+ Op<1>() = Index;
setName(Name);
}
@@ -1079,12 +1144,14 @@
const std::string &Name,
Instruction *InsertBef)
: Instruction(cast<VectorType>(Val->getType())->getElementType(),
- ExtractElement, Ops, 2, InsertBef) {
+ ExtractElement,
+ OperandTraits<ExtractElementInst>::op_begin(this),
+ 2, InsertBef) {
Constant *Index = ConstantInt::get(Type::Int32Ty, IndexV);
assert(isValidOperands(Val, Index) &&
"Invalid extractelement instruction operands!");
- Ops[0].init(Val, this);
- Ops[1].init(Index, this);
+ Op<0>() = Val;
+ Op<1>() = Index;
setName(Name);
}
@@ -1093,12 +1160,14 @@
const std::string &Name,
BasicBlock *InsertAE)
: Instruction(cast<VectorType>(Val->getType())->getElementType(),
- ExtractElement, Ops, 2, InsertAE) {
+ ExtractElement,
+ OperandTraits<ExtractElementInst>::op_begin(this),
+ 2, InsertAE) {
assert(isValidOperands(Val, Index) &&
"Invalid extractelement instruction operands!");
- Ops[0].init(Val, this);
- Ops[1].init(Index, this);
+ Op<0>() = Val;
+ Op<1>() = Index;
setName(Name);
}
@@ -1106,13 +1175,15 @@
const std::string &Name,
BasicBlock *InsertAE)
: Instruction(cast<VectorType>(Val->getType())->getElementType(),
- ExtractElement, Ops, 2, InsertAE) {
+ ExtractElement,
+ OperandTraits<ExtractElementInst>::op_begin(this),
+ 2, InsertAE) {
Constant *Index = ConstantInt::get(Type::Int32Ty, IndexV);
assert(isValidOperands(Val, Index) &&
"Invalid extractelement instruction operands!");
- Ops[0].init(Val, this);
- Ops[1].init(Index, this);
+ Op<0>() = Val;
+ Op<1>() = Index;
setName(Name);
}
@@ -1129,33 +1200,38 @@
//===----------------------------------------------------------------------===//
InsertElementInst::InsertElementInst(const InsertElementInst &IE)
- : Instruction(IE.getType(), InsertElement, Ops, 3) {
- Ops[0].init(IE.Ops[0], this);
- Ops[1].init(IE.Ops[1], this);
- Ops[2].init(IE.Ops[2], this);
+ : Instruction(IE.getType(), InsertElement,
+ OperandTraits<InsertElementInst>::op_begin(this), 3) {
+ Op<0>() = IE.Op<0>();
+ Op<1>() = IE.Op<1>();
+ Op<2>() = IE.Op<2>();
}
InsertElementInst::InsertElementInst(Value *Vec, Value *Elt, Value *Index,
const std::string &Name,
Instruction *InsertBef)
- : Instruction(Vec->getType(), InsertElement, Ops, 3, InsertBef) {
+ : Instruction(Vec->getType(), InsertElement,
+ OperandTraits<InsertElementInst>::op_begin(this),
+ 3, InsertBef) {
assert(isValidOperands(Vec, Elt, Index) &&
"Invalid insertelement instruction operands!");
- Ops[0].init(Vec, this);
- Ops[1].init(Elt, this);
- Ops[2].init(Index, this);
+ Op<0>() = Vec;
+ Op<1>() = Elt;
+ Op<2>() = Index;
setName(Name);
}
InsertElementInst::InsertElementInst(Value *Vec, Value *Elt, unsigned IndexV,
const std::string &Name,
Instruction *InsertBef)
- : Instruction(Vec->getType(), InsertElement, Ops, 3, InsertBef) {
+ : Instruction(Vec->getType(), InsertElement,
+ OperandTraits<InsertElementInst>::op_begin(this),
+ 3, InsertBef) {
Constant *Index = ConstantInt::get(Type::Int32Ty, IndexV);
assert(isValidOperands(Vec, Elt, Index) &&
"Invalid insertelement instruction operands!");
- Ops[0].init(Vec, this);
- Ops[1].init(Elt, this);
- Ops[2].init(Index, this);
+ Op<0>() = Vec;
+ Op<1>() = Elt;
+ Op<2>() = Index;
setName(Name);
}
@@ -1163,27 +1239,31 @@
InsertElementInst::InsertElementInst(Value *Vec, Value *Elt, Value *Index,
const std::string &Name,
BasicBlock *InsertAE)
- : Instruction(Vec->getType(), InsertElement, Ops, 3, InsertAE) {
+ : Instruction(Vec->getType(), InsertElement,
+ OperandTraits<InsertElementInst>::op_begin(this),
+ 3, InsertAE) {
assert(isValidOperands(Vec, Elt, Index) &&
"Invalid insertelement instruction operands!");
- Ops[0].init(Vec, this);
- Ops[1].init(Elt, this);
- Ops[2].init(Index, this);
+ Op<0>() = Vec;
+ Op<1>() = Elt;
+ Op<2>() = Index;
setName(Name);
}
InsertElementInst::InsertElementInst(Value *Vec, Value *Elt, unsigned IndexV,
const std::string &Name,
BasicBlock *InsertAE)
-: Instruction(Vec->getType(), InsertElement, Ops, 3, InsertAE) {
+: Instruction(Vec->getType(), InsertElement,
+ OperandTraits<InsertElementInst>::op_begin(this),
+ 3, InsertAE) {
Constant *Index = ConstantInt::get(Type::Int32Ty, IndexV);
assert(isValidOperands(Vec, Elt, Index) &&
"Invalid insertelement instruction operands!");
- Ops[0].init(Vec, this);
- Ops[1].init(Elt, this);
- Ops[2].init(Index, this);
+ Op<0>() = Vec;
+ Op<1>() = Elt;
+ Op<2>() = Index;
setName(Name);
}
@@ -1206,34 +1286,42 @@
//===----------------------------------------------------------------------===//
ShuffleVectorInst::ShuffleVectorInst(const ShuffleVectorInst &SV)
- : Instruction(SV.getType(), ShuffleVector, Ops, 3) {
- Ops[0].init(SV.Ops[0], this);
- Ops[1].init(SV.Ops[1], this);
- Ops[2].init(SV.Ops[2], this);
+ : Instruction(SV.getType(), ShuffleVector,
+ OperandTraits<ShuffleVectorInst>::op_begin(this),
+ OperandTraits<ShuffleVectorInst>::operands(this)) {
+ Op<0>() = SV.Op<0>();
+ Op<1>() = SV.Op<1>();
+ Op<2>() = SV.Op<2>();
}
ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
const std::string &Name,
Instruction *InsertBefore)
- : Instruction(V1->getType(), ShuffleVector, Ops, 3, InsertBefore) {
+ : Instruction(V1->getType(), ShuffleVector,
+ OperandTraits<ShuffleVectorInst>::op_begin(this),
+ OperandTraits<ShuffleVectorInst>::operands(this),
+ InsertBefore) {
assert(isValidOperands(V1, V2, Mask) &&
"Invalid shuffle vector instruction operands!");
- Ops[0].init(V1, this);
- Ops[1].init(V2, this);
- Ops[2].init(Mask, this);
+ Op<0>() = V1;
+ Op<1>() = V2;
+ Op<2>() = Mask;
setName(Name);
}
ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
const std::string &Name,
BasicBlock *InsertAtEnd)
- : Instruction(V1->getType(), ShuffleVector, Ops, 3, InsertAtEnd) {
+ : Instruction(V1->getType(), ShuffleVector,
+ OperandTraits<ShuffleVectorInst>::op_begin(this),
+ OperandTraits<ShuffleVectorInst>::operands(this),
+ InsertAtEnd) {
assert(isValidOperands(V1, V2, Mask) &&
"Invalid shuffle vector instruction operands!");
- Ops[0].init(V1, this);
- Ops[1].init(V2, this);
- Ops[2].init(Mask, this);
+ Op<0>() = V1;
+ Op<1>() = V2;
+ Op<2>() = Mask;
setName(Name);
}
@@ -1267,6 +1355,115 @@
return cast<ConstantInt>(MaskCV->getOperand(i))->getZExtValue();
}
+//===----------------------------------------------------------------------===//
+// InsertValueInst Class
+//===----------------------------------------------------------------------===//
+
+void InsertValueInst::init(Value *Agg, Value *Val, const unsigned *Idx,
+ unsigned NumIdx, const std::string &Name) {
+ assert(NumOperands == 2 && "NumOperands not initialized?");
+ Op<0>() = Agg;
+ Op<1>() = Val;
+
+ Indices.insert(Indices.end(), Idx, Idx + NumIdx);
+ setName(Name);
+}
+
+void InsertValueInst::init(Value *Agg, Value *Val, unsigned Idx,
+ const std::string &Name) {
+ assert(NumOperands == 2 && "NumOperands not initialized?");
+ Op<0>() = Agg;
+ Op<1>() = Val;
+
+ Indices.push_back(Idx);
+ setName(Name);
+}
+
+InsertValueInst::InsertValueInst(const InsertValueInst &IVI)
+ : Instruction(IVI.getType(), InsertValue,
+ OperandTraits<InsertValueInst>::op_begin(this), 2),
+ Indices(IVI.Indices) {
+ Op<0>() = IVI.getOperand(0);
+ Op<1>() = IVI.getOperand(1);
+}
+
+InsertValueInst::InsertValueInst(Value *Agg,
+ Value *Val,
+ unsigned Idx,
+ const std::string &Name,
+ Instruction *InsertBefore)
+ : Instruction(Agg->getType(), InsertValue,
+ OperandTraits<InsertValueInst>::op_begin(this),
+ 2, InsertBefore) {
+ init(Agg, Val, Idx, Name);
+}
+
+InsertValueInst::InsertValueInst(Value *Agg,
+ Value *Val,
+ unsigned Idx,
+ const std::string &Name,
+ BasicBlock *InsertAtEnd)
+ : Instruction(Agg->getType(), InsertValue,
+ OperandTraits<InsertValueInst>::op_begin(this),
+ 2, InsertAtEnd) {
+ init(Agg, Val, Idx, Name);
+}
+
+//===----------------------------------------------------------------------===//
+// ExtractValueInst Class
+//===----------------------------------------------------------------------===//
+
+void ExtractValueInst::init(const unsigned *Idx, unsigned NumIdx,
+ const std::string &Name) {
+ assert(NumOperands == 1 && "NumOperands not initialized?");
+
+ Indices.insert(Indices.end(), Idx, Idx + NumIdx);
+ setName(Name);
+}
+
+void ExtractValueInst::init(unsigned Idx, const std::string &Name) {
+ assert(NumOperands == 1 && "NumOperands not initialized?");
+
+ Indices.push_back(Idx);
+ setName(Name);
+}
+
+ExtractValueInst::ExtractValueInst(const ExtractValueInst &EVI)
+ : UnaryInstruction(EVI.getType(), ExtractValue, EVI.getOperand(0)),
+ Indices(EVI.Indices) {
+}
+
+// getIndexedType - Returns the type of the element that would be extracted
+// with an extractvalue instruction with the specified parameters.
+//
+// A null type is returned if the indices are invalid for the specified
+// pointer type.
+//
+const Type* ExtractValueInst::getIndexedType(const Type *Agg,
+ const unsigned *Idxs,
+ unsigned NumIdx) {
+ unsigned CurIdx = 0;
+ for (; CurIdx != NumIdx; ++CurIdx) {
+ const CompositeType *CT = dyn_cast<CompositeType>(Agg);
+ if (!CT || isa<PointerType>(CT) || isa<VectorType>(CT)) return 0;
+ unsigned Index = Idxs[CurIdx];
+ if (!CT->indexValid(Index)) return 0;
+ Agg = CT->getTypeAtIndex(Index);
+
+ // If the new type forwards to another type, then it is in the middle
+ // of being refined to another type (and hence, may have dropped all
+ // references to what it was using before). So, use the new forwarded
+ // type.
+ if (const Type *Ty = Agg->getForwardedType())
+ Agg = Ty;
+ }
+ return CurIdx == NumIdx ? Agg : 0;
+}
+
+const Type* ExtractValueInst::getIndexedType(const Type *Agg,
+ unsigned Idx) {
+ return getIndexedType(Agg, &Idx, 1);
+}
//===----------------------------------------------------------------------===//
// BinaryOperator Class
@@ -1275,9 +1472,12 @@
BinaryOperator::BinaryOperator(BinaryOps iType, Value *S1, Value *S2,
const Type *Ty, const std::string &Name,
Instruction *InsertBefore)
- : Instruction(Ty, iType, Ops, 2, InsertBefore) {
- Ops[0].init(S1, this);
- Ops[1].init(S2, this);
+ : Instruction(Ty, iType,
+ OperandTraits<BinaryOperator>::op_begin(this),
+ OperandTraits<BinaryOperator>::operands(this),
+ InsertBefore) {
+ Op<0>() = S1;
+ Op<1>() = S2;
init(iType);
setName(Name);
}
@@ -1285,9 +1485,12 @@
BinaryOperator::BinaryOperator(BinaryOps iType, Value *S1, Value *S2,
const Type *Ty, const std::string &Name,
BasicBlock *InsertAtEnd)
- : Instruction(Ty, iType, Ops, 2, InsertAtEnd) {
- Ops[0].init(S1, this);
- Ops[1].init(S2, this);
+ : Instruction(Ty, iType,
+ OperandTraits<BinaryOperator>::op_begin(this),
+ OperandTraits<BinaryOperator>::operands(this),
+ InsertAtEnd) {
+ Op<0>() = S1;
+ Op<1>() = S2;
init(iType);
setName(Name);
}
@@ -1361,7 +1564,7 @@
#endif
}
-BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2,
+BinaryOperator *BinaryOperator::Create(BinaryOps Op, Value *S1, Value *S2,
const std::string &Name,
Instruction *InsertBefore) {
assert(S1->getType() == S2->getType() &&
@@ -1369,15 +1572,15 @@
return new BinaryOperator(Op, S1, S2, S1->getType(), Name, InsertBefore);
}
-BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2,
+BinaryOperator *BinaryOperator::Create(BinaryOps Op, Value *S1, Value *S2,
const std::string &Name,
BasicBlock *InsertAtEnd) {
- BinaryOperator *Res = create(Op, S1, S2, Name);
+ BinaryOperator *Res = Create(Op, S1, S2, Name);
InsertAtEnd->getInstList().push_back(Res);
return Res;
}
-BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name,
+BinaryOperator *BinaryOperator::CreateNeg(Value *Op, const std::string &Name,
Instruction *InsertBefore) {
Value *zero = ConstantExpr::getZeroValueForNegationExpr(Op->getType());
return new BinaryOperator(Instruction::Sub,
@@ -1385,7 +1588,7 @@
Op->getType(), Name, InsertBefore);
}
-BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name,
+BinaryOperator *BinaryOperator::CreateNeg(Value *Op, const std::string &Name,
BasicBlock *InsertAtEnd) {
Value *zero = ConstantExpr::getZeroValueForNegationExpr(Op->getType());
return new BinaryOperator(Instruction::Sub,
@@ -1393,7 +1596,7 @@
Op->getType(), Name, InsertAtEnd);
}
-BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name,
+BinaryOperator *BinaryOperator::CreateNot(Value *Op, const std::string &Name,
Instruction *InsertBefore) {
Constant *C;
if (const VectorType *PTy = dyn_cast<VectorType>(Op->getType())) {
@@ -1407,7 +1610,7 @@
Op->getType(), Name, InsertBefore);
}
-BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name,
+BinaryOperator *BinaryOperator::CreateNot(Value *Op, const std::string &Name,
BasicBlock *InsertAtEnd) {
Constant *AllOnes;
if (const VectorType *PTy = dyn_cast<VectorType>(Op->getType())) {
@@ -1482,7 +1685,7 @@
bool BinaryOperator::swapOperands() {
if (!isCommutative())
return true; // Can't commute operands
- std::swap(Ops[0], Ops[1]);
+ Op<0>().swap(Op<1>());
return false;
}
@@ -1524,10 +1727,9 @@
/// changed in order to effect the cast. Essentially, it identifies cases where
/// no code gen is necessary for the cast, hence the name no-op cast. For
/// example, the following are all no-op casts:
-/// # bitcast uint %X, int
-/// # bitcast uint* %x, sbyte*
-/// # bitcast vector< 2 x int > %x, vector< 4 x short>
-/// # ptrtoint uint* %x, uint ; on 32-bit plaforms only
+/// # bitcast i32* %x to i8*
+/// # bitcast <2 x i32> %x to <4 x i16>
+/// # ptrtoint i32* %x to i32 ; on 32-bit plaforms only
/// @brief Determine if a cast is a no-op.
bool CastInst::isNoopCast(const Type *IntPtrTy) const {
switch (getOpcode()) {
@@ -1713,7 +1915,7 @@
return 0;
}
-CastInst *CastInst::create(Instruction::CastOps op, Value *S, const Type *Ty,
+CastInst *CastInst::Create(Instruction::CastOps op, Value *S, const Type *Ty,
const std::string &Name, Instruction *InsertBefore) {
// Construct and return the appropriate CastInst subclass
switch (op) {
@@ -1735,7 +1937,7 @@
return 0;
}
-CastInst *CastInst::create(Instruction::CastOps op, Value *S, const Type *Ty,
+CastInst *CastInst::Create(Instruction::CastOps op, Value *S, const Type *Ty,
const std::string &Name, BasicBlock *InsertAtEnd) {
// Construct and return the appropriate CastInst subclass
switch (op) {
@@ -1757,55 +1959,55 @@
return 0;
}
-CastInst *CastInst::createZExtOrBitCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreateZExtOrBitCast(Value *S, const Type *Ty,
const std::string &Name,
Instruction *InsertBefore) {
if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertBefore);
- return create(Instruction::ZExt, S, Ty, Name, InsertBefore);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
+ return Create(Instruction::ZExt, S, Ty, Name, InsertBefore);
}
-CastInst *CastInst::createZExtOrBitCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreateZExtOrBitCast(Value *S, const Type *Ty,
const std::string &Name,
BasicBlock *InsertAtEnd) {
if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
- return create(Instruction::ZExt, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::ZExt, S, Ty, Name, InsertAtEnd);
}
-CastInst *CastInst::createSExtOrBitCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreateSExtOrBitCast(Value *S, const Type *Ty,
const std::string &Name,
Instruction *InsertBefore) {
if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertBefore);
- return create(Instruction::SExt, S, Ty, Name, InsertBefore);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
+ return Create(Instruction::SExt, S, Ty, Name, InsertBefore);
}
-CastInst *CastInst::createSExtOrBitCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreateSExtOrBitCast(Value *S, const Type *Ty,
const std::string &Name,
BasicBlock *InsertAtEnd) {
if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
- return create(Instruction::SExt, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::SExt, S, Ty, Name, InsertAtEnd);
}
-CastInst *CastInst::createTruncOrBitCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreateTruncOrBitCast(Value *S, const Type *Ty,
const std::string &Name,
Instruction *InsertBefore) {
if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertBefore);
- return create(Instruction::Trunc, S, Ty, Name, InsertBefore);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
+ return Create(Instruction::Trunc, S, Ty, Name, InsertBefore);
}
-CastInst *CastInst::createTruncOrBitCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreateTruncOrBitCast(Value *S, const Type *Ty,
const std::string &Name,
BasicBlock *InsertAtEnd) {
if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
- return create(Instruction::Trunc, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::Trunc, S, Ty, Name, InsertAtEnd);
}
-CastInst *CastInst::createPointerCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreatePointerCast(Value *S, const Type *Ty,
const std::string &Name,
BasicBlock *InsertAtEnd) {
assert(isa<PointerType>(S->getType()) && "Invalid cast");
@@ -1813,12 +2015,12 @@
"Invalid cast");
if (Ty->isInteger())
- return create(Instruction::PtrToInt, S, Ty, Name, InsertAtEnd);
- return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::PtrToInt, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
}
/// @brief Create a BitCast or a PtrToInt cast instruction
-CastInst *CastInst::createPointerCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreatePointerCast(Value *S, const Type *Ty,
const std::string &Name,
Instruction *InsertBefore) {
assert(isa<PointerType>(S->getType()) && "Invalid cast");
@@ -1826,11 +2028,11 @@
"Invalid cast");
if (Ty->isInteger())
- return create(Instruction::PtrToInt, S, Ty, Name, InsertBefore);
- return create(Instruction::BitCast, S, Ty, Name, InsertBefore);
+ return Create(Instruction::PtrToInt, S, Ty, Name, InsertBefore);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
}
-CastInst *CastInst::createIntegerCast(Value *C, const Type *Ty,
+CastInst *CastInst::CreateIntegerCast(Value *C, const Type *Ty,
bool isSigned, const std::string &Name,
Instruction *InsertBefore) {
assert(C->getType()->isInteger() && Ty->isInteger() && "Invalid cast");
@@ -1840,10 +2042,10 @@
(SrcBits == DstBits ? Instruction::BitCast :
(SrcBits > DstBits ? Instruction::Trunc :
(isSigned ? Instruction::SExt : Instruction::ZExt)));
- return create(opcode, C, Ty, Name, InsertBefore);
+ return Create(opcode, C, Ty, Name, InsertBefore);
}
-CastInst *CastInst::createIntegerCast(Value *C, const Type *Ty,
+CastInst *CastInst::CreateIntegerCast(Value *C, const Type *Ty,
bool isSigned, const std::string &Name,
BasicBlock *InsertAtEnd) {
assert(C->getType()->isInteger() && Ty->isInteger() && "Invalid cast");
@@ -1853,10 +2055,10 @@
(SrcBits == DstBits ? Instruction::BitCast :
(SrcBits > DstBits ? Instruction::Trunc :
(isSigned ? Instruction::SExt : Instruction::ZExt)));
- return create(opcode, C, Ty, Name, InsertAtEnd);
+ return Create(opcode, C, Ty, Name, InsertAtEnd);
}
-CastInst *CastInst::createFPCast(Value *C, const Type *Ty,
+CastInst *CastInst::CreateFPCast(Value *C, const Type *Ty,
const std::string &Name,
Instruction *InsertBefore) {
assert(C->getType()->isFloatingPoint() && Ty->isFloatingPoint() &&
@@ -1866,10 +2068,10 @@
Instruction::CastOps opcode =
(SrcBits == DstBits ? Instruction::BitCast :
(SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt));
- return create(opcode, C, Ty, Name, InsertBefore);
+ return Create(opcode, C, Ty, Name, InsertBefore);
}
-CastInst *CastInst::createFPCast(Value *C, const Type *Ty,
+CastInst *CastInst::CreateFPCast(Value *C, const Type *Ty,
const std::string &Name,
BasicBlock *InsertAtEnd) {
assert(C->getType()->isFloatingPoint() && Ty->isFloatingPoint() &&
@@ -1879,7 +2081,7 @@
Instruction::CastOps opcode =
(SrcBits == DstBits ? Instruction::BitCast :
(SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt));
- return create(opcode, C, Ty, Name, InsertAtEnd);
+ return Create(opcode, C, Ty, Name, InsertAtEnd);
}
// Check whether it is valid to call getCastOpcode for these types.
@@ -1896,45 +2098,45 @@
unsigned DestBits = DestTy->getPrimitiveSizeInBits(); // 0 for ptr/vector
// Run through the possibilities ...
- if (DestTy->isInteger()) { // Casting to integral
- if (SrcTy->isInteger()) { // Casting from integral
+ if (DestTy->isInteger()) { // Casting to integral
+ if (SrcTy->isInteger()) { // Casting from integral
return true;
- } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
+ } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
return true;
} else if (const VectorType *PTy = dyn_cast<VectorType>(SrcTy)) {
- // Casting from vector
+ // Casting from vector
return DestBits == PTy->getBitWidth();
- } else { // Casting from something else
+ } else { // Casting from something else
return isa<PointerType>(SrcTy);
}
- } else if (DestTy->isFloatingPoint()) { // Casting to floating pt
- if (SrcTy->isInteger()) { // Casting from integral
+ } else if (DestTy->isFloatingPoint()) { // Casting to floating pt
+ if (SrcTy->isInteger()) { // Casting from integral
return true;
- } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
+ } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt
return true;
} else if (const VectorType *PTy = dyn_cast<VectorType>(SrcTy)) {
- // Casting from vector
+ // Casting from vector
return DestBits == PTy->getBitWidth();
- } else { // Casting from something else
+ } else { // Casting from something else
return false;
}
} else if (const VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) {
- // Casting to vector
+ // Casting to vector
if (const VectorType *SrcPTy = dyn_cast<VectorType>(SrcTy)) {
- // Casting from vector
+ // Casting from vector
return DestPTy->getBitWidth() == SrcPTy->getBitWidth();
- } else { // Casting from something else
+ } else { // Casting from something else
return DestPTy->getBitWidth() == SrcBits;
}
- } else if (isa<PointerType>(DestTy)) { // Casting to pointer
- if (isa<PointerType>(SrcTy)) { // Casting from pointer
+ } else if (isa<PointerType>(DestTy)) { // Casting to pointer
+ if (isa<PointerType>(SrcTy)) { // Casting from pointer
return true;
- } else if (SrcTy->isInteger()) { // Casting from integral
+ } else if (SrcTy->isInteger()) { // Casting from integral
return true;
- } else { // Casting from something else
+ } else { // Casting from something else
return false;
}
- } else { // Casting to something else
+ } else { // Casting to something else
return false;
}
}
@@ -2252,91 +2454,68 @@
// CmpInst Classes
//===----------------------------------------------------------------------===//
-CmpInst::CmpInst(OtherOps op, unsigned short predicate, Value *LHS, Value *RHS,
- const std::string &Name, Instruction *InsertBefore)
- : Instruction(Type::Int1Ty, op, Ops, 2, InsertBefore) {
- Ops[0].init(LHS, this);
- Ops[1].init(RHS, this);
+CmpInst::CmpInst(const Type *ty, OtherOps op, unsigned short predicate,
+ Value *LHS, Value *RHS, const std::string &Name,
+ Instruction *InsertBefore)
+ : Instruction(ty, op,
+ OperandTraits<CmpInst>::op_begin(this),
+ OperandTraits<CmpInst>::operands(this),
+ InsertBefore) {
+ Op<0>() = LHS;
+ Op<1>() = RHS;
SubclassData = predicate;
setName(Name);
- if (op == Instruction::ICmp) {
- assert(predicate >= ICmpInst::FIRST_ICMP_PREDICATE &&
- predicate <= ICmpInst::LAST_ICMP_PREDICATE &&
- "Invalid ICmp predicate value");
- const Type* Op0Ty = getOperand(0)->getType();
- const Type* Op1Ty = getOperand(1)->getType();
- assert(Op0Ty == Op1Ty &&
- "Both operands to ICmp instruction are not of the same type!");
- // Check that the operands are the right type
- assert((Op0Ty->isInteger() || isa<PointerType>(Op0Ty)) &&
- "Invalid operand types for ICmp instruction");
- return;
- }
- assert(op == Instruction::FCmp && "Invalid CmpInst opcode");
- assert(predicate <= FCmpInst::LAST_FCMP_PREDICATE &&
- "Invalid FCmp predicate value");
- const Type* Op0Ty = getOperand(0)->getType();
- const Type* Op1Ty = getOperand(1)->getType();
- assert(Op0Ty == Op1Ty &&
- "Both operands to FCmp instruction are not of the same type!");
- // Check that the operands are the right type
- assert(Op0Ty->isFloatingPoint() &&
- "Invalid operand types for FCmp instruction");
}
-
-CmpInst::CmpInst(OtherOps op, unsigned short predicate, Value *LHS, Value *RHS,
- const std::string &Name, BasicBlock *InsertAtEnd)
- : Instruction(Type::Int1Ty, op, Ops, 2, InsertAtEnd) {
- Ops[0].init(LHS, this);
- Ops[1].init(RHS, this);
+
+CmpInst::CmpInst(const Type *ty, OtherOps op, unsigned short predicate,
+ Value *LHS, Value *RHS, const std::string &Name,
+ BasicBlock *InsertAtEnd)
+ : Instruction(ty, op,
+ OperandTraits<CmpInst>::op_begin(this),
+ OperandTraits<CmpInst>::operands(this),
+ InsertAtEnd) {
+ Op<0>() = LHS;
+ Op<1>() = RHS;
SubclassData = predicate;
setName(Name);
- if (op == Instruction::ICmp) {
- assert(predicate >= ICmpInst::FIRST_ICMP_PREDICATE &&
- predicate <= ICmpInst::LAST_ICMP_PREDICATE &&
- "Invalid ICmp predicate value");
-
- const Type* Op0Ty = getOperand(0)->getType();
- const Type* Op1Ty = getOperand(1)->getType();
- assert(Op0Ty == Op1Ty &&
- "Both operands to ICmp instruction are not of the same type!");
- // Check that the operands are the right type
- assert((Op0Ty->isInteger() || isa<PointerType>(Op0Ty)) &&
- "Invalid operand types for ICmp instruction");
- return;
- }
- assert(op == Instruction::FCmp && "Invalid CmpInst opcode");
- assert(predicate <= FCmpInst::LAST_FCMP_PREDICATE &&
- "Invalid FCmp predicate value");
- const Type* Op0Ty = getOperand(0)->getType();
- const Type* Op1Ty = getOperand(1)->getType();
- assert(Op0Ty == Op1Ty &&
- "Both operands to FCmp instruction are not of the same type!");
- // Check that the operands are the right type
- assert(Op0Ty->isFloatingPoint() &&
- "Invalid operand types for FCmp instruction");
}
CmpInst *
-CmpInst::create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2,
+CmpInst::Create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2,
const std::string &Name, Instruction *InsertBefore) {
if (Op == Instruction::ICmp) {
- return new ICmpInst(ICmpInst::Predicate(predicate), S1, S2, Name,
+ return new ICmpInst(CmpInst::Predicate(predicate), S1, S2, Name,
+ InsertBefore);
+ }
+ if (Op == Instruction::FCmp) {
+ return new FCmpInst(CmpInst::Predicate(predicate), S1, S2, Name,
InsertBefore);
}
- return new FCmpInst(FCmpInst::Predicate(predicate), S1, S2, Name,
- InsertBefore);
+ if (Op == Instruction::VICmp) {
+ return new VICmpInst(CmpInst::Predicate(predicate), S1, S2, Name,
+ InsertBefore);
+ }
+ return new VFCmpInst(CmpInst::Predicate(predicate), S1, S2, Name,
+ InsertBefore);
}
CmpInst *
-CmpInst::create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2,
+CmpInst::Create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2,
const std::string &Name, BasicBlock *InsertAtEnd) {
if (Op == Instruction::ICmp) {
- return new ICmpInst(ICmpInst::Predicate(predicate), S1, S2, Name,
+ return new ICmpInst(CmpInst::Predicate(predicate), S1, S2, Name,
+ InsertAtEnd);
+ }
+ if (Op == Instruction::FCmp) {
+ return new FCmpInst(CmpInst::Predicate(predicate), S1, S2, Name,
InsertAtEnd);
}
- return new FCmpInst(FCmpInst::Predicate(predicate), S1, S2, Name,
- InsertAtEnd);
+ if (Op == Instruction::VICmp) {
+ return new VICmpInst(CmpInst::Predicate(predicate), S1, S2, Name,
+ InsertAtEnd);
+ }
+ return new VFCmpInst(CmpInst::Predicate(predicate), S1, S2, Name,
+ InsertAtEnd);
}
void CmpInst::swapOperands() {
@@ -2359,10 +2538,9 @@
}
-ICmpInst::Predicate ICmpInst::getInversePredicate(Predicate pred) {
+CmpInst::Predicate CmpInst::getInversePredicate(Predicate pred) {
switch (pred) {
- default:
- assert(!"Unknown icmp predicate!");
+ default: assert(!"Unknown cmp predicate!");
case ICMP_EQ: return ICMP_NE;
case ICMP_NE: return ICMP_EQ;
case ICMP_UGT: return ICMP_ULE;
@@ -2373,22 +2551,23 @@
case ICMP_SLT: return ICMP_SGE;
case ICMP_SGE: return ICMP_SLT;
case ICMP_SLE: return ICMP_SGT;
- }
-}
-ICmpInst::Predicate ICmpInst::getSwappedPredicate(Predicate pred) {
- switch (pred) {
- default: assert(! "Unknown icmp predicate!");
- case ICMP_EQ: case ICMP_NE:
- return pred;
- case ICMP_SGT: return ICMP_SLT;
- case ICMP_SLT: return ICMP_SGT;
- case ICMP_SGE: return ICMP_SLE;
- case ICMP_SLE: return ICMP_SGE;
- case ICMP_UGT: return ICMP_ULT;
- case ICMP_ULT: return ICMP_UGT;
- case ICMP_UGE: return ICMP_ULE;
- case ICMP_ULE: return ICMP_UGE;
+ case FCMP_OEQ: return FCMP_UNE;
+ case FCMP_ONE: return FCMP_UEQ;
+ case FCMP_OGT: return FCMP_ULE;
+ case FCMP_OLT: return FCMP_UGE;
+ case FCMP_OGE: return FCMP_ULT;
+ case FCMP_OLE: return FCMP_UGT;
+ case FCMP_UEQ: return FCMP_ONE;
+ case FCMP_UNE: return FCMP_OEQ;
+ case FCMP_UGT: return FCMP_OLE;
+ case FCMP_ULT: return FCMP_OGE;
+ case FCMP_UGE: return FCMP_OLT;
+ case FCMP_ULE: return FCMP_OGT;
+ case FCMP_ORD: return FCMP_UNO;
+ case FCMP_UNO: return FCMP_ORD;
+ case FCMP_TRUE: return FCMP_FALSE;
+ case FCMP_FALSE: return FCMP_TRUE;
}
}
@@ -2464,32 +2643,20 @@
return ConstantRange(Lower, Upper);
}
-FCmpInst::Predicate FCmpInst::getInversePredicate(Predicate pred) {
- switch (pred) {
- default:
- assert(!"Unknown icmp predicate!");
- case FCMP_OEQ: return FCMP_UNE;
- case FCMP_ONE: return FCMP_UEQ;
- case FCMP_OGT: return FCMP_ULE;
- case FCMP_OLT: return FCMP_UGE;
- case FCMP_OGE: return FCMP_ULT;
- case FCMP_OLE: return FCMP_UGT;
- case FCMP_UEQ: return FCMP_ONE;
- case FCMP_UNE: return FCMP_OEQ;
- case FCMP_UGT: return FCMP_OLE;
- case FCMP_ULT: return FCMP_OGE;
- case FCMP_UGE: return FCMP_OLT;
- case FCMP_ULE: return FCMP_OGT;
- case FCMP_ORD: return FCMP_UNO;
- case FCMP_UNO: return FCMP_ORD;
- case FCMP_TRUE: return FCMP_FALSE;
- case FCMP_FALSE: return FCMP_TRUE;
- }
-}
-
-FCmpInst::Predicate FCmpInst::getSwappedPredicate(Predicate pred) {
+CmpInst::Predicate CmpInst::getSwappedPredicate(Predicate pred) {
switch (pred) {
- default: assert(!"Unknown fcmp predicate!");
+ default: assert(!"Unknown cmp predicate!");
+ case ICMP_EQ: case ICMP_NE:
+ return pred;
+ case ICMP_SGT: return ICMP_SLT;
+ case ICMP_SLT: return ICMP_SGT;
+ case ICMP_SGE: return ICMP_SLE;
+ case ICMP_SLE: return ICMP_SGE;
+ case ICMP_UGT: return ICMP_ULT;
+ case ICMP_ULT: return ICMP_UGT;
+ case ICMP_UGE: return ICMP_ULE;
+ case ICMP_ULE: return ICMP_UGE;
+
case FCMP_FALSE: case FCMP_TRUE:
case FCMP_OEQ: case FCMP_ONE:
case FCMP_UEQ: case FCMP_UNE:
@@ -2548,10 +2715,10 @@
assert(Value && Default);
ReservedSpace = 2+NumCases*2;
NumOperands = 2;
- OperandList = new Use[ReservedSpace];
+ OperandList = allocHungoffUses(ReservedSpace);
- OperandList[0].init(Value, this);
- OperandList[1].init(Default, this);
+ OperandList[0] = Value;
+ OperandList[1] = Default;
}
/// SwitchInst ctor - Create a new switch instruction, specifying a value to
@@ -2576,16 +2743,16 @@
SwitchInst::SwitchInst(const SwitchInst &SI)
: TerminatorInst(Type::VoidTy, Instruction::Switch,
- new Use[SI.getNumOperands()], SI.getNumOperands()) {
+ allocHungoffUses(SI.getNumOperands()), SI.getNumOperands()) {
Use *OL = OperandList, *InOL = SI.OperandList;
for (unsigned i = 0, E = SI.getNumOperands(); i != E; i+=2) {
- OL[i].init(InOL[i], this);
- OL[i+1].init(InOL[i+1], this);
+ OL[i] = InOL[i];
+ OL[i+1] = InOL[i+1];
}
}
SwitchInst::~SwitchInst() {
- delete [] OperandList;
+ dropHungoffUses(OperandList);
}
@@ -2598,8 +2765,8 @@
// Initialize some new operands.
assert(OpNo+1 < ReservedSpace && "Growing didn't work!");
NumOperands = OpNo+2;
- OperandList[OpNo].init(OnVal, this);
- OperandList[OpNo+1].init(Dest, this);
+ OperandList[OpNo] = OnVal;
+ OperandList[OpNo+1] = Dest;
}
/// removeCase - This method removes the specified successor from the switch
@@ -2632,13 +2799,14 @@
/// resizeOperands - resize operands - This adjusts the length of the operands
/// list according to the following behavior:
/// 1. If NumOps == 0, grow the operand list in response to a push_back style
-/// of operation. This grows the number of ops by 1.5 times.
+/// of operation. This grows the number of ops by 3 times.
/// 2. If NumOps > NumOperands, reserve space for NumOps operands.
/// 3. If NumOps == NumOperands, trim the reserved space.
///
void SwitchInst::resizeOperands(unsigned NumOps) {
+ unsigned e = getNumOperands();
if (NumOps == 0) {
- NumOps = getNumOperands()/2*6;
+ NumOps = e*3;
} else if (NumOps*2 > NumOperands) {
// No resize needed.
if (ReservedSpace >= NumOps) return;
@@ -2649,14 +2817,13 @@
}
ReservedSpace = NumOps;
- Use *NewOps = new Use[NumOps];
+ Use *NewOps = allocHungoffUses(NumOps);
Use *OldOps = OperandList;
- for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
- NewOps[i].init(OldOps[i], this);
- OldOps[i].set(0);
+ for (unsigned i = 0; i != e; ++i) {
+ NewOps[i] = OldOps[i];
}
- delete [] OldOps;
OperandList = NewOps;
+ if (OldOps) Use::zap(OldOps, OldOps + e, true);
}
@@ -2677,11 +2844,12 @@
GetResultInst::GetResultInst(Value *Aggregate, unsigned Index,
const std::string &Name,
Instruction *InsertBef)
- : Instruction(cast<StructType>(Aggregate->getType())->getElementType(Index),
- GetResult, &Aggr, 1, InsertBef) {
- assert(isValidOperands(Aggregate, Index) && "Invalid GetResultInst operands!");
- Aggr.init(Aggregate, this);
- Idx = Index;
+ : UnaryInstruction(cast<StructType>(Aggregate->getType())
+ ->getElementType(Index),
+ GetResult, Aggregate, InsertBef),
+ Idx(Index) {
+ assert(isValidOperands(Aggregate, Index)
+ && "Invalid GetResultInst operands!");
setName(Name);
}
@@ -2691,7 +2859,7 @@
if (const StructType *STy = dyn_cast<StructType>(Aggregate->getType())) {
unsigned NumElements = STy->getNumElements();
- if (Index >= NumElements)
+ if (Index >= NumElements || NumElements == 0)
return false;
// getresult aggregate value's element types are restricted to
@@ -2714,16 +2882,31 @@
}
BinaryOperator *BinaryOperator::clone() const {
- return create(getOpcode(), Ops[0], Ops[1]);
+ return Create(getOpcode(), Op<0>(), Op<1>());
}
FCmpInst* FCmpInst::clone() const {
- return new FCmpInst(getPredicate(), Ops[0], Ops[1]);
+ return new FCmpInst(getPredicate(), Op<0>(), Op<1>());
}
ICmpInst* ICmpInst::clone() const {
- return new ICmpInst(getPredicate(), Ops[0], Ops[1]);
+ return new ICmpInst(getPredicate(), Op<0>(), Op<1>());
}
+VFCmpInst* VFCmpInst::clone() const {
+ return new VFCmpInst(getPredicate(), Op<0>(), Op<1>());
+}
+VICmpInst* VICmpInst::clone() const {
+ return new VICmpInst(getPredicate(), Op<0>(), Op<1>());
+}
+
+ExtractValueInst *ExtractValueInst::clone() const {
+ return new ExtractValueInst(*this);
+}
+InsertValueInst *InsertValueInst::clone() const {
+ return new InsertValueInst(*this);
+}
+
+
MallocInst *MallocInst::clone() const { return new MallocInst(*this); }
AllocaInst *AllocaInst::clone() const { return new AllocaInst(*this); }
FreeInst *FreeInst::clone() const { return new FreeInst(getOperand(0)); }
@@ -2741,8 +2924,12 @@
CastInst *PtrToIntInst::clone() const { return new PtrToIntInst(*this); }
CastInst *IntToPtrInst::clone() const { return new IntToPtrInst(*this); }
CastInst *BitCastInst::clone() const { return new BitCastInst(*this); }
-CallInst *CallInst::clone() const { return new(getNumOperands()) CallInst(*this); }
-SelectInst *SelectInst::clone() const { return new(getNumOperands()) SelectInst(*this); }
+CallInst *CallInst::clone() const {
+ return new(getNumOperands()) CallInst(*this);
+}
+SelectInst *SelectInst::clone() const {
+ return new(getNumOperands()) SelectInst(*this);
+}
VAArgInst *VAArgInst::clone() const { return new VAArgInst(*this); }
ExtractElementInst *ExtractElementInst::clone() const {
@@ -2755,10 +2942,16 @@
return new ShuffleVectorInst(*this);
}
PHINode *PHINode::clone() const { return new PHINode(*this); }
-ReturnInst *ReturnInst::clone() const { return new(getNumOperands()) ReturnInst(*this); }
-BranchInst *BranchInst::clone() const { return new(getNumOperands()) BranchInst(*this); }
-SwitchInst *SwitchInst::clone() const { return new(getNumOperands()) SwitchInst(*this); }
-InvokeInst *InvokeInst::clone() const { return new(getNumOperands()) InvokeInst(*this); }
+ReturnInst *ReturnInst::clone() const {
+ return new(getNumOperands()) ReturnInst(*this);
+}
+BranchInst *BranchInst::clone() const {
+ return new(getNumOperands()) BranchInst(*this);
+}
+SwitchInst *SwitchInst::clone() const { return new SwitchInst(*this); }
+InvokeInst *InvokeInst::clone() const {
+ return new(getNumOperands()) InvokeInst(*this);
+}
UnwindInst *UnwindInst::clone() const { return new UnwindInst(); }
UnreachableInst *UnreachableInst::clone() const { return new UnreachableInst();}
GetResultInst *GetResultInst::clone() const { return new GetResultInst(*this); }
Modified: llvm/branches/non-call-eh/lib/VMCore/IntrinsicInst.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/IntrinsicInst.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/IntrinsicInst.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/IntrinsicInst.cpp Sun Jul 6 15:45:41 2008
@@ -28,6 +28,7 @@
#include "llvm/IntrinsicInst.h"
#include "llvm/Constants.h"
#include "llvm/GlobalVariable.h"
+#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
using namespace llvm;
@@ -57,24 +58,20 @@
/// DbgStopPointInst - This represents the llvm.dbg.stoppoint instruction.
///
-std::string DbgStopPointInst::getFileName() const {
+Value *DbgStopPointInst::getFileName() const {
// Once the operand indices are verified, update this assert
assert(LLVMDebugVersion == (6 << 16) && "Verify operand indices");
GlobalVariable *GV = cast<GlobalVariable>(getContext());
- if (!GV->hasInitializer()) return "";
+ if (!GV->hasInitializer()) return NULL;
ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer());
- return CS->getOperand(3)->getStringValue();
+ return CS->getOperand(4);
}
-std::string DbgStopPointInst::getDirectory() const {
+Value *DbgStopPointInst::getDirectory() const {
// Once the operand indices are verified, update this assert
assert(LLVMDebugVersion == (6 << 16) && "Verify operand indices");
GlobalVariable *GV = cast<GlobalVariable>(getContext());
- if (!GV->hasInitializer()) return "";
+ if (!GV->hasInitializer()) return NULL;
ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer());
- return CS->getOperand(4)->getStringValue();
+ return CS->getOperand(4);
}
-
-//===----------------------------------------------------------------------===//
-/// Ensure that users of IntrinsicInst.h will link with this module.
-DEFINING_FILE_FOR(IntrinsicInst)
Modified: llvm/branches/non-call-eh/lib/VMCore/Mangler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/Mangler.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/Mangler.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/Mangler.cpp Sun Jul 6 15:45:41 2008
@@ -166,7 +166,8 @@
} else {
// If GV is external but the existing one is static, mangle the existing one
if ((GV->hasExternalLinkage() || GV->hasDLLImportLinkage()) &&
- !(ExistingValue->hasExternalLinkage() || ExistingValue->hasDLLImportLinkage())) {
+ !(ExistingValue->hasExternalLinkage()
+ || ExistingValue->hasDLLImportLinkage())) {
MangledGlobals.insert(ExistingValue);
ExistingValue = GV;
} else if ((GV->hasExternalLinkage() ||
@@ -208,9 +209,8 @@
std::map<std::string, GlobalValue*> Names;
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
InsertName(I, Names);
- for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
+ for (Module::global_iterator I = M.global_begin(), E = M.global_end();
+ I != E;
+ ++I)
InsertName(I, Names);
}
-
-// Cause this file to be linked in when Support/Mangler.h is #included
-DEFINING_FILE_FOR(Mangler)
Modified: llvm/branches/non-call-eh/lib/VMCore/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/Module.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/Module.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/Module.cpp Sun Jul 6 15:45:41 2008
@@ -156,10 +156,12 @@
// Okay, the function exists. Does it have externally visible linkage?
if (F->hasInternalLinkage()) {
- // Rename the function.
- F->setName(SymTab.getUniqueName(F->getName()));
+ // Clear the function's name.
+ F->setName("");
// Retry, now there won't be a conflict.
- return getOrInsertFunction(Name, Ty);
+ Constant *NewF = getOrInsertFunction(Name, Ty);
+ F->setName(&Name[0], Name.size());
+ return NewF;
}
// If the function exists but has the wrong type, return a bitcast to the
@@ -201,6 +203,11 @@
return dyn_cast_or_null<Function>(SymTab.lookup(Name));
}
+Function *Module::getFunction(const char *Name) const {
+ const ValueSymbolTable &SymTab = getValueSymbolTable();
+ return dyn_cast_or_null<Function>(SymTab.lookup(Name, Name+strlen(Name)));
+}
+
//===----------------------------------------------------------------------===//
// Methods for easy access to the global variables in the module.
//
Modified: llvm/branches/non-call-eh/lib/VMCore/Pass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/Pass.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/Pass.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/Pass.cpp Sun Jul 6 15:45:41 2008
@@ -13,6 +13,7 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/Pass.h"
#include "llvm/PassManager.h"
#include "llvm/Module.h"
#include "llvm/ModuleProvider.h"
@@ -122,7 +123,8 @@
class PassRegistrar {
/// PassInfoMap - Keep track of the passinfo object for each registered llvm
/// pass.
- std::map<intptr_t, PassInfo*> PassInfoMap;
+ typedef std::map<intptr_t, const PassInfo*> MapType;
+ MapType PassInfoMap;
/// AnalysisGroupInfo - Keep track of information for each analysis group.
struct AnalysisGroupInfo {
@@ -137,19 +139,18 @@
public:
const PassInfo *GetPassInfo(intptr_t TI) const {
- std::map<intptr_t, PassInfo*>::const_iterator I = PassInfoMap.find(TI);
+ MapType::const_iterator I = PassInfoMap.find(TI);
return I != PassInfoMap.end() ? I->second : 0;
}
- void RegisterPass(PassInfo &PI) {
+ void RegisterPass(const PassInfo &PI) {
bool Inserted =
PassInfoMap.insert(std::make_pair(PI.getTypeInfo(),&PI)).second;
- assert(Inserted && "Pass registered multiple times!");
+ assert(Inserted && "Pass registered multiple times!"); Inserted=Inserted;
}
- void UnregisterPass(PassInfo &PI) {
- std::map<intptr_t, PassInfo*>::iterator I =
- PassInfoMap.find(PI.getTypeInfo());
+ void UnregisterPass(const PassInfo &PI) {
+ MapType::iterator I = PassInfoMap.find(PI.getTypeInfo());
assert(I != PassInfoMap.end() && "Pass registered but not in map!");
// Remove pass from the map.
@@ -157,7 +158,7 @@
}
void EnumerateWith(PassRegistrationListener *L) {
- for (std::map<intptr_t, PassInfo*>::const_iterator I = PassInfoMap.begin(),
+ for (MapType::const_iterator I = PassInfoMap.begin(),
E = PassInfoMap.end(); I != E; ++I)
L->passEnumerate(I->second);
}
@@ -206,18 +207,18 @@
return getPassRegistrar()->GetPassInfo(TI);
}
-void RegisterPassBase::registerPass() {
- getPassRegistrar()->RegisterPass(PIObj);
+void PassInfo::registerPass() {
+ getPassRegistrar()->RegisterPass(*this);
// Notify any listeners.
if (Listeners)
for (std::vector<PassRegistrationListener*>::iterator
I = Listeners->begin(), E = Listeners->end(); I != E; ++I)
- (*I)->passRegistered(&PIObj);
+ (*I)->passRegistered(this);
}
-void RegisterPassBase::unregisterPass() {
- getPassRegistrar()->UnregisterPass(PIObj);
+void PassInfo::unregisterPass() {
+ getPassRegistrar()->UnregisterPass(*this);
}
//===----------------------------------------------------------------------===//
@@ -226,18 +227,18 @@
// RegisterAGBase implementation
//
-RegisterAGBase::RegisterAGBase(intptr_t InterfaceID,
+RegisterAGBase::RegisterAGBase(const char *Name, intptr_t InterfaceID,
intptr_t PassID, bool isDefault)
- : RegisterPassBase(InterfaceID),
+ : PassInfo(Name, InterfaceID),
ImplementationInfo(0), isDefaultImplementation(isDefault) {
InterfaceInfo = const_cast<PassInfo*>(Pass::lookupPassInfo(InterfaceID));
if (InterfaceInfo == 0) {
// First reference to Interface, register it now.
registerPass();
- InterfaceInfo = &PIObj;
+ InterfaceInfo = this;
}
- assert(PIObj.isAnalysisGroup() &&
+ assert(isAnalysisGroup() &&
"Trying to join an analysis group that is a normal pass!");
if (PassID) {
@@ -254,11 +255,6 @@
}
}
-void RegisterAGBase::setGroupName(const char *Name) {
- assert(InterfaceInfo->getPassName()[0] == 0 && "Interface Name already set!");
- InterfaceInfo->setPassName(Name);
-}
-
//===----------------------------------------------------------------------===//
// PassRegistrationListener implementation
Modified: llvm/branches/non-call-eh/lib/VMCore/PassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/PassManager.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/PassManager.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/PassManager.cpp Sun Jul 6 15:45:41 2008
@@ -19,6 +19,7 @@
#include "llvm/ModuleProvider.h"
#include "llvm/Support/Streams.h"
#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Analysis/Dominators.h"
#include "llvm-c/Core.h"
#include <algorithm>
#include <vector>
@@ -41,6 +42,11 @@
None, Arguments, Structure, Executions, Details
};
+bool VerifyDomInfo = false;
+static cl::opt<bool,true>
+VerifyDomInfoX("verify-dom-info", cl::location(VerifyDomInfo),
+ cl::desc("Verify dominator info (time consuming)"));
+
static cl::opt<enum PassDebugLevel>
PassDebugging("debug-pass", cl::Hidden,
cl::desc("Print PassManager debugging information"),
@@ -360,10 +366,10 @@
}
};
-static TimingInfo *TheTimeInfo;
-
} // End of anon namespace
+static TimingInfo *TheTimeInfo;
+
//===----------------------------------------------------------------------===//
// PMTopLevelManager implementation
@@ -608,7 +614,47 @@
}
}
-/// Remove Analyss not preserved by Pass P
+/// verifyDomInfo - Verify dominator information if it is available.
+void PMDataManager::verifyDomInfo(Pass &P, Function &F) {
+
+ if (!VerifyDomInfo || !P.getResolver())
+ return;
+
+ DominatorTree *DT = P.getAnalysisToUpdate<DominatorTree>();
+ if (!DT)
+ return;
+
+ DominatorTree OtherDT;
+ OtherDT.getBase().recalculate(F);
+ if (DT->compare(OtherDT)) {
+ cerr << "Dominator Information for " << F.getNameStart() << "\n";
+ cerr << "Pass " << P.getPassName() << "\n";
+ cerr << "----- Valid -----\n";
+ OtherDT.dump();
+ cerr << "----- Invalid -----\n";
+ DT->dump();
+ assert (0 && "Invalid dominator info");
+ }
+
+ DominanceFrontier *DF = P.getAnalysisToUpdate<DominanceFrontier>();
+ if (!DF)
+ return;
+
+ DominanceFrontier OtherDF;
+ std::vector<BasicBlock*> DTRoots = DT->getRoots();
+ OtherDF.calculate(*DT, DT->getNode(DTRoots[0]));
+ if (DF->compare(OtherDF)) {
+ cerr << "Dominator Information for " << F.getNameStart() << "\n";
+ cerr << "Pass " << P.getPassName() << "\n";
+ cerr << "----- Valid -----\n";
+ OtherDF.dump();
+ cerr << "----- Invalid -----\n";
+ DF->dump();
+ assert (0 && "Invalid dominator info");
+ }
+}
+
+/// Remove Analysis not preserved by Pass P
void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
AnalysisUsage AnUsage;
P->getAnalysisUsage(AnUsage);
@@ -621,9 +667,15 @@
std::map<AnalysisID, Pass*>::iterator Info = I++;
if (!dynamic_cast<ImmutablePass*>(Info->second)
&& std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) ==
- PreservedSet.end())
+ PreservedSet.end()) {
// Remove this analysis
AvailableAnalysis.erase(Info);
+ if (PassDebugging >= Details) {
+ Pass *S = Info->second;
+ cerr << " -- " << P->getPassName() << " is not preserving ";
+ cerr << S->getPassName() << "\n";
+ }
+ }
}
// Check inherited analysis also. If P is not preserving analysis
@@ -644,7 +696,6 @@
InheritedAnalysis[Index]->erase(Info);
}
}
-
}
/// Remove analysis passes that are not used any longer
@@ -659,6 +710,12 @@
TPM->collectLastUses(DeadPasses, P);
+ if (PassDebugging >= Details && !DeadPasses.empty()) {
+ cerr << " -*- " << P->getPassName();
+ cerr << " is the last user of following pass instances.";
+ cerr << " Free these instances\n";
+ }
+
for (SmallVector<Pass *, 12>::iterator I = DeadPasses.begin(),
E = DeadPasses.end(); I != E; ++I) {
@@ -707,6 +764,7 @@
Pass *PRequired = *I;
unsigned RDepth = 0;
+ assert (PRequired->getResolver() && "Analysis Resolver is not set");
PMDataManager &DM = PRequired->getResolver()->getPMDataManager();
RDepth = DM.getDepth();
@@ -801,6 +859,7 @@
// If that is not the case then it will raise an assert when it is used.
continue;
AnalysisResolver *AR = P->getResolver();
+ assert (AR && "Analysis Resolver is not set");
AR->addAnalysisImplsPair(*I, Impl);
}
}
@@ -924,7 +983,11 @@
// When Pass manager is not able to order required analysis info, Pass manager
// checks whether any lower level manager will be able to provide this
// analysis info on demand or not.
- assert (0 && "Unable to handle Pass that requires lower level Analysis pass");
+#ifndef NDEBUG
+ cerr << "Unable to schedule " << RequiredPass->getPassName();
+ cerr << " required by " << P->getPassName() << "\n";
+#endif
+ assert (0 && "Unable to schedule pass");
}
// Destructor
@@ -1186,6 +1249,9 @@
removeNotPreservedAnalysis(FP);
recordAvailableAnalysis(FP);
removeDeadPasses(FP, F.getNameStart(), ON_FUNCTION_MSG);
+
+ // If dominator information is available then verify the info if requested.
+ verifyDomInfo(*FP, F);
}
return Changed;
}
Modified: llvm/branches/non-call-eh/lib/VMCore/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/Type.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/Type.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/Type.cpp Sun Jul 6 15:45:41 2008
@@ -90,7 +90,7 @@
// Finally, remove the memory as an array deallocation of the chars it was
// constructed from.
- delete [] reinterpret_cast<const char*>(this);
+ operator delete(const_cast<Type *>(this));
return;
}
@@ -396,16 +396,24 @@
// Structure indexes require 32-bit integer constants.
if (V->getType() == Type::Int32Ty)
if (const ConstantInt *CU = dyn_cast<ConstantInt>(V))
- return CU->getZExtValue() < NumContainedTys;
+ return indexValid(CU->getZExtValue());
return false;
}
+bool StructType::indexValid(unsigned V) const {
+ return V < NumContainedTys;
+}
+
// getTypeAtIndex - Given an index value into the type, return the type of the
// element. For a structure type, this must be a constant value...
//
const Type *StructType::getTypeAtIndex(const Value *V) const {
- assert(indexValid(V) && "Invalid structure index!");
unsigned Idx = (unsigned)cast<ConstantInt>(V)->getZExtValue();
+ return getTypeAtIndex(Idx);
+}
+
+const Type *StructType::getTypeAtIndex(unsigned Idx) const {
+ assert(indexValid(Idx) && "Invalid structure index!");
return ContainedTys[Idx];
}
@@ -437,16 +445,35 @@
// Derived Type Constructors
//===----------------------------------------------------------------------===//
+/// isValidReturnType - Return true if the specified type is valid as a return
+/// type.
+bool FunctionType::isValidReturnType(const Type *RetTy) {
+ if (RetTy->isFirstClassType())
+ return true;
+ if (RetTy == Type::VoidTy || isa<OpaqueType>(RetTy))
+ return true;
+
+ // If this is a multiple return case, verify that each return is a first class
+ // value and that there is at least one value.
+ const StructType *SRetTy = dyn_cast<StructType>(RetTy);
+ if (SRetTy == 0 || SRetTy->getNumElements() == 0)
+ return false;
+
+ for (unsigned i = 0, e = SRetTy->getNumElements(); i != e; ++i)
+ if (!SRetTy->getElementType(i)->isFirstClassType())
+ return false;
+ return true;
+}
+
FunctionType::FunctionType(const Type *Result,
const std::vector<const Type*> &Params,
bool IsVarArgs)
: DerivedType(FunctionTyID), isVarArgs(IsVarArgs) {
ContainedTys = reinterpret_cast<PATypeHandle*>(this+1);
NumContainedTys = Params.size() + 1; // + 1 for result type
- assert((Result->isFirstClassType() || Result == Type::VoidTy ||
- Result->getTypeID() == Type::StructTyID ||
- isa<OpaqueType>(Result)) &&
- "LLVM functions cannot return aggregates");
+ assert(isValidReturnType(Result) && "invalid return type for function");
+
+
bool isAbstract = Result->isAbstract();
new (&ContainedTys[0]) PATypeHandle(Result, this);
@@ -531,6 +558,7 @@
}
+namespace {
/// TypePromotionGraph and graph traits - this is designed to allow us to do
/// efficient SCC processing of type graphs. This is the exact same as
@@ -541,6 +569,8 @@
TypePromotionGraph(Type *T) : Ty(T) {}
};
+}
+
namespace llvm {
template <> struct GraphTraits<TypePromotionGraph> {
typedef Type NodeType;
@@ -687,11 +717,11 @@
// ever reach a non-abstract type, we know that we don't need to search the
// subgraph.
static bool AbstractTypeHasCycleThrough(const Type *TargetTy, const Type *CurTy,
- std::set<const Type*> &VisitedTypes) {
+ SmallPtrSet<const Type*, 128> &VisitedTypes) {
if (TargetTy == CurTy) return true;
if (!CurTy->isAbstract()) return false;
- if (!VisitedTypes.insert(CurTy).second)
+ if (!VisitedTypes.insert(CurTy))
return false; // Already been here.
for (Type::subtype_iterator I = CurTy->subtype_begin(),
@@ -702,10 +732,10 @@
}
static bool ConcreteTypeHasCycleThrough(const Type *TargetTy, const Type *CurTy,
- std::set<const Type*> &VisitedTypes) {
+ SmallPtrSet<const Type*, 128> &VisitedTypes) {
if (TargetTy == CurTy) return true;
- if (!VisitedTypes.insert(CurTy).second)
+ if (!VisitedTypes.insert(CurTy))
return false; // Already been here.
for (Type::subtype_iterator I = CurTy->subtype_begin(),
@@ -718,7 +748,7 @@
/// TypeHasCycleThroughItself - Return true if the specified type has a cycle
/// back to itself.
static bool TypeHasCycleThroughItself(const Type *Ty) {
- std::set<const Type*> VisitedTypes;
+ SmallPtrSet<const Type*, 128> VisitedTypes;
if (Ty->isAbstract()) { // Optimized case for abstract types.
for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end();
@@ -871,7 +901,7 @@
// The old record is now out-of-date, because one of the children has been
// updated. Remove the obsolete entry from the map.
unsigned NumErased = Map.erase(ValType::get(Ty));
- assert(NumErased && "Element not found!");
+ assert(NumErased && "Element not found!"); NumErased = NumErased;
// Remember the structural hash for the type before we start hacking on it,
// in case we need it later.
@@ -1091,12 +1121,11 @@
bool isVarArg) {
FunctionValType VT(ReturnType, Params, isVarArg);
FunctionType *FT = FunctionTypes->get(VT);
- if (FT) {
+ if (FT)
return FT;
- }
- FT = (FunctionType*) new char[sizeof(FunctionType) +
- sizeof(PATypeHandle)*(Params.size()+1)];
+ FT = (FunctionType*) operator new(sizeof(FunctionType) +
+ sizeof(PATypeHandle)*(Params.size()+1));
new (FT) FunctionType(ReturnType, Params, isVarArg);
FunctionTypes->add(VT, FT);
@@ -1237,8 +1266,8 @@
if (ST) return ST;
// Value not found. Derive a new type!
- ST = (StructType*) new char[sizeof(StructType) +
- sizeof(PATypeHandle) * ETypes.size()];
+ ST = (StructType*) operator new(sizeof(StructType) +
+ sizeof(PATypeHandle) * ETypes.size());
new (ST) StructType(ETypes, isPacked);
StructTypes->add(STV, ST);
@@ -1397,7 +1426,7 @@
while (!AbstractTypeUsers.empty() && NewTy != this) {
AbstractTypeUser *User = AbstractTypeUsers.back();
- unsigned OldSize = AbstractTypeUsers.size();
+ unsigned OldSize = AbstractTypeUsers.size(); OldSize=OldSize;
#ifdef DEBUG_MERGE_TYPES
DOUT << " REFINING user " << OldSize-1 << "[" << (void*)User
<< "] of abstract type [" << (void*)this << " "
@@ -1424,7 +1453,7 @@
DOUT << "typeIsREFINED type: " << (void*)this << " " << *this << "\n";
#endif
- unsigned OldSize = AbstractTypeUsers.size();
+ unsigned OldSize = AbstractTypeUsers.size(); OldSize=OldSize;
while (!AbstractTypeUsers.empty()) {
AbstractTypeUser *ATU = AbstractTypeUsers.back();
ATU->typeBecameConcrete(this);
Modified: llvm/branches/non-call-eh/lib/VMCore/TypeSymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/TypeSymbolTable.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/TypeSymbolTable.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/TypeSymbolTable.cpp Sun Jul 6 15:45:41 2008
@@ -64,7 +64,9 @@
// list...
if (Result->isAbstract()) {
#if DEBUG_ABSTYPE
- cerr << "Removing abstract type from symtab" << Result->getDescription()<<"\n";
+ cerr << "Removing abstract type from symtab"
+ << Result->getDescription()
+ << "\n";
#endif
cast<DerivedType>(Result)->removeAbstractTypeUser(this);
}
Added: llvm/branches/non-call-eh/lib/VMCore/Use.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/Use.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/Use.cpp (added)
+++ llvm/branches/non-call-eh/lib/VMCore/Use.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,162 @@
+//===-- Use.cpp - Implement the Use class ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the algorithm for finding the User of a Use.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/User.h"
+
+namespace llvm {
+
+//===----------------------------------------------------------------------===//
+// Use swap Implementation
+//===----------------------------------------------------------------------===//
+
+void Use::swap(Use &RHS) {
+ Value *V1(Val);
+ Value *V2(RHS.Val);
+ if (V1 != V2) {
+ if (V1) {
+ removeFromList();
+ }
+
+ if (V2) {
+ RHS.removeFromList();
+ Val = V2;
+ V2->addUse(*this);
+ } else {
+ Val = 0;
+ }
+
+ if (V1) {
+ RHS.Val = V1;
+ V1->addUse(RHS);
+ } else {
+ RHS.Val = 0;
+ }
+ }
+}
+
+//===----------------------------------------------------------------------===//
+// Use getImpliedUser Implementation
+//===----------------------------------------------------------------------===//
+
+const Use *Use::getImpliedUser() const {
+ const Use *Current = this;
+
+ while (true) {
+ unsigned Tag = extractTag<PrevPtrTag, fullStopTag>((Current++)->Prev);
+ switch (Tag) {
+ case zeroDigitTag:
+ case oneDigitTag:
+ continue;
+
+ case stopTag: {
+ ++Current;
+ ptrdiff_t Offset = 1;
+ while (true) {
+ unsigned Tag = extractTag<PrevPtrTag, fullStopTag>(Current->Prev);
+ switch (Tag) {
+ case zeroDigitTag:
+ case oneDigitTag:
+ ++Current;
+ Offset = (Offset << 1) + Tag;
+ continue;
+ default:
+ return Current + Offset;
+ }
+ }
+ }
+
+ case fullStopTag:
+ return Current;
+ }
+ }
+}
+
+//===----------------------------------------------------------------------===//
+// Use initTags Implementation
+//===----------------------------------------------------------------------===//
+
+Use *Use::initTags(Use * const Start, Use *Stop, ptrdiff_t Done) {
+ ptrdiff_t Count = Done;
+ while (Start != Stop) {
+ --Stop;
+ Stop->Val = 0;
+ if (!Count) {
+ Stop->Prev = reinterpret_cast<Use**>(Done == 0 ? fullStopTag : stopTag);
+ ++Done;
+ Count = Done;
+ } else {
+ Stop->Prev = reinterpret_cast<Use**>(Count & 1);
+ Count >>= 1;
+ ++Done;
+ }
+ }
+
+ return Start;
+}
+
+//===----------------------------------------------------------------------===//
+// Use zap Implementation
+//===----------------------------------------------------------------------===//
+
+void Use::zap(Use *Start, const Use *Stop, bool del) {
+ if (del) {
+ while (Start != Stop) {
+ (--Stop)->~Use();
+ }
+ ::operator delete(Start);
+ return;
+ }
+
+ while (Start != Stop) {
+ (Start++)->set(0);
+ }
+}
+
+//===----------------------------------------------------------------------===//
+// AugmentedUse layout struct
+//===----------------------------------------------------------------------===//
+
+struct AugmentedUse : Use {
+ User *ref;
+ AugmentedUse(); // not implemented
+};
+
+
+//===----------------------------------------------------------------------===//
+// Use getUser Implementation
+//===----------------------------------------------------------------------===//
+
+User *Use::getUser() const {
+ const Use *End = getImpliedUser();
+ User *She = static_cast<const AugmentedUse*>(End - 1)->ref;
+ She = extractTag<Tag, tagOne>(She)
+ ? llvm::stripTag<tagOne>(She)
+ : reinterpret_cast<User*>(const_cast<Use*>(End));
+
+ return She;
+}
+
+//===----------------------------------------------------------------------===//
+// User allocHungoffUses Implementation
+//===----------------------------------------------------------------------===//
+
+Use *User::allocHungoffUses(unsigned N) const {
+ Use *Begin = static_cast<Use*>(::operator new(sizeof(Use) * N
+ + sizeof(AugmentedUse)
+ - sizeof(Use)));
+ Use *End = Begin + N;
+ static_cast<AugmentedUse&>(End[-1]).ref = addTag(this, tagOne);
+ return Use::initTags(Begin, End);
+}
+
+} // End llvm namespace
Modified: llvm/branches/non-call-eh/lib/VMCore/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/Value.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/Value.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/Value.cpp Sun Jul 6 15:45:41 2008
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Constant.h"
+#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/InstrTypes.h"
#include "llvm/Instructions.h"
@@ -92,6 +93,17 @@
return true;
}
+/// isUsedInBasicBlock - Return true if this value is used in the specified
+/// basic block.
+bool Value::isUsedInBasicBlock(BasicBlock *BB) const {
+ for (use_const_iterator I = use_begin(), E = use_end(); I != E; ++I) {
+ const Instruction *User = dyn_cast<Instruction>(*I);
+ if (User && User->getParent() == BB)
+ return true;
+ }
+ return false;
+}
+
/// getNumUses - This method computes the number of uses of this Value. This
/// is a linear time operation. Use hasOneUse or hasNUses to check for specific
@@ -136,6 +148,13 @@
return Name ? Name->getKeyLength() : 0;
}
+/// isName - Return true if this value has the name specified by the provided
+/// nul terminated string.
+bool Value::isName(const char *N) const {
+ unsigned InLen = strlen(N);
+ return InLen == getNameLen() && memcmp(getNameStart(), N, InLen) == 0;
+}
+
std::string Value::getNameStr() const {
if (Name == 0) return "";
@@ -245,7 +264,7 @@
// Get V's ST, this should always succed, because V has a name.
ValueSymbolTable *VST;
bool Failure = getSymTab(V, VST);
- assert(!Failure && "V has a name, so it should have a ST!");
+ assert(!Failure && "V has a name, so it should have a ST!"); Failure=Failure;
// If these values are both in the same symtab, we can do this very fast.
// This works even if both values have no symtab yet.
@@ -302,6 +321,30 @@
uncheckedReplaceAllUsesWith(New);
}
+Value *Value::stripPointerCasts() {
+ if (ConstantExpr *CE = dyn_cast<ConstantExpr>(this)) {
+ if (CE->getOpcode() == Instruction::BitCast) {
+ if (isa<PointerType>(CE->getOperand(0)->getType()))
+ return CE->getOperand(0)->stripPointerCasts();
+ } else if (CE->getOpcode() == Instruction::GetElementPtr) {
+ for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i)
+ if (!CE->getOperand(i)->isNullValue())
+ return this;
+ return CE->getOperand(0)->stripPointerCasts();
+ }
+ return this;
+ }
+
+ if (BitCastInst *CI = dyn_cast<BitCastInst>(this)) {
+ if (isa<PointerType>(CI->getOperand(0)->getType()))
+ return CI->getOperand(0)->stripPointerCasts();
+ } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(this)) {
+ if (GEP->hasAllZeroIndices())
+ return GEP->getOperand(0)->stripPointerCasts();
+ }
+ return this;
+}
+
//===----------------------------------------------------------------------===//
// User Class
//===----------------------------------------------------------------------===//
@@ -324,3 +367,21 @@
}
}
+void *User::operator new(size_t s, unsigned Us) {
+ void *Storage = ::operator new(s + sizeof(Use) * Us);
+ Use *Start = static_cast<Use*>(Storage);
+ Use *End = Start + Us;
+ User *Obj = reinterpret_cast<User*>(End);
+ Obj->OperandList = Start;
+ Obj->NumOperands = Us;
+ Use::initTags(Start, End);
+ return Obj;
+}
+
+void User::operator delete(void *Usr) {
+ User *Start = static_cast<User*>(Usr);
+ Use *Storage = static_cast<Use*>(Usr) - Start->NumOperands;
+ ::operator delete(Storage == Start->OperandList
+ ? Storage
+ : Usr);
+}
Modified: llvm/branches/non-call-eh/lib/VMCore/ValueSymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/ValueSymbolTable.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/ValueSymbolTable.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/ValueSymbolTable.cpp Sun Jul 6 15:45:41 2008
@@ -15,7 +15,7 @@
#include "llvm/GlobalValue.h"
#include "llvm/Type.h"
#include "llvm/ValueSymbolTable.h"
-#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Debug.h"
using namespace llvm;
@@ -30,21 +30,6 @@
#endif
}
-// getUniqueName - Given a base name, return a string that is either equal to
-// it (or derived from it) that does not already occur in the symbol table for
-// the specified type.
-//
-std::string ValueSymbolTable::getUniqueName(const std::string &BaseName) const {
- std::string TryName = BaseName;
-
- // See if the name exists
- while (vmap.find(&TryName[0], &TryName[TryName.size()]) != vmap.end())
- // Loop until we find a free name in the symbol table.
- TryName = BaseName + utostr(++LastUnique);
- return TryName;
-}
-
-
// lookup a value - Returns null on failure...
//
Value *ValueSymbolTable::lookup(const std::string &Name) const {
@@ -54,6 +39,14 @@
return 0;
}
+Value *ValueSymbolTable::lookup(const char *NameBegin,
+ const char *NameEnd) const {
+ const_iterator VI = vmap.find(NameBegin, NameEnd);
+ if (VI != vmap.end()) // We found the symbol
+ return VI->getValue();
+ return 0;
+}
+
// Insert a value into the symbol table with the specified name...
//
void ValueSymbolTable::reinsertValue(Value* V) {
@@ -65,18 +58,17 @@
return;
}
- // FIXME: this could be much more efficient.
-
// Otherwise, there is a naming conflict. Rename this value.
- std::string UniqueName = V->getName();
-
+ SmallString<128> UniqueName(V->getNameStart(), V->getNameEnd());
+
+ // The name is too already used, just free it so we can allocate a new name.
V->Name->Destroy();
unsigned BaseSize = UniqueName.size();
while (1) {
// Trim any suffix off.
UniqueName.resize(BaseSize);
- UniqueName += utostr(++LastUnique);
+ UniqueName.append_uint_32(++LastUnique);
// Try insert the vmap entry with this suffix.
ValueName &NewName = vmap.GetOrCreateValue(&UniqueName[0],
&UniqueName[UniqueName.size()]);
@@ -92,7 +84,7 @@
void ValueSymbolTable::removeValueName(ValueName *V) {
//DEBUG(DOUT << " Removing Value: " << V->getKeyData() << "\n");
- // Remove the value from the plane.
+ // Remove the value from the symbol table.
vmap.remove(V);
}
@@ -101,6 +93,7 @@
/// auto-renames the name and returns that instead.
ValueName *ValueSymbolTable::createValueName(const char *NameStart,
unsigned NameLen, Value *V) {
+ // In the common case, the name is not already in the symbol table.
ValueName &Entry = vmap.GetOrCreateValue(NameStart, NameStart+NameLen);
if (Entry.getValue() == 0) {
Entry.setValue(V);
@@ -109,14 +102,14 @@
return &Entry;
}
- // FIXME: this could be much more efficient.
-
// Otherwise, there is a naming conflict. Rename this value.
- std::string UniqueName(NameStart, NameStart+NameLen);
+ SmallString<128> UniqueName(NameStart, NameStart+NameLen);
+
while (1) {
// Trim any suffix off.
UniqueName.resize(NameLen);
- UniqueName += utostr(++LastUnique);
+ UniqueName.append_uint_32(++LastUnique);
+
// Try insert the vmap entry with this suffix.
ValueName &NewName = vmap.GetOrCreateValue(&UniqueName[0],
&UniqueName[UniqueName.size()]);
Modified: llvm/branches/non-call-eh/lib/VMCore/ValueTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/ValueTypes.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/ValueTypes.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/ValueTypes.cpp Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-//===-- ValueTypes.cpp - Implementation of MVT::ValueType methods ---------===//
+//===----------- ValueTypes.cpp - Implementation of MVT methods -----------===//
//
// The LLVM Compiler Infrastructure
//
@@ -17,17 +17,17 @@
#include "llvm/DerivedTypes.h"
using namespace llvm;
-/// MVT::getValueTypeString - This function returns value type as a string,
-/// e.g. "i32".
-std::string MVT::getValueTypeString(MVT::ValueType VT) {
- switch (VT) {
+/// getMVTString - This function returns value type as a string, e.g. "i32".
+std::string MVT::getMVTString() const {
+ switch (V) {
default:
- if (isVector(VT))
- return "v" + utostr(getVectorNumElements(VT)) +
- getValueTypeString(getVectorElementType(VT));
- if (isInteger(VT))
- return "i" + utostr(getSizeInBits(VT));
- assert(0 && "Invalid ValueType!");
+ if (isVector())
+ return "v" + utostr(getVectorNumElements()) +
+ getVectorElementType().getMVTString();
+ if (isInteger())
+ return "i" + utostr(getSizeInBits());
+ assert(0 && "Invalid MVT!");
+ return "?";
case MVT::i1: return "i1";
case MVT::i8: return "i8";
case MVT::i16: return "i16";
@@ -58,19 +58,20 @@
}
}
-/// MVT::getTypeForValueType - This method returns an LLVM type corresponding
-/// to the specified ValueType. Note that this will abort for types that cannot
-/// be represented.
-const Type *MVT::getTypeForValueType(MVT::ValueType VT) {
- switch (VT) {
+/// getTypeForMVT - This method returns an LLVM type corresponding to the
+/// specified MVT. For integer types, this returns an unsigned type. Note
+/// that this will abort for types that cannot be represented.
+const Type *MVT::getTypeForMVT() const {
+ switch (V) {
default:
- if (isVector(VT))
- return VectorType::get(getTypeForValueType(getVectorElementType(VT)),
- getVectorNumElements(VT));
- if (isInteger(VT))
- return IntegerType::get(getSizeInBits(VT));
- assert(0 && "ValueType does not correspond to LLVM type!");
- case MVT::isVoid:return Type::VoidTy;
+ if (isVector())
+ return VectorType::get(getVectorElementType().getTypeForMVT(),
+ getVectorNumElements());
+ if (isInteger())
+ return IntegerType::get(getSizeInBits());
+ assert(0 && "MVT does not correspond to LLVM type!");
+ return Type::VoidTy;
+ case MVT::isVoid: return Type::VoidTy;
case MVT::i1: return Type::Int1Ty;
case MVT::i8: return Type::Int8Ty;
case MVT::i16: return Type::Int16Ty;
@@ -98,18 +99,19 @@
}
}
-/// MVT::getValueType - Return the value type corresponding to the specified
-/// type. This returns all pointers as MVT::iPTR. If HandleUnknown is true,
-/// unknown types are returned as Other, otherwise they are invalid.
-MVT::ValueType MVT::getValueType(const Type *Ty, bool HandleUnknown) {
+/// getMVT - Return the value type corresponding to the specified type. This
+/// returns all pointers as MVT::iPTR. If HandleUnknown is true, unknown types
+/// are returned as Other, otherwise they are invalid.
+MVT MVT::getMVT(const Type *Ty, bool HandleUnknown){
switch (Ty->getTypeID()) {
default:
if (HandleUnknown) return MVT::Other;
assert(0 && "Unknown type!");
+ return MVT::isVoid;
case Type::VoidTyID:
return MVT::isVoid;
case Type::IntegerTyID:
- return getIntegerType(cast<IntegerType>(Ty)->getBitWidth());
+ return getIntegerVT(cast<IntegerType>(Ty)->getBitWidth());
case Type::FloatTyID: return MVT::f32;
case Type::DoubleTyID: return MVT::f64;
case Type::X86_FP80TyID: return MVT::f80;
@@ -118,8 +120,8 @@
case Type::PointerTyID: return MVT::iPTR;
case Type::VectorTyID: {
const VectorType *VTy = cast<VectorType>(Ty);
- return getVectorType(getValueType(VTy->getElementType(), false),
- VTy->getNumElements());
+ return getVectorVT(getMVT(VTy->getElementType(), false),
+ VTy->getNumElements());
}
}
}
Modified: llvm/branches/non-call-eh/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/lib/VMCore/Verifier.cpp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/lib/VMCore/Verifier.cpp (original)
+++ llvm/branches/non-call-eh/lib/VMCore/Verifier.cpp Sun Jul 6 15:45:41 2008
@@ -92,11 +92,14 @@
return false;
}
};
+}
- char PreVerifier::ID = 0;
- RegisterPass<PreVerifier> PreVer("preverify", "Preliminary module verification");
- const PassInfo *PreVerifyID = PreVer.getPassInfo();
+char PreVerifier::ID = 0;
+static RegisterPass<PreVerifier>
+PreVer("preverify", "Preliminary module verification");
+static const PassInfo *const PreVerifyID = &PreVer;
+namespace {
struct VISIBILITY_HIDDEN
Verifier : public FunctionPass, InstVisitor<Verifier> {
static char ID; // Pass ID, replacement for typeid
@@ -305,11 +308,10 @@
Broken = true;
}
};
-
- char Verifier::ID = 0;
- RegisterPass<Verifier> X("verify", "Module Verifier");
} // End anonymous namespace
+char Verifier::ID = 0;
+static RegisterPass<Verifier> X("verify", "Module Verifier");
// Assert - We know that cond should be true, if not print an error message.
#define Assert(C, M) \
@@ -367,9 +369,11 @@
Assert1(GA.hasExternalLinkage() || GA.hasInternalLinkage() ||
GA.hasWeakLinkage(),
"Alias should have external or external weak linkage!", &GA);
+ Assert1(GA.getAliasee(),
+ "Aliasee cannot be NULL!", &GA);
Assert1(GA.getType() == GA.getAliasee()->getType(),
"Alias and aliasee types should match!", &GA);
-
+
if (!isa<GlobalValue>(GA.getAliasee())) {
const ConstantExpr *CE = dyn_cast<ConstantExpr>(GA.getAliasee());
Assert1(CE && CE->getOpcode() == Instruction::BitCast &&
@@ -530,12 +534,6 @@
// Ensure that basic blocks have terminators!
Assert1(BB.getTerminator(), "Basic Block does not have terminator!", &BB);
- // Ensure that the BB doesn't point out of its Function for unwinding.
- Assert2(!BB.getUnwindDest() ||
- BB.getUnwindDest()->getParent() == BB.getParent(),
- "Basic Block unwinds to block in different function!",
- &BB, BB.getUnwindDest());
-
// Check constraints that this basic block imposes on all of the PHI nodes in
// it.
if (isa<PHINode>(BB.front())) {
@@ -592,22 +590,34 @@
void Verifier::visitReturnInst(ReturnInst &RI) {
Function *F = RI.getParent()->getParent();
unsigned N = RI.getNumOperands();
- if (N == 0)
- Assert2(F->getReturnType() == Type::VoidTy,
+ if (F->getReturnType() == Type::VoidTy)
+ Assert2(N == 0,
"Found return instr that returns void in Function of non-void "
"return type!", &RI, F->getReturnType());
- else if (const StructType *STy = dyn_cast<StructType>(F->getReturnType())) {
- for (unsigned i = 0; i < N; i++)
+ else if (N == 1 && F->getReturnType() == RI.getOperand(0)->getType()) {
+ // Exactly one return value and it matches the return type. Good.
+ } else if (const StructType *STy = dyn_cast<StructType>(F->getReturnType())) {
+ // The return type is a struct; check for multiple return values.
+ Assert2(STy->getNumElements() == N,
+ "Incorrect number of return values in ret instruction!",
+ &RI, F->getReturnType());
+ for (unsigned i = 0; i != N; ++i)
Assert2(STy->getElementType(i) == RI.getOperand(i)->getType(),
"Function return type does not match operand "
"type of return inst!", &RI, F->getReturnType());
- }
- else if (N == 1)
- Assert2(F->getReturnType() == RI.getOperand(0)->getType(),
- "Function return type does not match operand "
- "type of return inst!", &RI, F->getReturnType());
- else
- Assert1(0, "Invalid return type!", &RI);
+ } else if (const ArrayType *ATy = dyn_cast<ArrayType>(F->getReturnType())) {
+ // The return type is an array; check for multiple return values.
+ Assert2(ATy->getNumElements() == N,
+ "Incorrect number of return values in ret instruction!",
+ &RI, F->getReturnType());
+ for (unsigned i = 0; i != N; ++i)
+ Assert2(ATy->getElementType() == RI.getOperand(i)->getType(),
+ "Function return type does not match operand "
+ "type of return inst!", &RI, F->getReturnType());
+ } else {
+ CheckFailed("Function return type does not match operand "
+ "type of return inst!", &RI, F->getReturnType());
+ }
// Check to make sure that the return value has necessary properties for
// terminators...
@@ -1046,7 +1056,7 @@
SmallVector<Value*, 16> Idxs(GEP.idx_begin(), GEP.idx_end());
const Type *ElTy =
GetElementPtrInst::getIndexedType(GEP.getOperand(0)->getType(),
- Idxs.begin(), Idxs.end(), true);
+ Idxs.begin(), Idxs.end());
Assert1(ElTy, "Invalid indices for GEP pointer type!", &GEP);
Assert2(isa<PointerType>(GEP.getType()) &&
cast<PointerType>(GEP.getType())->getElementType() == ElTy,
@@ -1081,8 +1091,14 @@
}
void Verifier::visitGetResultInst(GetResultInst &GRI) {
- Assert1(GRI.isValidOperands(GRI.getAggregateValue(), GRI.getIndex()),
+ Assert1(GetResultInst::isValidOperands(GRI.getAggregateValue(),
+ GRI.getIndex()),
"Invalid GetResultInst operands!", &GRI);
+ Assert1(isa<CallInst>(GRI.getAggregateValue()) ||
+ isa<InvokeInst>(GRI.getAggregateValue()) ||
+ isa<UndefValue>(GRI.getAggregateValue()),
+ "GetResultInst operand must be a call/invoke/undef!", &GRI);
+
visitInstruction(GRI);
}
@@ -1270,8 +1286,7 @@
"Intrinsic parameter #1 is not i8**.", &CI);
Assert1(CI.getOperand(2)->getType() == PtrTy,
"Intrinsic parameter #2 is not i8*.", &CI);
- Assert1(isa<AllocaInst>(
- IntrinsicInst::StripPointerCasts(CI.getOperand(1))),
+ Assert1(isa<AllocaInst>(CI.getOperand(1)->stripPointerCasts()),
"llvm.gcroot parameter #1 must be an alloca.", &CI);
Assert1(isa<Constant>(CI.getOperand(2)),
"llvm.gcroot parameter #2 must be a constant.", &CI);
@@ -1297,7 +1312,7 @@
&CI);
} break;
case Intrinsic::init_trampoline:
- Assert1(isa<Function>(IntrinsicInst::StripPointerCasts(CI.getOperand(2))),
+ Assert1(isa<Function>(CI.getOperand(2)->stripPointerCasts()),
"llvm.init_trampoline parameter #2 must resolve to a function.",
&CI);
break;
@@ -1327,7 +1342,7 @@
// Note that "arg#0" is the return type.
for (unsigned ArgNo = 0; ArgNo < Count; ++ArgNo) {
- MVT::ValueType VT = va_arg(VA, MVT::ValueType);
+ int VT = va_arg(VA, int); // An MVT::SimpleValueType when non-negative.
if (VT == MVT::isVoid && ArgNo > 0) {
if (!FTy->isVarArg())
@@ -1347,8 +1362,8 @@
EltTy = VTy->getElementType();
NumElts = VTy->getNumElements();
}
-
- if ((int)VT < 0) {
+
+ if (VT < 0) {
int Match = ~VT;
if (Match == 0) {
if (Ty != FTy->getReturnType()) {
@@ -1399,7 +1414,7 @@
Suffix += ".";
if (EltTy != Ty)
Suffix += "v" + utostr(NumElts);
- Suffix += MVT::getValueTypeString(MVT::getValueType(EltTy));
+ Suffix += MVT::getMVT(EltTy).getMVTString();
} else if (VT == MVT::iPTR) {
if (!isa<PointerType>(Ty)) {
if (ArgNo == 0)
@@ -1410,19 +1425,20 @@
"pointer and a pointer is required.", F);
break;
}
- } else if (MVT::isVector(VT)) {
+ } else if (MVT((MVT::SimpleValueType)VT).isVector()) {
+ MVT VVT = MVT((MVT::SimpleValueType)VT);
// If this is a vector argument, verify the number and type of elements.
- if (MVT::getVectorElementType(VT) != MVT::getValueType(EltTy)) {
+ if (VVT.getVectorElementType() != MVT::getMVT(EltTy)) {
CheckFailed("Intrinsic prototype has incorrect vector element type!",
F);
break;
}
- if (MVT::getVectorNumElements(VT) != NumElts) {
+ if (VVT.getVectorNumElements() != NumElts) {
CheckFailed("Intrinsic prototype has incorrect number of "
"vector elements!",F);
break;
}
- } else if (MVT::getTypeForValueType(VT) != EltTy) {
+ } else if (MVT((MVT::SimpleValueType)VT).getTypeForMVT() != EltTy) {
if (ArgNo == 0)
CheckFailed("Intrinsic prototype has incorrect result type!", F);
else
@@ -1488,7 +1504,7 @@
PassManager PM;
Verifier *V = new Verifier(action);
PM.add(V);
- PM.run((Module&)M);
+ PM.run(const_cast<Module&>(M));
if (ErrorInfo && V->Broken)
*ErrorInfo = V->msgs.str();
Modified: llvm/branches/non-call-eh/projects/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/projects/Makefile?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/projects/Makefile (original)
+++ llvm/branches/non-call-eh/projects/Makefile Sun Jul 6 15:45:41 2008
@@ -10,7 +10,9 @@
include $(LEVEL)/Makefile.config
-DIRS:= $(filter-out llvm-test,$(patsubst $(PROJ_SRC_DIR)/%/Makefile,%,$(wildcard $(PROJ_SRC_DIR)/*/Makefile)))
+# Compile all subdirs, except for the test suite, which lives in test-suite.
+# Before 2008.06.24 it lived in llvm-test, so exclude that as well for now.
+DIRS:= $(filter-out llvm-test test-suite,$(patsubst $(PROJ_SRC_DIR)/%/Makefile,%,$(wildcard $(PROJ_SRC_DIR)/*/Makefile)))
# Sparc cannot link shared libraries (libtool problem?)
ifeq ($(ARCH), Sparc)
Modified: llvm/branches/non-call-eh/test/Analysis/Andersens/basictest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/Andersens/basictest.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/Andersens/basictest.ll (original)
+++ llvm/branches/non-call-eh/test/Analysis/Andersens/basictest.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -anders-aa -aa-eval
+; RUN: llvm-as < %s | opt -anders-aa -aa-eval 2>/dev/null
define void @test1() {
%X = malloc i32*
Modified: llvm/branches/non-call-eh/test/Analysis/Andersens/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/Andersens/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/Andersens/dg.exp (original)
+++ llvm/branches/non-call-eh/test/Analysis/Andersens/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Modified: llvm/branches/non-call-eh/test/Analysis/Andersens/external.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/Andersens/external.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/Andersens/external.ll (original)
+++ llvm/branches/non-call-eh/test/Analysis/Andersens/external.ll Sun Jul 6 15:45:41 2008
@@ -2,7 +2,7 @@
; Because the 'internal' function is passed to an external function, we don't
; know what the incoming values will alias. As such, we cannot do the
-; optimization checked by the 'arg-must-alias.llx' test.
+; optimization checked by the 'arg-must-alias.ll' test.
declare void @external(i32(i32*)*)
@G = internal constant i32* null
Modified: llvm/branches/non-call-eh/test/Analysis/Andersens/modreftest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/Andersens/modreftest.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/Andersens/modreftest.ll (original)
+++ llvm/branches/non-call-eh/test/Analysis/Andersens/modreftest.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -anders-aa -load-vn -gcse -instcombine | llvm-dis \
+; RUN: llvm-as < %s | opt -anders-aa -load-vn -gcse -instcombine | llvm-dis \
; RUN: | grep {ret i1 true}
@G = internal global i32* null
Modified: llvm/branches/non-call-eh/test/Analysis/Andersens/modreftest2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/Andersens/modreftest2.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/Andersens/modreftest2.ll (original)
+++ llvm/branches/non-call-eh/test/Analysis/Andersens/modreftest2.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -anders-aa -gvn | llvm-dis \
+; RUN: llvm-as < %s | opt -anders-aa -gvn | llvm-dis \
; RUN: | not grep {ret i32 undef}
;; From PR 2160
Modified: llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll (original)
+++ llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
+; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output 2>/dev/null
; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2
define void @test({[2 x i32],[2 x i32]}* %A, i64 %X, i64 %Y) {
%P1 = getelementptr {[2 x i32],[2 x i32]}* %A, i64 0, i32 0, i64 %X
Modified: llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll (original)
+++ llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
+; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output 2>/dev/null
; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2
define void @test([17 x i16]* %mask_bits) {
%P1 = getelementptr [17 x i16]* %mask_bits, i64 0, i64 0
Modified: llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll (original)
+++ llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
+; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output 2>/dev/null
define i32 @MTConcat([3 x i32]* %a.1) {
%tmp.961 = getelementptr [3 x i32]* %a.1, i64 0, i64 4
Modified: llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll (original)
+++ llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
+; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output 2>/dev/null
%struct..RefPoint = type { i32, { i32, i8, i8 } }
%struct..RefRect = type { %struct..RefPoint, %struct..RefPoint }
Added: llvm/branches/non-call-eh/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll (added)
+++ llvm/branches/non-call-eh/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | opt -gvn -disable-output
+; PR2395
+
+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"
+ %struct.S291 = type <{ %union.anon, i32 }>
+ %union.anon = type { }
+ at a291 = external global [5 x %struct.S291] ; <[5 x %struct.S291]*> [#uses=2]
+
+define void @test291() nounwind {
+entry:
+ store i32 1138410269, i32* getelementptr ([5 x %struct.S291]* @a291, i32 0, i32 2, i32 1)
+ %tmp54 = load i32* bitcast (%struct.S291* getelementptr ([5 x %struct.S291]* @a291, i32 0, i32 2) to i32*), align 4 ; <i32> [#uses=0]
+ unreachable
+}
Modified: llvm/branches/non-call-eh/test/Analysis/BasicAA/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/BasicAA/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/BasicAA/dg.exp (original)
+++ llvm/branches/non-call-eh/test/Analysis/BasicAA/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Modified: llvm/branches/non-call-eh/test/Analysis/BasicAA/licmtest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/BasicAA/licmtest.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/BasicAA/licmtest.ll (original)
+++ llvm/branches/non-call-eh/test/Analysis/BasicAA/licmtest.ll Sun Jul 6 15:45:41 2008
@@ -1,9 +1,8 @@
; Test that LICM uses basicaa to do alias analysis, which is capable of
; disambiguating some obvious cases. If LICM is able to disambiguate the
-; two pointers, then the load should be hoisted, and the store sunk. Thus
-; the loop becomes empty and can be deleted by ADCE.
+; two pointers, then the load should be hoisted, and the store sunk.
-; RUN: llvm-as < %s | opt -basicaa -licm --adce | llvm-dis | not grep Loop
+; RUN: llvm-as < %s | opt -basicaa -licm | llvm-dis | %prcontext @A 1 | not grep Loop
@A = global i32 7 ; <i32*> [#uses=3]
@B = global i32 8 ; <i32*> [#uses=2]
Added: llvm/branches/non-call-eh/test/Analysis/BasicAA/no-escape-call.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/BasicAA/no-escape-call.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/BasicAA/no-escape-call.ll (added)
+++ llvm/branches/non-call-eh/test/Analysis/BasicAA/no-escape-call.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,23 @@
+; RUN: llvm-as < %s | opt -basicaa -gvn -instcombine | llvm-dis | grep {ret i1 true}
+; PR2436
+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-darwin8"
+
+define i1 @foo(i32 %i) nounwind {
+entry:
+ %arr = alloca [10 x i8*] ; <[10 x i8*]*> [#uses=1]
+ %tmp2 = call i8* @getPtr( ) nounwind ; <i8*> [#uses=2]
+ %tmp4 = getelementptr [10 x i8*]* %arr, i32 0, i32 %i ; <i8**> [#uses=2]
+ store i8* %tmp2, i8** %tmp4, align 4
+ %tmp10 = getelementptr i8* %tmp2, i32 10 ; <i8*> [#uses=1]
+ store i8 42, i8* %tmp10, align 1
+ %tmp14 = load i8** %tmp4, align 4 ; <i8*> [#uses=1]
+ %tmp16 = getelementptr i8* %tmp14, i32 10 ; <i8*> [#uses=1]
+ %tmp17 = load i8* %tmp16, align 1 ; <i8> [#uses=1]
+ %tmp19 = icmp eq i8 %tmp17, 42 ; <i1> [#uses=1]
+ ret i1 %tmp19
+}
+
+declare i8* @getPtr()
+
+declare void @abort() noreturn nounwind
Removed: llvm/branches/non-call-eh/test/Analysis/Dominators/2006-09-26-PostDominanceFrontier.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/Dominators/2006-09-26-PostDominanceFrontier.ll?rev=53162&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/Dominators/2006-09-26-PostDominanceFrontier.ll (original)
+++ llvm/branches/non-call-eh/test/Analysis/Dominators/2006-09-26-PostDominanceFrontier.ll (removed)
@@ -1,97 +0,0 @@
-; RUN: llvm-as < %s | opt -analyze -postdomfrontier \
-; RUN: -disable-verify
-; ModuleID = '2006-09-26-PostDominanceFrontier.bc'
-target datalayout = "e-p:64:64"
-target triple = "alphaev67-unknown-linux-gnu"
- %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i32, [44 x i8] }
- %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 }
- at TOP = external global i64* ; <i64**> [#uses=1]
- at BOT = external global i64* ; <i64**> [#uses=1]
- at str = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
-
-declare void @fopen()
-
-define void @main(i8** %argv) {
-entry:
- %netSelect.i507 = alloca i64, align 8 ; <i64*> [#uses=0]
- %topStart.i = alloca i64, align 8 ; <i64*> [#uses=0]
- %topEnd.i = alloca i64, align 8 ; <i64*> [#uses=0]
- %botStart.i = alloca i64, align 8 ; <i64*> [#uses=0]
- %botEnd.i = alloca i64, align 8 ; <i64*> [#uses=0]
- %c1.i154 = alloca i32, align 4 ; <i32*> [#uses=0]
- %b1.i155 = alloca i32, align 4 ; <i32*> [#uses=0]
- %t1.i156 = alloca i32, align 4 ; <i32*> [#uses=0]
- %c1.i = alloca i32, align 4 ; <i32*> [#uses=0]
- %b1.i = alloca i32, align 4 ; <i32*> [#uses=0]
- %t1.i = alloca i32, align 4 ; <i32*> [#uses=0]
- %netSelect.i5 = alloca i64, align 8 ; <i64*> [#uses=0]
- %netSelect.i = alloca i64, align 8 ; <i64*> [#uses=0]
- %tmp2.i = getelementptr i8** %argv, i32 1 ; <i8**> [#uses=1]
- %tmp3.i4 = load i8** %tmp2.i ; <i8*> [#uses=0]
- call void @fopen( )
- br i1 false, label %DimensionChannel.exit, label %bb.backedge.i
-
-bb.backedge.i: ; preds = %entry
- ret void
-
-DimensionChannel.exit: ; preds = %entry
- %tmp13.i137 = malloc i64, i32 0 ; <i64*> [#uses=1]
- %tmp610.i = malloc i64, i32 0 ; <i64*> [#uses=1]
- br label %cond_true.i143
-
-cond_true.i143: ; preds = %cond_true.i143, %DimensionChannel.exit
- %tmp9.i140 = getelementptr i64* %tmp13.i137, i64 0 ; <i64*> [#uses=0]
- %tmp12.i = getelementptr i64* %tmp610.i, i64 0 ; <i64*> [#uses=0]
- br i1 false, label %bb18.i144, label %cond_true.i143
-
-bb18.i144: ; preds = %cond_true.i143
- call void @fopen( )
- %tmp76.i105 = malloc i64, i32 0 ; <i64*> [#uses=3]
- %tmp674.i = malloc i64, i32 0 ; <i64*> [#uses=2]
- %tmp1072.i = malloc i64, i32 0 ; <i64*> [#uses=2]
- %tmp1470.i = malloc i64, i32 0 ; <i64*> [#uses=1]
- br label %cond_true.i114
-
-cond_true.i114: ; preds = %cond_true.i114, %bb18.i144
- %tmp17.i108 = getelementptr i64* %tmp76.i105, i64 0 ; <i64*> [#uses=0]
- %tmp20.i = getelementptr i64* %tmp674.i, i64 0 ; <i64*> [#uses=0]
- %tmp23.i111 = getelementptr i64* %tmp1470.i, i64 0 ; <i64*> [#uses=0]
- br i1 false, label %cond_true40.i, label %cond_true.i114
-
-cond_true40.i: ; preds = %cond_true40.i, %cond_true.i114
- %tmp33.i115 = getelementptr i64* %tmp1072.i, i64 0 ; <i64*> [#uses=0]
- br i1 false, label %bb142.i, label %cond_true40.i
-
-cond_next54.i: ; preds = %cond_true76.i
- %tmp57.i = getelementptr i64* %tmp55.i, i64 0 ; <i64*> [#uses=0]
- br i1 false, label %bb64.i, label %bb69.i
-
-bb64.i: ; preds = %cond_true76.i, %cond_next54.i
- %tmp67.i117 = getelementptr i64* %tmp76.i105, i64 0 ; <i64*> [#uses=0]
- br i1 false, label %bb114.i, label %cond_true111.i
-
-bb69.i: ; preds = %cond_next54.i
- br i1 false, label %bb79.i, label %cond_true76.i
-
-cond_true76.i: ; preds = %bb142.i, %bb69.i
- %tmp48.i = getelementptr i64* %tmp46.i, i64 0 ; <i64*> [#uses=0]
- br i1 false, label %bb64.i, label %cond_next54.i
-
-bb79.i: ; preds = %bb69.i
- br i1 false, label %bb114.i, label %cond_true111.i
-
-cond_true111.i: ; preds = %bb79.i, %bb64.i
- %tmp84.i127 = getelementptr i64* %tmp46.i, i64 0 ; <i64*> [#uses=0]
- ret void
-
-bb114.i: ; preds = %bb142.i, %bb79.i, %bb64.i
- %tmp117.i = getelementptr i64* %tmp76.i105, i64 0 ; <i64*> [#uses=0]
- %tmp132.i131 = getelementptr i64* %tmp674.i, i64 0 ; <i64*> [#uses=0]
- %tmp122.i = getelementptr i64* %tmp1072.i, i64 0 ; <i64*> [#uses=0]
- ret void
-
-bb142.i: ; preds = %cond_true40.i
- %tmp46.i = load i64** @BOT ; <i64*> [#uses=2]
- %tmp55.i = load i64** @TOP ; <i64*> [#uses=1]
- br i1 false, label %bb114.i, label %cond_true76.i
-}
Removed: llvm/branches/non-call-eh/test/Analysis/Dominators/2007-04-17-PostDominanceFrontier.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/Dominators/2007-04-17-PostDominanceFrontier.ll?rev=53162&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/Dominators/2007-04-17-PostDominanceFrontier.ll (original)
+++ llvm/branches/non-call-eh/test/Analysis/Dominators/2007-04-17-PostDominanceFrontier.ll (removed)
@@ -1,692 +0,0 @@
-; RUN: llvm-as < %s | opt -postdomfrontier -disable-output
-
-define void @SManager() {
-entry:
- br label %bb.outer
-
-bb.outer: ; preds = %bb193, %entry
- br label %bb.outer156
-
-bb.loopexit: ; preds = %bb442
- br label %bb.outer156
-
-bb.outer156: ; preds = %bb.loopexit, %bb.outer
- br label %bb
-
-bb: ; preds = %bb.backedge, %bb.outer156
- br i1 false, label %cond_true, label %bb.cond_next_crit_edge
-
-bb.cond_next_crit_edge: ; preds = %bb
- br label %cond_next
-
-cond_true: ; preds = %bb
- br label %cond_next
-
-cond_next: ; preds = %cond_true, %bb.cond_next_crit_edge
- br i1 false, label %cond_next.bb.backedge_crit_edge, label %cond_next107
-
-cond_next.bb.backedge_crit_edge: ; preds = %cond_next
- br label %bb.backedge
-
-bb.backedge: ; preds = %cond_true112.bb.backedge_crit_edge, %cond_next.bb.backedge_crit_edge
- br label %bb
-
-cond_next107: ; preds = %cond_next
- br i1 false, label %cond_true112, label %cond_next197
-
-cond_true112: ; preds = %cond_next107
- br i1 false, label %cond_true118, label %cond_true112.bb.backedge_crit_edge
-
-cond_true112.bb.backedge_crit_edge: ; preds = %cond_true112
- br label %bb.backedge
-
-cond_true118: ; preds = %cond_true112
- br i1 false, label %bb123.preheader, label %cond_true118.bb148_crit_edge
-
-cond_true118.bb148_crit_edge: ; preds = %cond_true118
- br label %bb148
-
-bb123.preheader: ; preds = %cond_true118
- br label %bb123
-
-bb123: ; preds = %bb142.bb123_crit_edge, %bb123.preheader
- br i1 false, label %bb123.bb142_crit_edge, label %cond_next.i57
-
-bb123.bb142_crit_edge: ; preds = %bb123
- br label %bb142
-
-cond_next.i57: ; preds = %bb123
- br i1 false, label %cond_true135, label %cond_next.i57.bb142_crit_edge
-
-cond_next.i57.bb142_crit_edge: ; preds = %cond_next.i57
- br label %bb142
-
-cond_true135: ; preds = %cond_next.i57
- br label %bb142
-
-bb142: ; preds = %cond_true135, %cond_next.i57.bb142_crit_edge, %bb123.bb142_crit_edge
- br i1 false, label %bb148.loopexit, label %bb142.bb123_crit_edge
-
-bb142.bb123_crit_edge: ; preds = %bb142
- br label %bb123
-
-bb148.loopexit: ; preds = %bb142
- br label %bb148
-
-bb148: ; preds = %bb148.loopexit, %cond_true118.bb148_crit_edge
- br i1 false, label %bb151.preheader, label %bb148.bb177_crit_edge
-
-bb148.bb177_crit_edge: ; preds = %bb148
- br label %bb177
-
-bb151.preheader: ; preds = %bb148
- br label %bb151
-
-bb151: ; preds = %bb171.bb151_crit_edge, %bb151.preheader
- br i1 false, label %bb151.bb171_crit_edge, label %cond_next.i49
-
-bb151.bb171_crit_edge: ; preds = %bb151
- br label %bb171
-
-cond_next.i49: ; preds = %bb151
- br i1 false, label %cond_true164, label %cond_next.i49.bb171_crit_edge
-
-cond_next.i49.bb171_crit_edge: ; preds = %cond_next.i49
- br label %bb171
-
-cond_true164: ; preds = %cond_next.i49
- br label %bb171
-
-bb171: ; preds = %cond_true164, %cond_next.i49.bb171_crit_edge, %bb151.bb171_crit_edge
- br i1 false, label %bb177.loopexit, label %bb171.bb151_crit_edge
-
-bb171.bb151_crit_edge: ; preds = %bb171
- br label %bb151
-
-bb177.loopexit: ; preds = %bb171
- br label %bb177
-
-bb177: ; preds = %bb177.loopexit, %bb148.bb177_crit_edge
- br i1 false, label %bb180.preheader, label %bb177.bb193_crit_edge
-
-bb177.bb193_crit_edge: ; preds = %bb177
- br label %bb193
-
-bb180.preheader: ; preds = %bb177
- br label %bb180
-
-bb180: ; preds = %bb180.bb180_crit_edge, %bb180.preheader
- br i1 false, label %bb193.loopexit, label %bb180.bb180_crit_edge
-
-bb180.bb180_crit_edge: ; preds = %bb180
- br label %bb180
-
-bb193.loopexit: ; preds = %bb180
- br label %bb193
-
-bb193: ; preds = %bb193.loopexit, %bb177.bb193_crit_edge
- br label %bb.outer
-
-cond_next197: ; preds = %cond_next107
- br i1 false, label %cond_next210, label %cond_true205
-
-cond_true205: ; preds = %cond_next197
- br i1 false, label %cond_true205.bb213_crit_edge, label %cond_true205.bb299_crit_edge
-
-cond_true205.bb299_crit_edge: ; preds = %cond_true205
- br label %bb299
-
-cond_true205.bb213_crit_edge: ; preds = %cond_true205
- br label %bb213
-
-cond_next210: ; preds = %cond_next197
- br label %bb293
-
-bb213: ; preds = %bb293.bb213_crit_edge, %cond_true205.bb213_crit_edge
- br i1 false, label %bb213.cond_next290_crit_edge, label %cond_true248
-
-bb213.cond_next290_crit_edge: ; preds = %bb213
- br label %cond_next290
-
-cond_true248: ; preds = %bb213
- br i1 false, label %cond_true248.cond_next290_crit_edge, label %cond_true255
-
-cond_true248.cond_next290_crit_edge: ; preds = %cond_true248
- br label %cond_next290
-
-cond_true255: ; preds = %cond_true248
- br i1 false, label %cond_true266, label %cond_true255.cond_next271_crit_edge
-
-cond_true255.cond_next271_crit_edge: ; preds = %cond_true255
- br label %cond_next271
-
-cond_true266: ; preds = %cond_true255
- br label %cond_next271
-
-cond_next271: ; preds = %cond_true266, %cond_true255.cond_next271_crit_edge
- br label %cond_next290
-
-cond_next290: ; preds = %cond_next271, %cond_true248.cond_next290_crit_edge, %bb213.cond_next290_crit_edge
- br label %bb293
-
-bb293: ; preds = %cond_next290, %cond_next210
- br i1 false, label %bb293.bb213_crit_edge, label %bb293.bb299_crit_edge
-
-bb293.bb299_crit_edge: ; preds = %bb293
- br label %bb299
-
-bb293.bb213_crit_edge: ; preds = %bb293
- br label %bb213
-
-bb299: ; preds = %bb293.bb299_crit_edge, %cond_true205.bb299_crit_edge
- br i1 false, label %bb302.preheader, label %bb299.bb390_crit_edge
-
-bb299.bb390_crit_edge: ; preds = %bb299
- br label %bb390
-
-bb302.preheader: ; preds = %bb299
- br label %bb302
-
-bb302: ; preds = %bb384.bb302_crit_edge, %bb302.preheader
- br i1 false, label %bb302.bb384_crit_edge, label %cond_true339
-
-bb302.bb384_crit_edge: ; preds = %bb302
- br label %bb384
-
-cond_true339: ; preds = %bb302
- br i1 false, label %cond_true339.bb384_crit_edge, label %cond_true346
-
-cond_true339.bb384_crit_edge: ; preds = %cond_true339
- br label %bb384
-
-cond_true346: ; preds = %cond_true339
- br i1 false, label %cond_true357, label %cond_true346.cond_next361_crit_edge
-
-cond_true346.cond_next361_crit_edge: ; preds = %cond_true346
- br label %cond_next361
-
-cond_true357: ; preds = %cond_true346
- br label %cond_next361
-
-cond_next361: ; preds = %cond_true357, %cond_true346.cond_next361_crit_edge
- br label %bb384
-
-bb384: ; preds = %cond_next361, %cond_true339.bb384_crit_edge, %bb302.bb384_crit_edge
- br i1 false, label %bb390.loopexit, label %bb384.bb302_crit_edge
-
-bb384.bb302_crit_edge: ; preds = %bb384
- br label %bb302
-
-bb390.loopexit: ; preds = %bb384
- br label %bb390
-
-bb390: ; preds = %bb390.loopexit, %bb299.bb390_crit_edge
- br i1 false, label %bb391.preheader, label %bb390.bb442.preheader_crit_edge
-
-bb390.bb442.preheader_crit_edge: ; preds = %bb390
- br label %bb442.preheader
-
-bb391.preheader: ; preds = %bb390
- br label %bb391
-
-bb391: ; preds = %bb413.bb391_crit_edge, %bb391.preheader
- br i1 false, label %bb391.bb413_crit_edge, label %cond_next404
-
-bb391.bb413_crit_edge: ; preds = %bb391
- br label %bb413
-
-cond_next404: ; preds = %bb391
- br i1 false, label %cond_next404.HWrite.exit_crit_edge, label %cond_next.i13
-
-cond_next404.HWrite.exit_crit_edge: ; preds = %cond_next404
- br label %HWrite.exit
-
-cond_next.i13: ; preds = %cond_next404
- br i1 false, label %cond_next.i13.cond_next13.i_crit_edge, label %cond_true12.i
-
-cond_next.i13.cond_next13.i_crit_edge: ; preds = %cond_next.i13
- br label %cond_next13.i
-
-cond_true12.i: ; preds = %cond_next.i13
- br label %cond_next13.i
-
-cond_next13.i: ; preds = %cond_true12.i, %cond_next.i13.cond_next13.i_crit_edge
- br i1 false, label %cond_next13.i.bb.i22_crit_edge, label %cond_next43.i
-
-cond_next13.i.bb.i22_crit_edge: ; preds = %cond_next13.i
- br label %bb.i22
-
-cond_next43.i: ; preds = %cond_next13.i
- br i1 false, label %cond_next43.i.bb.i22_crit_edge, label %bb60.i
-
-cond_next43.i.bb.i22_crit_edge: ; preds = %cond_next43.i
- br label %bb.i22
-
-bb.i22: ; preds = %cond_next43.i.bb.i22_crit_edge, %cond_next13.i.bb.i22_crit_edge
- br label %bb413
-
-bb60.i: ; preds = %cond_next43.i
- br i1 false, label %bb60.i.HWrite.exit_crit_edge, label %cond_true81.i
-
-bb60.i.HWrite.exit_crit_edge: ; preds = %bb60.i
- br label %HWrite.exit
-
-cond_true81.i: ; preds = %bb60.i
- br label %bb413
-
-HWrite.exit: ; preds = %bb60.i.HWrite.exit_crit_edge, %cond_next404.HWrite.exit_crit_edge
- br label %bb413
-
-bb413: ; preds = %HWrite.exit, %cond_true81.i, %bb.i22, %bb391.bb413_crit_edge
- br i1 false, label %bb442.preheader.loopexit, label %bb413.bb391_crit_edge
-
-bb413.bb391_crit_edge: ; preds = %bb413
- br label %bb391
-
-bb442.preheader.loopexit: ; preds = %bb413
- br label %bb442.preheader
-
-bb442.preheader: ; preds = %bb442.preheader.loopexit, %bb390.bb442.preheader_crit_edge
- br label %bb442.outer
-
-bb420: ; preds = %bb442
- br i1 false, label %bb439.loopexit, label %cond_next433
-
-cond_next433: ; preds = %bb420
- br i1 false, label %cond_next433.HRead.exit.loopexit_crit_edge, label %cond_next.i
-
-cond_next433.HRead.exit.loopexit_crit_edge: ; preds = %cond_next433
- br label %HRead.exit.loopexit
-
-cond_next.i: ; preds = %cond_next433
- br i1 false, label %cond_true9.i, label %cond_false223.i
-
-cond_true9.i: ; preds = %cond_next.i
- switch i32 0, label %cond_false.i [
- i32 1, label %cond_true9.i.cond_true15.i_crit_edge
- i32 5, label %cond_true9.i.cond_true15.i_crit_edge9
- ]
-
-cond_true9.i.cond_true15.i_crit_edge9: ; preds = %cond_true9.i
- br label %cond_true15.i
-
-cond_true9.i.cond_true15.i_crit_edge: ; preds = %cond_true9.i
- br label %cond_true15.i
-
-cond_true15.i: ; preds = %cond_true9.i.cond_true15.i_crit_edge, %cond_true9.i.cond_true15.i_crit_edge9
- br i1 false, label %cond_true15.i.cond_true44.i_crit_edge, label %cond_true15.i.cond_false49.i_crit_edge
-
-cond_true15.i.cond_false49.i_crit_edge: ; preds = %cond_true15.i
- br label %cond_false49.i
-
-cond_true15.i.cond_true44.i_crit_edge: ; preds = %cond_true15.i
- br label %cond_true44.i
-
-cond_false.i: ; preds = %cond_true9.i
- br i1 false, label %cond_false.i.cond_next39.i_crit_edge, label %cond_true30.i
-
-cond_false.i.cond_next39.i_crit_edge: ; preds = %cond_false.i
- br label %cond_next39.i
-
-cond_true30.i: ; preds = %cond_false.i
- br label %cond_next39.i
-
-cond_next39.i: ; preds = %cond_true30.i, %cond_false.i.cond_next39.i_crit_edge
- br i1 false, label %cond_next39.i.cond_true44.i_crit_edge, label %cond_next39.i.cond_false49.i_crit_edge
-
-cond_next39.i.cond_false49.i_crit_edge: ; preds = %cond_next39.i
- br label %cond_false49.i
-
-cond_next39.i.cond_true44.i_crit_edge: ; preds = %cond_next39.i
- br label %cond_true44.i
-
-cond_true44.i: ; preds = %cond_next39.i.cond_true44.i_crit_edge, %cond_true15.i.cond_true44.i_crit_edge
- br i1 false, label %cond_true44.i.cond_next70.i_crit_edge, label %cond_true44.i.cond_true61.i_crit_edge
-
-cond_true44.i.cond_true61.i_crit_edge: ; preds = %cond_true44.i
- br label %cond_true61.i
-
-cond_true44.i.cond_next70.i_crit_edge: ; preds = %cond_true44.i
- br label %cond_next70.i
-
-cond_false49.i: ; preds = %cond_next39.i.cond_false49.i_crit_edge, %cond_true15.i.cond_false49.i_crit_edge
- br i1 false, label %cond_false49.i.cond_next70.i_crit_edge, label %cond_false49.i.cond_true61.i_crit_edge
-
-cond_false49.i.cond_true61.i_crit_edge: ; preds = %cond_false49.i
- br label %cond_true61.i
-
-cond_false49.i.cond_next70.i_crit_edge: ; preds = %cond_false49.i
- br label %cond_next70.i
-
-cond_true61.i: ; preds = %cond_false49.i.cond_true61.i_crit_edge, %cond_true44.i.cond_true61.i_crit_edge
- br i1 false, label %cond_true61.i.cond_next70.i_crit_edge, label %cond_true67.i
-
-cond_true61.i.cond_next70.i_crit_edge: ; preds = %cond_true61.i
- br label %cond_next70.i
-
-cond_true67.i: ; preds = %cond_true61.i
- br label %cond_next70.i
-
-cond_next70.i: ; preds = %cond_true67.i, %cond_true61.i.cond_next70.i_crit_edge, %cond_false49.i.cond_next70.i_crit_edge, %cond_true44.i.cond_next70.i_crit_edge
- br i1 false, label %cond_true77.i, label %cond_next81.i
-
-cond_true77.i: ; preds = %cond_next70.i
- br label %bb442.outer.backedge
-
-cond_next81.i: ; preds = %cond_next70.i
- br i1 false, label %cond_true87.i, label %cond_false94.i
-
-cond_true87.i: ; preds = %cond_next81.i
- br i1 false, label %cond_true87.i.cond_true130.i_crit_edge, label %cond_true87.i.cond_next135.i_crit_edge
-
-cond_true87.i.cond_next135.i_crit_edge: ; preds = %cond_true87.i
- br label %cond_next135.i
-
-cond_true87.i.cond_true130.i_crit_edge: ; preds = %cond_true87.i
- br label %cond_true130.i
-
-cond_false94.i: ; preds = %cond_next81.i
- switch i32 0, label %cond_false94.i.cond_next125.i_crit_edge [
- i32 1, label %cond_false94.i.cond_true100.i_crit_edge
- i32 5, label %cond_false94.i.cond_true100.i_crit_edge10
- ]
-
-cond_false94.i.cond_true100.i_crit_edge10: ; preds = %cond_false94.i
- br label %cond_true100.i
-
-cond_false94.i.cond_true100.i_crit_edge: ; preds = %cond_false94.i
- br label %cond_true100.i
-
-cond_false94.i.cond_next125.i_crit_edge: ; preds = %cond_false94.i
- br label %cond_next125.i
-
-cond_true100.i: ; preds = %cond_false94.i.cond_true100.i_crit_edge, %cond_false94.i.cond_true100.i_crit_edge10
- br i1 false, label %cond_true107.i, label %cond_true100.i.cond_next109.i_crit_edge
-
-cond_true100.i.cond_next109.i_crit_edge: ; preds = %cond_true100.i
- br label %cond_next109.i
-
-cond_true107.i: ; preds = %cond_true100.i
- br label %cond_next109.i
-
-cond_next109.i: ; preds = %cond_true107.i, %cond_true100.i.cond_next109.i_crit_edge
- br i1 false, label %cond_next109.i.cond_next125.i_crit_edge, label %cond_true116.i
-
-cond_next109.i.cond_next125.i_crit_edge: ; preds = %cond_next109.i
- br label %cond_next125.i
-
-cond_true116.i: ; preds = %cond_next109.i
- br label %cond_next125.i
-
-cond_next125.i: ; preds = %cond_true116.i, %cond_next109.i.cond_next125.i_crit_edge, %cond_false94.i.cond_next125.i_crit_edge
- br i1 false, label %cond_next125.i.cond_true130.i_crit_edge, label %cond_next125.i.cond_next135.i_crit_edge
-
-cond_next125.i.cond_next135.i_crit_edge: ; preds = %cond_next125.i
- br label %cond_next135.i
-
-cond_next125.i.cond_true130.i_crit_edge: ; preds = %cond_next125.i
- br label %cond_true130.i
-
-cond_true130.i: ; preds = %cond_next125.i.cond_true130.i_crit_edge, %cond_true87.i.cond_true130.i_crit_edge
- br label %cond_next135.i
-
-cond_next135.i: ; preds = %cond_true130.i, %cond_next125.i.cond_next135.i_crit_edge, %cond_true87.i.cond_next135.i_crit_edge
- br i1 false, label %cond_true142.i, label %cond_next135.i.cond_next149.i_crit_edge
-
-cond_next135.i.cond_next149.i_crit_edge: ; preds = %cond_next135.i
- br label %cond_next149.i
-
-cond_true142.i: ; preds = %cond_next135.i
- br label %cond_next149.i
-
-cond_next149.i: ; preds = %cond_true142.i, %cond_next135.i.cond_next149.i_crit_edge
- br i1 false, label %cond_true156.i, label %cond_next149.i.cond_next163.i_crit_edge
-
-cond_next149.i.cond_next163.i_crit_edge: ; preds = %cond_next149.i
- br label %cond_next163.i
-
-cond_true156.i: ; preds = %cond_next149.i
- br label %cond_next163.i
-
-cond_next163.i: ; preds = %cond_true156.i, %cond_next149.i.cond_next163.i_crit_edge
- br i1 false, label %cond_true182.i, label %cond_next163.i.cond_next380.i_crit_edge
-
-cond_next163.i.cond_next380.i_crit_edge: ; preds = %cond_next163.i
- br label %cond_next380.i
-
-cond_true182.i: ; preds = %cond_next163.i
- br i1 false, label %cond_true182.i.cond_next380.i_crit_edge, label %cond_true196.i
-
-cond_true182.i.cond_next380.i_crit_edge: ; preds = %cond_true182.i
- br label %cond_next380.i
-
-cond_true196.i: ; preds = %cond_true182.i
- br i1 false, label %cond_true210.i, label %cond_true196.i.cond_next380.i_crit_edge
-
-cond_true196.i.cond_next380.i_crit_edge: ; preds = %cond_true196.i
- br label %cond_next380.i
-
-cond_true210.i: ; preds = %cond_true196.i
- br i1 false, label %cond_true216.i, label %cond_true210.i.cond_next380.i_crit_edge
-
-cond_true210.i.cond_next380.i_crit_edge: ; preds = %cond_true210.i
- br label %cond_next380.i
-
-cond_true216.i: ; preds = %cond_true210.i
- br label %cond_next380.i
-
-cond_false223.i: ; preds = %cond_next.i
- br i1 false, label %cond_true229.i, label %cond_false355.i
-
-cond_true229.i: ; preds = %cond_false223.i
- br i1 false, label %cond_true229.i.HRead.exit.loopexit_crit_edge, label %cond_next243.i
-
-cond_true229.i.HRead.exit.loopexit_crit_edge: ; preds = %cond_true229.i
- br label %HRead.exit.loopexit
-
-cond_next243.i: ; preds = %cond_true229.i
- br i1 false, label %cond_true248.i, label %cond_false255.i
-
-cond_true248.i: ; preds = %cond_next243.i
- br label %cond_next260.i
-
-cond_false255.i: ; preds = %cond_next243.i
- br label %cond_next260.i
-
-cond_next260.i: ; preds = %cond_false255.i, %cond_true248.i
- br i1 false, label %cond_true267.i, label %cond_next273.i
-
-cond_true267.i: ; preds = %cond_next260.i
- br label %bb442.backedge
-
-bb442.backedge: ; preds = %bb.i, %cond_true267.i
- br label %bb442
-
-cond_next273.i: ; preds = %cond_next260.i
- br i1 false, label %cond_true281.i, label %cond_next273.i.cond_next288.i_crit_edge
-
-cond_next273.i.cond_next288.i_crit_edge: ; preds = %cond_next273.i
- br label %cond_next288.i
-
-cond_true281.i: ; preds = %cond_next273.i
- br label %cond_next288.i
-
-cond_next288.i: ; preds = %cond_true281.i, %cond_next273.i.cond_next288.i_crit_edge
- br i1 false, label %cond_true295.i, label %cond_next288.i.cond_next302.i_crit_edge
-
-cond_next288.i.cond_next302.i_crit_edge: ; preds = %cond_next288.i
- br label %cond_next302.i
-
-cond_true295.i: ; preds = %cond_next288.i
- br label %cond_next302.i
-
-cond_next302.i: ; preds = %cond_true295.i, %cond_next288.i.cond_next302.i_crit_edge
- br i1 false, label %cond_next302.i.cond_next380.i_crit_edge, label %cond_true328.i
-
-cond_next302.i.cond_next380.i_crit_edge: ; preds = %cond_next302.i
- br label %cond_next380.i
-
-cond_true328.i: ; preds = %cond_next302.i
- br i1 false, label %cond_true343.i, label %cond_true328.i.cond_next380.i_crit_edge
-
-cond_true328.i.cond_next380.i_crit_edge: ; preds = %cond_true328.i
- br label %cond_next380.i
-
-cond_true343.i: ; preds = %cond_true328.i
- br i1 false, label %cond_true349.i, label %cond_true343.i.cond_next380.i_crit_edge
-
-cond_true343.i.cond_next380.i_crit_edge: ; preds = %cond_true343.i
- br label %cond_next380.i
-
-cond_true349.i: ; preds = %cond_true343.i
- br label %cond_next380.i
-
-cond_false355.i: ; preds = %cond_false223.i
- br i1 false, label %cond_false355.i.bb.i_crit_edge, label %cond_next363.i
-
-cond_false355.i.bb.i_crit_edge: ; preds = %cond_false355.i
- br label %bb.i
-
-cond_next363.i: ; preds = %cond_false355.i
- br i1 false, label %bb377.i, label %cond_next363.i.bb.i_crit_edge
-
-cond_next363.i.bb.i_crit_edge: ; preds = %cond_next363.i
- br label %bb.i
-
-bb.i: ; preds = %cond_next363.i.bb.i_crit_edge, %cond_false355.i.bb.i_crit_edge
- br label %bb442.backedge
-
-bb377.i: ; preds = %cond_next363.i
- br label %cond_next380.i
-
-cond_next380.i: ; preds = %bb377.i, %cond_true349.i, %cond_true343.i.cond_next380.i_crit_edge, %cond_true328.i.cond_next380.i_crit_edge, %cond_next302.i.cond_next380.i_crit_edge, %cond_true216.i, %cond_true210.i.cond_next380.i_crit_edge, %cond_true196.i.cond_next380.i_crit_edge, %cond_true182.i.cond_next380.i_crit_edge, %cond_next163.i.cond_next380.i_crit_edge
- br i1 false, label %cond_next380.i.HRead.exit_crit_edge, label %cond_true391.i
-
-cond_next380.i.HRead.exit_crit_edge: ; preds = %cond_next380.i
- br label %HRead.exit
-
-cond_true391.i: ; preds = %cond_next380.i
- br label %bb442.outer.backedge
-
-bb442.outer.backedge: ; preds = %bb439, %cond_true391.i, %cond_true77.i
- br label %bb442.outer
-
-HRead.exit.loopexit: ; preds = %cond_true229.i.HRead.exit.loopexit_crit_edge, %cond_next433.HRead.exit.loopexit_crit_edge
- br label %HRead.exit
-
-HRead.exit: ; preds = %HRead.exit.loopexit, %cond_next380.i.HRead.exit_crit_edge
- br label %bb439
-
-bb439.loopexit: ; preds = %bb420
- br label %bb439
-
-bb439: ; preds = %bb439.loopexit, %HRead.exit
- br label %bb442.outer.backedge
-
-bb442.outer: ; preds = %bb442.outer.backedge, %bb442.preheader
- br label %bb442
-
-bb442: ; preds = %bb442.outer, %bb442.backedge
- br i1 false, label %bb420, label %bb.loopexit
-}
-
-define void @Invalidate() {
-entry:
- br i1 false, label %cond_false, label %cond_true
-
-cond_true: ; preds = %entry
- br i1 false, label %cond_true40, label %cond_true.cond_next_crit_edge
-
-cond_true.cond_next_crit_edge: ; preds = %cond_true
- br label %cond_next
-
-cond_true40: ; preds = %cond_true
- br label %cond_next
-
-cond_next: ; preds = %cond_true40, %cond_true.cond_next_crit_edge
- br i1 false, label %cond_true68, label %cond_next.cond_next73_crit_edge
-
-cond_next.cond_next73_crit_edge: ; preds = %cond_next
- br label %cond_next73
-
-cond_true68: ; preds = %cond_next
- br label %cond_next73
-
-cond_next73: ; preds = %cond_true68, %cond_next.cond_next73_crit_edge
- br i1 false, label %cond_true91, label %cond_next73.cond_next96_crit_edge
-
-cond_next73.cond_next96_crit_edge: ; preds = %cond_next73
- br label %cond_next96
-
-cond_true91: ; preds = %cond_next73
- br label %cond_next96
-
-cond_next96: ; preds = %cond_true91, %cond_next73.cond_next96_crit_edge
- br i1 false, label %cond_next96.cond_next112_crit_edge, label %cond_true105
-
-cond_next96.cond_next112_crit_edge: ; preds = %cond_next96
- br label %cond_next112
-
-cond_true105: ; preds = %cond_next96
- br label %cond_next112
-
-cond_next112: ; preds = %cond_true105, %cond_next96.cond_next112_crit_edge
- br i1 false, label %cond_next112.cond_next127_crit_edge, label %cond_true119
-
-cond_next112.cond_next127_crit_edge: ; preds = %cond_next112
- br label %cond_next127
-
-cond_true119: ; preds = %cond_next112
- br label %cond_next127
-
-cond_next127: ; preds = %cond_true119, %cond_next112.cond_next127_crit_edge
- br i1 false, label %cond_next141, label %cond_true134
-
-cond_true134: ; preds = %cond_next127
- br i1 false, label %cond_true134.bb161_crit_edge, label %cond_true134.bb_crit_edge
-
-cond_true134.bb_crit_edge: ; preds = %cond_true134
- br label %bb
-
-cond_true134.bb161_crit_edge: ; preds = %cond_true134
- br label %bb161
-
-cond_next141: ; preds = %cond_next127
- br label %bb154
-
-bb: ; preds = %bb154.bb_crit_edge, %cond_true134.bb_crit_edge
- br label %bb154
-
-bb154: ; preds = %bb, %cond_next141
- br i1 false, label %bb154.bb161_crit_edge, label %bb154.bb_crit_edge
-
-bb154.bb_crit_edge: ; preds = %bb154
- br label %bb
-
-bb154.bb161_crit_edge: ; preds = %bb154
- br label %bb161
-
-bb161: ; preds = %bb154.bb161_crit_edge, %cond_true134.bb161_crit_edge
- br i1 false, label %bb161.cond_next201_crit_edge, label %cond_true198
-
-bb161.cond_next201_crit_edge: ; preds = %bb161
- br label %cond_next201
-
-cond_true198: ; preds = %bb161
- br label %cond_next201
-
-cond_next201: ; preds = %cond_true198, %bb161.cond_next201_crit_edge
- br i1 false, label %cond_next212, label %cond_true206
-
-cond_true206: ; preds = %cond_next201
- br label %UnifiedReturnBlock
-
-cond_false: ; preds = %entry
- br label %UnifiedReturnBlock
-
-cond_next212: ; preds = %cond_next201
- br label %UnifiedReturnBlock
-
-UnifiedReturnBlock: ; preds = %cond_next212, %cond_false, %cond_true206
- ret void
-}
Removed: llvm/branches/non-call-eh/test/Analysis/Dominators/2007-04-20-PostDom-Reset.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/Dominators/2007-04-20-PostDom-Reset.ll?rev=53162&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/Dominators/2007-04-20-PostDom-Reset.ll (original)
+++ llvm/branches/non-call-eh/test/Analysis/Dominators/2007-04-20-PostDom-Reset.ll (removed)
@@ -1,28 +0,0 @@
-; RUN: llvm-as < %s | opt -postdomfrontier -disable-output
-
-define void @args_out_of_range() {
-entry:
- br label %bb
-
-bb: ; preds = %bb, %entry
- br label %bb
-}
-
-define void @args_out_of_range_3() {
-entry:
- br label %bb
-
-bb: ; preds = %bb, %entry
- br label %bb
-}
-
-define void @Feq() {
-entry:
- br i1 false, label %cond_true, label %cond_next
-
-cond_true: ; preds = %entry
- unreachable
-
-cond_next: ; preds = %entry
- unreachable
-}
Modified: llvm/branches/non-call-eh/test/Analysis/Dominators/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/Dominators/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/Dominators/dg.exp (original)
+++ llvm/branches/non-call-eh/test/Analysis/Dominators/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Modified: llvm/branches/non-call-eh/test/Analysis/GlobalsModRef/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/GlobalsModRef/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/GlobalsModRef/dg.exp (original)
+++ llvm/branches/non-call-eh/test/Analysis/GlobalsModRef/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Modified: llvm/branches/non-call-eh/test/Analysis/LoadVN/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/LoadVN/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/LoadVN/dg.exp (original)
+++ llvm/branches/non-call-eh/test/Analysis/LoadVN/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Modified: llvm/branches/non-call-eh/test/Analysis/LoopInfo/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/LoopInfo/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/LoopInfo/dg.exp (original)
+++ llvm/branches/non-call-eh/test/Analysis/LoopInfo/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Propchange: llvm/branches/non-call-eh/test/Analysis/PostDominators/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Jul 6 15:45:41 2008
@@ -0,0 +1 @@
+Output
Added: llvm/branches/non-call-eh/test/Analysis/PostDominators/2006-09-26-PostDominanceFrontier.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/PostDominators/2006-09-26-PostDominanceFrontier.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/PostDominators/2006-09-26-PostDominanceFrontier.ll (added)
+++ llvm/branches/non-call-eh/test/Analysis/PostDominators/2006-09-26-PostDominanceFrontier.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,97 @@
+; RUN: llvm-as < %s | opt -analyze -postdomfrontier \
+; RUN: -disable-verify
+; ModuleID = '2006-09-26-PostDominanceFrontier.bc'
+target datalayout = "e-p:64:64"
+target triple = "alphaev67-unknown-linux-gnu"
+ %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i32, [44 x i8] }
+ %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 }
+ at TOP = external global i64* ; <i64**> [#uses=1]
+ at BOT = external global i64* ; <i64**> [#uses=1]
+ at str = external global [2 x i8] ; <[2 x i8]*> [#uses=0]
+
+declare void @fopen()
+
+define void @main(i8** %argv) {
+entry:
+ %netSelect.i507 = alloca i64, align 8 ; <i64*> [#uses=0]
+ %topStart.i = alloca i64, align 8 ; <i64*> [#uses=0]
+ %topEnd.i = alloca i64, align 8 ; <i64*> [#uses=0]
+ %botStart.i = alloca i64, align 8 ; <i64*> [#uses=0]
+ %botEnd.i = alloca i64, align 8 ; <i64*> [#uses=0]
+ %c1.i154 = alloca i32, align 4 ; <i32*> [#uses=0]
+ %b1.i155 = alloca i32, align 4 ; <i32*> [#uses=0]
+ %t1.i156 = alloca i32, align 4 ; <i32*> [#uses=0]
+ %c1.i = alloca i32, align 4 ; <i32*> [#uses=0]
+ %b1.i = alloca i32, align 4 ; <i32*> [#uses=0]
+ %t1.i = alloca i32, align 4 ; <i32*> [#uses=0]
+ %netSelect.i5 = alloca i64, align 8 ; <i64*> [#uses=0]
+ %netSelect.i = alloca i64, align 8 ; <i64*> [#uses=0]
+ %tmp2.i = getelementptr i8** %argv, i32 1 ; <i8**> [#uses=1]
+ %tmp3.i4 = load i8** %tmp2.i ; <i8*> [#uses=0]
+ call void @fopen( )
+ br i1 false, label %DimensionChannel.exit, label %bb.backedge.i
+
+bb.backedge.i: ; preds = %entry
+ ret void
+
+DimensionChannel.exit: ; preds = %entry
+ %tmp13.i137 = malloc i64, i32 0 ; <i64*> [#uses=1]
+ %tmp610.i = malloc i64, i32 0 ; <i64*> [#uses=1]
+ br label %cond_true.i143
+
+cond_true.i143: ; preds = %cond_true.i143, %DimensionChannel.exit
+ %tmp9.i140 = getelementptr i64* %tmp13.i137, i64 0 ; <i64*> [#uses=0]
+ %tmp12.i = getelementptr i64* %tmp610.i, i64 0 ; <i64*> [#uses=0]
+ br i1 false, label %bb18.i144, label %cond_true.i143
+
+bb18.i144: ; preds = %cond_true.i143
+ call void @fopen( )
+ %tmp76.i105 = malloc i64, i32 0 ; <i64*> [#uses=3]
+ %tmp674.i = malloc i64, i32 0 ; <i64*> [#uses=2]
+ %tmp1072.i = malloc i64, i32 0 ; <i64*> [#uses=2]
+ %tmp1470.i = malloc i64, i32 0 ; <i64*> [#uses=1]
+ br label %cond_true.i114
+
+cond_true.i114: ; preds = %cond_true.i114, %bb18.i144
+ %tmp17.i108 = getelementptr i64* %tmp76.i105, i64 0 ; <i64*> [#uses=0]
+ %tmp20.i = getelementptr i64* %tmp674.i, i64 0 ; <i64*> [#uses=0]
+ %tmp23.i111 = getelementptr i64* %tmp1470.i, i64 0 ; <i64*> [#uses=0]
+ br i1 false, label %cond_true40.i, label %cond_true.i114
+
+cond_true40.i: ; preds = %cond_true40.i, %cond_true.i114
+ %tmp33.i115 = getelementptr i64* %tmp1072.i, i64 0 ; <i64*> [#uses=0]
+ br i1 false, label %bb142.i, label %cond_true40.i
+
+cond_next54.i: ; preds = %cond_true76.i
+ %tmp57.i = getelementptr i64* %tmp55.i, i64 0 ; <i64*> [#uses=0]
+ br i1 false, label %bb64.i, label %bb69.i
+
+bb64.i: ; preds = %cond_true76.i, %cond_next54.i
+ %tmp67.i117 = getelementptr i64* %tmp76.i105, i64 0 ; <i64*> [#uses=0]
+ br i1 false, label %bb114.i, label %cond_true111.i
+
+bb69.i: ; preds = %cond_next54.i
+ br i1 false, label %bb79.i, label %cond_true76.i
+
+cond_true76.i: ; preds = %bb142.i, %bb69.i
+ %tmp48.i = getelementptr i64* %tmp46.i, i64 0 ; <i64*> [#uses=0]
+ br i1 false, label %bb64.i, label %cond_next54.i
+
+bb79.i: ; preds = %bb69.i
+ br i1 false, label %bb114.i, label %cond_true111.i
+
+cond_true111.i: ; preds = %bb79.i, %bb64.i
+ %tmp84.i127 = getelementptr i64* %tmp46.i, i64 0 ; <i64*> [#uses=0]
+ ret void
+
+bb114.i: ; preds = %bb142.i, %bb79.i, %bb64.i
+ %tmp117.i = getelementptr i64* %tmp76.i105, i64 0 ; <i64*> [#uses=0]
+ %tmp132.i131 = getelementptr i64* %tmp674.i, i64 0 ; <i64*> [#uses=0]
+ %tmp122.i = getelementptr i64* %tmp1072.i, i64 0 ; <i64*> [#uses=0]
+ ret void
+
+bb142.i: ; preds = %cond_true40.i
+ %tmp46.i = load i64** @BOT ; <i64*> [#uses=2]
+ %tmp55.i = load i64** @TOP ; <i64*> [#uses=1]
+ br i1 false, label %bb114.i, label %cond_true76.i
+}
Added: llvm/branches/non-call-eh/test/Analysis/PostDominators/2007-04-17-PostDominanceFrontier.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/PostDominators/2007-04-17-PostDominanceFrontier.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/PostDominators/2007-04-17-PostDominanceFrontier.ll (added)
+++ llvm/branches/non-call-eh/test/Analysis/PostDominators/2007-04-17-PostDominanceFrontier.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,692 @@
+; RUN: llvm-as < %s | opt -postdomfrontier -disable-output
+
+define void @SManager() {
+entry:
+ br label %bb.outer
+
+bb.outer: ; preds = %bb193, %entry
+ br label %bb.outer156
+
+bb.loopexit: ; preds = %bb442
+ br label %bb.outer156
+
+bb.outer156: ; preds = %bb.loopexit, %bb.outer
+ br label %bb
+
+bb: ; preds = %bb.backedge, %bb.outer156
+ br i1 false, label %cond_true, label %bb.cond_next_crit_edge
+
+bb.cond_next_crit_edge: ; preds = %bb
+ br label %cond_next
+
+cond_true: ; preds = %bb
+ br label %cond_next
+
+cond_next: ; preds = %cond_true, %bb.cond_next_crit_edge
+ br i1 false, label %cond_next.bb.backedge_crit_edge, label %cond_next107
+
+cond_next.bb.backedge_crit_edge: ; preds = %cond_next
+ br label %bb.backedge
+
+bb.backedge: ; preds = %cond_true112.bb.backedge_crit_edge, %cond_next.bb.backedge_crit_edge
+ br label %bb
+
+cond_next107: ; preds = %cond_next
+ br i1 false, label %cond_true112, label %cond_next197
+
+cond_true112: ; preds = %cond_next107
+ br i1 false, label %cond_true118, label %cond_true112.bb.backedge_crit_edge
+
+cond_true112.bb.backedge_crit_edge: ; preds = %cond_true112
+ br label %bb.backedge
+
+cond_true118: ; preds = %cond_true112
+ br i1 false, label %bb123.preheader, label %cond_true118.bb148_crit_edge
+
+cond_true118.bb148_crit_edge: ; preds = %cond_true118
+ br label %bb148
+
+bb123.preheader: ; preds = %cond_true118
+ br label %bb123
+
+bb123: ; preds = %bb142.bb123_crit_edge, %bb123.preheader
+ br i1 false, label %bb123.bb142_crit_edge, label %cond_next.i57
+
+bb123.bb142_crit_edge: ; preds = %bb123
+ br label %bb142
+
+cond_next.i57: ; preds = %bb123
+ br i1 false, label %cond_true135, label %cond_next.i57.bb142_crit_edge
+
+cond_next.i57.bb142_crit_edge: ; preds = %cond_next.i57
+ br label %bb142
+
+cond_true135: ; preds = %cond_next.i57
+ br label %bb142
+
+bb142: ; preds = %cond_true135, %cond_next.i57.bb142_crit_edge, %bb123.bb142_crit_edge
+ br i1 false, label %bb148.loopexit, label %bb142.bb123_crit_edge
+
+bb142.bb123_crit_edge: ; preds = %bb142
+ br label %bb123
+
+bb148.loopexit: ; preds = %bb142
+ br label %bb148
+
+bb148: ; preds = %bb148.loopexit, %cond_true118.bb148_crit_edge
+ br i1 false, label %bb151.preheader, label %bb148.bb177_crit_edge
+
+bb148.bb177_crit_edge: ; preds = %bb148
+ br label %bb177
+
+bb151.preheader: ; preds = %bb148
+ br label %bb151
+
+bb151: ; preds = %bb171.bb151_crit_edge, %bb151.preheader
+ br i1 false, label %bb151.bb171_crit_edge, label %cond_next.i49
+
+bb151.bb171_crit_edge: ; preds = %bb151
+ br label %bb171
+
+cond_next.i49: ; preds = %bb151
+ br i1 false, label %cond_true164, label %cond_next.i49.bb171_crit_edge
+
+cond_next.i49.bb171_crit_edge: ; preds = %cond_next.i49
+ br label %bb171
+
+cond_true164: ; preds = %cond_next.i49
+ br label %bb171
+
+bb171: ; preds = %cond_true164, %cond_next.i49.bb171_crit_edge, %bb151.bb171_crit_edge
+ br i1 false, label %bb177.loopexit, label %bb171.bb151_crit_edge
+
+bb171.bb151_crit_edge: ; preds = %bb171
+ br label %bb151
+
+bb177.loopexit: ; preds = %bb171
+ br label %bb177
+
+bb177: ; preds = %bb177.loopexit, %bb148.bb177_crit_edge
+ br i1 false, label %bb180.preheader, label %bb177.bb193_crit_edge
+
+bb177.bb193_crit_edge: ; preds = %bb177
+ br label %bb193
+
+bb180.preheader: ; preds = %bb177
+ br label %bb180
+
+bb180: ; preds = %bb180.bb180_crit_edge, %bb180.preheader
+ br i1 false, label %bb193.loopexit, label %bb180.bb180_crit_edge
+
+bb180.bb180_crit_edge: ; preds = %bb180
+ br label %bb180
+
+bb193.loopexit: ; preds = %bb180
+ br label %bb193
+
+bb193: ; preds = %bb193.loopexit, %bb177.bb193_crit_edge
+ br label %bb.outer
+
+cond_next197: ; preds = %cond_next107
+ br i1 false, label %cond_next210, label %cond_true205
+
+cond_true205: ; preds = %cond_next197
+ br i1 false, label %cond_true205.bb213_crit_edge, label %cond_true205.bb299_crit_edge
+
+cond_true205.bb299_crit_edge: ; preds = %cond_true205
+ br label %bb299
+
+cond_true205.bb213_crit_edge: ; preds = %cond_true205
+ br label %bb213
+
+cond_next210: ; preds = %cond_next197
+ br label %bb293
+
+bb213: ; preds = %bb293.bb213_crit_edge, %cond_true205.bb213_crit_edge
+ br i1 false, label %bb213.cond_next290_crit_edge, label %cond_true248
+
+bb213.cond_next290_crit_edge: ; preds = %bb213
+ br label %cond_next290
+
+cond_true248: ; preds = %bb213
+ br i1 false, label %cond_true248.cond_next290_crit_edge, label %cond_true255
+
+cond_true248.cond_next290_crit_edge: ; preds = %cond_true248
+ br label %cond_next290
+
+cond_true255: ; preds = %cond_true248
+ br i1 false, label %cond_true266, label %cond_true255.cond_next271_crit_edge
+
+cond_true255.cond_next271_crit_edge: ; preds = %cond_true255
+ br label %cond_next271
+
+cond_true266: ; preds = %cond_true255
+ br label %cond_next271
+
+cond_next271: ; preds = %cond_true266, %cond_true255.cond_next271_crit_edge
+ br label %cond_next290
+
+cond_next290: ; preds = %cond_next271, %cond_true248.cond_next290_crit_edge, %bb213.cond_next290_crit_edge
+ br label %bb293
+
+bb293: ; preds = %cond_next290, %cond_next210
+ br i1 false, label %bb293.bb213_crit_edge, label %bb293.bb299_crit_edge
+
+bb293.bb299_crit_edge: ; preds = %bb293
+ br label %bb299
+
+bb293.bb213_crit_edge: ; preds = %bb293
+ br label %bb213
+
+bb299: ; preds = %bb293.bb299_crit_edge, %cond_true205.bb299_crit_edge
+ br i1 false, label %bb302.preheader, label %bb299.bb390_crit_edge
+
+bb299.bb390_crit_edge: ; preds = %bb299
+ br label %bb390
+
+bb302.preheader: ; preds = %bb299
+ br label %bb302
+
+bb302: ; preds = %bb384.bb302_crit_edge, %bb302.preheader
+ br i1 false, label %bb302.bb384_crit_edge, label %cond_true339
+
+bb302.bb384_crit_edge: ; preds = %bb302
+ br label %bb384
+
+cond_true339: ; preds = %bb302
+ br i1 false, label %cond_true339.bb384_crit_edge, label %cond_true346
+
+cond_true339.bb384_crit_edge: ; preds = %cond_true339
+ br label %bb384
+
+cond_true346: ; preds = %cond_true339
+ br i1 false, label %cond_true357, label %cond_true346.cond_next361_crit_edge
+
+cond_true346.cond_next361_crit_edge: ; preds = %cond_true346
+ br label %cond_next361
+
+cond_true357: ; preds = %cond_true346
+ br label %cond_next361
+
+cond_next361: ; preds = %cond_true357, %cond_true346.cond_next361_crit_edge
+ br label %bb384
+
+bb384: ; preds = %cond_next361, %cond_true339.bb384_crit_edge, %bb302.bb384_crit_edge
+ br i1 false, label %bb390.loopexit, label %bb384.bb302_crit_edge
+
+bb384.bb302_crit_edge: ; preds = %bb384
+ br label %bb302
+
+bb390.loopexit: ; preds = %bb384
+ br label %bb390
+
+bb390: ; preds = %bb390.loopexit, %bb299.bb390_crit_edge
+ br i1 false, label %bb391.preheader, label %bb390.bb442.preheader_crit_edge
+
+bb390.bb442.preheader_crit_edge: ; preds = %bb390
+ br label %bb442.preheader
+
+bb391.preheader: ; preds = %bb390
+ br label %bb391
+
+bb391: ; preds = %bb413.bb391_crit_edge, %bb391.preheader
+ br i1 false, label %bb391.bb413_crit_edge, label %cond_next404
+
+bb391.bb413_crit_edge: ; preds = %bb391
+ br label %bb413
+
+cond_next404: ; preds = %bb391
+ br i1 false, label %cond_next404.HWrite.exit_crit_edge, label %cond_next.i13
+
+cond_next404.HWrite.exit_crit_edge: ; preds = %cond_next404
+ br label %HWrite.exit
+
+cond_next.i13: ; preds = %cond_next404
+ br i1 false, label %cond_next.i13.cond_next13.i_crit_edge, label %cond_true12.i
+
+cond_next.i13.cond_next13.i_crit_edge: ; preds = %cond_next.i13
+ br label %cond_next13.i
+
+cond_true12.i: ; preds = %cond_next.i13
+ br label %cond_next13.i
+
+cond_next13.i: ; preds = %cond_true12.i, %cond_next.i13.cond_next13.i_crit_edge
+ br i1 false, label %cond_next13.i.bb.i22_crit_edge, label %cond_next43.i
+
+cond_next13.i.bb.i22_crit_edge: ; preds = %cond_next13.i
+ br label %bb.i22
+
+cond_next43.i: ; preds = %cond_next13.i
+ br i1 false, label %cond_next43.i.bb.i22_crit_edge, label %bb60.i
+
+cond_next43.i.bb.i22_crit_edge: ; preds = %cond_next43.i
+ br label %bb.i22
+
+bb.i22: ; preds = %cond_next43.i.bb.i22_crit_edge, %cond_next13.i.bb.i22_crit_edge
+ br label %bb413
+
+bb60.i: ; preds = %cond_next43.i
+ br i1 false, label %bb60.i.HWrite.exit_crit_edge, label %cond_true81.i
+
+bb60.i.HWrite.exit_crit_edge: ; preds = %bb60.i
+ br label %HWrite.exit
+
+cond_true81.i: ; preds = %bb60.i
+ br label %bb413
+
+HWrite.exit: ; preds = %bb60.i.HWrite.exit_crit_edge, %cond_next404.HWrite.exit_crit_edge
+ br label %bb413
+
+bb413: ; preds = %HWrite.exit, %cond_true81.i, %bb.i22, %bb391.bb413_crit_edge
+ br i1 false, label %bb442.preheader.loopexit, label %bb413.bb391_crit_edge
+
+bb413.bb391_crit_edge: ; preds = %bb413
+ br label %bb391
+
+bb442.preheader.loopexit: ; preds = %bb413
+ br label %bb442.preheader
+
+bb442.preheader: ; preds = %bb442.preheader.loopexit, %bb390.bb442.preheader_crit_edge
+ br label %bb442.outer
+
+bb420: ; preds = %bb442
+ br i1 false, label %bb439.loopexit, label %cond_next433
+
+cond_next433: ; preds = %bb420
+ br i1 false, label %cond_next433.HRead.exit.loopexit_crit_edge, label %cond_next.i
+
+cond_next433.HRead.exit.loopexit_crit_edge: ; preds = %cond_next433
+ br label %HRead.exit.loopexit
+
+cond_next.i: ; preds = %cond_next433
+ br i1 false, label %cond_true9.i, label %cond_false223.i
+
+cond_true9.i: ; preds = %cond_next.i
+ switch i32 0, label %cond_false.i [
+ i32 1, label %cond_true9.i.cond_true15.i_crit_edge
+ i32 5, label %cond_true9.i.cond_true15.i_crit_edge9
+ ]
+
+cond_true9.i.cond_true15.i_crit_edge9: ; preds = %cond_true9.i
+ br label %cond_true15.i
+
+cond_true9.i.cond_true15.i_crit_edge: ; preds = %cond_true9.i
+ br label %cond_true15.i
+
+cond_true15.i: ; preds = %cond_true9.i.cond_true15.i_crit_edge, %cond_true9.i.cond_true15.i_crit_edge9
+ br i1 false, label %cond_true15.i.cond_true44.i_crit_edge, label %cond_true15.i.cond_false49.i_crit_edge
+
+cond_true15.i.cond_false49.i_crit_edge: ; preds = %cond_true15.i
+ br label %cond_false49.i
+
+cond_true15.i.cond_true44.i_crit_edge: ; preds = %cond_true15.i
+ br label %cond_true44.i
+
+cond_false.i: ; preds = %cond_true9.i
+ br i1 false, label %cond_false.i.cond_next39.i_crit_edge, label %cond_true30.i
+
+cond_false.i.cond_next39.i_crit_edge: ; preds = %cond_false.i
+ br label %cond_next39.i
+
+cond_true30.i: ; preds = %cond_false.i
+ br label %cond_next39.i
+
+cond_next39.i: ; preds = %cond_true30.i, %cond_false.i.cond_next39.i_crit_edge
+ br i1 false, label %cond_next39.i.cond_true44.i_crit_edge, label %cond_next39.i.cond_false49.i_crit_edge
+
+cond_next39.i.cond_false49.i_crit_edge: ; preds = %cond_next39.i
+ br label %cond_false49.i
+
+cond_next39.i.cond_true44.i_crit_edge: ; preds = %cond_next39.i
+ br label %cond_true44.i
+
+cond_true44.i: ; preds = %cond_next39.i.cond_true44.i_crit_edge, %cond_true15.i.cond_true44.i_crit_edge
+ br i1 false, label %cond_true44.i.cond_next70.i_crit_edge, label %cond_true44.i.cond_true61.i_crit_edge
+
+cond_true44.i.cond_true61.i_crit_edge: ; preds = %cond_true44.i
+ br label %cond_true61.i
+
+cond_true44.i.cond_next70.i_crit_edge: ; preds = %cond_true44.i
+ br label %cond_next70.i
+
+cond_false49.i: ; preds = %cond_next39.i.cond_false49.i_crit_edge, %cond_true15.i.cond_false49.i_crit_edge
+ br i1 false, label %cond_false49.i.cond_next70.i_crit_edge, label %cond_false49.i.cond_true61.i_crit_edge
+
+cond_false49.i.cond_true61.i_crit_edge: ; preds = %cond_false49.i
+ br label %cond_true61.i
+
+cond_false49.i.cond_next70.i_crit_edge: ; preds = %cond_false49.i
+ br label %cond_next70.i
+
+cond_true61.i: ; preds = %cond_false49.i.cond_true61.i_crit_edge, %cond_true44.i.cond_true61.i_crit_edge
+ br i1 false, label %cond_true61.i.cond_next70.i_crit_edge, label %cond_true67.i
+
+cond_true61.i.cond_next70.i_crit_edge: ; preds = %cond_true61.i
+ br label %cond_next70.i
+
+cond_true67.i: ; preds = %cond_true61.i
+ br label %cond_next70.i
+
+cond_next70.i: ; preds = %cond_true67.i, %cond_true61.i.cond_next70.i_crit_edge, %cond_false49.i.cond_next70.i_crit_edge, %cond_true44.i.cond_next70.i_crit_edge
+ br i1 false, label %cond_true77.i, label %cond_next81.i
+
+cond_true77.i: ; preds = %cond_next70.i
+ br label %bb442.outer.backedge
+
+cond_next81.i: ; preds = %cond_next70.i
+ br i1 false, label %cond_true87.i, label %cond_false94.i
+
+cond_true87.i: ; preds = %cond_next81.i
+ br i1 false, label %cond_true87.i.cond_true130.i_crit_edge, label %cond_true87.i.cond_next135.i_crit_edge
+
+cond_true87.i.cond_next135.i_crit_edge: ; preds = %cond_true87.i
+ br label %cond_next135.i
+
+cond_true87.i.cond_true130.i_crit_edge: ; preds = %cond_true87.i
+ br label %cond_true130.i
+
+cond_false94.i: ; preds = %cond_next81.i
+ switch i32 0, label %cond_false94.i.cond_next125.i_crit_edge [
+ i32 1, label %cond_false94.i.cond_true100.i_crit_edge
+ i32 5, label %cond_false94.i.cond_true100.i_crit_edge10
+ ]
+
+cond_false94.i.cond_true100.i_crit_edge10: ; preds = %cond_false94.i
+ br label %cond_true100.i
+
+cond_false94.i.cond_true100.i_crit_edge: ; preds = %cond_false94.i
+ br label %cond_true100.i
+
+cond_false94.i.cond_next125.i_crit_edge: ; preds = %cond_false94.i
+ br label %cond_next125.i
+
+cond_true100.i: ; preds = %cond_false94.i.cond_true100.i_crit_edge, %cond_false94.i.cond_true100.i_crit_edge10
+ br i1 false, label %cond_true107.i, label %cond_true100.i.cond_next109.i_crit_edge
+
+cond_true100.i.cond_next109.i_crit_edge: ; preds = %cond_true100.i
+ br label %cond_next109.i
+
+cond_true107.i: ; preds = %cond_true100.i
+ br label %cond_next109.i
+
+cond_next109.i: ; preds = %cond_true107.i, %cond_true100.i.cond_next109.i_crit_edge
+ br i1 false, label %cond_next109.i.cond_next125.i_crit_edge, label %cond_true116.i
+
+cond_next109.i.cond_next125.i_crit_edge: ; preds = %cond_next109.i
+ br label %cond_next125.i
+
+cond_true116.i: ; preds = %cond_next109.i
+ br label %cond_next125.i
+
+cond_next125.i: ; preds = %cond_true116.i, %cond_next109.i.cond_next125.i_crit_edge, %cond_false94.i.cond_next125.i_crit_edge
+ br i1 false, label %cond_next125.i.cond_true130.i_crit_edge, label %cond_next125.i.cond_next135.i_crit_edge
+
+cond_next125.i.cond_next135.i_crit_edge: ; preds = %cond_next125.i
+ br label %cond_next135.i
+
+cond_next125.i.cond_true130.i_crit_edge: ; preds = %cond_next125.i
+ br label %cond_true130.i
+
+cond_true130.i: ; preds = %cond_next125.i.cond_true130.i_crit_edge, %cond_true87.i.cond_true130.i_crit_edge
+ br label %cond_next135.i
+
+cond_next135.i: ; preds = %cond_true130.i, %cond_next125.i.cond_next135.i_crit_edge, %cond_true87.i.cond_next135.i_crit_edge
+ br i1 false, label %cond_true142.i, label %cond_next135.i.cond_next149.i_crit_edge
+
+cond_next135.i.cond_next149.i_crit_edge: ; preds = %cond_next135.i
+ br label %cond_next149.i
+
+cond_true142.i: ; preds = %cond_next135.i
+ br label %cond_next149.i
+
+cond_next149.i: ; preds = %cond_true142.i, %cond_next135.i.cond_next149.i_crit_edge
+ br i1 false, label %cond_true156.i, label %cond_next149.i.cond_next163.i_crit_edge
+
+cond_next149.i.cond_next163.i_crit_edge: ; preds = %cond_next149.i
+ br label %cond_next163.i
+
+cond_true156.i: ; preds = %cond_next149.i
+ br label %cond_next163.i
+
+cond_next163.i: ; preds = %cond_true156.i, %cond_next149.i.cond_next163.i_crit_edge
+ br i1 false, label %cond_true182.i, label %cond_next163.i.cond_next380.i_crit_edge
+
+cond_next163.i.cond_next380.i_crit_edge: ; preds = %cond_next163.i
+ br label %cond_next380.i
+
+cond_true182.i: ; preds = %cond_next163.i
+ br i1 false, label %cond_true182.i.cond_next380.i_crit_edge, label %cond_true196.i
+
+cond_true182.i.cond_next380.i_crit_edge: ; preds = %cond_true182.i
+ br label %cond_next380.i
+
+cond_true196.i: ; preds = %cond_true182.i
+ br i1 false, label %cond_true210.i, label %cond_true196.i.cond_next380.i_crit_edge
+
+cond_true196.i.cond_next380.i_crit_edge: ; preds = %cond_true196.i
+ br label %cond_next380.i
+
+cond_true210.i: ; preds = %cond_true196.i
+ br i1 false, label %cond_true216.i, label %cond_true210.i.cond_next380.i_crit_edge
+
+cond_true210.i.cond_next380.i_crit_edge: ; preds = %cond_true210.i
+ br label %cond_next380.i
+
+cond_true216.i: ; preds = %cond_true210.i
+ br label %cond_next380.i
+
+cond_false223.i: ; preds = %cond_next.i
+ br i1 false, label %cond_true229.i, label %cond_false355.i
+
+cond_true229.i: ; preds = %cond_false223.i
+ br i1 false, label %cond_true229.i.HRead.exit.loopexit_crit_edge, label %cond_next243.i
+
+cond_true229.i.HRead.exit.loopexit_crit_edge: ; preds = %cond_true229.i
+ br label %HRead.exit.loopexit
+
+cond_next243.i: ; preds = %cond_true229.i
+ br i1 false, label %cond_true248.i, label %cond_false255.i
+
+cond_true248.i: ; preds = %cond_next243.i
+ br label %cond_next260.i
+
+cond_false255.i: ; preds = %cond_next243.i
+ br label %cond_next260.i
+
+cond_next260.i: ; preds = %cond_false255.i, %cond_true248.i
+ br i1 false, label %cond_true267.i, label %cond_next273.i
+
+cond_true267.i: ; preds = %cond_next260.i
+ br label %bb442.backedge
+
+bb442.backedge: ; preds = %bb.i, %cond_true267.i
+ br label %bb442
+
+cond_next273.i: ; preds = %cond_next260.i
+ br i1 false, label %cond_true281.i, label %cond_next273.i.cond_next288.i_crit_edge
+
+cond_next273.i.cond_next288.i_crit_edge: ; preds = %cond_next273.i
+ br label %cond_next288.i
+
+cond_true281.i: ; preds = %cond_next273.i
+ br label %cond_next288.i
+
+cond_next288.i: ; preds = %cond_true281.i, %cond_next273.i.cond_next288.i_crit_edge
+ br i1 false, label %cond_true295.i, label %cond_next288.i.cond_next302.i_crit_edge
+
+cond_next288.i.cond_next302.i_crit_edge: ; preds = %cond_next288.i
+ br label %cond_next302.i
+
+cond_true295.i: ; preds = %cond_next288.i
+ br label %cond_next302.i
+
+cond_next302.i: ; preds = %cond_true295.i, %cond_next288.i.cond_next302.i_crit_edge
+ br i1 false, label %cond_next302.i.cond_next380.i_crit_edge, label %cond_true328.i
+
+cond_next302.i.cond_next380.i_crit_edge: ; preds = %cond_next302.i
+ br label %cond_next380.i
+
+cond_true328.i: ; preds = %cond_next302.i
+ br i1 false, label %cond_true343.i, label %cond_true328.i.cond_next380.i_crit_edge
+
+cond_true328.i.cond_next380.i_crit_edge: ; preds = %cond_true328.i
+ br label %cond_next380.i
+
+cond_true343.i: ; preds = %cond_true328.i
+ br i1 false, label %cond_true349.i, label %cond_true343.i.cond_next380.i_crit_edge
+
+cond_true343.i.cond_next380.i_crit_edge: ; preds = %cond_true343.i
+ br label %cond_next380.i
+
+cond_true349.i: ; preds = %cond_true343.i
+ br label %cond_next380.i
+
+cond_false355.i: ; preds = %cond_false223.i
+ br i1 false, label %cond_false355.i.bb.i_crit_edge, label %cond_next363.i
+
+cond_false355.i.bb.i_crit_edge: ; preds = %cond_false355.i
+ br label %bb.i
+
+cond_next363.i: ; preds = %cond_false355.i
+ br i1 false, label %bb377.i, label %cond_next363.i.bb.i_crit_edge
+
+cond_next363.i.bb.i_crit_edge: ; preds = %cond_next363.i
+ br label %bb.i
+
+bb.i: ; preds = %cond_next363.i.bb.i_crit_edge, %cond_false355.i.bb.i_crit_edge
+ br label %bb442.backedge
+
+bb377.i: ; preds = %cond_next363.i
+ br label %cond_next380.i
+
+cond_next380.i: ; preds = %bb377.i, %cond_true349.i, %cond_true343.i.cond_next380.i_crit_edge, %cond_true328.i.cond_next380.i_crit_edge, %cond_next302.i.cond_next380.i_crit_edge, %cond_true216.i, %cond_true210.i.cond_next380.i_crit_edge, %cond_true196.i.cond_next380.i_crit_edge, %cond_true182.i.cond_next380.i_crit_edge, %cond_next163.i.cond_next380.i_crit_edge
+ br i1 false, label %cond_next380.i.HRead.exit_crit_edge, label %cond_true391.i
+
+cond_next380.i.HRead.exit_crit_edge: ; preds = %cond_next380.i
+ br label %HRead.exit
+
+cond_true391.i: ; preds = %cond_next380.i
+ br label %bb442.outer.backedge
+
+bb442.outer.backedge: ; preds = %bb439, %cond_true391.i, %cond_true77.i
+ br label %bb442.outer
+
+HRead.exit.loopexit: ; preds = %cond_true229.i.HRead.exit.loopexit_crit_edge, %cond_next433.HRead.exit.loopexit_crit_edge
+ br label %HRead.exit
+
+HRead.exit: ; preds = %HRead.exit.loopexit, %cond_next380.i.HRead.exit_crit_edge
+ br label %bb439
+
+bb439.loopexit: ; preds = %bb420
+ br label %bb439
+
+bb439: ; preds = %bb439.loopexit, %HRead.exit
+ br label %bb442.outer.backedge
+
+bb442.outer: ; preds = %bb442.outer.backedge, %bb442.preheader
+ br label %bb442
+
+bb442: ; preds = %bb442.outer, %bb442.backedge
+ br i1 false, label %bb420, label %bb.loopexit
+}
+
+define void @Invalidate() {
+entry:
+ br i1 false, label %cond_false, label %cond_true
+
+cond_true: ; preds = %entry
+ br i1 false, label %cond_true40, label %cond_true.cond_next_crit_edge
+
+cond_true.cond_next_crit_edge: ; preds = %cond_true
+ br label %cond_next
+
+cond_true40: ; preds = %cond_true
+ br label %cond_next
+
+cond_next: ; preds = %cond_true40, %cond_true.cond_next_crit_edge
+ br i1 false, label %cond_true68, label %cond_next.cond_next73_crit_edge
+
+cond_next.cond_next73_crit_edge: ; preds = %cond_next
+ br label %cond_next73
+
+cond_true68: ; preds = %cond_next
+ br label %cond_next73
+
+cond_next73: ; preds = %cond_true68, %cond_next.cond_next73_crit_edge
+ br i1 false, label %cond_true91, label %cond_next73.cond_next96_crit_edge
+
+cond_next73.cond_next96_crit_edge: ; preds = %cond_next73
+ br label %cond_next96
+
+cond_true91: ; preds = %cond_next73
+ br label %cond_next96
+
+cond_next96: ; preds = %cond_true91, %cond_next73.cond_next96_crit_edge
+ br i1 false, label %cond_next96.cond_next112_crit_edge, label %cond_true105
+
+cond_next96.cond_next112_crit_edge: ; preds = %cond_next96
+ br label %cond_next112
+
+cond_true105: ; preds = %cond_next96
+ br label %cond_next112
+
+cond_next112: ; preds = %cond_true105, %cond_next96.cond_next112_crit_edge
+ br i1 false, label %cond_next112.cond_next127_crit_edge, label %cond_true119
+
+cond_next112.cond_next127_crit_edge: ; preds = %cond_next112
+ br label %cond_next127
+
+cond_true119: ; preds = %cond_next112
+ br label %cond_next127
+
+cond_next127: ; preds = %cond_true119, %cond_next112.cond_next127_crit_edge
+ br i1 false, label %cond_next141, label %cond_true134
+
+cond_true134: ; preds = %cond_next127
+ br i1 false, label %cond_true134.bb161_crit_edge, label %cond_true134.bb_crit_edge
+
+cond_true134.bb_crit_edge: ; preds = %cond_true134
+ br label %bb
+
+cond_true134.bb161_crit_edge: ; preds = %cond_true134
+ br label %bb161
+
+cond_next141: ; preds = %cond_next127
+ br label %bb154
+
+bb: ; preds = %bb154.bb_crit_edge, %cond_true134.bb_crit_edge
+ br label %bb154
+
+bb154: ; preds = %bb, %cond_next141
+ br i1 false, label %bb154.bb161_crit_edge, label %bb154.bb_crit_edge
+
+bb154.bb_crit_edge: ; preds = %bb154
+ br label %bb
+
+bb154.bb161_crit_edge: ; preds = %bb154
+ br label %bb161
+
+bb161: ; preds = %bb154.bb161_crit_edge, %cond_true134.bb161_crit_edge
+ br i1 false, label %bb161.cond_next201_crit_edge, label %cond_true198
+
+bb161.cond_next201_crit_edge: ; preds = %bb161
+ br label %cond_next201
+
+cond_true198: ; preds = %bb161
+ br label %cond_next201
+
+cond_next201: ; preds = %cond_true198, %bb161.cond_next201_crit_edge
+ br i1 false, label %cond_next212, label %cond_true206
+
+cond_true206: ; preds = %cond_next201
+ br label %UnifiedReturnBlock
+
+cond_false: ; preds = %entry
+ br label %UnifiedReturnBlock
+
+cond_next212: ; preds = %cond_next201
+ br label %UnifiedReturnBlock
+
+UnifiedReturnBlock: ; preds = %cond_next212, %cond_false, %cond_true206
+ ret void
+}
Added: llvm/branches/non-call-eh/test/Analysis/PostDominators/2007-04-20-PostDom-Reset.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/PostDominators/2007-04-20-PostDom-Reset.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/PostDominators/2007-04-20-PostDom-Reset.ll (added)
+++ llvm/branches/non-call-eh/test/Analysis/PostDominators/2007-04-20-PostDom-Reset.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,28 @@
+; RUN: llvm-as < %s | opt -postdomfrontier -disable-output
+
+define void @args_out_of_range() {
+entry:
+ br label %bb
+
+bb: ; preds = %bb, %entry
+ br label %bb
+}
+
+define void @args_out_of_range_3() {
+entry:
+ br label %bb
+
+bb: ; preds = %bb, %entry
+ br label %bb
+}
+
+define void @Feq() {
+entry:
+ br i1 false, label %cond_true, label %cond_next
+
+cond_true: ; preds = %entry
+ unreachable
+
+cond_next: ; preds = %entry
+ unreachable
+}
Added: llvm/branches/non-call-eh/test/Analysis/PostDominators/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/PostDominators/dg.exp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/PostDominators/dg.exp (added)
+++ llvm/branches/non-call-eh/test/Analysis/PostDominators/dg.exp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,3 @@
+load_lib llvm.exp
+
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Added: llvm/branches/non-call-eh/test/Analysis/PostDominators/pr1098.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/PostDominators/pr1098.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/PostDominators/pr1098.ll (added)
+++ llvm/branches/non-call-eh/test/Analysis/PostDominators/pr1098.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | opt -postdomtree -analyze | grep entry
+; PR932
+
+define void @foo(i1 %x) {
+entry:
+ br i1 %x, label %bb1, label %bb0
+bb0: ; preds = %entry, bb0
+ br label %bb0
+bb1: ; preds = %entry
+ br label %bb2
+bb2: ; preds = %bb1
+ ret void
+}
+
Added: llvm/branches/non-call-eh/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll (added)
+++ llvm/branches/non-call-eh/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,21 @@
+; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep {61 iterations}
+; PR2364
+
+define i32 @func_6() nounwind {
+entry:
+ br label %bb5
+
+bb: ; preds = %bb5
+ %tmp2 = add i32 %i.0, 1 ; <i32> [#uses=1]
+ %tmp4 = add i8 %x.0, -4 ; <i8> [#uses=1]
+ br label %bb5
+
+bb5: ; preds = %bb, %entry
+ %x.0 = phi i8 [ 0, %entry ], [ %tmp4, %bb ] ; <i8> [#uses=2]
+ %i.0 = phi i32 [ 0, %entry ], [ %tmp2, %bb ] ; <i32> [#uses=2]
+ %tmp7 = icmp eq i8 %x.0, 12 ; <i1> [#uses=1]
+ br i1 %tmp7, label %return, label %bb
+
+return: ; preds = %bb5
+ ret i32 %i.0
+}
Added: llvm/branches/non-call-eh/test/Analysis/ScalarEvolution/2008-06-12-BinomialInt64.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/ScalarEvolution/2008-06-12-BinomialInt64.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/ScalarEvolution/2008-06-12-BinomialInt64.ll (added)
+++ llvm/branches/non-call-eh/test/Analysis/ScalarEvolution/2008-06-12-BinomialInt64.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,43 @@
+; RUN: llvm-as < %s | opt -analyze -scalar-evolution 2>/dev/null
+; PR2433
+
+define i32 @main1(i32 %argc, i8** %argv) nounwind {
+entry:
+ br i1 false, label %bb10, label %bb23
+
+bb10: ; preds = %bb10, %entry
+ %accum.03 = phi i64 [ %tmp14, %bb10 ], [ 0, %entry ] ; <i64> [#uses=1]
+ %i.02 = phi i32 [ %tmp16, %bb10 ], [ 0, %entry ] ; <i32> [#uses=1]
+ %d.1.01 = phi i64 [ %tmp5.i, %bb10 ], [ 0, %entry ] ; <i64> [#uses=1]
+ %tmp5.i = add i64 %d.1.01, 1 ; <i64> [#uses=2]
+ %tmp14 = add i64 %accum.03, %tmp5.i ; <i64> [#uses=2]
+ %tmp16 = add i32 %i.02, 1 ; <i32> [#uses=2]
+ %tmp20 = icmp slt i32 %tmp16, 0 ; <i1> [#uses=1]
+ br i1 %tmp20, label %bb10, label %bb23
+
+bb23: ; preds = %bb10, %entry
+ %accum.0.lcssa = phi i64 [ 0, %entry ], [ %tmp14, %bb10 ] ; <i64> [#uses=0]
+ ret i32 0
+}
+
+define i32 @main2(i32 %argc, i8** %argv) {
+entry:
+ %tmp8 = tail call i32 @atoi( i8* null ) nounwind readonly ; <i32> [#uses=1]
+ br i1 false, label %bb9, label %bb21
+
+bb9: ; preds = %bb9, %entry
+ %accum.03 = phi i64 [ %tmp12, %bb9 ], [ 0, %entry ] ; <i64> [#uses=1]
+ %i.02 = phi i32 [ %tmp14, %bb9 ], [ 0, %entry ] ; <i32> [#uses=1]
+ %d.1.01 = phi i64 [ %tmp4.i, %bb9 ], [ 0, %entry ] ; <i64> [#uses=1]
+ %tmp4.i = add i64 %d.1.01, 1 ; <i64> [#uses=2]
+ %tmp12 = add i64 %accum.03, %tmp4.i ; <i64> [#uses=2]
+ %tmp14 = add i32 %i.02, 1 ; <i32> [#uses=2]
+ %tmp18 = icmp slt i32 %tmp14, %tmp8 ; <i1> [#uses=1]
+ br i1 %tmp18, label %bb9, label %bb21
+
+bb21: ; preds = %bb9, %entry
+ %accum.0.lcssa = phi i64 [ 0, %entry ], [ %tmp12, %bb9 ] ; <i64> [#uses=0]
+ ret i32 0
+}
+
+declare i32 @atoi(i8*) nounwind readonly
Modified: llvm/branches/non-call-eh/test/Analysis/ScalarEvolution/smax.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Analysis/ScalarEvolution/smax.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Analysis/ScalarEvolution/smax.ll (original)
+++ llvm/branches/non-call-eh/test/Analysis/ScalarEvolution/smax.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,6 @@
; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep smax | count 2
; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep \
-; RUN: "%. smax %. smax %."
+; RUN: {%. smax %. smax %.}
; PR1614
define i32 @x(i32 %a, i32 %b, i32 %c) {
Modified: llvm/branches/non-call-eh/test/Archive/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Archive/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Archive/dg.exp (original)
+++ llvm/branches/non-call-eh/test/Archive/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Propchange: llvm/branches/non-call-eh/test/Archive/toc_MacOSX.ll
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type (removed)
@@ -1 +0,0 @@
-application/octet-stream
Modified: llvm/branches/non-call-eh/test/Assembler/2002-01-24-BadSymbolTableAssert.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-01-24-BadSymbolTableAssert.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-01-24-BadSymbolTableAssert.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-01-24-BadSymbolTableAssert.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
; This testcase failed due to a bad assertion in SymbolTable.cpp, removed in
; the 1.20 revision. Basically the symbol table assumed that if there was an
Modified: llvm/branches/non-call-eh/test/Assembler/2002-01-24-ValueRefineAbsType.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-01-24-ValueRefineAbsType.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-01-24-ValueRefineAbsType.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-01-24-ValueRefineAbsType.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
; This testcase used to fail due to a lack of this diff in Value.cpp:
; diff -r1.16 Value.cpp
Modified: llvm/branches/non-call-eh/test/Assembler/2002-02-19-TypeParsing.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-02-19-TypeParsing.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-02-19-TypeParsing.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-02-19-TypeParsing.ll Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
%Hosp = type { i32, i32, i32, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* }, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* }, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* }, { \2*, { i32, i32, i32, { [4 x \3], \2, \5, %Hosp, i32, i32 }* }*, \2* } }
Modified: llvm/branches/non-call-eh/test/Assembler/2002-03-08-NameCollision.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-03-08-NameCollision.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-03-08-NameCollision.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-03-08-NameCollision.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
; Method arguments were being checked for collisions at the global scope before
; the method object was created by the parser. Because of this, false
Modified: llvm/branches/non-call-eh/test/Assembler/2002-03-08-NameCollision2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-03-08-NameCollision2.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-03-08-NameCollision2.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-03-08-NameCollision2.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
; Another name collision problem. Here the problem was that if a forward
; declaration for a method was found, that this would cause spurious conflicts
Modified: llvm/branches/non-call-eh/test/Assembler/2002-04-04-PureVirtMethCall.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-04-04-PureVirtMethCall.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-04-04-PureVirtMethCall.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-04-04-PureVirtMethCall.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
type { { \2 *, \4 ** },
{ \2 *, \4 ** }
Modified: llvm/branches/non-call-eh/test/Assembler/2002-04-04-PureVirtMethCall2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-04-04-PureVirtMethCall2.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-04-04-PureVirtMethCall2.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-04-04-PureVirtMethCall2.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
%t = type { { \2*, \2 },
{ \2*, \2 }
Modified: llvm/branches/non-call-eh/test/Assembler/2002-04-05-TypeParsing.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-04-05-TypeParsing.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-04-05-TypeParsing.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-04-05-TypeParsing.ll Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
%Hosp = type { { \2*, { \2, %Hosp }* }, { \2*, { \2, %Hosp }* } }
Modified: llvm/branches/non-call-eh/test/Assembler/2002-05-02-InvalidForwardRef.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-05-02-InvalidForwardRef.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-05-02-InvalidForwardRef.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-05-02-InvalidForwardRef.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
; It looks like the assembler is not forward resolving the function declaraion
; correctly.
Modified: llvm/branches/non-call-eh/test/Assembler/2002-07-08-HugePerformanceProblem.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-07-08-HugePerformanceProblem.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-07-08-HugePerformanceProblem.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-07-08-HugePerformanceProblem.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,6 @@
; This file takes about 48 __MINUTES__ to assemble using as. This is WAY too
; long. The type resolution code needs to be sped up a lot.
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
%ALL_INTERSECTIONS_METHOD = type i32 (%OBJECT*, %RAY*, %ISTACK*)*
%BBOX = type { %BBOX_VECT, %BBOX_VECT }
%BBOX_TREE = type { i16, i16, %BBOX, %BBOX_TREE** }
Modified: llvm/branches/non-call-eh/test/Assembler/2002-07-25-ParserAssertionFailure.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-07-25-ParserAssertionFailure.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-07-25-ParserAssertionFailure.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-07-25-ParserAssertionFailure.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,6 @@
; Make sure we don't get an assertion failure, even though this is a parse
; error
-; RUN: not llvm-as < %s -o /dev/null -f |& grep {No arguments}
+; RUN: not llvm-as %s -o /dev/null -f |& grep {No arguments}
%ty = type void (i32)
Modified: llvm/branches/non-call-eh/test/Assembler/2002-08-15-CastAmbiguity.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-08-15-CastAmbiguity.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-08-15-CastAmbiguity.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-08-15-CastAmbiguity.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
define void @test(i32 %X) {
call void @test( i32 6 )
Modified: llvm/branches/non-call-eh/test/Assembler/2002-08-15-ConstantExprProblem.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-08-15-ConstantExprProblem.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-08-15-ConstantExprProblem.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-08-15-ConstantExprProblem.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
@.LC0 = internal global [12 x i8] c"hello world\00" ; <[12 x i8]*> [#uses=1]
Modified: llvm/branches/non-call-eh/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
@.LC0 = internal global [12 x i8] c"hello world\00" ; <[12 x i8]*> [#uses=1]
Modified: llvm/branches/non-call-eh/test/Assembler/2002-08-22-DominanceProblem.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-08-22-DominanceProblem.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-08-22-DominanceProblem.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-08-22-DominanceProblem.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
; Dominance relationships is not calculated correctly for unreachable blocks,
; which causes the verifier to barf on this input.
Modified: llvm/branches/non-call-eh/test/Assembler/2002-10-08-LargeArrayPerformance.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-10-08-LargeArrayPerformance.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-10-08-LargeArrayPerformance.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-10-08-LargeArrayPerformance.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
; This testcase comes from the following really simple c file:
;; int foo[30000]
;;; We should not be soo slow for such a simple case!
Modified: llvm/branches/non-call-eh/test/Assembler/2002-10-15-NameClash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-10-15-NameClash.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-10-15-NameClash.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-10-15-NameClash.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
declare i32 @"ArrayRef"([100 x i32] * %Array)
Modified: llvm/branches/non-call-eh/test/Assembler/2002-12-15-GlobalResolve.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2002-12-15-GlobalResolve.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2002-12-15-GlobalResolve.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2002-12-15-GlobalResolve.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
@X = external global i32*
@X1 = external global %T*
Modified: llvm/branches/non-call-eh/test/Assembler/2003-01-30-UnsignedString.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2003-01-30-UnsignedString.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2003-01-30-UnsignedString.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2003-01-30-UnsignedString.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
@spell_order = global [4 x i8] c"\FF\00\F7\00"
Modified: llvm/branches/non-call-eh/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
; There should be absolutely no problem with this testcase.
define i32 @test(i32 %arg1, i32 %arg2) {
Modified: llvm/branches/non-call-eh/test/Assembler/2003-05-15-AssemblerProblem.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2003-05-15-AssemblerProblem.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2003-05-15-AssemblerProblem.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2003-05-15-AssemblerProblem.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,6 @@
; This bug was caused by two CPR's existing for the same global variable,
; colliding in the Module level CPR map.
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
define void @test() {
call void (...)* bitcast (void (i16*, i32)* @AddString to void (...)*)( i16* null, i32 0 )
Modified: llvm/branches/non-call-eh/test/Assembler/2003-05-15-SwitchBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2003-05-15-SwitchBug.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2003-05-15-SwitchBug.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2003-05-15-SwitchBug.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
; Check minimal switch statement
Modified: llvm/branches/non-call-eh/test/Assembler/2003-05-21-ConstantShiftExpr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2003-05-21-ConstantShiftExpr.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2003-05-21-ConstantShiftExpr.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2003-05-21-ConstantShiftExpr.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
; Test that shift instructions can be used in constant expressions.
global i32 3670016
Modified: llvm/branches/non-call-eh/test/Assembler/2003-05-21-EmptyStructTest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2003-05-21-EmptyStructTest.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2003-05-21-EmptyStructTest.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2003-05-21-EmptyStructTest.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
; The old C front-end never generated empty structures, now the new one
; can. For some reason we never handled them in the parser. Weird.
Modified: llvm/branches/non-call-eh/test/Assembler/2003-06-30-RecursiveTypeProblem.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2003-06-30-RecursiveTypeProblem.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2003-06-30-RecursiveTypeProblem.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2003-06-30-RecursiveTypeProblem.ll Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
%MidFnTy = type void (%MidFnTy*)
Modified: llvm/branches/non-call-eh/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
%T = type i32
@X = global i32* null ; <i32**> [#uses=0]
Modified: llvm/branches/non-call-eh/test/Assembler/2003-11-11-ImplicitRename.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2003-11-11-ImplicitRename.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2003-11-11-ImplicitRename.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2003-11-11-ImplicitRename.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s > /dev/null
+; RUN: not llvm-as < %s >& /dev/null
void %test() {
%X = add int 0, 1
Modified: llvm/branches/non-call-eh/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s -o /dev/null -f |& grep {Undefined type remains}
+; RUN: not llvm-as %s -o /dev/null -f |& grep {Undefined type remains}
; END.
@d_reduction_0_dparser_gram = global {
Modified: llvm/branches/non-call-eh/test/Assembler/2004-02-27-SelfUseAssertError.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2004-02-27-SelfUseAssertError.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2004-02-27-SelfUseAssertError.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2004-02-27-SelfUseAssertError.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
; %inc2 uses it's own value, but that's ok, as it's unreachable!
Modified: llvm/branches/non-call-eh/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
define i32* @t1({ float, i32 }* %X) {
%W = getelementptr { float, i32 }* %X, i32 20, i32 1 ; <i32*> [#uses=0]
Modified: llvm/branches/non-call-eh/test/Assembler/2004-09-29-VerifierIsReallySlow.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2004-09-29-VerifierIsReallySlow.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2004-09-29-VerifierIsReallySlow.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2004-09-29-VerifierIsReallySlow.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,6 @@
; Check to see that the verifier does not take an outrageous amount of time on
; this testcase.
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
%"complex long double" = type { double, double }
%"struct.std::dcomplex" = type { %"complex long double" }
Modified: llvm/branches/non-call-eh/test/Assembler/2004-10-22-BCWriterUndefBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2004-10-22-BCWriterUndefBug.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2004-10-22-BCWriterUndefBug.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2004-10-22-BCWriterUndefBug.ll Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
;; The bytecode writer was trying to treat undef values as ConstantArray's when
;; they looked like strings.
-;; RUN: llvm-as < %s -o /dev/null -f
+;; RUN: llvm-as %s -o /dev/null -f
@G = internal global [8 x i8] undef
Modified: llvm/branches/non-call-eh/test/Assembler/2004-11-28-InvalidTypeCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2004-11-28-InvalidTypeCrash.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2004-11-28-InvalidTypeCrash.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2004-11-28-InvalidTypeCrash.ll Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
; Test for PR463. This program is erroneous, but should not crash llvm-as.
-; RUN: not llvm-as < %s -o /dev/null -f |& \
+; RUN: not llvm-as %s -o /dev/null -f |& \
; RUN: grep {Cannot create a null initialized value of this type}
@.FOO = internal global %struct.none zeroinitializer
Modified: llvm/branches/non-call-eh/test/Assembler/2005-01-31-CallingAggregateFunction.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2005-01-31-CallingAggregateFunction.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2005-01-31-CallingAggregateFunction.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2005-01-31-CallingAggregateFunction.ll Sun Jul 6 15:45:41 2008
@@ -1,8 +1,8 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
define void @test() {
- call {} @foo()
+ call {i32} @foo()
ret void
}
-declare {} @foo()
+declare {i32 } @foo()
Modified: llvm/branches/non-call-eh/test/Assembler/2007-01-02-Undefined-Arg-Type.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2007-01-02-Undefined-Arg-Type.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2007-01-02-Undefined-Arg-Type.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2007-01-02-Undefined-Arg-Type.ll Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
; The assembler should catch an undefined argument type .
-; RUN: not llvm-as < %s -o /dev/null -f |& grep {Reference to abstract argument}
+; RUN: not llvm-as %s -o /dev/null -f |& grep {Reference to abstract argument}
; %typedef.bc_struct = type opaque
Modified: llvm/branches/non-call-eh/test/Assembler/2007-01-05-Cmp-ConstExpr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2007-01-05-Cmp-ConstExpr.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2007-01-05-Cmp-ConstExpr.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2007-01-05-Cmp-ConstExpr.ll Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
; Test Case for PR1080
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
@str = internal constant [4 x i8] c"-ga\00" ; <[4 x i8]*> [#uses=2]
Modified: llvm/branches/non-call-eh/test/Assembler/2007-01-16-CrashOnBadCast.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2007-01-16-CrashOnBadCast.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2007-01-16-CrashOnBadCast.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2007-01-16-CrashOnBadCast.ll Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
; PR1117
-; RUN: not llvm-as < %s -o /dev/null -f |& grep {invalid cast opcode for cast from}
+; RUN: not llvm-as %s -o /dev/null -f |& grep {invalid cast opcode for cast from}
define i8* @nada(i64 %X) {
%result = trunc i64 %X to i8*
Modified: llvm/branches/non-call-eh/test/Assembler/2007-01-16-CrashOnBadCast2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2007-01-16-CrashOnBadCast2.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2007-01-16-CrashOnBadCast2.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2007-01-16-CrashOnBadCast2.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
; PR1117
-; RUN: not llvm-as < %s -o /dev/null -f |& grep {invalid cast opcode for cast from}
+; RUN: not llvm-as %s -o /dev/null -f |& grep {invalid cast opcode for cast from}
@X = constant i8* trunc (i64 0 to i8*)
Modified: llvm/branches/non-call-eh/test/Assembler/2007-04-15-BadIntrinsic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2007-04-15-BadIntrinsic.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2007-04-15-BadIntrinsic.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2007-04-15-BadIntrinsic.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s -o /dev/null -f |& grep {Call to invalid LLVM intrinsic}
+; RUN: not llvm-as %s -o /dev/null -f |& grep {Call to invalid LLVM intrinsic}
declare i32 @llvm.foobar(i32 %foo)
Modified: llvm/branches/non-call-eh/test/Assembler/2007-11-26-AttributeOverload.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/2007-11-26-AttributeOverload.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/2007-11-26-AttributeOverload.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/2007-11-26-AttributeOverload.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s
+; RUN: not llvm-as < %s >& /dev/null
declare i32 @atoi(i8*) nounwind readonly
declare i32 @atoi(i8*)
Modified: llvm/branches/non-call-eh/test/Assembler/AutoUpgradeIntrinsics.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/AutoUpgradeIntrinsics.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/AutoUpgradeIntrinsics.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/AutoUpgradeIntrinsics.ll Sun Jul 6 15:45:41 2008
@@ -7,7 +7,7 @@
; RUN: llvm-as < %s | llvm-dis | \
; RUN: not grep {llvm\\.bswap\\.i\[0-9\]*\\.i\[0-9\]*}
; RUN: llvm-as < %s | llvm-dis | \
-; RUN: grep {llvm\\.x86\\.mmx\\.ps} | grep {2 x i32> | count 6
+; RUN: grep {llvm\\.x86\\.mmx\\.ps} | grep {\\\<2 x i32\\\>} | count 6
declare i32 @llvm.ctpop.i28(i28 %val)
declare i32 @llvm.cttz.i29(i29 %val)
Added: llvm/branches/non-call-eh/test/Assembler/aggregate-constant-values.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/aggregate-constant-values.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/aggregate-constant-values.ll (added)
+++ llvm/branches/non-call-eh/test/Assembler/aggregate-constant-values.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,27 @@
+; RUN: llvm-as < %s | llvm-dis | grep 7 | count 3
+
+define void @foo({i32, i32}* %x) nounwind {
+ store {i32, i32}{i32 7, i32 9}, {i32, i32}* %x
+ ret void
+}
+define void @foo_empty({}* %x) nounwind {
+ store {}{}, {}* %x
+ ret void
+}
+define void @bar([2 x i32]* %x) nounwind {
+ store [2 x i32][i32 7, i32 9], [2 x i32]* %x
+ ret void
+}
+define void @bar_empty([0 x i32]* %x) nounwind {
+ store [0 x i32][], [0 x i32]* %x
+ ret void
+}
+define void @qux(<{i32, i32}>* %x) nounwind {
+ store <{i32, i32}><{i32 7, i32 9}>, <{i32, i32}>* %x
+ ret void
+}
+define void @qux_empty(<{}>* %x) nounwind {
+ store <{}><{}>, <{}>* %x
+ ret void
+}
+
Added: llvm/branches/non-call-eh/test/Assembler/aggregate-return-single-value.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/aggregate-return-single-value.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/aggregate-return-single-value.ll (added)
+++ llvm/branches/non-call-eh/test/Assembler/aggregate-return-single-value.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llvm-dis
+
+define { i32 } @fooa() nounwind {
+ ret i32 0
+}
+define { i32 } @foob() nounwind {
+ ret {i32}{ i32 0 }
+}
+define [1 x i32] @fooc() nounwind {
+ ret i32 0
+}
+define [1 x i32] @food() nounwind {
+ ret [1 x i32][ i32 0 ]
+}
Modified: llvm/branches/non-call-eh/test/Assembler/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/dg.exp (original)
+++ llvm/branches/non-call-eh/test/Assembler/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Added: llvm/branches/non-call-eh/test/Assembler/huge-array.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/huge-array.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/huge-array.ll (added)
+++ llvm/branches/non-call-eh/test/Assembler/huge-array.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,5 @@
+; RUN: llvm-as < %s | llvm-dis | grep 18446744073709551615 | count 2
+
+define [18446744073709551615 x i8]* @foo() {
+ ret [18446744073709551615 x i8]* null
+}
Added: llvm/branches/non-call-eh/test/Assembler/insertextractvalue.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/insertextractvalue.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/insertextractvalue.ll (added)
+++ llvm/branches/non-call-eh/test/Assembler/insertextractvalue.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,23 @@
+; RUN: llvm-as < %s | llvm-dis > %t
+; RUN: grep insertvalue %t | count 1
+; RUN: grep extractvalue %t | count 1
+
+define float @foo({{i32},{float, double}}* %p) nounwind {
+ %t = load {{i32},{float, double}}* %p
+ %s = extractvalue {{i32},{float, double}} %t, 1, 0
+ %r = insertvalue {{i32},{float, double}} %t, double 2.0, 1, 1
+ store {{i32},{float, double}} %r, {{i32},{float, double}}* %p
+ ret float %s
+}
+define float @bar({{i32},{float, double}}* %p) nounwind {
+ store {{i32},{float, double}} insertvalue ({{i32},{float, double}}{{i32}{i32 4},{float, double}{float 4.0, double 5.0}}, double 20.0, 1, 1), {{i32},{float, double}}* %p
+ ret float extractvalue ({{i32},{float, double}}{{i32}{i32 3},{float, double}{float 7.0, double 9.0}}, 1, 0)
+}
+define float @car({{i32},{float, double}}* %p) nounwind {
+ store {{i32},{float, double}} insertvalue ({{i32},{float, double}} undef, double 20.0, 1, 1), {{i32},{float, double}}* %p
+ ret float extractvalue ({{i32},{float, double}} undef, 1, 0)
+}
+define float @dar({{i32},{float, double}}* %p) nounwind {
+ store {{i32},{float, double}} insertvalue ({{i32},{float, double}} zeroinitializer, double 20.0, 1, 1), {{i32},{float, double}}* %p
+ ret float extractvalue ({{i32},{float, double}} zeroinitializer, 1, 0)
+}
Modified: llvm/branches/non-call-eh/test/Assembler/select.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Assembler/select.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Assembler/select.ll (original)
+++ llvm/branches/non-call-eh/test/Assembler/select.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
define i32 @test(i1 %C, i32 %V1, i32 %V2) {
Modified: llvm/branches/non-call-eh/test/Bindings/Ocaml/ocaml.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Bindings/Ocaml/ocaml.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Bindings/Ocaml/ocaml.exp (original)
+++ llvm/branches/non-call-eh/test/Bindings/Ocaml/ocaml.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr,ml}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp,ml}]]
Modified: llvm/branches/non-call-eh/test/Bindings/Ocaml/vmcore.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Bindings/Ocaml/vmcore.ml?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Bindings/Ocaml/vmcore.ml (original)
+++ llvm/branches/non-call-eh/test/Bindings/Ocaml/vmcore.ml Sun Jul 6 15:45:41 2008
@@ -13,20 +13,34 @@
(* Tiny unit test framework - really just to help find which line is busted *)
let exit_status = ref 0
+let suite_name = ref ""
+let group_name = ref ""
let case_num = ref 0
+let print_checkpoints = false
let group name =
+ group_name := !suite_name ^ "/" ^ name;
case_num := 0;
- prerr_endline (" " ^ name ^ "...")
+ if print_checkpoints then
+ prerr_endline (" " ^ name ^ "...")
let insist cond =
incr case_num;
- if not cond then exit_status := 10;
- prerr_endline (" " ^ (string_of_int !case_num) ^ if cond then ""
- else " FAIL")
+ if not cond then
+ exit_status := 10;
+ match print_checkpoints, cond with
+ | false, true -> ()
+ | false, false ->
+ prerr_endline ("FAILED: " ^ !suite_name ^ "/" ^ !group_name ^ " #" ^ (string_of_int !case_num))
+ | true, true ->
+ prerr_endline (" " ^ (string_of_int !case_num))
+ | true, false ->
+ prerr_endline (" " ^ (string_of_int !case_num) ^ " FAIL")
let suite name f =
- prerr_endline (name ^ ":");
+ suite_name := name;
+ if print_checkpoints then
+ prerr_endline (name ^ ":");
f ()
@@ -245,7 +259,7 @@
ignore (define_global "Const08" c m);
insist ((vector_type i16_type 8) = (type_of c));
- (* RUN: grep {Const09.*\{ i16, i16, i32, i32 \} \{} < %t.ll
+ (* RUN: grep {Const09.*. i16, i16, i32, i32 . .} < %t.ll
*)
group "structure";
let c = const_struct [| one; two; three; four |] in
Modified: llvm/branches/non-call-eh/test/Bitcode/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Bitcode/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Bitcode/dg.exp (original)
+++ llvm/branches/non-call-eh/test/Bitcode/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Modified: llvm/branches/non-call-eh/test/Bitcode/memcpy.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Bitcode/memcpy.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Bitcode/memcpy.ll (original)
+++ llvm/branches/non-call-eh/test/Bitcode/memcpy.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o /dev/null -f
+; RUN: llvm-as %s -o /dev/null -f
define void @test(i32* %P, i32* %Q) {
entry:
Added: llvm/branches/non-call-eh/test/Bitcode/sse2_loadl_pd.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Bitcode/sse2_loadl_pd.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Bitcode/sse2_loadl_pd.ll (added)
+++ llvm/branches/non-call-eh/test/Bitcode/sse2_loadl_pd.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,2 @@
+; RUN: llvm-dis < %s.bc | not grep {i32 @llvm\\.loadl.pd}
+; RUN: llvm-dis < %s.bc | grep shufflevector
Added: llvm/branches/non-call-eh/test/Bitcode/sse2_loadl_pd.ll.bc
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Bitcode/sse2_loadl_pd.ll.bc?rev=53163&view=auto
==============================================================================
Binary files llvm/branches/non-call-eh/test/Bitcode/sse2_loadl_pd.ll.bc (added) and llvm/branches/non-call-eh/test/Bitcode/sse2_loadl_pd.ll.bc Sun Jul 6 15:45:41 2008 differ
Added: llvm/branches/non-call-eh/test/Bitcode/sse2_movs_d.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Bitcode/sse2_movs_d.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Bitcode/sse2_movs_d.ll (added)
+++ llvm/branches/non-call-eh/test/Bitcode/sse2_movs_d.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,2 @@
+; RUN: llvm-dis < %s.bc | not grep {i32 @llvm\\.movs.d}
+; RUN: llvm-dis < %s.bc | grep shufflevector
Added: llvm/branches/non-call-eh/test/Bitcode/sse2_movs_d.ll.bc
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Bitcode/sse2_movs_d.ll.bc?rev=53163&view=auto
==============================================================================
Binary files llvm/branches/non-call-eh/test/Bitcode/sse2_movs_d.ll.bc (added) and llvm/branches/non-call-eh/test/Bitcode/sse2_movs_d.ll.bc Sun Jul 6 15:45:41 2008 differ
Added: llvm/branches/non-call-eh/test/Bitcode/sse2_punpck_qdq.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Bitcode/sse2_punpck_qdq.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Bitcode/sse2_punpck_qdq.ll (added)
+++ llvm/branches/non-call-eh/test/Bitcode/sse2_punpck_qdq.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,3 @@
+; RUN: llvm-dis < %s.bc | not grep {i32 @llvm\\.punpckh.qdq}
+; RUN: llvm-dis < %s.bc | not grep {i32 @llvm\\.punpckl.qdq}
+; RUN: llvm-dis < %s.bc | grep shufflevector
Added: llvm/branches/non-call-eh/test/Bitcode/sse2_punpck_qdq.ll.bc
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Bitcode/sse2_punpck_qdq.ll.bc?rev=53163&view=auto
==============================================================================
Binary files llvm/branches/non-call-eh/test/Bitcode/sse2_punpck_qdq.ll.bc (added) and llvm/branches/non-call-eh/test/Bitcode/sse2_punpck_qdq.ll.bc Sun Jul 6 15:45:41 2008 differ
Added: llvm/branches/non-call-eh/test/Bitcode/sse2_shuf_pd.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Bitcode/sse2_shuf_pd.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Bitcode/sse2_shuf_pd.ll (added)
+++ llvm/branches/non-call-eh/test/Bitcode/sse2_shuf_pd.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,2 @@
+; RUN: llvm-dis < %s.bc | not grep {i32 @llvm\\.shuf.pd}
+; RUN: llvm-dis < %s.bc | grep shufflevector
Added: llvm/branches/non-call-eh/test/Bitcode/sse2_shuf_pd.ll.bc
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Bitcode/sse2_shuf_pd.ll.bc?rev=53163&view=auto
==============================================================================
Binary files llvm/branches/non-call-eh/test/Bitcode/sse2_shuf_pd.ll.bc (added) and llvm/branches/non-call-eh/test/Bitcode/sse2_shuf_pd.ll.bc Sun Jul 6 15:45:41 2008 differ
Added: llvm/branches/non-call-eh/test/Bitcode/sse2_unpck_pd.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Bitcode/sse2_unpck_pd.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Bitcode/sse2_unpck_pd.ll (added)
+++ llvm/branches/non-call-eh/test/Bitcode/sse2_unpck_pd.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,3 @@
+; RUN: llvm-dis < %s.bc | not grep {i32 @llvm\\.unpckh.pd}
+; RUN: llvm-dis < %s.bc | not grep {i32 @llvm\\.unpckl.pd}
+; RUN: llvm-dis < %s.bc | grep shufflevector
Added: llvm/branches/non-call-eh/test/Bitcode/sse2_unpck_pd.ll.bc
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Bitcode/sse2_unpck_pd.ll.bc?rev=53163&view=auto
==============================================================================
Binary files llvm/branches/non-call-eh/test/Bitcode/sse2_unpck_pd.ll.bc (added) and llvm/branches/non-call-eh/test/Bitcode/sse2_unpck_pd.ll.bc Sun Jul 6 15:45:41 2008 differ
Modified: llvm/branches/non-call-eh/test/BugPoint/crash-narrowfunctiontest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/BugPoint/crash-narrowfunctiontest.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/BugPoint/crash-narrowfunctiontest.ll (original)
+++ llvm/branches/non-call-eh/test/BugPoint/crash-narrowfunctiontest.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,6 @@
; Test that bugpoint can narrow down the testcase to the important function
;
-; RUN: bugpoint %s -bugpoint-crashcalls
+; RUN: bugpoint %s -bugpoint-crashcalls -silence-passes > /dev/null
define i32 @foo() { ret i32 1 }
Modified: llvm/branches/non-call-eh/test/BugPoint/misopt-basictest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/BugPoint/misopt-basictest.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/BugPoint/misopt-basictest.ll (original)
+++ llvm/branches/non-call-eh/test/BugPoint/misopt-basictest.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: bugpoint %s -dce -bugpoint-deletecalls -simplifycfg
+; RUN: bugpoint %s -dce -bugpoint-deletecalls -simplifycfg -silence-passes
@.LC0 = internal global [13 x i8] c"Hello World\0A\00" ; <[13 x i8]*> [#uses=1]
Modified: llvm/branches/non-call-eh/test/BugPoint/remove_arguments_test.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/BugPoint/remove_arguments_test.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/BugPoint/remove_arguments_test.ll (original)
+++ llvm/branches/non-call-eh/test/BugPoint/remove_arguments_test.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: bugpoint %s -bugpoint-crashcalls
+; RUN: bugpoint %s -bugpoint-crashcalls -silence-passes
; Test to make sure that arguments are removed from the function if they are
; unnecessary.
Added: llvm/branches/non-call-eh/test/CodeGen/ARM/2008-05-19-LiveIntervalsBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/ARM/2008-05-19-LiveIntervalsBug.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/ARM/2008-05-19-LiveIntervalsBug.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/ARM/2008-05-19-LiveIntervalsBug.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,55 @@
+; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin
+
+ %struct.BiContextType = type { i16, i8, i32 }
+ %struct.Bitstream = type { i32, i32, i8, i32, i32, i8, i8, i32, i32, i8*, i32 }
+ %struct.DataPartition = type { %struct.Bitstream*, %struct.EncodingEnvironment, %struct.EncodingEnvironment }
+ %struct.DecRefPicMarking_t = type { i32, i32, i32, i32, i32, %struct.DecRefPicMarking_t* }
+ %struct.EncodingEnvironment = type { i32, i32, i32, i32, i32, i8*, i32*, i32, i32 }
+ %struct.ImageParameters = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8**, i8**, i32, i32***, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [9 x [16 x [16 x i16]]], [5 x [16 x [16 x i16]]], [9 x [8 x [8 x i16]]], [2 x [4 x [16 x [16 x i16]]]], [16 x [16 x i16]], [16 x [16 x i32]], i32****, i32***, i32***, i32***, i32****, i32****, %struct.Picture*, %struct.Slice*, %struct.Macroblock*, i32*, i32*, i32, i32, i32, i32, [4 x [4 x i32]], i32, i32, i32, i32, i32, double, i32, i32, i32, i32, i16******, i16******, i16******, i16******, [15 x i16], i32, i32, i32, i32, i32, i32, i32, i32, [6 x [32 x i32]], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [1 x i32], i32, i32, [2 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.DecRefPicMarking_t*, i32, i32, i32, i32, i32, i32, i32, i32, i3!
2, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, double**, double***, i32***, double**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [3 x [2 x i32]], [2 x i32], i32, i32, i16, i32, i32, i32, i32, i32 }
+ %struct.Macroblock = type { i32, i32, i32, [2 x i32], i32, [8 x i32], %struct.Macroblock*, %struct.Macroblock*, i32, [2 x [4 x [4 x [2 x i32]]]], [16 x i8], [16 x i8], i32, i64, [4 x i32], [4 x i32], i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16, double, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
+ %struct.MotionInfoContexts = type { [3 x [11 x %struct.BiContextType]], [2 x [9 x %struct.BiContextType]], [2 x [10 x %struct.BiContextType]], [2 x [6 x %struct.BiContextType]], [4 x %struct.BiContextType], [4 x %struct.BiContextType], [3 x %struct.BiContextType] }
+ %struct.Picture = type { i32, i32, [100 x %struct.Slice*], i32, float, float, float }
+ %struct.Slice = type { i32, i32, i32, i32, i32, i32, %struct.DataPartition*, %struct.MotionInfoContexts*, %struct.TextureInfoContexts*, i32, i32*, i32*, i32*, i32, i32*, i32*, i32*, i32 (i32)*, [3 x [2 x i32]] }
+ %struct.TextureInfoContexts = type { [2 x %struct.BiContextType], [4 x %struct.BiContextType], [3 x [4 x %struct.BiContextType]], [10 x [4 x %struct.BiContextType]], [10 x [15 x %struct.BiContextType]], [10 x [15 x %struct.BiContextType]], [10 x [5 x %struct.BiContextType]], [10 x [5 x %struct.BiContextType]], [10 x [15 x %struct.BiContextType]], [10 x [15 x %struct.BiContextType]] }
+ at images = external global %struct.ImageParameters ; <%struct.ImageParameters*> [#uses=2]
+
+declare i8* @calloc(i32, i32)
+
+define fastcc void @init_global_buffers() nounwind {
+entry:
+ %tmp50.i.i = mul i32 0, 0 ; <i32> [#uses=2]
+ br i1 false, label %init_orig_buffers.exit, label %cond_true.i29
+
+cond_true.i29: ; preds = %entry
+ %tmp17.i = load i32* getelementptr (%struct.ImageParameters* @images, i32 0, i32 20), align 8 ; <i32> [#uses=1]
+ %tmp20.i27 = load i32* getelementptr (%struct.ImageParameters* @images, i32 0, i32 16), align 8 ; <i32> [#uses=1]
+ %tmp8.i.i = select i1 false, i32 1, i32 0 ; <i32> [#uses=1]
+ br label %bb.i8.us.i
+
+bb.i8.us.i: ; preds = %get_mem2Dpel.exit.i.us.i, %cond_true.i29
+ %j.04.i.us.i = phi i32 [ %indvar.next39.i, %get_mem2Dpel.exit.i.us.i ], [ 0, %cond_true.i29 ] ; <i32> [#uses=2]
+ %tmp13.i.us.i = getelementptr i16*** null, i32 %j.04.i.us.i ; <i16***> [#uses=0]
+ %tmp15.i.i.us.i = tail call i8* @calloc( i32 0, i32 2 ) ; <i8*> [#uses=0]
+ store i16* null, i16** null, align 4
+ br label %bb.i.i.us.i
+
+get_mem2Dpel.exit.i.us.i: ; preds = %bb.i.i.us.i
+ %indvar.next39.i = add i32 %j.04.i.us.i, 1 ; <i32> [#uses=2]
+ %exitcond40.i = icmp eq i32 %indvar.next39.i, 2 ; <i1> [#uses=1]
+ br i1 %exitcond40.i, label %get_mem3Dpel.exit.split.i, label %bb.i8.us.i
+
+bb.i.i.us.i: ; preds = %bb.i.i.us.i, %bb.i8.us.i
+ %exitcond.i = icmp eq i32 0, %tmp8.i.i ; <i1> [#uses=1]
+ br i1 %exitcond.i, label %get_mem2Dpel.exit.i.us.i, label %bb.i.i.us.i
+
+get_mem3Dpel.exit.split.i: ; preds = %get_mem2Dpel.exit.i.us.i
+ %tmp30.i.i = shl i32 %tmp17.i, 2 ; <i32> [#uses=1]
+ %tmp31.i.i = mul i32 %tmp30.i.i, %tmp20.i27 ; <i32> [#uses=1]
+ %tmp23.i31 = add i32 %tmp31.i.i, %tmp50.i.i ; <i32> [#uses=1]
+ br label %init_orig_buffers.exit
+
+init_orig_buffers.exit: ; preds = %get_mem3Dpel.exit.split.i, %entry
+ %memory_size.0.i = phi i32 [ %tmp23.i31, %get_mem3Dpel.exit.split.i ], [ %tmp50.i.i, %entry ] ; <i32> [#uses=1]
+ %tmp41 = add i32 0, %memory_size.0.i ; <i32> [#uses=0]
+ unreachable
+}
Added: llvm/branches/non-call-eh/test/CodeGen/ARM/2008-05-19-ScavengerAssert.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/ARM/2008-05-19-ScavengerAssert.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/ARM/2008-05-19-ScavengerAssert.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/ARM/2008-05-19-ScavengerAssert.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,22 @@
+; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin
+
+ %struct.Decoders = type { i32**, i16***, i16****, i16***, i16**, i8**, i8** }
+ at decoders = external global %struct.Decoders ; <%struct.Decoders*> [#uses=1]
+
+declare i8* @calloc(i32, i32)
+
+declare fastcc i32 @get_mem2Dint(i32***, i32, i32)
+
+define fastcc void @init_global_buffers() nounwind {
+entry:
+ %tmp151 = tail call fastcc i32 @get_mem2Dint( i32*** getelementptr (%struct.Decoders* @decoders, i32 0, i32 0), i32 16, i32 16 ) ; <i32> [#uses=1]
+ %tmp158 = tail call i8* @calloc( i32 0, i32 4 ) ; <i8*> [#uses=0]
+ br i1 false, label %cond_true166, label %bb190.preheader
+
+bb190.preheader: ; preds = %entry
+ %memory_size.3555 = add i32 0, %tmp151 ; <i32> [#uses=0]
+ unreachable
+
+cond_true166: ; preds = %entry
+ unreachable
+}
Modified: llvm/branches/non-call-eh/test/CodeGen/ARM/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/ARM/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/ARM/dg.exp (original)
+++ llvm/branches/non-call-eh/test/CodeGen/ARM/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
load_lib llvm.exp
if { [llvm_supports_target ARM] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+ RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
}
Modified: llvm/branches/non-call-eh/test/CodeGen/Alpha/ctlz.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/Alpha/ctlz.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/Alpha/ctlz.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/Alpha/ctlz.ll Sun Jul 6 15:45:41 2008
@@ -2,7 +2,6 @@
; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev67 | grep -i ctlz
; RUN: llvm-as < %s | llc -march=alpha -mattr=+CIX | grep -i ctlz
; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev6 | not grep -i ctlz
-; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev56 | not grep -i ctlz
; RUN: llvm-as < %s | llc -march=alpha -mattr=-CIX | not grep -i ctlz
declare i8 @llvm.ctlz.i8(i8)
Modified: llvm/branches/non-call-eh/test/CodeGen/Alpha/ctpop.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/Alpha/ctpop.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/Alpha/ctpop.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/Alpha/ctpop.ll Sun Jul 6 15:45:41 2008
@@ -4,8 +4,6 @@
; RUN: grep -i ctpop
; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev6 | \
; RUN: not grep -i ctpop
-; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev56 | \
-; RUN: not grep -i ctpop
; RUN: llvm-as < %s | llc -march=alpha -mattr=-CIX | \
; RUN: not grep -i ctpop
Modified: llvm/branches/non-call-eh/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,5 @@
; For PR1099
-; RUN: llvm-as < %s | llc -march=c | \
-; RUN: grep {return ((((llvm_cbe_tmp2 == llvm_cbe_b_2e_0_2e_0_2e_val)) ? (1) : (0)))}
+; RUN: llvm-as < %s | llc -march=c | grep {(llvm_cbe_tmp2 == llvm_cbe_b_2e_0_2e_0_2e_val)}
target datalayout = "e-p:32:32"
target triple = "i686-apple-darwin8"
Modified: llvm/branches/non-call-eh/test/CodeGen/CBackend/2007-01-15-NamedArrayType.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/CBackend/2007-01-15-NamedArrayType.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/CBackend/2007-01-15-NamedArrayType.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/CBackend/2007-01-15-NamedArrayType.ll Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
; PR918
-; RUN: llvm-as < %s | llc -march=c | not grep fixarray_array3
+; RUN: llvm-as < %s | llc -march=c | not grep {l_structtype_s l_fixarray_array3}
%structtype_s = type { i32 }
%fixarray_array3 = type [3 x %structtype_s]
Added: llvm/branches/non-call-eh/test/CodeGen/CBackend/2008-05-21-MRV-InlineAsm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/CBackend/2008-05-21-MRV-InlineAsm.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/CBackend/2008-05-21-MRV-InlineAsm.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/CBackend/2008-05-21-MRV-InlineAsm.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,19 @@
+; RUN: llvm-as < %s | llc -march=c
+
+declare {i32, i32} @foo()
+
+define i32 @test() {
+ %A = call {i32, i32} @foo()
+ %B = getresult {i32, i32} %A, 0
+ %C = getresult {i32, i32} %A, 1
+ %D = add i32 %B, %C
+ ret i32 %D
+}
+
+define i32 @test2() {
+ %A = call {i32, i32} asm sideeffect "...", "={cx},={di},~{dirflag},~{fpsr},~{flags},~{memory}"()
+ %B = getresult {i32, i32} %A, 0
+ %C = getresult {i32, i32} %A, 1
+ %D = add i32 %B, %C
+ ret i32 %D
+}
Added: llvm/branches/non-call-eh/test/CodeGen/CBackend/2008-05-31-BoolOverflow.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/CBackend/2008-05-31-BoolOverflow.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/CBackend/2008-05-31-BoolOverflow.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/CBackend/2008-05-31-BoolOverflow.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc -march=c | grep {llvm_cbe_t.*&1}
+define i32 @test(i32 %r) {
+ %s = icmp eq i32 %r, 0
+ %t = add i1 %s, %s
+ %u = zext i1 %t to i32
+ br i1 %t, label %A, label %B
+A:
+
+ ret i32 %u
+B:
+
+ %v = select i1 %t, i32 %r, i32 %u
+ ret i32 %v
+}
Added: llvm/branches/non-call-eh/test/CodeGen/CBackend/2008-06-04-IndirectMem.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/CBackend/2008-06-04-IndirectMem.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/CBackend/2008-06-04-IndirectMem.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/CBackend/2008-06-04-IndirectMem.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llc -march=c | grep {"m"(llvm_cbe_newcw))}
+; PR2407
+
+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 = "i386-pc-linux-gnu"
+
+define void @foo() {
+ %newcw = alloca i16 ; <i16*> [#uses=2]
+ call void asm sideeffect "fldcw $0", "*m,~{dirflag},~{fpsr},~{flags}"( i16*
+%newcw ) nounwind
+ ret void
+}
Modified: llvm/branches/non-call-eh/test/CodeGen/CBackend/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/CBackend/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/CBackend/dg.exp (original)
+++ llvm/branches/non-call-eh/test/CodeGen/CBackend/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
load_lib llvm.exp
if { [llvm_supports_target CBackend] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+ RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
}
Modified: llvm/branches/non-call-eh/test/CodeGen/CellSPU/and_ops.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/CellSPU/and_ops.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/CellSPU/and_ops.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/CellSPU/and_ops.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,7 @@
; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep and %t1.s | count 232
+; RUN: grep and %t1.s | count 234
; RUN: grep andc %t1.s | count 85
-; RUN: grep andi %t1.s | count 36
+; RUN: grep andi %t1.s | count 37
; RUN: grep andhi %t1.s | count 30
; RUN: grep andbi %t1.s | count 4
Added: llvm/branches/non-call-eh/test/CodeGen/CellSPU/and_ops_more.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/CellSPU/and_ops_more.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/CellSPU/and_ops_more.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/CellSPU/and_ops_more.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,26 @@
+; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
+; RUN: grep and %t1.s | count 10
+; RUN: not grep andc %t1.s
+; RUN: not grep andi %t1.s
+; RUN: grep andhi %t1.s | count 5
+; RUN: grep andbi %t1.s | count 1
+; XFAIL: *
+
+; This testcase is derived from test/CodeGen/CellSPU/and_ops.ll and
+; records the changes due to r50358. The and_sext8 function appears
+; to be improved by this change, while the andhi_i16 function appears
+; to be pessimized.
+
+target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
+target triple = "spu"
+
+define i16 @andhi_i16(i16 signext %in) signext {
+ %tmp38 = and i16 %in, 37 ; <i16> [#uses=1]
+ ret i16 %tmp38
+}
+
+define i8 @and_sext8(i8 signext %in) signext {
+ ; ANDBI generated
+ %tmp38 = and i8 %in, 37
+ ret i8 %tmp38
+}
Modified: llvm/branches/non-call-eh/test/CodeGen/CellSPU/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/CellSPU/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/CellSPU/dg.exp (original)
+++ llvm/branches/non-call-eh/test/CodeGen/CellSPU/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
load_lib llvm.exp
if { [llvm_supports_target CellSPU] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+ RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
}
Modified: llvm/branches/non-call-eh/test/CodeGen/CellSPU/immed64.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/CellSPU/immed64.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/CellSPU/immed64.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/CellSPU/immed64.ll Sun Jul 6 15:45:41 2008
@@ -1,16 +1,16 @@
; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s
-; RUN: grep lqa %t1.s | count 13
-; RUN: grep il %t1.s | count 22
-; RUN: grep shufb %t1.s | count 13
-; RUN: grep 65520 %t1.s | count 1
-; RUN: grep 43981 %t1.s | count 1
-; RUN: grep 13702 %t1.s | count 1
-; RUN: grep 81 %t1.s | count 2
-; RUN: grep 28225 %t1.s | count 1
-; RUN: grep 30720 %t1.s | count 1
-; RUN: grep 192 %t1.s | count 32
-; RUN: grep 128 %t1.s | count 30
-; RUN: grep 224 %t1.s | count 2
+; RUN: grep lqa %t1.s | count 13
+; RUN: grep il %t1.s | count 22
+; RUN: grep shufb %t1.s | count 13
+; RUN: grep 65520 %t1.s | count 1
+; RUN: grep 43981 %t1.s | count 1
+; RUN: grep 13702 %t1.s | count 1
+; RUN: grep 28225 %t1.s | count 1
+; RUN: grep 30720 %t1.s | count 1
+; RUN: grep 3233857728 %t1.s | count 8
+; RUN: grep 2155905152 %t1.s | count 6
+; RUN: grep 66051 %t1.s | count 7
+; RUN: grep 471670303 %t1.s | count 11
target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
target triple = "spu"
Modified: llvm/branches/non-call-eh/test/CodeGen/Generic/2002-04-14-UnexpectedUnsignedType.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/Generic/2002-04-14-UnexpectedUnsignedType.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/Generic/2002-04-14-UnexpectedUnsignedType.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/Generic/2002-04-14-UnexpectedUnsignedType.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o - | llc
+; RUN: llvm-as %s -o - | llc
; This caused the backend to assert out with:
; SparcInstrInfo.cpp:103: failed assertion `0 && "Unexpected unsigned type"'
Modified: llvm/branches/non-call-eh/test/CodeGen/Generic/GC/badreadproto.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/Generic/GC/badreadproto.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/Generic/GC/badreadproto.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/Generic/GC/badreadproto.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s
+; RUN: not llvm-as < %s >& /dev/null
%list = type { i32, %list* }
Modified: llvm/branches/non-call-eh/test/CodeGen/Generic/GC/badrootproto.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/Generic/GC/badrootproto.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/Generic/GC/badrootproto.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/Generic/GC/badrootproto.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s
+; RUN: not llvm-as < %s >& /dev/null
%list = type { i32, %list* }
%meta = type opaque
Modified: llvm/branches/non-call-eh/test/CodeGen/Generic/GC/badwriteproto.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/Generic/GC/badwriteproto.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/Generic/GC/badwriteproto.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/Generic/GC/badwriteproto.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s
+; RUN: not llvm-as < %s >& /dev/null
%list = type { i32, %list* }
Modified: llvm/branches/non-call-eh/test/CodeGen/Generic/GC/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/Generic/GC/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/Generic/GC/dg.exp (original)
+++ llvm/branches/non-call-eh/test/CodeGen/Generic/GC/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Modified: llvm/branches/non-call-eh/test/CodeGen/Generic/GC/outside.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/Generic/GC/outside.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/Generic/GC/outside.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/Generic/GC/outside.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s
+; RUN: not llvm-as < %s >& /dev/null
declare void @llvm.gcroot(i8**, i8*)
Modified: llvm/branches/non-call-eh/test/CodeGen/Generic/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/Generic/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/Generic/dg.exp (original)
+++ llvm/branches/non-call-eh/test/CodeGen/Generic/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Added: llvm/branches/non-call-eh/test/CodeGen/Generic/getresult-undef.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/Generic/getresult-undef.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/Generic/getresult-undef.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/Generic/getresult-undef.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s | llc
+
+define double @foo() {
+ %t = getresult {double, double} undef, 1
+ ret double %t
+}
Added: llvm/branches/non-call-eh/test/CodeGen/Generic/multiple-return-values-cross-block-with-invoke.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/Generic/multiple-return-values-cross-block-with-invoke.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/Generic/multiple-return-values-cross-block-with-invoke.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/Generic/multiple-return-values-cross-block-with-invoke.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,18 @@
+; RUN: llvm-as < %s | llc
+
+declare { i64, double } @wild()
+
+define void @foo(i64* %p, double* %q) nounwind {
+ %t = invoke { i64, double } @wild() to label %normal unwind label %handler
+
+normal:
+ %mrv_gr = getresult { i64, double } %t, 0
+ store i64 %mrv_gr, i64* %p
+ %mrv_gr12681 = getresult { i64, double } %t, 1
+ store double %mrv_gr12681, double* %q
+ ret void
+
+handler:
+ ret void
+}
+
Added: llvm/branches/non-call-eh/test/CodeGen/Generic/select-cc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/Generic/select-cc.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/Generic/select-cc.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/Generic/select-cc.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llc
+; PR2504
+
+define <2 x double> @vector_select(<2 x double> %x, <2 x double> %y) nounwind {
+ %x.lo = extractelement <2 x double> %x, i32 0 ; <double> [#uses=1]
+ %x.lo.ge = fcmp oge double %x.lo, 0.000000e+00 ; <i1> [#uses=1]
+ %a.d = select i1 %x.lo.ge, <2 x double> %y, <2 x double> %x ; <<2 x double>> [#uses=1]
+ ret <2 x double> %a.d
+}
Modified: llvm/branches/non-call-eh/test/CodeGen/Generic/spillccr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/Generic/spillccr.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/Generic/spillccr.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/Generic/spillccr.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o - | llc
+; RUN: llvm-as %s -o - | llc
; July 6, 2002 -- LLC Regression test
; This test case checks if the integer CC register %xcc (or %ccr)
Modified: llvm/branches/non-call-eh/test/CodeGen/Generic/switch-lower-feature.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/Generic/switch-lower-feature.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/Generic/switch-lower-feature.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/Generic/switch-lower-feature.ll Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$7 | count 1
-; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$6 | count 1
+; RUN: llvm-as < %s | llc -march=x86 -o - | grep {\$7} | count 1
+; RUN: llvm-as < %s | llc -march=x86 -o - | grep {\$6} | count 1
; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1024 | count 1
; RUN: llvm-as < %s | llc -march=x86 -o - | grep jb | count 2
; RUN: llvm-as < %s | llc -march=x86 -o - | grep je | count 1
Modified: llvm/branches/non-call-eh/test/CodeGen/IA64/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/IA64/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/IA64/dg.exp (original)
+++ llvm/branches/non-call-eh/test/CodeGen/IA64/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
load_lib llvm.exp
if { [llvm_supports_target IA64] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+ RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
}
Modified: llvm/branches/non-call-eh/test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll Sun Jul 6 15:45:41 2008
@@ -1,15 +1,14 @@
; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8.8.0 | grep {foo r3, r4}
-; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8.8.0 | grep {bar r3, r}
+; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8.8.0 | grep {bari r3, 47}
; PR1351
-define i32 @test1(i32 %Y, i32 %X) {
+define i32 @test1(i32 %Y, i32 %X) nounwind {
%tmp1 = tail call i32 asm "foo${1:I} $0, $1", "=r,rI"( i32 %X )
ret i32 %tmp1
}
-;; TODO: We'd actually prefer this to be 'bari r3, 47', but 'bar r3, rN' is also ok.
-define i32 @test2(i32 %Y, i32 %X) {
+define i32 @test2(i32 %Y, i32 %X) nounwind {
%tmp1 = tail call i32 asm "bar${1:I} $0, $1", "=r,rI"( i32 47 )
ret i32 %tmp1
}
Added: llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-04-23-CoalescerCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-04-23-CoalescerCrash.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-04-23-CoalescerCrash.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-04-23-CoalescerCrash.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,89 @@
+; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin
+
+ at _ZL10DeviceCode = internal global i16 0 ; <i16*> [#uses=1]
+ at .str19 = internal constant [64 x i8] c"unlock_then_erase_sector: failed to erase block (status= 0x%x)\0A\00" ; <[64 x i8]*> [#uses=1]
+ at .str34 = internal constant [68 x i8] c"ProgramByWords - Erasing sector 0x%llx to 0x%llx (size 0x%x bytes)\0A\00" ; <[68 x i8]*> [#uses=1]
+ at .str35 = internal constant [37 x i8] c"ProgramByWords - Done erasing flash\0A\00" ; <[37 x i8]*> [#uses=1]
+ at .str36 = internal constant [48 x i8] c"ProgramByWords - Starting to write to FLASH...\0A\00" ; <[48 x i8]*> [#uses=1]
+
+declare void @IOLog(i8*, ...)
+
+declare void @IODelay(i32)
+
+define i32 @_Z14ProgramByWordsPvyy(i8* %buffer, i64 %Offset, i64 %bufferSize) nounwind {
+entry:
+ volatile store i8 -1, i8* null, align 1
+ %tmp28 = icmp eq i8 0, 0 ; <i1> [#uses=1]
+ br i1 %tmp28, label %bb107, label %bb
+
+bb: ; preds = %entry
+ %tmp9596430 = zext i32 0 to i64 ; <i64> [#uses=1]
+ %tmp98431 = add i64 %tmp9596430, %Offset ; <i64> [#uses=1]
+ %tmp100433 = icmp ugt i64 %tmp98431, %Offset ; <i1> [#uses=1]
+ br i1 %tmp100433, label %bb31, label %bb103
+
+bb31: ; preds = %_Z24unlock_then_erase_sectory.exit, %bb
+ %Pos.0.reg2mem.0 = phi i64 [ %tmp93, %_Z24unlock_then_erase_sectory.exit ], [ %Offset, %bb ] ; <i64> [#uses=3]
+ %tmp35 = load i16* @_ZL10DeviceCode, align 2 ; <i16> [#uses=1]
+ %tmp3536 = zext i16 %tmp35 to i32 ; <i32> [#uses=2]
+ %tmp37 = and i32 %tmp3536, 65520 ; <i32> [#uses=1]
+ %tmp38 = icmp eq i32 %tmp37, 35008 ; <i1> [#uses=1]
+ %tmp34 = sub i64 %Pos.0.reg2mem.0, %Offset ; <i64> [#uses=2]
+ br i1 %tmp38, label %bb41, label %bb68
+
+bb41: ; preds = %bb31
+ %tmp43 = add i32 0, -1 ; <i32> [#uses=1]
+ %tmp4344 = zext i32 %tmp43 to i64 ; <i64> [#uses=1]
+ %tmp46 = and i64 %tmp4344, %tmp34 ; <i64> [#uses=0]
+ %tmp49 = and i32 %tmp3536, 1 ; <i32> [#uses=0]
+ ret i32 0
+
+bb68: ; preds = %bb31
+ tail call void (i8*, ...)* @IOLog( i8* getelementptr ([68 x i8]* @.str34, i32 0, i32 0), i64 %tmp34, i64 0, i32 131072 ) nounwind
+ %tmp2021.i = trunc i64 %Pos.0.reg2mem.0 to i32 ; <i32> [#uses=1]
+ %tmp202122.i = inttoptr i32 %tmp2021.i to i8* ; <i8*> [#uses=1]
+ tail call void @IODelay( i32 500 ) nounwind
+ %tmp53.i = volatile load i16* null, align 2 ; <i16> [#uses=2]
+ %tmp5455.i = zext i16 %tmp53.i to i32 ; <i32> [#uses=1]
+ br i1 false, label %bb.i, label %bb65.i
+
+bb.i: ; preds = %bb68
+ ret i32 0
+
+bb65.i: ; preds = %bb68
+ %tmp67.i = icmp eq i16 %tmp53.i, 128 ; <i1> [#uses=1]
+ br i1 %tmp67.i, label %_Z24unlock_then_erase_sectory.exit, label %bb70.i
+
+bb70.i: ; preds = %bb65.i
+ tail call void (i8*, ...)* @IOLog( i8* getelementptr ([64 x i8]* @.str19, i32 0, i32 0), i32 %tmp5455.i ) nounwind
+ ret i32 0
+
+_Z24unlock_then_erase_sectory.exit: ; preds = %bb65.i
+ volatile store i8 -1, i8* %tmp202122.i, align 1
+ %tmp93 = add i64 0, %Pos.0.reg2mem.0 ; <i64> [#uses=2]
+ %tmp98 = add i64 0, %Offset ; <i64> [#uses=1]
+ %tmp100 = icmp ugt i64 %tmp98, %tmp93 ; <i1> [#uses=1]
+ br i1 %tmp100, label %bb31, label %bb103
+
+bb103: ; preds = %_Z24unlock_then_erase_sectory.exit, %bb
+ tail call void (i8*, ...)* @IOLog( i8* getelementptr ([37 x i8]* @.str35, i32 0, i32 0) ) nounwind
+ ret i32 0
+
+bb107: ; preds = %entry
+ tail call void (i8*, ...)* @IOLog( i8* getelementptr ([48 x i8]* @.str36, i32 0, i32 0) ) nounwind
+ %tmp114115 = bitcast i8* %buffer to i16* ; <i16*> [#uses=1]
+ %tmp256 = lshr i64 %bufferSize, 1 ; <i64> [#uses=1]
+ %tmp256257 = trunc i64 %tmp256 to i32 ; <i32> [#uses=1]
+ %tmp258 = getelementptr i16* %tmp114115, i32 %tmp256257 ; <i16*> [#uses=0]
+ ret i32 0
+}
+
+define i32 @_Z17program_64B_blockyPm(i64 %Base, i32* %pData) nounwind {
+entry:
+ unreachable
+}
+
+define i32 @_Z15ProgramByBlocksyy(i64 %Offset, i64 %bufferSize) nounwind {
+entry:
+ ret i32 0
+}
Added: llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-05-01-ppc_fp128.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-05-01-ppc_fp128.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-05-01-ppc_fp128.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-05-01-ppc_fp128.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llc -march=ppc32
+target triple = "powerpc-apple-darwin9.2.2"
+
+define i256 @func(ppc_fp128 %a, ppc_fp128 %b, ppc_fp128 %c, ppc_fp128 %d) nounwind readnone {
+entry:
+ br i1 false, label %bb36, label %bb484
+
+bb36: ; preds = %entry
+ %tmp124 = fcmp ord ppc_fp128 %b, 0xM00000000000000000000000000000000 ; <i1> [#uses=1]
+ %tmp140 = and i1 %tmp124, fcmp une (ppc_fp128 0xM00000000000000000000000000000000, ppc_fp128 0xM00000000000000000000000000000000) ; <i1> [#uses=0]
+ unreachable
+
+bb484: ; preds = %entry
+ ret i256 0
+}
Added: llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-06-19-LegalizerCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-06-19-LegalizerCrash.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-06-19-LegalizerCrash.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-06-19-LegalizerCrash.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s | llc -march=ppc32
+
+define void @t() nounwind {
+ call void null( ppc_fp128 undef )
+ unreachable
+}
Added: llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-06-21-F128LoadStore.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-06-21-F128LoadStore.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-06-21-F128LoadStore.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-06-21-F128LoadStore.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=ppc32
+
+ at g = external global ppc_fp128
+ at h = external global ppc_fp128
+
+define void @f() {
+ %tmp = load ppc_fp128* @g
+ store ppc_fp128 %tmp, ppc_fp128* @h
+ ret void
+}
Added: llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-06-23-LiveVariablesCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-06-23-LiveVariablesCrash.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-06-23-LiveVariablesCrash.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-06-23-LiveVariablesCrash.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,25 @@
+; RUN: llvm-as < %s | llc -march=ppc32
+; <rdar://problem/6020042>
+
+define i32 @bork() nounwind {
+entry:
+ br i1 true, label %bb1, label %bb3
+
+bb1:
+ %tmp1 = load i8* null, align 1
+ %tmp2 = icmp eq i8 %tmp1, 0
+ br label %bb2
+
+bb2:
+ %val1 = phi i32 [ 0, %bb1 ], [ %val2, %bb2 ]
+ %val2 = select i1 %tmp2, i32 -1, i32 %val1
+ switch i32 %val2, label %bb2 [
+ i32 -1, label %bb3
+ i32 0, label %bb1
+ i32 1, label %bb3
+ i32 2, label %bb1
+ ]
+
+bb3:
+ ret i32 -1
+}
Modified: llvm/branches/non-call-eh/test/CodeGen/PowerPC/atomic-1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/PowerPC/atomic-1.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/PowerPC/atomic-1.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/PowerPC/atomic-1.ll Sun Jul 6 15:45:41 2008
@@ -2,17 +2,17 @@
; RUN: llvm-as < %s | llc -march=ppc32 | grep stwcx. | count 4
define i32 @exchange_and_add(i32* %mem, i32 %val) nounwind {
- %tmp = call i32 @llvm.atomic.las.i32( i32* %mem, i32 %val )
+ %tmp = call i32 @llvm.atomic.load.add.i32( i32* %mem, i32 %val )
ret i32 %tmp
}
define i32 @exchange_and_cmp(i32* %mem) nounwind {
- %tmp = call i32 @llvm.atomic.lcs.i32( i32* %mem, i32 0, i32 1 )
+ %tmp = call i32 @llvm.atomic.cmp.swap.i32( i32* %mem, i32 0, i32 1 )
ret i32 %tmp
}
define i16 @exchange_and_cmp16(i16* %mem) nounwind {
- %tmp = call i16 @llvm.atomic.lcs.i16( i16* %mem, i16 0, i16 1 )
+ %tmp = call i16 @llvm.atomic.cmp.swap.i16( i16* %mem, i16 0, i16 1 )
ret i16 %tmp
}
@@ -21,7 +21,7 @@
ret i32 %tmp
}
-declare i32 @llvm.atomic.las.i32(i32*, i32) nounwind
-declare i32 @llvm.atomic.lcs.i32(i32*, i32, i32) nounwind
-declare i16 @llvm.atomic.lcs.i16(i16*, i16, i16) nounwind
+declare i32 @llvm.atomic.load.add.i32(i32*, i32) nounwind
+declare i32 @llvm.atomic.cmp.swap.i32(i32*, i32, i32) nounwind
+declare i16 @llvm.atomic.cmp.swap.i16(i16*, i16, i16) nounwind
declare i32 @llvm.atomic.swap.i32(i32*, i32) nounwind
Modified: llvm/branches/non-call-eh/test/CodeGen/PowerPC/atomic-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/PowerPC/atomic-2.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/PowerPC/atomic-2.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/PowerPC/atomic-2.ll Sun Jul 6 15:45:41 2008
@@ -2,12 +2,12 @@
; RUN: llvm-as < %s | llc -march=ppc64 | grep stdcx. | count 3
define i64 @exchange_and_add(i64* %mem, i64 %val) nounwind {
- %tmp = call i64 @llvm.atomic.las.i64( i64* %mem, i64 %val )
+ %tmp = call i64 @llvm.atomic.load.add.i64( i64* %mem, i64 %val )
ret i64 %tmp
}
define i64 @exchange_and_cmp(i64* %mem) nounwind {
- %tmp = call i64 @llvm.atomic.lcs.i64( i64* %mem, i64 0, i64 1 )
+ %tmp = call i64 @llvm.atomic.cmp.swap.i64( i64* %mem, i64 0, i64 1 )
ret i64 %tmp
}
@@ -16,6 +16,6 @@
ret i64 %tmp
}
-declare i64 @llvm.atomic.las.i64(i64*, i64) nounwind
-declare i64 @llvm.atomic.lcs.i64(i64*, i64, i64) nounwind
+declare i64 @llvm.atomic.load.add.i64(i64*, i64) nounwind
+declare i64 @llvm.atomic.cmp.swap.i64(i64*, i64, i64) nounwind
declare i64 @llvm.atomic.swap.i64(i64*, i64) nounwind
Modified: llvm/branches/non-call-eh/test/CodeGen/PowerPC/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/PowerPC/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/PowerPC/dg.exp (original)
+++ llvm/branches/non-call-eh/test/CodeGen/PowerPC/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
load_lib llvm.exp
if { [llvm_supports_target PowerPC] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+ RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
}
Added: llvm/branches/non-call-eh/test/CodeGen/PowerPC/tailcall1-64.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/PowerPC/tailcall1-64.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/PowerPC/tailcall1-64.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/PowerPC/tailcall1-64.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -march=ppc64 -tailcallopt | grep TC_RETURNd8
+define fastcc i32 @tailcallee(i32 %a1, i32 %a2, i32 %a3, i32 %a4) {
+entry:
+ ret i32 %a3
+}
+
+define fastcc i32 @tailcaller(i32 %in1, i32 %in2) {
+entry:
+ %tmp11 = tail call fastcc i32 @tailcallee( i32 %in1, i32 %in2, i32 %in1, i32 %in2 ) ; <i32> [#uses=1]
+ ret i32 %tmp11
+}
Added: llvm/branches/non-call-eh/test/CodeGen/PowerPC/tailcall1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/PowerPC/tailcall1.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/PowerPC/tailcall1.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/PowerPC/tailcall1.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -march=ppc32 -tailcallopt | grep TC_RETURN
+define fastcc i32 @tailcallee(i32 %a1, i32 %a2, i32 %a3, i32 %a4) {
+entry:
+ ret i32 %a3
+}
+
+define fastcc i32 @tailcaller(i32 %in1, i32 %in2) {
+entry:
+ %tmp11 = tail call fastcc i32 @tailcallee( i32 %in1, i32 %in2, i32 %in1, i32 %in2 ) ; <i32> [#uses=1]
+ ret i32 %tmp11
+}
Added: llvm/branches/non-call-eh/test/CodeGen/PowerPC/tailcallpic1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/PowerPC/tailcallpic1.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/PowerPC/tailcallpic1.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/PowerPC/tailcallpic1.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc -tailcallopt -mtriple=powerpc-apple-darwin -relocation-model=pic | grep TC_RETURN
+
+
+
+define protected fastcc i32 @tailcallee(i32 %a1, i32 %a2, i32 %a3, i32 %a4) {
+entry:
+ ret i32 %a3
+}
+
+define fastcc i32 @tailcaller(i32 %in1, i32 %in2) {
+entry:
+ %tmp11 = tail call fastcc i32 @tailcallee( i32 %in1, i32 %in2, i32 %in1, i32 %in2 ) ; <i32> [#uses=1]
+ ret i32 %tmp11
+}
Modified: llvm/branches/non-call-eh/test/CodeGen/SPARC/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/SPARC/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/SPARC/dg.exp (original)
+++ llvm/branches/non-call-eh/test/CodeGen/SPARC/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
load_lib llvm.exp
if { [llvm_supports_target Sparc] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+ RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll Sun Jul 6 15:45:41 2008
@@ -1,9 +1,7 @@
; RUN: llvm-as < %s | \
-; RUN: llc -march=x86 -mtriple=i686-apple-darwin8 -relocation-model=static | \
-; RUN: grep {movl _last} | count 1
-; RUN: llvm-as < %s | \
-; RUN: llc -march=x86 -mtriple=i686-apple-darwin8 -relocation-model=static | \
-; RUN: grep {cmpl.*_last} | count 1
+; RUN: llc -march=x86 -mtriple=i686-apple-darwin8 -relocation-model=static > %t
+; RUN: grep {movl _last} %t | count 1
+; RUN: grep {cmpl.*_last} %t | count 1
@block = external global i8* ; <i8**> [#uses=1]
@last = external global i32 ; <i32*> [#uses=3]
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/2006-05-11-InstrSched.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2006-05-11-InstrSched.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2006-05-11-InstrSched.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2006-05-11-InstrSched.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats |&\
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats -realign-stack=0 |&\
; RUN: grep {asm-printer} | grep 32
target datalayout = "e-p:32:32"
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/2006-05-17-VectorArg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2006-05-17-VectorArg.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2006-05-17-VectorArg.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2006-05-17-VectorArg.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-define <4 x float> @opRSQ(<4 x float> %a) {
+define <4 x float> @opRSQ(<4 x float> %a) nounwind {
entry:
%tmp2 = extractelement <4 x float> %a, i32 3 ; <float> [#uses=2]
%abscond = fcmp oge float %tmp2, -0.000000e+00 ; <i1> [#uses=1]
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/2006-07-31-SingleRegClass.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2006-07-31-SingleRegClass.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2006-07-31-SingleRegClass.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2006-07-31-SingleRegClass.ll Sun Jul 6 15:45:41 2008
@@ -1,8 +1,7 @@
; PR850
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | \
-; RUN: grep {movl 4(%eax),%ebp}
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | \
-; RUN: grep {movl 0(%eax), %ebx}
+; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att > %t
+; RUN: grep {movl 4(%eax),%ebp} %t
+; RUN: grep {movl 0(%eax), %ebx} %t
define i32 @foo(i32 %__s.i.i, i32 %tmp5.i.i, i32 %tmp6.i.i, i32 %tmp7.i.i, i32 %tmp8.i.i) {
%tmp9.i.i = call i32 asm sideeffect "push %ebp\0Apush %ebx\0Amovl 4($2),%ebp\0Amovl 0($2), %ebx\0Amovl $1,%eax\0Aint $$0x80\0Apop %ebx\0Apop %ebp", "={ax},i,0,{cx},{dx},{si},{di}"( i32 192, i32 %__s.i.i, i32 %tmp5.i.i, i32 %tmp6.i.i, i32 %tmp7.i.i, i32 %tmp8.i.i ) ; <i32> [#uses=1]
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/2006-11-17-IllegalMove.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2006-11-17-IllegalMove.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2006-11-17-IllegalMove.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2006-11-17-IllegalMove.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,6 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | \
-; RUN: grep movb | count 2
-; RUN: llvm-as < %s | llc -march=x86-64 | \
-; RUN: grep movzbw
+; RUN: llvm-as < %s | llc -march=x86-64 > %t
+; RUN: grep movb %t | count 2
+; RUN: grep movzbw %t
define void @handle_vector_size_attribute() {
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/2006-11-28-Memcpy.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2006-11-28-Memcpy.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2006-11-28-Memcpy.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2006-11-28-Memcpy.ll Sun Jul 6 15:45:41 2008
@@ -8,7 +8,7 @@
@bytes = constant [4 x i8] c"\AA\BB\CC\DD" ; <[4 x i8]*> [#uses=1]
@bytes2 = global [4 x i8] c"\AA\BB\CC\DD" ; <[4 x i8]*> [#uses=1]
-define i32 @test1() {
+define i32 @test1() nounwind {
%y = alloca i32 ; <i32*> [#uses=2]
%c = bitcast i32* %y to i8* ; <i8*> [#uses=1]
%z = getelementptr [4 x i8]* @bytes, i32 0, i32 0 ; <i8*> [#uses=1]
@@ -19,7 +19,7 @@
ret i32 0
}
-define void @test2() {
+define void @test2() nounwind {
%y = alloca i32 ; <i32*> [#uses=2]
%c = bitcast i32* %y to i8* ; <i8*> [#uses=1]
%z = getelementptr [4 x i8]* @bytes2, i32 0, i32 0 ; <i8*> [#uses=1]
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll Sun Jul 6 15:45:41 2008
@@ -1,5 +1,6 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep leaq
-; RUN: llvm-as < %s | llc -march=x86-64 | not grep {,%rsp)}
+; RUN: llvm-as < %s | llc -march=x86-64 > %t
+; RUN: grep leaq %t
+; RUN: not grep {,%rsp)} %t
; PR1103
target datalayout = "e-p:64:64"
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/2007-06-28-X86-64-isel.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2007-06-28-X86-64-isel.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2007-06-28-X86-64-isel.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2007-06-28-X86-64-isel.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | | llc -march=x86-64 -mattr=+sse2
+; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+sse2
define void @test() {
%tmp1 = call <8 x i16> @llvm.x86.sse2.pmins.w( <8 x i16> zeroinitializer, <8 x i16> bitcast (<4 x i32> < i32 7, i32 7, i32 7, i32 7 > to <8 x i16>) )
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/2007-06-29-DAGCombinerBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2007-06-29-DAGCombinerBug.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2007-06-29-DAGCombinerBug.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2007-06-29-DAGCombinerBug.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | | llc -march=x86 -mattr=+sse2
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
define void @test() {
entry:
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/2007-06-29-VecFPConstantCSEBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2007-06-29-VecFPConstantCSEBug.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2007-06-29-VecFPConstantCSEBug.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2007-06-29-VecFPConstantCSEBug.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | | llc -march=x86 -mattr=+sse2
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
define void @test(<4 x float>* %arg) {
%tmp89 = getelementptr <4 x float>* %arg, i64 3
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/2007-07-03-GR64ToVR64.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2007-07-03-GR64ToVR64.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2007-07-03-GR64ToVR64.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2007-07-03-GR64ToVR64.ll Sun Jul 6 15:45:41 2008
@@ -1,10 +1,10 @@
-; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+mmx | grep {movd %rsi, %mm0}
-; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+mmx | grep {movd %rdi, %mm1}
-; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+mmx | grep {paddusw %mm0, %mm1}
+; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx | grep {movd %rsi, %mm0}
+; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx | grep {movd %rdi, %mm1}
+; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx | grep {paddusw %mm0, %mm1}
@R = external global <1 x i64> ; <<1 x i64>*> [#uses=1]
-define void @foo(<1 x i64> %A, <1 x i64> %B) {
+define void @foo(<1 x i64> %A, <1 x i64> %B) nounwind {
entry:
%tmp4 = bitcast <1 x i64> %B to <4 x i16> ; <<4 x i16>> [#uses=1]
%tmp6 = bitcast <1 x i64> %A to <4 x i16> ; <<4 x i16>> [#uses=1]
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/2007-10-04-AvoidEFLAGSCopy.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2007-10-04-AvoidEFLAGSCopy.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2007-10-04-AvoidEFLAGSCopy.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2007-10-04-AvoidEFLAGSCopy.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc | not grep pushf
+; RUN: llvm-as < %s | llc -march=x86 | not grep pushf
%struct.gl_texture_image = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8* }
%struct.gl_texture_object = type { i32, i32, i32, float, [4 x i32], i32, i32, i32, i32, i32, float, [11 x %struct.gl_texture_image*], [1024 x i8], i32, i32, i32, i8, i8*, i8, void (%struct.gl_texture_object*, i32, float*, float*, float*, float*, i8*, i8*, i8*, i8*)*, %struct.gl_texture_object* }
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep movl | count 4
+; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep movl | count 2
%struct.double_int = type { i64, i64 }
%struct.tree_common = type <{ i8, [3 x i8] }>
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll Sun Jul 6 15:45:41 2008
@@ -3,7 +3,7 @@
declare fastcc void @rdft(i32, i32, double*, i32*, double*)
-define fastcc void @mp_sqrt(i32 %n, i32 %radix, i32* %in, i32* %out, i32* %tmp1, i32* %tmp2, i32 %nfft, double* %tmp1fft, double* %tmp2fft, i32* %ip, double* %w) {
+define fastcc void @mp_sqrt(i32 %n, i32 %radix, i32* %in, i32* %out, i32* %tmp1, i32* %tmp2, i32 %nfft, double* %tmp1fft, double* %tmp2fft, i32* %ip, double* %w) nounwind {
entry:
br label %bb.i5
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/2008-02-18-TailMergingBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-02-18-TailMergingBug.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-02-18-TailMergingBug.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-02-18-TailMergingBug.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -stats |& grep {Number of block tails merged} | grep 6
+; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -stats |& grep {Number of block tails merged} | grep 9
; PR1909
@.str = internal constant [48 x i8] c"transformed bounds: (%.2f, %.2f), (%.2f, %.2f)\0A\00" ; <[48 x i8]*> [#uses=1]
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-24-MemCpyBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-24-MemCpyBug.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-24-MemCpyBug.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-24-MemCpyBug.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llc -march=x86 | not grep 120
+; Don't accidentally add the offset twice for trailing bytes.
+
+ %struct.S63 = type { [63 x i8] }
+ at g1s63 = external global %struct.S63 ; <%struct.S63*> [#uses=1]
+
+declare void @test63(%struct.S63* byval align 4 ) nounwind
+
+define void @testit63_entry_2E_ce() nounwind {
+ tail call void @test63( %struct.S63* byval align 4 @g1s63 ) nounwind
+ ret void
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-24-pblendw-fold-crash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-24-pblendw-fold-crash.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-24-pblendw-fold-crash.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-24-pblendw-fold-crash.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llc -mattr=+sse41
+; rdar://5886601
+; gcc testsuite: gcc.target/i386/sse4_1-pblendw.c
+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-darwin8"
+
+define i32 @main() nounwind {
+entry:
+ %tmp122 = load <2 x i64>* null, align 16 ; <<2 x i64>> [#uses=1]
+ %tmp126 = bitcast <2 x i64> %tmp122 to <8 x i16> ; <<8 x i16>> [#uses=1]
+ %tmp129 = call <8 x i16> @llvm.x86.sse41.pblendw( <8 x i16> zeroinitializer, <8 x i16> %tmp126, i32 2 ) nounwind ; <<8 x i16>> [#uses=0]
+ ret i32 0
+}
+
+declare <8 x i16> @llvm.x86.sse41.pblendw(<8 x i16>, <8 x i16>, i32) nounwind
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-26-Asm-Optimize-Imm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-26-Asm-Optimize-Imm.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-26-Asm-Optimize-Imm.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-26-Asm-Optimize-Imm.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc | grep {1 \$2 3}
+; rdar://5720231
+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-darwin8"
+
+define void @test() nounwind {
+entry:
+ tail call void asm sideeffect " ${0:c} $1 ${2:c} ", "imr,imr,i,~{dirflag},~{fpsr},~{flags}"( i32 1, i32 2, i32 3 ) nounwind
+ ret void
+}
+
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-28-CoalescerBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-28-CoalescerBug.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-28-CoalescerBug.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-28-CoalescerBug.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,167 @@
+; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | grep movl > %t
+; RUN: not grep {r\[abcd\]x} %t
+; RUN: not grep {r\[ds\]i} %t
+; RUN: not grep {r\[bs\]p} %t
+
+ %struct.BITMAP = type { i16, i16, i32, i32, i32, i32, i32, i32, i8*, i8* }
+ %struct.BltData = type { float, float, float, float }
+ %struct.BltDepth = type { i32, i8**, i32, %struct.BITMAP* (%struct.BltDepth**, %struct.BITMAP*, i32, i32, float*, float, i32)*, i32 (%struct.BltDepth**, %struct.BltOp*)*, i32 (%struct.BltDepth**, %struct.BltOp*, %struct.BltImg*)*, i32 (%struct.BltDepth**, %struct.BltOp*, %struct.BltSh*)*, [28 x [2 x [2 x i32]]]*, %struct.BltData* }
+ %struct.BltImg = type { i32, i8, i8, i8, float, float*, float*, i32, i32, float*, i32 (i8*, i8*, i8**, i32*, i8**, i32*)*, i8* }
+ %struct.BltOp = type { i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i8* }
+ %struct.BltSh = type { i8, i8, i8, i8, float, float*, float*, float*, float*, i32, i32, float*, float*, float* }
+
+define void @t(%struct.BltDepth* %depth, %struct.BltOp* %bop, i32 %mode) nounwind {
+entry:
+ switch i32 %mode, label %return [
+ i32 1, label %bb2898.us
+ i32 18, label %bb13086.preheader
+ ]
+
+bb13086.preheader: ; preds = %entry
+ %tmp13098 = icmp eq i32 0, 0 ; <i1> [#uses=1]
+ %tmp13238 = icmp eq i32 0, 0 ; <i1> [#uses=1]
+ br label %bb13088
+
+bb2898.us: ; preds = %bb2898.us, %entry
+ br label %bb2898.us
+
+bb13088: ; preds = %bb13572, %bb13567, %bb13107, %bb13086.preheader
+ br i1 %tmp13098, label %bb13107, label %bb13101
+
+bb13101: ; preds = %bb13088
+ br label %bb13107
+
+bb13107: ; preds = %bb13101, %bb13088
+ %iftmp.684.0 = phi i32 [ 0, %bb13101 ], [ 65535, %bb13088 ] ; <i32> [#uses=2]
+ %tmp13111 = load i64* null, align 8 ; <i64> [#uses=3]
+ %tmp13116 = lshr i64 %tmp13111, 16 ; <i64> [#uses=1]
+ %tmp1311613117 = trunc i64 %tmp13116 to i32 ; <i32> [#uses=1]
+ %tmp13118 = and i32 %tmp1311613117, 65535 ; <i32> [#uses=1]
+ %tmp13120 = lshr i64 %tmp13111, 32 ; <i64> [#uses=1]
+ %tmp1312013121 = trunc i64 %tmp13120 to i32 ; <i32> [#uses=1]
+ %tmp13122 = and i32 %tmp1312013121, 65535 ; <i32> [#uses=2]
+ %tmp13124 = lshr i64 %tmp13111, 48 ; <i64> [#uses=1]
+ %tmp1312413125 = trunc i64 %tmp13124 to i32 ; <i32> [#uses=2]
+ %tmp1314013141not = xor i16 0, -1 ; <i16> [#uses=1]
+ %tmp1314013141not13142 = zext i16 %tmp1314013141not to i32 ; <i32> [#uses=3]
+ %tmp13151 = mul i32 %tmp13122, %tmp1314013141not13142 ; <i32> [#uses=1]
+ %tmp13154 = mul i32 %tmp1312413125, %tmp1314013141not13142 ; <i32> [#uses=1]
+ %tmp13157 = mul i32 %iftmp.684.0, %tmp1314013141not13142 ; <i32> [#uses=1]
+ %tmp13171 = add i32 %tmp13151, 1 ; <i32> [#uses=1]
+ %tmp13172 = add i32 %tmp13171, 0 ; <i32> [#uses=1]
+ %tmp13176 = add i32 %tmp13154, 1 ; <i32> [#uses=1]
+ %tmp13177 = add i32 %tmp13176, 0 ; <i32> [#uses=1]
+ %tmp13181 = add i32 %tmp13157, 1 ; <i32> [#uses=1]
+ %tmp13182 = add i32 %tmp13181, 0 ; <i32> [#uses=1]
+ %tmp13188 = lshr i32 %tmp13172, 16 ; <i32> [#uses=1]
+ %tmp13190 = lshr i32 %tmp13177, 16 ; <i32> [#uses=1]
+ %tmp13192 = lshr i32 %tmp13182, 16 ; <i32> [#uses=1]
+ %tmp13198 = sub i32 %tmp13118, 0 ; <i32> [#uses=1]
+ %tmp13201 = sub i32 %tmp13122, %tmp13188 ; <i32> [#uses=1]
+ %tmp13204 = sub i32 %tmp1312413125, %tmp13190 ; <i32> [#uses=1]
+ %tmp13207 = sub i32 %iftmp.684.0, %tmp13192 ; <i32> [#uses=1]
+ %tmp1320813209 = zext i32 %tmp13204 to i64 ; <i64> [#uses=1]
+ %tmp13211 = shl i64 %tmp1320813209, 48 ; <i64> [#uses=1]
+ %tmp1321213213 = zext i32 %tmp13201 to i64 ; <i64> [#uses=1]
+ %tmp13214 = shl i64 %tmp1321213213, 32 ; <i64> [#uses=1]
+ %tmp13215 = and i64 %tmp13214, 281470681743360 ; <i64> [#uses=1]
+ %tmp1321713218 = zext i32 %tmp13198 to i64 ; <i64> [#uses=1]
+ %tmp13219 = shl i64 %tmp1321713218, 16 ; <i64> [#uses=1]
+ %tmp13220 = and i64 %tmp13219, 4294901760 ; <i64> [#uses=1]
+ %tmp13216 = or i64 %tmp13211, 0 ; <i64> [#uses=1]
+ %tmp13221 = or i64 %tmp13216, %tmp13215 ; <i64> [#uses=1]
+ %tmp13225 = or i64 %tmp13221, %tmp13220 ; <i64> [#uses=4]
+ %tmp1322713228 = trunc i32 %tmp13207 to i16 ; <i16> [#uses=4]
+ %tmp13233 = icmp eq i16 %tmp1322713228, 0 ; <i1> [#uses=1]
+ br i1 %tmp13233, label %bb13088, label %bb13236
+
+bb13236: ; preds = %bb13107
+ br i1 false, label %bb13567, label %bb13252
+
+bb13252: ; preds = %bb13236
+ %tmp1329013291 = zext i16 %tmp1322713228 to i64 ; <i64> [#uses=8]
+ %tmp13296 = lshr i64 %tmp13225, 16 ; <i64> [#uses=1]
+ %tmp13297 = and i64 %tmp13296, 65535 ; <i64> [#uses=1]
+ %tmp13299 = lshr i64 %tmp13225, 32 ; <i64> [#uses=1]
+ %tmp13300 = and i64 %tmp13299, 65535 ; <i64> [#uses=1]
+ %tmp13302 = lshr i64 %tmp13225, 48 ; <i64> [#uses=1]
+ %tmp13306 = sub i64 %tmp1329013291, 0 ; <i64> [#uses=0]
+ %tmp13309 = sub i64 %tmp1329013291, %tmp13297 ; <i64> [#uses=1]
+ %tmp13312 = sub i64 %tmp1329013291, %tmp13300 ; <i64> [#uses=1]
+ %tmp13315 = sub i64 %tmp1329013291, %tmp13302 ; <i64> [#uses=1]
+ %tmp13318 = mul i64 %tmp1329013291, %tmp1329013291 ; <i64> [#uses=1]
+ br i1 false, label %bb13339, label %bb13324
+
+bb13324: ; preds = %bb13252
+ br i1 false, label %bb13339, label %bb13330
+
+bb13330: ; preds = %bb13324
+ %tmp13337 = sdiv i64 0, 0 ; <i64> [#uses=1]
+ br label %bb13339
+
+bb13339: ; preds = %bb13330, %bb13324, %bb13252
+ %r0120.0 = phi i64 [ %tmp13337, %bb13330 ], [ 0, %bb13252 ], [ 4294836225, %bb13324 ] ; <i64> [#uses=1]
+ br i1 false, label %bb13360, label %bb13345
+
+bb13345: ; preds = %bb13339
+ br i1 false, label %bb13360, label %bb13351
+
+bb13351: ; preds = %bb13345
+ %tmp13354 = mul i64 0, %tmp13318 ; <i64> [#uses=1]
+ %tmp13357 = sub i64 %tmp1329013291, %tmp13309 ; <i64> [#uses=1]
+ %tmp13358 = sdiv i64 %tmp13354, %tmp13357 ; <i64> [#uses=1]
+ br label %bb13360
+
+bb13360: ; preds = %bb13351, %bb13345, %bb13339
+ %r1121.0 = phi i64 [ %tmp13358, %bb13351 ], [ 0, %bb13339 ], [ 4294836225, %bb13345 ] ; <i64> [#uses=1]
+ br i1 false, label %bb13402, label %bb13387
+
+bb13387: ; preds = %bb13360
+ br label %bb13402
+
+bb13402: ; preds = %bb13387, %bb13360
+ %r3123.0 = phi i64 [ 0, %bb13360 ], [ 4294836225, %bb13387 ] ; <i64> [#uses=1]
+ %tmp13404 = icmp eq i16 %tmp1322713228, -1 ; <i1> [#uses=1]
+ br i1 %tmp13404, label %bb13435, label %bb13407
+
+bb13407: ; preds = %bb13402
+ br label %bb13435
+
+bb13435: ; preds = %bb13407, %bb13402
+ %r0120.1 = phi i64 [ 0, %bb13407 ], [ %r0120.0, %bb13402 ] ; <i64> [#uses=0]
+ %r1121.1 = phi i64 [ 0, %bb13407 ], [ %r1121.0, %bb13402 ] ; <i64> [#uses=0]
+ %r3123.1 = phi i64 [ 0, %bb13407 ], [ %r3123.0, %bb13402 ] ; <i64> [#uses=0]
+ %tmp13450 = mul i64 0, %tmp13312 ; <i64> [#uses=0]
+ %tmp13455 = mul i64 0, %tmp13315 ; <i64> [#uses=0]
+ %tmp13461 = add i64 0, %tmp1329013291 ; <i64> [#uses=1]
+ %tmp13462 = mul i64 %tmp13461, 65535 ; <i64> [#uses=1]
+ %tmp13466 = sub i64 %tmp13462, 0 ; <i64> [#uses=1]
+ %tmp13526 = add i64 %tmp13466, 1 ; <i64> [#uses=1]
+ %tmp13527 = add i64 %tmp13526, 0 ; <i64> [#uses=1]
+ %tmp13528 = ashr i64 %tmp13527, 16 ; <i64> [#uses=4]
+ %tmp13536 = sub i64 %tmp13528, 0 ; <i64> [#uses=1]
+ %tmp13537 = shl i64 %tmp13536, 32 ; <i64> [#uses=1]
+ %tmp13538 = and i64 %tmp13537, 281470681743360 ; <i64> [#uses=1]
+ %tmp13542 = sub i64 %tmp13528, 0 ; <i64> [#uses=1]
+ %tmp13543 = shl i64 %tmp13542, 16 ; <i64> [#uses=1]
+ %tmp13544 = and i64 %tmp13543, 4294901760 ; <i64> [#uses=1]
+ %tmp13548 = sub i64 %tmp13528, 0 ; <i64> [#uses=1]
+ %tmp13549 = and i64 %tmp13548, 65535 ; <i64> [#uses=1]
+ %tmp13539 = or i64 %tmp13538, 0 ; <i64> [#uses=1]
+ %tmp13545 = or i64 %tmp13539, %tmp13549 ; <i64> [#uses=1]
+ %tmp13550 = or i64 %tmp13545, %tmp13544 ; <i64> [#uses=1]
+ %tmp1355213553 = trunc i64 %tmp13528 to i16 ; <i16> [#uses=1]
+ br label %bb13567
+
+bb13567: ; preds = %bb13435, %bb13236
+ %tsp1040.0.0 = phi i64 [ %tmp13550, %bb13435 ], [ %tmp13225, %bb13236 ] ; <i64> [#uses=0]
+ %tsp1040.1.0 = phi i16 [ %tmp1355213553, %bb13435 ], [ %tmp1322713228, %bb13236 ] ; <i16> [#uses=1]
+ br i1 %tmp13238, label %bb13088, label %bb13572
+
+bb13572: ; preds = %bb13567
+ store i16 %tsp1040.1.0, i16* null, align 2
+ br label %bb13088
+
+return: ; preds = %entry
+ ret void
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-28-CyclicSchedUnit.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-28-CyclicSchedUnit.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-28-CyclicSchedUnit.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-28-CyclicSchedUnit.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s | llc -march=x86
+
+define i64 @t(i64 %maxIdleDuration) nounwind {
+ call void asm sideeffect "wrmsr", "{cx},A,~{dirflag},~{fpsr},~{flags}"( i32 416, i64 0 ) nounwind
+ unreachable
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-01-InvalidOrdCompare.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-01-InvalidOrdCompare.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-01-InvalidOrdCompare.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-01-InvalidOrdCompare.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llc -enable-unsafe-fp-math -march=x86 | grep jnp
+; rdar://5902801
+
+declare void @test2()
+
+define i32 @test(double %p) nounwind {
+ %tmp5 = fcmp uno double %p, 0.000000e+00
+ br i1 %tmp5, label %bb, label %UnifiedReturnBlock
+bb:
+ call void @test2()
+ ret i32 17
+UnifiedReturnBlock:
+ ret i32 42
+}
+
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-06-SpillerBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-06-SpillerBug.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-06-SpillerBug.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-06-SpillerBug.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,37 @@
+; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -relocation-model=pic -disable-fp-elim | grep addb | grep ebp
+
+ %struct.rc4_state = type { i32, i32, [256 x i32] }
+ at .str1 = internal constant [65 x i8] c"m[%d] = 0x%02x, m[%d] = 0x%02x, 0x%02x, k = %d, key[k] = 0x%02x\0A\00" ; <[65 x i8]*> [#uses=1]
+ at keys = internal constant [7 x [30 x i8]] [ [30 x i8] c"\08\01#Eg\89\AB\CD\EF\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [30 x i8] c"\08\01#Eg\89\AB\CD\EF\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [30 x i8] c"\08\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [30 x i8] c"\04\EF\01#E\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [30 x i8] c"\08\01#Eg\89\AB\CD\EF\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [30 x i8] c"\04\EF\01#E\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [30 x i8] zeroinitializer ] ; <[7 x [30 x i8]]*> [#uses=1]
+
+declare i32 @printf(i8*, ...) nounwind
+
+define i32 @main(i32 %argc, i8** %argv) nounwind {
+entry:
+ br label %bb25
+
+bb25: ; preds = %bb25, %entry
+ br i1 false, label %bb.i, label %bb25
+
+bb.i: ; preds = %bb.i, %bb25
+ br i1 false, label %bb21.i, label %bb.i
+
+bb21.i: ; preds = %bb21.i, %bb.i
+ %k.0.reg2mem.0.i = phi i32 [ %k.1.i, %bb21.i ], [ 0, %bb.i ] ; <i32> [#uses=2]
+ %j.0.reg2mem.0.i = phi i8 [ %tmp35.i, %bb21.i ], [ 0, %bb.i ] ; <i8> [#uses=1]
+ %tmp25.i = load i32* null, align 4 ; <i32> [#uses=4]
+ %tmp2829.i = trunc i32 %tmp25.i to i8 ; <i8> [#uses=1]
+ %.sum = add i32 %k.0.reg2mem.0.i, 1 ; <i32> [#uses=3]
+ %tmp33.i = getelementptr [7 x [30 x i8]]* @keys, i32 0, i32 0, i32 %.sum ; <i8*> [#uses=1]
+ %tmp34.i = load i8* %tmp33.i, align 1 ; <i8> [#uses=1]
+ %tmp30.i = add i8 %tmp2829.i, %j.0.reg2mem.0.i ; <i8> [#uses=1]
+ %tmp35.i = add i8 %tmp30.i, %tmp34.i ; <i8> [#uses=2]
+ %tmp3536.i = zext i8 %tmp35.i to i32 ; <i32> [#uses=2]
+ %tmp39.i = getelementptr %struct.rc4_state* null, i32 0, i32 2, i32 %tmp3536.i ; <i32*> [#uses=1]
+ store i32 %tmp25.i, i32* %tmp39.i, align 4
+ %tmp60.i = load i32* null, align 4 ; <i32> [#uses=1]
+ %tmp65.i = call i32 (i8*, ...)* @printf( i8* getelementptr ([65 x i8]* @.str1, i32 0, i32 0), i32 0, i32 %tmp60.i, i32 %tmp3536.i, i32 %tmp25.i, i32 %tmp25.i, i32 %k.0.reg2mem.0.i, i32 0 ) nounwind ; <i32> [#uses=0]
+ %tmp70.i = icmp slt i32 %.sum, 8 ; <i1> [#uses=1]
+ %k.1.i = select i1 %tmp70.i, i32 %.sum, i32 0 ; <i32> [#uses=1]
+ br label %bb21.i
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-09-PHIElimBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-09-PHIElimBug.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-09-PHIElimBug.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-09-PHIElimBug.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,25 @@
+; RUN: llvm-as < %s | llc -march=x86
+
+ %struct.V = type { <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x i32>, float*, float*, float*, float*, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, i32, i32, i32, i32, i32, i32, i32, i32 }
+
+define fastcc void @t() nounwind {
+entry:
+ br i1 false, label %bb23816.preheader, label %bb23821
+
+bb23816.preheader: ; preds = %entry
+ %tmp23735 = and i32 0, 2 ; <i32> [#uses=0]
+ br label %bb23830
+
+bb23821: ; preds = %entry
+ br i1 false, label %bb23830, label %bb23827
+
+bb23827: ; preds = %bb23821
+ %tmp23829 = getelementptr %struct.V* null, i32 0, i32 42 ; <i32*> [#uses=0]
+ br label %bb23830
+
+bb23830: ; preds = %bb23827, %bb23821, %bb23816.preheader
+ %scaledInDst.2.reg2mem.5 = phi i8 [ undef, %bb23827 ], [ undef, %bb23821 ], [ undef, %bb23816.preheader ] ; <i8> [#uses=1]
+ %toBool35047 = icmp eq i8 %scaledInDst.2.reg2mem.5, 0 ; <i1> [#uses=1]
+ %bothcond39107 = or i1 %toBool35047, false ; <i1> [#uses=0]
+ unreachable
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
+
+define fastcc void @glgVectorFloatConversion() nounwind {
+ %tmp12745 = load <4 x float>* null, align 16 ; <<4 x float>> [#uses=1]
+ %tmp12773 = insertelement <4 x float> %tmp12745, float 1.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
+ %tmp12774 = insertelement <4 x float> %tmp12773, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
+ %tmp12775 = insertelement <4 x float> %tmp12774, float 1.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
+ store <4 x float> %tmp12775, <4 x float>* null, align 16
+ unreachable
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-12-tailmerge-5.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-12-tailmerge-5.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-12-tailmerge-5.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-12-tailmerge-5.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,145 @@
+; RUN: llvm-as < %s | llc | grep abort | count 1
+; Calls to abort should all be merged
+
+; ModuleID = '5898899.c'
+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"
+target triple = "x86_64-apple-darwin8"
+ %struct.BoundaryAlignment = type { [3 x i8], i8, i16, i16, i8, [2 x i8] }
+
+define void @passing2(i64 %str.0, i64 %str.1, i16 signext %s, i32 %j, i8 signext %c, i16 signext %t, i16 signext %u, i8 signext %d) nounwind {
+entry:
+ %str_addr = alloca %struct.BoundaryAlignment ; <%struct.BoundaryAlignment*> [#uses=7]
+ %s_addr = alloca i16 ; <i16*> [#uses=1]
+ %j_addr = alloca i32 ; <i32*> [#uses=2]
+ %c_addr = alloca i8 ; <i8*> [#uses=2]
+ %t_addr = alloca i16 ; <i16*> [#uses=2]
+ %u_addr = alloca i16 ; <i16*> [#uses=2]
+ %d_addr = alloca i8 ; <i8*> [#uses=2]
+ %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
+ %tmp = bitcast %struct.BoundaryAlignment* %str_addr to { i64, i64 }* ; <{ i64, i64 }*> [#uses=1]
+ %tmp1 = getelementptr { i64, i64 }* %tmp, i32 0, i32 0 ; <i64*> [#uses=1]
+ store i64 %str.0, i64* %tmp1
+ %tmp2 = bitcast %struct.BoundaryAlignment* %str_addr to { i64, i64 }* ; <{ i64, i64 }*> [#uses=1]
+ %tmp3 = getelementptr { i64, i64 }* %tmp2, i32 0, i32 1 ; <i64*> [#uses=1]
+ %bc = bitcast i64* %tmp3 to i8* ; <i8*> [#uses=2]
+ %byte = trunc i64 %str.1 to i8 ; <i8> [#uses=1]
+ store i8 %byte, i8* %bc
+ %shft = lshr i64 %str.1, 8 ; <i64> [#uses=2]
+ %Loc = getelementptr i8* %bc, i32 1 ; <i8*> [#uses=2]
+ %byte4 = trunc i64 %shft to i8 ; <i8> [#uses=1]
+ store i8 %byte4, i8* %Loc
+ %shft5 = lshr i64 %shft, 8 ; <i64> [#uses=2]
+ %Loc6 = getelementptr i8* %Loc, i32 1 ; <i8*> [#uses=2]
+ %byte7 = trunc i64 %shft5 to i8 ; <i8> [#uses=1]
+ store i8 %byte7, i8* %Loc6
+ %shft8 = lshr i64 %shft5, 8 ; <i64> [#uses=2]
+ %Loc9 = getelementptr i8* %Loc6, i32 1 ; <i8*> [#uses=2]
+ %byte10 = trunc i64 %shft8 to i8 ; <i8> [#uses=1]
+ store i8 %byte10, i8* %Loc9
+ %shft11 = lshr i64 %shft8, 8 ; <i64> [#uses=0]
+ %Loc12 = getelementptr i8* %Loc9, i32 1 ; <i8*> [#uses=0]
+ store i16 %s, i16* %s_addr
+ store i32 %j, i32* %j_addr
+ store i8 %c, i8* %c_addr
+ store i16 %t, i16* %t_addr
+ store i16 %u, i16* %u_addr
+ store i8 %d, i8* %d_addr
+ %tmp13 = getelementptr %struct.BoundaryAlignment* %str_addr, i32 0, i32 0 ; <[3 x i8]*> [#uses=1]
+ %tmp1314 = bitcast [3 x i8]* %tmp13 to i32* ; <i32*> [#uses=1]
+ %tmp15 = load i32* %tmp1314, align 4 ; <i32> [#uses=1]
+ %tmp16 = shl i32 %tmp15, 14 ; <i32> [#uses=1]
+ %tmp17 = ashr i32 %tmp16, 23 ; <i32> [#uses=1]
+ %tmp1718 = trunc i32 %tmp17 to i16 ; <i16> [#uses=1]
+ %sextl = shl i16 %tmp1718, 7 ; <i16> [#uses=1]
+ %sextr = ashr i16 %sextl, 7 ; <i16> [#uses=2]
+ %sextl19 = shl i16 %sextr, 7 ; <i16> [#uses=1]
+ %sextr20 = ashr i16 %sextl19, 7 ; <i16> [#uses=0]
+ %sextl21 = shl i16 %sextr, 7 ; <i16> [#uses=1]
+ %sextr22 = ashr i16 %sextl21, 7 ; <i16> [#uses=1]
+ %sextr2223 = sext i16 %sextr22 to i32 ; <i32> [#uses=1]
+ %tmp24 = load i32* %j_addr, align 4 ; <i32> [#uses=1]
+ %tmp25 = icmp ne i32 %sextr2223, %tmp24 ; <i1> [#uses=1]
+ %tmp2526 = zext i1 %tmp25 to i8 ; <i8> [#uses=1]
+ %toBool = icmp ne i8 %tmp2526, 0 ; <i1> [#uses=1]
+ br i1 %toBool, label %bb, label %bb27
+
+bb: ; preds = %entry
+ call void (...)* @abort( ) noreturn nounwind
+ unreachable
+
+bb27: ; preds = %entry
+ %tmp28 = getelementptr %struct.BoundaryAlignment* %str_addr, i32 0, i32 1 ; <i8*> [#uses=1]
+ %tmp29 = load i8* %tmp28, align 4 ; <i8> [#uses=1]
+ %tmp30 = load i8* %c_addr, align 1 ; <i8> [#uses=1]
+ %tmp31 = icmp ne i8 %tmp29, %tmp30 ; <i1> [#uses=1]
+ %tmp3132 = zext i1 %tmp31 to i8 ; <i8> [#uses=1]
+ %toBool33 = icmp ne i8 %tmp3132, 0 ; <i1> [#uses=1]
+ br i1 %toBool33, label %bb34, label %bb35
+
+bb34: ; preds = %bb27
+ call void (...)* @abort( ) noreturn nounwind
+ unreachable
+
+bb35: ; preds = %bb27
+ %tmp36 = getelementptr %struct.BoundaryAlignment* %str_addr, i32 0, i32 2 ; <i16*> [#uses=1]
+ %tmp37 = load i16* %tmp36, align 4 ; <i16> [#uses=1]
+ %tmp38 = shl i16 %tmp37, 7 ; <i16> [#uses=1]
+ %tmp39 = ashr i16 %tmp38, 7 ; <i16> [#uses=1]
+ %sextl40 = shl i16 %tmp39, 7 ; <i16> [#uses=1]
+ %sextr41 = ashr i16 %sextl40, 7 ; <i16> [#uses=2]
+ %sextl42 = shl i16 %sextr41, 7 ; <i16> [#uses=1]
+ %sextr43 = ashr i16 %sextl42, 7 ; <i16> [#uses=0]
+ %sextl44 = shl i16 %sextr41, 7 ; <i16> [#uses=1]
+ %sextr45 = ashr i16 %sextl44, 7 ; <i16> [#uses=1]
+ %tmp46 = load i16* %t_addr, align 2 ; <i16> [#uses=1]
+ %tmp47 = icmp ne i16 %sextr45, %tmp46 ; <i1> [#uses=1]
+ %tmp4748 = zext i1 %tmp47 to i8 ; <i8> [#uses=1]
+ %toBool49 = icmp ne i8 %tmp4748, 0 ; <i1> [#uses=1]
+ br i1 %toBool49, label %bb50, label %bb51
+
+bb50: ; preds = %bb35
+ call void (...)* @abort( ) noreturn nounwind
+ unreachable
+
+bb51: ; preds = %bb35
+ %tmp52 = getelementptr %struct.BoundaryAlignment* %str_addr, i32 0, i32 3 ; <i16*> [#uses=1]
+ %tmp53 = load i16* %tmp52, align 4 ; <i16> [#uses=1]
+ %tmp54 = shl i16 %tmp53, 7 ; <i16> [#uses=1]
+ %tmp55 = ashr i16 %tmp54, 7 ; <i16> [#uses=1]
+ %sextl56 = shl i16 %tmp55, 7 ; <i16> [#uses=1]
+ %sextr57 = ashr i16 %sextl56, 7 ; <i16> [#uses=2]
+ %sextl58 = shl i16 %sextr57, 7 ; <i16> [#uses=1]
+ %sextr59 = ashr i16 %sextl58, 7 ; <i16> [#uses=0]
+ %sextl60 = shl i16 %sextr57, 7 ; <i16> [#uses=1]
+ %sextr61 = ashr i16 %sextl60, 7 ; <i16> [#uses=1]
+ %tmp62 = load i16* %u_addr, align 2 ; <i16> [#uses=1]
+ %tmp63 = icmp ne i16 %sextr61, %tmp62 ; <i1> [#uses=1]
+ %tmp6364 = zext i1 %tmp63 to i8 ; <i8> [#uses=1]
+ %toBool65 = icmp ne i8 %tmp6364, 0 ; <i1> [#uses=1]
+ br i1 %toBool65, label %bb66, label %bb67
+
+bb66: ; preds = %bb51
+ call void (...)* @abort( ) noreturn nounwind
+ unreachable
+
+bb67: ; preds = %bb51
+ %tmp68 = getelementptr %struct.BoundaryAlignment* %str_addr, i32 0, i32 4 ; <i8*> [#uses=1]
+ %tmp69 = load i8* %tmp68, align 4 ; <i8> [#uses=1]
+ %tmp70 = load i8* %d_addr, align 1 ; <i8> [#uses=1]
+ %tmp71 = icmp ne i8 %tmp69, %tmp70 ; <i1> [#uses=1]
+ %tmp7172 = zext i1 %tmp71 to i8 ; <i8> [#uses=1]
+ %toBool73 = icmp ne i8 %tmp7172, 0 ; <i1> [#uses=1]
+ br i1 %toBool73, label %bb74, label %bb75
+
+bb74: ; preds = %bb67
+ call void (...)* @abort( ) noreturn nounwind
+ unreachable
+
+bb75: ; preds = %bb67
+ br label %return
+
+return: ; preds = %bb75
+ ret void
+}
+
+declare void @abort(...) noreturn nounwind
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-21-CoalescerBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-21-CoalescerBug.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-21-CoalescerBug.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-21-CoalescerBug.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,97 @@
+; RUN: llvm-as < %s | llc -march=x86 -fast | grep mov | count 4
+; PR2343
+
+ %llvm.dbg.anchor.type = type { i32, i32 }
+ %struct.CUMULATIVE_ARGS = type { 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, [4 x i32] }
+ %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.cfg_stats_d], %struct.object_block*, i64 }
+ %struct.cfg_stats_d = type { i32 }
+ %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.def_optype_d = type { %struct.def_optype_d*, %struct.tree_node** }
+ %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 { %struct.edge_prediction*, %struct.edge_def*, i32, i32 }
+ %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*, i8, i32, 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, i32, %struct.__sbuf, %struct.VEC_tree_gc*, %struct.tree_node*, i8*, i8*, i8*, i8*, i8*, %struct.tree_node*, i8, i8, i8, i8, i8, i8 }
+ %struct.htab = type { i32 (i8*)*, i32 (i8*, i8*)*, void (i8*)*, i8**, i32, i32, i32, i32, i32, i8* (i32, i32)*, void (i8*)*, i8*, i8* (i8*, i32, i32)*, void (i8*, i8*)*, i32 }
+ %struct.initial_value_struct = type opaque
+ %struct.lang_decl = type opaque
+ %struct.language_function = type opaque
+ %struct.loop = type { i32, %struct.basic_block_def*, %struct.basic_block_def*, %llvm.dbg.anchor.type, i32, i32, i32, i32, %struct.loop**, i32, %struct.loop*, %struct.loop*, %struct.loop*, %struct.loop*, i8*, %struct.tree_node*, %struct.tree_node*, %struct.nb_iter_bound*, %struct.edge_def*, i32 }
+ %struct.machine_function = type opaque
+ %struct.maydef_optype_d = type { %struct.maydef_optype_d*, %struct.tree_node*, %struct.tree_node*, %struct.ssa_use_operand_d }
+ %struct.nb_iter_bound = type { %struct.tree_node*, %struct.tree_node*, %struct.nb_iter_bound* }
+ %struct.object_block = type { %struct.section*, i32, i64, %struct.VEC_rtx_gc*, %struct.VEC_rtx_gc* }
+ %struct.obstack = type { i32, %struct._obstack_chunk*, i8*, i8*, i8*, i32, i32, %struct._obstack_chunk* (i8*, i32)*, void (i8*, %struct._obstack_chunk*)*, i8*, i8 }
+ %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.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.ssa_use_operand_d = type { %struct.ssa_use_operand_d*, %struct.ssa_use_operand_d*, %struct.tree_node*, %struct.tree_node** }
+ %struct.stmt_ann_d = type { %struct.tree_ann_common_d, i8, %struct.basic_block_def*, %struct.stmt_operands_d, %struct.bitmap_head_def*, i32, i8* }
+ %struct.stmt_operands_d = type { %struct.def_optype_d*, %struct.use_optype_d*, %struct.maydef_optype_d*, %struct.vuse_optype_d*, %struct.maydef_optype_d* }
+ %struct.temp_slot = type opaque
+ %struct.tree_ann_common_d = type { i32, i8*, %struct.tree_node* }
+ %struct.tree_ann_d = type { %struct.stmt_ann_d }
+ %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %struct.tree_ann_d*, i8, i8, i8, i8, i8 }
+ %struct.tree_decl_common = type { %struct.tree_decl_minimal, %struct.tree_node*, i8, i8, i8, i8, i8, i32, %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*, i32 }
+ %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, i64, %struct.function* }
+ %struct.tree_node = type { %struct.tree_function_decl }
+ %struct.u = type { %struct.block_symbol }
+ %struct.unnamed_section = type { %struct.cfg_stats_d, void (i8*)*, i8*, %struct.section* }
+ %struct.use_optype_d = type { %struct.use_optype_d*, %struct.ssa_use_operand_d }
+ %struct.var_refs_queue = type { %struct.rtx_def*, i32, i32, %struct.var_refs_queue* }
+ %struct.varasm_status = type opaque
+ %struct.vuse_optype_d = type { %struct.vuse_optype_d*, %struct.tree_node*, %struct.ssa_use_operand_d }
+ at llvm.used = appending global [1 x i8*] [ i8* bitcast (%struct.edge_def* (%struct.edge_def*, %struct.basic_block_def*)* @tree_redirect_edge_and_branch to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0]
+
+define %struct.edge_def* @tree_redirect_edge_and_branch(%struct.edge_def* %e1, %struct.basic_block_def* %dest2) nounwind {
+entry:
+ br label %bb497
+
+bb483: ; preds = %bb497
+ %tmp496 = load %struct.tree_node** null, align 4 ; <%struct.tree_node*> [#uses=1]
+ br label %bb497
+
+bb497: ; preds = %bb483, %entry
+ %cases.0 = phi %struct.tree_node* [ %tmp496, %bb483 ], [ null, %entry ] ; <%struct.tree_node*> [#uses=1]
+ %last.0 = phi %struct.tree_node* [ %cases.0, %bb483 ], [ undef, %entry ] ; <%struct.tree_node*> [#uses=1]
+ br i1 false, label %bb483, label %bb502
+
+bb502: ; preds = %bb497
+ br i1 false, label %bb507, label %bb841
+
+bb507: ; preds = %bb502
+ %tmp517 = getelementptr %struct.tree_node* %last.0, i32 0, i32 0 ; <%struct.tree_function_decl*> [#uses=1]
+ %tmp517518 = bitcast %struct.tree_function_decl* %tmp517 to %struct.tree_common* ; <%struct.tree_common*> [#uses=1]
+ %tmp519 = getelementptr %struct.tree_common* %tmp517518, i32 0, i32 0 ; <%struct.tree_node**> [#uses=1]
+ store %struct.tree_node* null, %struct.tree_node** %tmp519, align 4
+ br label %bb841
+
+bb841: ; preds = %bb507, %bb502
+ unreachable
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-22-FoldUnalignedLoad.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-22-FoldUnalignedLoad.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-22-FoldUnalignedLoad.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-22-FoldUnalignedLoad.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movups | count 2
+
+define void @a(<4 x float>* %x) nounwind {
+entry:
+ %tmp2 = load <4 x float>* %x, align 1
+ %inv = call <4 x float> @llvm.x86.sse.rcp.ps(<4 x float> %tmp2)
+ store <4 x float> %inv, <4 x float>* %x, align 1
+ ret void
+}
+
+declare <4 x float> @llvm.x86.sse.rcp.ps(<4 x float>)
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-28-CoalescerBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-28-CoalescerBug.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-28-CoalescerBug.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-28-CoalescerBug.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -mtriple=x86_64-unknown-linux-gnu
+; PR2289
+
+define void @_ada_ca11001() {
+entry:
+ %tmp59 = call i16 @ca11001_0__cartesian_assign( i8 zeroext 0, i8 zeroext 0, i16 undef ) ; <i16> [#uses=0]
+ unreachable
+}
+
+declare i16 @ca11001_0__cartesian_assign(i8 zeroext , i8 zeroext , i16)
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-28-LocalRegAllocBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-28-LocalRegAllocBug.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-28-LocalRegAllocBug.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-28-LocalRegAllocBug.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,30 @@
+; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -regalloc=local
+
+ at _ZTVN10Evaluation10GridOutputILi3EEE = external constant [5 x i32 (...)*] ; <[5 x i32 (...)*]*> [#uses=1]
+
+declare i8* @llvm.eh.exception() nounwind
+
+declare i8* @_Znwm(i32)
+
+declare i8* @__cxa_begin_catch(i8*) nounwind
+
+define i32 @main(i32 %argc, i8** %argv) {
+entry:
+ br i1 false, label %bb37, label %bb34
+
+bb34: ; preds = %entry
+ ret i32 1
+
+bb37: ; preds = %entry
+ %tmp12.i.i.i.i.i66 = invoke i8* @_Znwm( i32 12 )
+ to label %tmp12.i.i.i.i.i.noexc65 unwind label %lpad243 ; <i8*> [#uses=0]
+
+tmp12.i.i.i.i.i.noexc65: ; preds = %bb37
+ unreachable
+
+lpad243: ; preds = %bb37
+ %eh_ptr244 = call i8* @llvm.eh.exception( ) ; <i8*> [#uses=1]
+ store i32 (...)** getelementptr ([5 x i32 (...)*]* @_ZTVN10Evaluation10GridOutputILi3EEE, i32 0, i32 2), i32 (...)*** null, align 8
+ %tmp133 = call i8* @__cxa_begin_catch( i8* %eh_ptr244 ) nounwind ; <i8*> [#uses=0]
+ unreachable
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-04-MemCpyLoweringBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-04-MemCpyLoweringBug.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-04-MemCpyLoweringBug.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-04-MemCpyLoweringBug.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,19 @@
+; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -mattr=+sse2 -disable-fp-elim | grep subl | grep 24
+
+ %struct.argument_t = type { i8*, %struct.argument_t*, i32, %struct.ipc_type_t*, i32, void (...)*, void (...)*, void (...)*, void (...)*, void (...)*, i8*, i8*, i8*, i8*, i8*, i32, i32, i32, %struct.routine*, %struct.argument_t*, %struct.argument_t*, %struct.argument_t*, %struct.argument_t*, %struct.argument_t*, %struct.argument_t*, %struct.argument_t*, i32, i32, i32, i32, i32, i32 }
+ %struct.ipc_type_t = type { i8*, %struct.ipc_type_t*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, i32, i32, i32, i32, %struct.ipc_type_t*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8* }
+ %struct.routine = type opaque
+@"\01LC" = external constant [11 x i8] ; <[11 x i8]*> [#uses=1]
+
+define i8* @InArgMsgField(%struct.argument_t* %arg, i8* %str) nounwind {
+entry:
+ %who = alloca [20 x i8] ; <[20 x i8]*> [#uses=1]
+ %who1 = getelementptr [20 x i8]* %who, i32 0, i32 0 ; <i8*> [#uses=2]
+ call void @llvm.memset.i32( i8* %who1, i8 0, i32 20, i32 1 )
+ call void @llvm.memcpy.i32( i8* %who1, i8* getelementptr ([11 x i8]* @"\01LC", i32 0, i32 0), i32 11, i32 1 )
+ unreachable
+}
+
+declare void @llvm.memset.i32(i8*, i8, i32, i32) nounwind
+
+declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-13-NotVolatileLoadStore.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-13-NotVolatileLoadStore.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-13-NotVolatileLoadStore.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-13-NotVolatileLoadStore.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,23 @@
+; RUN: llvm-as < %s | llc -march=x86 | not grep movsd
+; RUN: llvm-as < %s | llc -march=x86 | grep movw
+; RUN: llvm-as < %s | llc -march=x86 | grep addw
+; These transforms are turned off for volatile loads and stores.
+; Check that they weren't turned off for all loads and stores!
+
+ at atomic = global double 0.000000e+00 ; <double*> [#uses=1]
+ at atomic2 = global double 0.000000e+00 ; <double*> [#uses=1]
+ at ioport = global i32 0 ; <i32*> [#uses=1]
+ at ioport2 = global i32 0 ; <i32*> [#uses=1]
+
+define i16 @f(i64 %x) {
+ %b = bitcast i64 %x to double ; <double> [#uses=1]
+ store double %b, double* @atomic
+ store double 0.000000e+00, double* @atomic2
+ %l = load i32* @ioport ; <i32> [#uses=1]
+ %t = trunc i32 %l to i16 ; <i16> [#uses=1]
+ %l2 = load i32* @ioport2 ; <i32> [#uses=1]
+ %tmp = lshr i32 %l2, 16 ; <i32> [#uses=1]
+ %t2 = trunc i32 %tmp to i16 ; <i16> [#uses=1]
+ %f = add i16 %t, %t2 ; <i16> [#uses=1]
+ ret i16 %f
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-13-SpillerCommuting.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-13-SpillerCommuting.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-13-SpillerCommuting.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-13-SpillerCommuting.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,42 @@
+; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -relocation-model=pic -stats |& grep {spiller - Number of instructions commuted}
+
+ %struct.CABAC_context_element = type { i8, i8 }
+ %struct.MB_Info_CABAC = type { i8, i8, [2 x i8], i8, i8, i8, i16, i16, [4 x i8], [8 x %struct.MotionVector] }
+ %struct.MotionVector = type { i16, i16 }
+ %struct.RBSP2 = type { i32, i32, i16, i8, i16, i16, <1 x i64>, i32, i32, i32*, i32*, i32*, i32*, i32, i32, i32, i32, i32, i8, i16, i8, %struct.MB_Info_CABAC*, %struct.MB_Info_CABAC*, [2 x %struct.MB_Info_CABAC], [12 x i8], [460 x %struct.CABAC_context_element], [10 x i8], [10 x i8], [10 x i16], [4 x [120 x i32]], [15 x [36 x i8]], [6 x [8 x i8]], i16* }
+ %struct.Slice_Info = type { i32, i8, %struct.seq_parameter_set_rbsp_t*, %struct.seq_parameter_set_rbsp_t, i32, i16*, i8, i8, i8, i8, i16, i32 }
+ %struct.seq_parameter_set_rbsp_t = type { i32, i32, i32 }
+ at _ZL21CABAC_CTX_state_table = external constant [64 x i16] ; <[64 x i16]*> [#uses=1]
+ at _ZL15rLPS_table_64x4 = external constant [64 x [4 x i8]] ; <[64 x [4 x i8]]*> [#uses=1]
+
+define i32 @_ZN5RBSP220residual_block_cabacEP10Slice_InfoP13MB_Info_CABACS3_hjhhbPtPs(%struct.RBSP2* %this, %struct.Slice_Info* %slice, %struct.MB_Info_CABAC* %up, %struct.MB_Info_CABAC* %left, i8 zeroext %maxNumCoeff, i32 %blk_i, i8 zeroext %iCbCr, i8 zeroext %ctxBlockCat, i8 zeroext %intra_flag, i16* %mask, i16* %res) nounwind {
+entry:
+ %tmp43.i1590 = getelementptr %struct.RBSP2* %this, i32 0, i32 0 ; <i32*> [#uses=1]
+ br label %bb803
+
+bb803: ; preds = %_ZN5RBSP211decode_1bitEP21CABAC_context_element.exit1581, %entry
+ %numCoeff.11749 = phi i32 [ 0, %entry ], [ %numCoeff.11749.tmp868, %_ZN5RBSP211decode_1bitEP21CABAC_context_element.exit1581 ] ; <i32> [#uses=1]
+ %tmp28.i1503 = load i8* null, align 1 ; <i8> [#uses=1]
+ %tmp30.i1504 = getelementptr %struct.RBSP2* %this, i32 0, i32 25, i32 0, i32 0 ; <i8*> [#uses=2]
+ %tmp31.i1505 = load i8* %tmp30.i1504, align 1 ; <i8> [#uses=1]
+ %tmp3233.i1506 = zext i8 %tmp31.i1505 to i32 ; <i32> [#uses=2]
+ %tmp35.i1507 = getelementptr [64 x i16]* @_ZL21CABAC_CTX_state_table, i32 0, i32 %tmp3233.i1506 ; <i16*> [#uses=1]
+ %tmp36.i1508 = load i16* %tmp35.i1507, align 2 ; <i16> [#uses=1]
+ %tmp363738.i1509 = zext i16 %tmp36.i1508 to i32 ; <i32> [#uses=1]
+ %tmp51.i1514 = getelementptr [64 x [4 x i8]]* @_ZL15rLPS_table_64x4, i32 0, i32 %tmp3233.i1506, i32 0 ; <i8*> [#uses=1]
+ %tmp52.i1515 = load i8* %tmp51.i1514, align 1 ; <i8> [#uses=1]
+ %tmp5758.i1516 = zext i8 %tmp52.i1515 to i32 ; <i32> [#uses=1]
+ %tmp60.i1517 = sub i32 0, %tmp5758.i1516 ; <i32> [#uses=1]
+ store i32 %tmp60.i1517, i32* %tmp43.i1590, align 16
+ br i1 false, label %_ZN5RBSP211decode_1bitEP21CABAC_context_element.exit1581, label %bb.i1537
+
+bb.i1537: ; preds = %bb803
+ unreachable
+
+_ZN5RBSP211decode_1bitEP21CABAC_context_element.exit1581: ; preds = %bb803
+ %tmp328329.i1580 = trunc i32 %tmp363738.i1509 to i8 ; <i8> [#uses=1]
+ store i8 %tmp328329.i1580, i8* %tmp30.i1504, align 1
+ %toBool865 = icmp eq i8 %tmp28.i1503, 0 ; <i1> [#uses=1]
+ %numCoeff.11749.tmp868 = select i1 %toBool865, i32 %numCoeff.11749, i32 0 ; <i32> [#uses=1]
+ br label %bb803
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-13-VolatileLoadStore.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-13-VolatileLoadStore.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-13-VolatileLoadStore.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-13-VolatileLoadStore.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,22 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movsd | count 5
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movl | count 2
+
+ at atomic = global double 0.000000e+00 ; <double*> [#uses=1]
+ at atomic2 = global double 0.000000e+00 ; <double*> [#uses=1]
+ at anything = global i64 0 ; <i64*> [#uses=1]
+ at ioport = global i32 0 ; <i32*> [#uses=2]
+
+define i16 @f(i64 %x, double %y) {
+ %b = bitcast i64 %x to double ; <double> [#uses=1]
+ volatile store double %b, double* @atomic ; one processor operation only
+ volatile store double 0.000000e+00, double* @atomic2 ; one processor operation only
+ %b2 = bitcast double %y to i64 ; <i64> [#uses=1]
+ volatile store i64 %b2, i64* @anything ; may transform to store of double
+ %l = volatile load i32* @ioport ; must not narrow
+ %t = trunc i32 %l to i16 ; <i16> [#uses=1]
+ %l2 = volatile load i32* @ioport ; must not narrow
+ %tmp = lshr i32 %l2, 16 ; <i32> [#uses=1]
+ %t2 = trunc i32 %tmp to i16 ; <i16> [#uses=1]
+ %f = add i16 %t, %t2 ; <i16> [#uses=1]
+ ret i16 %f
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-16-SubregsBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-16-SubregsBug.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-16-SubregsBug.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-16-SubregsBug.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | grep mov | count 4
+
+define i16 @test(i16* %tmp179) nounwind {
+ %tmp180 = load i16* %tmp179, align 2 ; <i16> [#uses=2]
+ %tmp184 = and i16 %tmp180, -1024 ; <i16> [#uses=1]
+ %tmp186 = icmp eq i16 %tmp184, -32768 ; <i1> [#uses=1]
+ br i1 %tmp186, label %bb189, label %bb288
+
+bb189: ; preds = %0
+ ret i16 %tmp180
+
+bb288: ; preds = %0
+ ret i16 32
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-18-BadShuffle.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-18-BadShuffle.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-18-BadShuffle.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-18-BadShuffle.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -mcpu=i386 -mattr=+sse2 | grep pinsrw
+
+; Test to make sure we actually insert the bottom element of the vector
+define <8 x i16> @a(<8 x i16> %a) nounwind {
+entry:
+ shufflevector <8 x i16> %a, <8 x i16> zeroinitializer, <8 x i32> < i32 0, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8, i32 8 >
+ %add = add <8 x i16> %0, %a
+ ret <8 x i16> %add
+}
+
Added: llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-25-VecISelBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-25-VecISelBug.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-25-VecISelBug.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-25-VecISelBug.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep pslldq
+
+define void @t() nounwind {
+entry:
+ %tmp1 = shufflevector <4 x float> zeroinitializer, <4 x float> < float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00 >, <4 x i32> < i32 0, i32 1, i32 4, i32 5 >
+ %tmp2 = insertelement <4 x float> %tmp1, float 1.000000e+00, i32 3
+ store <4 x float> %tmp2, <4 x float>* null, align 16
+ unreachable
+}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/aligned-comm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/aligned-comm.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/aligned-comm.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/aligned-comm.ll Sun Jul 6 15:45:41 2008
@@ -5,4 +5,4 @@
; Darwin 9+ should get alignment on common symbols. Darwin8 does
; not support this.
- at array = weak global [4128 x i32] zeroinitializer, align 128
+ at array = common global [4128 x i32] zeroinitializer, align 128
Added: llvm/branches/non-call-eh/test/CodeGen/X86/asm-indirect-mem.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/asm-indirect-mem.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/asm-indirect-mem.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/asm-indirect-mem.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc
+; PR2267
+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-darwin8"
+
+define void @atomic_store_rel_int(i32* %p, i32 %v) nounwind {
+entry:
+ %asmtmp = tail call i32 asm sideeffect "xchgl $1,$0", "=*m,=r,*m,1,~{dirflag},~{fpsr},~{flags}"( i32* %p, i32* %p, i32 %v ) nounwind ; <i32> [#uses=0]
+ ret void
+}
+
Added: llvm/branches/non-call-eh/test/CodeGen/X86/atomic_op.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/atomic_op.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/atomic_op.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/atomic_op.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,93 @@
+; RUN: llvm-as < %s | llc -march=x86 -o %t1 -f
+; RUN: grep "lock xaddl" %t1 | count 4
+; RUN: grep "lock cmpxchgl" %t1 | count 13
+; RUN: grep "xchgl" %t1 | count 14
+; RUN: grep "cmova" %t1 | count 2
+; RUN: grep "cmovb" %t1 | count 2
+; RUN: grep "cmovg" %t1 | count 2
+; RUN: grep "cmovl" %t1 | count 2
+
+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"
+
+define void @main(i32 %argc, i8** %argv) {
+entry:
+ %argc.addr = alloca i32 ; <i32*> [#uses=1]
+ %argv.addr = alloca i8** ; <i8***> [#uses=1]
+ %val1 = alloca i32 ; <i32*> [#uses=2]
+ %val2 = alloca i32 ; <i32*> [#uses=15]
+ %andt = alloca i32 ; <i32*> [#uses=2]
+ %ort = alloca i32 ; <i32*> [#uses=2]
+ %xort = alloca i32 ; <i32*> [#uses=2]
+ %old = alloca i32 ; <i32*> [#uses=18]
+ %temp = alloca i32 ; <i32*> [#uses=2]
+ store i32 %argc, i32* %argc.addr
+ store i8** %argv, i8*** %argv.addr
+ store i32 0, i32* %val1
+ store i32 31, i32* %val2
+ store i32 3855, i32* %andt
+ store i32 3855, i32* %ort
+ store i32 3855, i32* %xort
+ store i32 4, i32* %temp
+ %tmp = load i32* %temp ; <i32> [#uses=1]
+ call i32 @llvm.atomic.load.add.i32( i32* %val1, i32 %tmp ) ; <i32>:0 [#uses=1]
+ store i32 %0, i32* %old
+ call i32 @llvm.atomic.load.sub.i32( i32* %val2, i32 30 ) ; <i32>:1 [#uses=1]
+ store i32 %1, i32* %old
+ call i32 @llvm.atomic.load.add.i32( i32* %val2, i32 1 ) ; <i32>:2 [#uses=1]
+ store i32 %2, i32* %old
+ call i32 @llvm.atomic.load.sub.i32( i32* %val2, i32 1 ) ; <i32>:3 [#uses=1]
+ store i32 %3, i32* %old
+ call i32 @llvm.atomic.load.and.i32( i32* %andt, i32 4080 ) ; <i32>:4 [#uses=1]
+ store i32 %4, i32* %old
+ call i32 @llvm.atomic.load.or.i32( i32* %ort, i32 4080 ) ; <i32>:5 [#uses=1]
+ store i32 %5, i32* %old
+ call i32 @llvm.atomic.load.xor.i32( i32* %xort, i32 4080 ) ; <i32>:6 [#uses=1]
+ store i32 %6, i32* %old
+ call i32 @llvm.atomic.load.min.i32( i32* %val2, i32 16 ) ; <i32>:7 [#uses=1]
+ store i32 %7, i32* %old
+ %neg = sub i32 0, 1 ; <i32> [#uses=1]
+ call i32 @llvm.atomic.load.min.i32( i32* %val2, i32 %neg ) ; <i32>:8 [#uses=1]
+ store i32 %8, i32* %old
+ call i32 @llvm.atomic.load.max.i32( i32* %val2, i32 1 ) ; <i32>:9 [#uses=1]
+ store i32 %9, i32* %old
+ call i32 @llvm.atomic.load.max.i32( i32* %val2, i32 0 ) ; <i32>:10 [#uses=1]
+ store i32 %10, i32* %old
+ call i32 @llvm.atomic.load.umax.i32( i32* %val2, i32 65535 ) ; <i32>:11 [#uses=1]
+ store i32 %11, i32* %old
+ call i32 @llvm.atomic.load.umax.i32( i32* %val2, i32 10 ) ; <i32>:12 [#uses=1]
+ store i32 %12, i32* %old
+ call i32 @llvm.atomic.load.umin.i32( i32* %val2, i32 1 ) ; <i32>:13 [#uses=1]
+ store i32 %13, i32* %old
+ call i32 @llvm.atomic.load.umin.i32( i32* %val2, i32 10 ) ; <i32>:14 [#uses=1]
+ store i32 %14, i32* %old
+ call i32 @llvm.atomic.swap.i32( i32* %val2, i32 1976 ) ; <i32>:15 [#uses=1]
+ store i32 %15, i32* %old
+ %neg1 = sub i32 0, 10 ; <i32> [#uses=1]
+ call i32 @llvm.atomic.cmp.swap.i32( i32* %val2, i32 %neg1, i32 1 ) ; <i32>:16 [#uses=1]
+ store i32 %16, i32* %old
+ call i32 @llvm.atomic.cmp.swap.i32( i32* %val2, i32 1976, i32 1 ) ; <i32>:17 [#uses=1]
+ store i32 %17, i32* %old
+ ret void
+}
+
+declare i32 @llvm.atomic.load.add.i32(i32*, i32) nounwind
+
+declare i32 @llvm.atomic.load.sub.i32(i32*, i32) nounwind
+
+declare i32 @llvm.atomic.load.and.i32(i32*, i32) nounwind
+
+declare i32 @llvm.atomic.load.or.i32(i32*, i32) nounwind
+
+declare i32 @llvm.atomic.load.xor.i32(i32*, i32) nounwind
+
+declare i32 @llvm.atomic.load.min.i32(i32*, i32) nounwind
+
+declare i32 @llvm.atomic.load.max.i32(i32*, i32) nounwind
+
+declare i32 @llvm.atomic.load.umax.i32(i32*, i32) nounwind
+
+declare i32 @llvm.atomic.load.umin.i32(i32*, i32) nounwind
+
+declare i32 @llvm.atomic.swap.i32(i32*, i32) nounwind
+
+declare i32 @llvm.atomic.cmp.swap.i32(i32*, i32, i32) nounwind
Added: llvm/branches/non-call-eh/test/CodeGen/X86/combine-lds.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/combine-lds.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/combine-lds.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/combine-lds.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movsd
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep mov | count 1
+
+define fastcc double @doload64(i64 %x) nounwind {
+ %tmp717 = bitcast i64 %x to double
+ ret double %tmp717
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/commute-intrinsic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/commute-intrinsic.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/commute-intrinsic.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/commute-intrinsic.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -mattr=+sse2 -relocation-model=static | not grep movaps
+
+ at a = external global <2 x i64> ; <<2 x i64>*> [#uses=1]
+
+define <2 x i64> @madd(<2 x i64> %b) nounwind {
+entry:
+ %tmp2 = load <2 x i64>* @a, align 16 ; <<2 x i64>> [#uses=1]
+ %tmp6 = bitcast <2 x i64> %b to <8 x i16> ; <<8 x i16>> [#uses=1]
+ %tmp9 = bitcast <2 x i64> %tmp2 to <8 x i16> ; <<8 x i16>> [#uses=1]
+ %tmp11 = tail call <4 x i32> @llvm.x86.sse2.pmadd.wd( <8 x i16> %tmp9, <8 x i16> %tmp6 ) nounwind readnone ; <<4 x i32>> [#uses=1]
+ %tmp14 = bitcast <4 x i32> %tmp11 to <2 x i64> ; <<2 x i64>> [#uses=1]
+ ret <2 x i64> %tmp14
+}
+
+declare <4 x i32> @llvm.x86.sse2.pmadd.wd(<8 x i16>, <8 x i16>) nounwind readnone
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/dagcombine-cse.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/dagcombine-cse.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/dagcombine-cse.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/dagcombine-cse.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats |& grep asm-printer | grep 14
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin -stats |& grep asm-printer | grep 14
define i32 @t(i8* %ref_frame_ptr, i32 %ref_frame_stride, i32 %idxX, i32 %idxY) nounwind {
entry:
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/dg.exp (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
load_lib llvm.exp
if { [llvm_supports_target X86] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+ RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/dollar-name.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/dollar-name.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/dollar-name.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/dollar-name.ll Sun Jul 6 15:45:41 2008
@@ -1,12 +1,12 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$bar) | count 1
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$qux) | count 1
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$hen) | count 1
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux | grep {(\$bar)} | count 1
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux | grep {(\$qux)} | count 1
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux | grep {(\$hen)} | count 1
; PR1339
@"$bar" = global i32 zeroinitializer
@"$qux" = external global i32
-define i32 @"$foo"() {
+define i32 @"$foo"() nounwind {
%m = load i32* @"$bar"
%n = load i32* @"$qux"
%t = add i32 %m, %n
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/extractelement-from-arg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/extractelement-from-arg.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/extractelement-from-arg.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/extractelement-from-arg.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,6 @@
-; RUN: llvm-as %s -o - | llc -march=x86-64
+; RUN: llvm-as %s -o - | llc -march=x86-64 -mattr=+sse2
-define void @test(float* %R, <4 x float> %X) {
+define void @test(float* %R, <4 x float> %X) nounwind {
%tmp = extractelement <4 x float> %X, i32 3
store float %tmp, float* %R
ret void
Added: llvm/branches/non-call-eh/test/CodeGen/X86/extractelement-load.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/extractelement-load.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/extractelement-load.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/extractelement-load.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+; RUN: llvm-as %s -o - | llc -march=x86 -mattr=+sse2 -mcpu=yonah | not grep movd
+; RUN: llvm-as %s -o - | llc -march=x86-64 -mattr=+sse2 -mcpu=yonah | not grep movd
+
+define i32 @t(<2 x i64>* %val) nounwind {
+ %tmp2 = load <2 x i64>* %val, align 16 ; <<2 x i64>> [#uses=1]
+ %tmp3 = bitcast <2 x i64> %tmp2 to <4 x i32> ; <<4 x i32>> [#uses=1]
+ %tmp4 = extractelement <4 x i32> %tmp3, i32 2 ; <i32> [#uses=1]
+ ret i32 %tmp4
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/fold-call.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/fold-call.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/fold-call.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/fold-call.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 | not grep mov
+; RUN: llvm-as < %s | llc -march=x86-64 | not grep mov
+
+declare void @bar()
+
+define void @foo(i32 %i0, i32 %i1, i32 %i2, i32 %i3, i32 %i4, i32 %i5, void()* %arg) nounwind {
+ call void @bar()
+ call void %arg()
+ ret void
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/inline-asm-mrv.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/inline-asm-mrv.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/inline-asm-mrv.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/inline-asm-mrv.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,35 @@
+; PR2094
+; RUN: llvm-as < %s | llc -march=x86-64 | grep movslq
+; RUN: llvm-as < %s | llc -march=x86-64 | grep addps
+; RUN: llvm-as < %s | llc -march=x86-64 | grep paddd
+; RUN: llvm-as < %s | llc -march=x86-64 | not grep movq
+
+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"
+target triple = "x86_64-apple-darwin8"
+
+define i32 @test1(i8* %v, i8* %blk2, i8* %blk1, i32 %stride, i32 %h) nounwind {
+ %tmp12 = sext i32 %stride to i64 ; <i64> [#uses=1]
+ %mrv = call {i32, i8*, i8*} asm sideeffect "$0 $1 $2 $3 $4 $5 $6",
+ "=r,=r,=r,r,r,r,r"( i64 %tmp12, i32 %h, i8* %blk1, i8* %blk2 ) nounwind
+ %tmp6 = getresult {i32, i8*, i8*} %mrv, 0
+ %tmp7 = call i32 asm sideeffect "set $0",
+ "=r,~{dirflag},~{fpsr},~{flags}"( ) nounwind
+ ret i32 %tmp7
+}
+
+define <4 x float> @test2() nounwind {
+ %mrv = call {<4 x float>, <4 x float>} asm "set $0, $1", "=x,=x"()
+ %a = getresult {<4 x float>, <4 x float>} %mrv, 0
+ %b = getresult {<4 x float>, <4 x float>} %mrv, 1
+ %c = add <4 x float> %a, %b
+ ret <4 x float> %c
+}
+
+define <4 x i32> @test3() nounwind {
+ %mrv = call {<4 x i32>, <4 x i32>} asm "set $0, $1", "=x,=x"()
+ %a = getresult {<4 x i32>, <4 x i32>} %mrv, 0
+ %b = getresult {<4 x i32>, <4 x i32>} %mrv, 1
+ %c = add <4 x i32> %a, %b
+ ret <4 x i32> %c
+}
+
Added: llvm/branches/non-call-eh/test/CodeGen/X86/isnan.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/isnan.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/isnan.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/isnan.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llc -march=x86 | not grep call
+
+declare i1 @llvm.isunordered.f64(double)
+
+define i1 @test_isnan(double %X) {
+ %R = fcmp uno double %X, %X ; <i1> [#uses=1]
+ ret i1 %R
+}
+
Removed: llvm/branches/non-call-eh/test/CodeGen/X86/isnan.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/isnan.llx?rev=53162&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/isnan.llx (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/isnan.llx (removed)
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llc -march=x86 | not grep call
-
-declare i1 @llvm.isunordered.f64(double)
-
-define i1 @test_isnan(double %X) {
- %R = fcmp uno double %X, %X ; <i1> [#uses=1]
- ret i1 %R
-}
-
Added: llvm/branches/non-call-eh/test/CodeGen/X86/isnan2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/isnan2.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/isnan2.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/isnan2.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | not grep pxor
+
+; This should not need to materialize 0.0 to evaluate the condition.
+
+define i32 @test(double %X) nounwind {
+entry:
+ %tmp6 = fcmp uno double %X, 0.000000e+00 ; <i1> [#uses=1]
+ %tmp67 = zext i1 %tmp6 to i32 ; <i32> [#uses=1]
+ ret i32 %tmp67
+}
+
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/loop-strength-reduce2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/loop-strength-reduce2.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/loop-strength-reduce2.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/loop-strength-reduce2.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -relocation-model=pic | grep '\$pb' | grep mov
+; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin -relocation-model=pic | grep {\$pb} | grep mov
;
; Make sure the PIC label flags2-"L1$pb" is not moved up to the preheader.
Added: llvm/branches/non-call-eh/test/CodeGen/X86/memcpy-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/memcpy-2.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/memcpy-2.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/memcpy-2.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=-sse -mtriple=i686-apple-darwin8.8.0 | grep mov | count 7
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse -mtriple=i686-apple-darwin8.8.0 | grep mov | count 5
+
+ %struct.ParmT = type { [25 x i8], i8, i8* }
+ at .str12 = internal constant [25 x i8] c"image\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" ; <[25 x i8]*> [#uses=1]
+
+declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
+
+define void @t(i32 %argc, i8** %argv) nounwind {
+entry:
+ %parms.i = alloca [13 x %struct.ParmT] ; <[13 x %struct.ParmT]*> [#uses=1]
+ %parms1.i = getelementptr [13 x %struct.ParmT]* %parms.i, i32 0, i32 0, i32 0, i32 0 ; <i8*> [#uses=1]
+ call void @llvm.memcpy.i32( i8* %parms1.i, i8* getelementptr ([25 x i8]* @.str12, i32 0, i32 0), i32 25, i32 1 ) nounwind
+ unreachable
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/memmove-4.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/memmove-4.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/memmove-4.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/memmove-4.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llc | not grep call
+
+target triple = "i686-pc-linux-gnu"
+
+define void @a(i8* %a, i8* %b) nounwind {
+ %tmp2 = bitcast i8* %a to i8*
+ %tmp3 = bitcast i8* %b to i8*
+ tail call void @llvm.memmove.i32( i8* %tmp2, i8* %tmp3, i32 12, i32 4 )
+ ret void
+}
+
+declare void @llvm.memmove.i32(i8*, i8*, i32, i32)
Added: llvm/branches/non-call-eh/test/CodeGen/X86/memset.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/memset.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/memset.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/memset.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,18 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=-sse -mtriple=i686-apple-darwin8.8.0 | grep mov | count 9
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse -mtriple=i686-apple-darwin8.8.0 | grep mov | count 3
+
+ %struct.x = type { i16, i16 }
+
+define void @t() nounwind {
+entry:
+ %up_mvd = alloca [8 x %struct.x] ; <[8 x %struct.x]*> [#uses=2]
+ %up_mvd116 = getelementptr [8 x %struct.x]* %up_mvd, i32 0, i32 0 ; <%struct.x*> [#uses=1]
+ %tmp110117 = bitcast [8 x %struct.x]* %up_mvd to i8* ; <i8*> [#uses=1]
+ call void @llvm.memset.i64( i8* %tmp110117, i8 0, i64 32, i32 8 )
+ call void @foo( %struct.x* %up_mvd116 ) nounwind
+ ret void
+}
+
+declare void @foo(%struct.x*)
+
+declare void @llvm.memset.i64(i8*, i8, i64, i32) nounwind
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/mingw-alloca.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/mingw-alloca.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/mingw-alloca.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/mingw-alloca.ll Sun Jul 6 15:45:41 2008
@@ -1,8 +1,8 @@
; RUN: llvm-as < %s | llc -o %t -f
; RUN: grep __alloca %t | count 2
-; RUN: grep 8028 %t
+; RUN: grep 4294967288 %t
; RUN: grep {pushl %eax} %t
-; RUN: grep 8024 %t | count 2
+; RUN: grep 8028 %t | count 2
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"
target triple = "i386-mingw32"
Added: llvm/branches/non-call-eh/test/CodeGen/X86/mmx-arg-passing.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/mmx-arg-passing.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/mmx-arg-passing.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/mmx-arg-passing.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,24 @@
+; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -mattr=+mmx | grep mm0 | count 3
+; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin -mattr=+mmx | grep esp | count 1
+; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx,+sse2 | grep xmm0
+; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx,+sse2 | grep rdi
+; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx,+sse2 | not grep movups
+;
+; On Darwin x86-32, v8i8, v4i16, v2i32 values are passed in MM[0-2].
+; On Darwin x86-32, v1i64 values are passed in memory.
+; On Darwin x86-64, v8i8, v4i16, v2i32 values are passed in XMM[0-7].
+; On Darwin x86-64, v1i64 values are passed in 64-bit GPRs.
+
+ at u1 = external global <8 x i8>
+
+define void @t1(<8 x i8> %v1) nounwind {
+ store <8 x i8> %v1, <8 x i8>* @u1, align 8
+ ret void
+}
+
+ at u2 = external global <1 x i64>
+
+define void @t2(<1 x i64> %v1) nounwind {
+ store <1 x i64> %v1, <1 x i64>* @u2, align 8
+ ret void
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/mmx-arg-passing2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/mmx-arg-passing2.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/mmx-arg-passing2.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/mmx-arg-passing2.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,24 @@
+; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx,+sse2 | grep movq2dq | count 1
+; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -mattr=+mmx,+sse2 | grep movdq2q | count 2
+
+ at g_v8qi = external global <8 x i8>
+
+define void @t1() nounwind {
+ %tmp3 = load <8 x i8>* @g_v8qi, align 8
+ %tmp4 = tail call i32 (...)* @pass_v8qi( <8 x i8> %tmp3 ) nounwind
+ ret void
+}
+
+define void @t2(<8 x i8> %v1, <8 x i8> %v2) nounwind {
+ %tmp3 = add <8 x i8> %v1, %v2
+ %tmp4 = tail call i32 (...)* @pass_v8qi( <8 x i8> %tmp3 ) nounwind
+ ret void
+}
+
+define void @t3() nounwind {
+ call void @pass_v1di( <1 x i64> zeroinitializer )
+ ret void
+}
+
+declare i32 @pass_v8qi(...)
+declare void @pass_v1di(<1 x i64>)
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/mmx-insert-element.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/mmx-insert-element.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/mmx-insert-element.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/mmx-insert-element.ll Sun Jul 6 15:45:41 2008
@@ -1,23 +1,7 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep movq | count 3
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | not grep movq
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep psllq
-; FIXME: This code outputs:
-;
-; subl $28, %esp
-; movl 32(%esp), %eax
-; movd %eax, %mm0
-; movq %mm0, (%esp)
-; movl (%esp), %eax
-; movl %eax, 20(%esp)
-; movq %mm0, 8(%esp)
-; movl 12(%esp), %eax
-; movl %eax, 16(%esp)
-; movq 16(%esp), %mm0
-; addl $28, %esp
-;
-; Which is ugly. We need to fix this.
-
-define <2 x i32> @qux(i32 %A) {
-entry:
+define <2 x i32> @qux(i32 %A) nounwind {
%tmp3 = insertelement <2 x i32> < i32 0, i32 undef >, i32 %A, i32 1 ; <<2 x i32>> [#uses=1]
ret <2 x i32> %tmp3
}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/mmx-shift.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/mmx-shift.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/mmx-shift.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/mmx-shift.ll Sun Jul 6 15:45:41 2008
@@ -1,14 +1,16 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep psllq | grep 32
+; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+mmx | grep psllq | grep 32
; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep psrad
+; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+mmx | grep psrlw
define i64 @t1(<1 x i64> %mm1) nounwind {
entry:
- %tmp6 = tail call <1 x i64> @llvm.x86.mmx.psll.q( <1 x i64> %mm1, <1 x i64> <i64 32> ) ; <<1 x i64>> [#uses=1]
+ %tmp6 = tail call <1 x i64> @llvm.x86.mmx.pslli.q( <1 x i64> %mm1, i32 32 ) ; <<1 x i64>> [#uses=1]
%retval1112 = bitcast <1 x i64> %tmp6 to i64 ; <i64> [#uses=1]
ret i64 %retval1112
}
-declare <1 x i64> @llvm.x86.mmx.psll.q(<1 x i64>, <1 x i64>) nounwind readnone
+declare <1 x i64> @llvm.x86.mmx.pslli.q(<1 x i64>, i32) nounwind readnone
define i64 @t2(<2 x i32> %mm1, <2 x i32> %mm2) nounwind {
entry:
@@ -18,3 +20,13 @@
}
declare <2 x i32> @llvm.x86.mmx.psra.d(<2 x i32>, <2 x i32>) nounwind readnone
+
+define i64 @t3(<1 x i64> %mm1, i32 %bits) nounwind {
+entry:
+ %tmp6 = bitcast <1 x i64> %mm1 to <4 x i16> ; <<4 x i16>> [#uses=1]
+ %tmp8 = tail call <4 x i16> @llvm.x86.mmx.psrli.w( <4 x i16> %tmp6, i32 %bits ) nounwind readnone ; <<4 x i16>> [#uses=1]
+ %retval1314 = bitcast <4 x i16> %tmp8 to i64 ; <i64> [#uses=1]
+ ret i64 %retval1314
+}
+
+declare <4 x i16> @llvm.x86.mmx.psrli.w(<4 x i16>, i32) nounwind readnone
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/nancvt.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/nancvt.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/nancvt.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/nancvt.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,8 @@
-; RUN: llvm-as < %s | opt -std-compile-opts | llc | grep 2147027116 | count 3
-; RUN: llvm-as < %s | opt -std-compile-opts | llc | grep 2147228864 | count 3
-; RUN: llvm-as < %s | opt -std-compile-opts | llc | grep 2146502828 | count 3
-; RUN: llvm-as < %s | opt -std-compile-opts | llc | grep 2143034560 | count 3
+; RUN: llvm-as < %s | opt -std-compile-opts | llc > %t
+; RUN: grep 2147027116 %t | count 3
+; RUN: grep 2147228864 %t | count 3
+; RUN: grep 2146502828 %t | count 3
+; RUN: grep 2143034560 %t | count 3
; Compile time conversions of NaNs.
; ModuleID = 'nan2.c'
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"
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/packed_struct.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/packed_struct.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/packed_struct.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/packed_struct.ll Sun Jul 6 15:45:41 2008
@@ -1,8 +1,9 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep foos+5
-; RUN: llvm-as < %s | llc -march=x86 | grep foos+1
-; RUN: llvm-as < %s | llc -march=x86 | grep foos+9
-; RUN: llvm-as < %s | llc -march=x86 | grep bara+19
-; RUN: llvm-as < %s | llc -march=x86 | grep bara+4
+; RUN: llvm-as < %s | llc -march=x86 > %t
+; RUN: grep foos+5 %t
+; RUN: grep foos+1 %t
+; RUN: grep foos+9 %t
+; RUN: grep bara+19 %t
+; RUN: grep bara+4 %t
; make sure we compute the correct offset for a packed structure
Added: llvm/branches/non-call-eh/test/CodeGen/X86/pmul.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/pmul.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/pmul.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/pmul.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,32 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 -stack-alignment=16 > %t
+; RUN: grep pmul %t | count 6
+; RUN: grep mov %t | count 8
+
+define <4 x i32> @a(<4 x i32> %i) nounwind {
+ %A = mul <4 x i32> %i, < i32 117, i32 117, i32 117, i32 117 >
+ ret <4 x i32> %A
+}
+define <2 x i64> @b(<2 x i64> %i) nounwind {
+ %A = mul <2 x i64> %i, < i64 117, i64 117 >
+ ret <2 x i64> %A
+}
+define <4 x i32> @c(<4 x i32> %i, <4 x i32> %j) nounwind {
+ %A = mul <4 x i32> %i, %j
+ ret <4 x i32> %A
+}
+define <2 x i64> @d(<2 x i64> %i, <2 x i64> %j) nounwind {
+ %A = mul <2 x i64> %i, %j
+ ret <2 x i64> %A
+}
+; Use a call to force spills.
+declare void @foo()
+define <4 x i32> @e(<4 x i32> %i, <4 x i32> %j) nounwind {
+ call void @foo()
+ %A = mul <4 x i32> %i, %j
+ ret <4 x i32> %A
+}
+define <2 x i64> @f(<2 x i64> %i, <2 x i64> %j) nounwind {
+ call void @foo()
+ %A = mul <2 x i64> %i, %j
+ ret <2 x i64> %A
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/pr2326.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/pr2326.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/pr2326.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/pr2326.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,24 @@
+; RUN: llvm-as < %s | llc -march=x86 | grep sete
+; PR2326
+
+define i32 @func_59(i32 %p_60) nounwind {
+entry:
+ %l_108 = alloca i32 ; <i32*> [#uses=2]
+ %tmp15 = load i32* null, align 4 ; <i32> [#uses=1]
+ %tmp16 = load i32* %l_108, align 4 ; <i32> [#uses=1]
+ %tmp17 = icmp eq i32 %tmp15, %tmp16 ; <i1> [#uses=1]
+ %tmp1718 = zext i1 %tmp17 to i8 ; <i8> [#uses=1]
+ %tmp19 = load i32* null, align 4 ; <i32> [#uses=1]
+ %tmp20 = load i32* %l_108, align 4 ; <i32> [#uses=1]
+ %tmp21 = icmp ule i32 %tmp19, %tmp20 ; <i1> [#uses=1]
+ %tmp2122 = zext i1 %tmp21 to i8 ; <i8> [#uses=1]
+ %toBool23 = icmp ne i8 %tmp1718, 0 ; <i1> [#uses=1]
+ %toBool24 = icmp ne i8 %tmp2122, 0 ; <i1> [#uses=1]
+ %tmp25 = and i1 %toBool23, %toBool24 ; <i1> [#uses=1]
+ %tmp2526 = zext i1 %tmp25 to i8 ; <i8> [#uses=1]
+ %tmp252627 = zext i8 %tmp2526 to i32 ; <i32> [#uses=1]
+ %tmp29 = call i32 (...)* @func_15( i32 %tmp252627, i32 0 ) nounwind ; <i32> [#uses=0]
+ unreachable
+}
+
+declare i32 @func_15(...)
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/prefetch.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/prefetch.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/prefetch.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/prefetch.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,8 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse | grep prefetchnta
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse | grep prefetcht0
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse | grep prefetcht1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse | grep prefetcht2
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse > %t
+; RUN: grep prefetchnta %t
+; RUN: grep prefetcht0 %t
+; RUN: grep prefetcht1 %t
+; RUN: grep prefetcht2 %t
define void @t(i8* %ptr) nounwind {
entry:
Added: llvm/branches/non-call-eh/test/CodeGen/X86/remat-mov0.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/remat-mov0.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/remat-mov0.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/remat-mov0.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,45 @@
+; RUN: llvm-as < %s | llc -march=x86 | grep xor | count 3
+
+ %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.ImgT = type { i8, i8*, i8*, %struct.FILE*, i32, i32, i32, i32, i8*, double*, float*, float*, float*, i32*, double, double, i32*, double*, i32*, i32* }
+ %struct._CompT = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, float, float, i8, %struct._PixT*, %struct._CompT*, i8, %struct._CompT* }
+ %struct._PixT = type { i32, i32, %struct._PixT* }
+ %struct.__sFILEX = type opaque
+ %struct.__sbuf = type { i8*, i32 }
+
+declare fastcc void @MergeComponents(%struct._CompT*, %struct._CompT*, %struct._CompT*, %struct._CompT**, %struct.ImgT*) nounwind
+
+define fastcc void @MergeToLeft(%struct._CompT* %comp, %struct._CompT** %head, %struct.ImgT* %img) nounwind {
+entry:
+ br label %bb208
+
+bb105: ; preds = %bb200
+ br i1 false, label %bb197, label %bb149
+
+bb149: ; preds = %bb105
+ %tmp151 = getelementptr %struct._CompT* null, i32 0, i32 0 ; <i32*> [#uses=1]
+ br i1 false, label %bb184, label %bb193
+
+bb184: ; preds = %bb149
+ tail call fastcc void @MergeComponents( %struct._CompT* %comp, %struct._CompT* null, %struct._CompT* null, %struct._CompT** %head, %struct.ImgT* %img ) nounwind
+ tail call fastcc void @MergeToLeft( %struct._CompT* %comp, %struct._CompT** %head, %struct.ImgT* %img ) nounwind
+ br label %bb193
+
+bb193: ; preds = %bb184, %bb149
+ %tmp196 = load i32* %tmp151, align 4 ; <i32> [#uses=1]
+ br label %bb197
+
+bb197: ; preds = %bb193, %bb105
+ %last_comp.0 = phi i32 [ %tmp196, %bb193 ], [ 0, %bb105 ] ; <i32> [#uses=0]
+ %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
+ br label %bb200
+
+bb200: ; preds = %bb208, %bb197
+ %indvar = phi i32 [ 0, %bb208 ], [ %indvar.next, %bb197 ] ; <i32> [#uses=2]
+ %xm.0 = sub i32 %indvar, 0 ; <i32> [#uses=1]
+ %tmp202 = icmp slt i32 %xm.0, 1 ; <i1> [#uses=1]
+ br i1 %tmp202, label %bb105, label %bb208
+
+bb208: ; preds = %bb200, %entry
+ br label %bb200
+}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/scalar_sse_minmax.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/scalar_sse_minmax.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/scalar_sse_minmax.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/scalar_sse_minmax.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,6 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse1,+sse2 | \
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse,+sse2 | \
; RUN: grep mins | count 3
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse1,+sse2 | \
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse,+sse2 | \
; RUN: grep maxs | count 2
declare i1 @llvm.isunordered.f64(double, double)
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/split-select.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/split-select.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/split-select.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/split-select.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,7 @@
; RUN: llvm-as < %s | llc -march=x86-64 | grep test | count 1
-define void @foo(i1 %c, <2 x float> %a, <2 x float> %b, <2 x float>* %p) {
- %x = select i1 %c, <2 x float> %a, <2 x float> %b
- store <2 x float> %x, <2 x float>* %p
+define void @foo(i1 %c, <2 x i16> %a, <2 x i16> %b, <2 x i16>* %p) {
+ %x = select i1 %c, <2 x i16> %a, <2 x i16> %b
+ store <2 x i16> %x, <2 x i16>* %p
ret void
}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-0.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-0.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-0.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-0.ll Sun Jul 6 15:45:41 2008
@@ -1,13 +1,11 @@
; RUN: llvm-as < %s | llc -march=x86-64 | not grep mov
-define <4 x float> @foo(<4 x float>* %p, <4 x float> %x)
-{
+define <4 x float> @foo(<4 x float>* %p, <4 x float> %x) nounwind {
%t = load <4 x float>* %p
%z = mul <4 x float> %t, %x
ret <4 x float> %z
}
-define <2 x double> @bar(<2 x double>* %p, <2 x double> %x)
-{
+define <2 x double> @bar(<2 x double>* %p, <2 x double> %x) nounwind {
%t = load <2 x double>* %p
%z = mul <2 x double> %t, %x
ret <2 x double> %z
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-1.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-1.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-1.ll Sun Jul 6 15:45:41 2008
@@ -1,12 +1,10 @@
; RUN: llvm-as < %s | llc -march=x86-64 | grep movap | count 2
-define <4 x float> @foo(<4 x float>* %p)
-{
+define <4 x float> @foo(<4 x float>* %p) nounwind {
%t = load <4 x float>* %p
ret <4 x float> %t
}
-define <2 x double> @bar(<2 x double>* %p)
-{
+define <2 x double> @bar(<2 x double>* %p) nounwind {
%t = load <2 x double>* %p
ret <2 x double> %t
}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-10.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-10.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-10.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-10.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | count 1
-define <2 x i64> @bar(<2 x i64>* %p)
-{
+define <2 x i64> @bar(<2 x i64>* %p) nounwind {
%t = load <2 x i64>* %p, align 8
ret <2 x i64> %t
}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-11.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-11.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-11.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-11.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,7 @@
; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -mtriple=i686-apple-darwin8 | grep movaps
; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -mtriple=linux | grep movups
-define <4 x float> @foo(float %a, float %b, float %c, float %d) {
+define <4 x float> @foo(float %a, float %b, float %c, float %d) nounwind {
entry:
%tmp6 = insertelement <4 x float> undef, float %a, i32 0
%tmp7 = insertelement <4 x float> %tmp6, float %b, i32 1
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-12.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-12.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-12.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-12.ll Sun Jul 6 15:45:41 2008
@@ -1,11 +1,11 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep unpck | count 2
-; RUN: llvm-as < %s | llc -march=x86-64 | grep shuf | count 2
-; RUN: llvm-as < %s | llc -march=x86-64 | grep ps | count 4
-; RUN: llvm-as < %s | llc -march=x86-64 | grep pd | count 4
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 4
+; RUN: llvm-as < %s | llc -march=x86-64 > %t
+; RUN: grep unpck %t | count 2
+; RUN: grep shuf %t | count 2
+; RUN: grep ps %t | count 4
+; RUN: grep pd %t | count 4
+; RUN: grep movup %t | count 4
-define <4 x float> @a(<4 x float>* %y)
-{
+define <4 x float> @a(<4 x float>* %y) nounwind {
%x = load <4 x float>* %y, align 4
%a = extractelement <4 x float> %x, i32 0
%b = extractelement <4 x float> %x, i32 1
@@ -17,8 +17,7 @@
%s = insertelement <4 x float> %r, float %a, i32 3
ret <4 x float> %s
}
-define <4 x float> @b(<4 x float>* %y, <4 x float> %z)
-{
+define <4 x float> @b(<4 x float>* %y, <4 x float> %z) nounwind {
%x = load <4 x float>* %y, align 4
%a = extractelement <4 x float> %x, i32 2
%b = extractelement <4 x float> %x, i32 3
@@ -30,8 +29,7 @@
%s = insertelement <4 x float> %r, float %b, i32 3
ret <4 x float> %s
}
-define <2 x double> @c(<2 x double>* %y)
-{
+define <2 x double> @c(<2 x double>* %y) nounwind {
%x = load <2 x double>* %y, align 8
%a = extractelement <2 x double> %x, i32 0
%c = extractelement <2 x double> %x, i32 1
@@ -39,8 +37,7 @@
%r = insertelement <2 x double> %p, double %a, i32 1
ret <2 x double> %r
}
-define <2 x double> @d(<2 x double>* %y, <2 x double> %z)
-{
+define <2 x double> @d(<2 x double>* %y, <2 x double> %z) nounwind {
%x = load <2 x double>* %y, align 8
%a = extractelement <2 x double> %x, i32 1
%c = extractelement <2 x double> %z, i32 1
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-2.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-2.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-2.ll Sun Jul 6 15:45:41 2008
@@ -1,13 +1,11 @@
; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 2
-define <4 x float> @foo(<4 x float>* %p, <4 x float> %x)
-{
+define <4 x float> @foo(<4 x float>* %p, <4 x float> %x) nounwind {
%t = load <4 x float>* %p, align 4
%z = mul <4 x float> %t, %x
ret <4 x float> %z
}
-define <2 x double> @bar(<2 x double>* %p, <2 x double> %x)
-{
+define <2 x double> @bar(<2 x double>* %p, <2 x double> %x) nounwind {
%t = load <2 x double>* %p, align 8
%z = mul <2 x double> %t, %x
ret <2 x double> %z
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-3.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-3.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-3.ll Sun Jul 6 15:45:41 2008
@@ -1,12 +1,10 @@
; RUN: llvm-as < %s | llc -march=x86-64 | grep movap | count 2
-define void @foo(<4 x float>* %p, <4 x float> %x)
-{
+define void @foo(<4 x float>* %p, <4 x float> %x) nounwind {
store <4 x float> %x, <4 x float>* %p
ret void
}
-define void @bar(<2 x double>* %p, <2 x double> %x)
-{
+define void @bar(<2 x double>* %p, <2 x double> %x) nounwind {
store <2 x double> %x, <2 x double>* %p
ret void
}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-4.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-4.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-4.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-4.ll Sun Jul 6 15:45:41 2008
@@ -1,12 +1,10 @@
; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 2
-define void @foo(<4 x float>* %p, <4 x float> %x)
-{
+define void @foo(<4 x float>* %p, <4 x float> %x) nounwind {
store <4 x float> %x, <4 x float>* %p, align 4
ret void
}
-define void @bar(<2 x double>* %p, <2 x double> %x)
-{
+define void @bar(<2 x double>* %p, <2 x double> %x) nounwind {
store <2 x double> %x, <2 x double>* %p, align 8
ret void
}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-5.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-5.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-5.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-5.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86-64 | grep movaps | count 1
-define <2 x i64> @bar(<2 x i64>* %p)
-{
+define <2 x i64> @bar(<2 x i64>* %p) nounwind {
%t = load <2 x i64>* %p
ret <2 x i64> %t
}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-6.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-6.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-6.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-6.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | count 1
-define <2 x i64> @bar(<2 x i64>* %p, <2 x i64> %x)
-{
+define <2 x i64> @bar(<2 x i64>* %p, <2 x i64> %x) nounwind {
%t = load <2 x i64>* %p, align 8
%z = mul <2 x i64> %t, %x
ret <2 x i64> %z
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-7.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-7.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-7.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-7.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86-64 | grep movaps | count 1
-define void @bar(<2 x i64>* %p, <2 x i64> %x)
-{
+define void @bar(<2 x i64>* %p, <2 x i64> %x) nounwind {
store <2 x i64> %x, <2 x i64>* %p
ret void
}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-8.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-8.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-8.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-8.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | count 1
-define void @bar(<2 x i64>* %p, <2 x i64> %x)
-{
+define void @bar(<2 x i64>* %p, <2 x i64> %x) nounwind {
store <2 x i64> %x, <2 x i64>* %p, align 8
ret void
}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-9.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-9.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-9.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-9.ll Sun Jul 6 15:45:41 2008
@@ -1,12 +1,10 @@
; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 2
-define <4 x float> @foo(<4 x float>* %p)
-{
+define <4 x float> @foo(<4 x float>* %p) nounwind {
%t = load <4 x float>* %p, align 4
ret <4 x float> %t
}
-define <2 x double> @bar(<2 x double>* %p)
-{
+define <2 x double> @bar(<2 x double>* %p) nounwind {
%t = load <2 x double>* %p, align 8
ret <2 x double> %t
}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/subclass-coalesce.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/subclass-coalesce.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/subclass-coalesce.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/subclass-coalesce.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,17 @@
+; RUN: llvm-as < %s | llc -march=x86 -join-subclass-copies -stats |& grep {Number of subclass joins performed}
+
+ at mem.6 = external global i64 ; <i64*> [#uses=1]
+
+define i64 @attachFunc() nounwind {
+entry:
+ %tmp64.i = add i64 0, 72 ; <i64> [#uses=1]
+ %tmp68.i = load i64* @mem.6, align 8 ; <i64> [#uses=1]
+ %tmp70.i = icmp sgt i64 %tmp64.i, %tmp68.i ; <i1> [#uses=1]
+ br i1 %tmp70.i, label %bb73.i, label %bb116
+
+bb73.i: ; preds = %entry
+ br label %bb116
+
+bb116: ; preds = %bb73.i, %entry
+ ret i64 %tmp68.i
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/tailcallstack64.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/tailcallstack64.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/tailcallstack64.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/tailcallstack64.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,21 @@
+; RUN: llvm-as < %s | llc -tailcallopt -march=x86-64 | grep TAILCALL
+; Check that lowered arguments on the stack do not overwrite each other.
+; Move param %in1 to temp register (%eax).
+; RUN: llvm-as < %s | llc -tailcallopt -march=x86-64 -x86-asm-syntax=att | grep {movl 40(%rsp), %eax}
+; Add %in1 %p1 to another temporary register (%r9d).
+; RUN: llvm-as < %s | llc -tailcallopt -march=x86-64 -x86-asm-syntax=att | grep {movl %edi, %r9d}
+; RUN: llvm-as < %s | llc -tailcallopt -march=x86-64 -x86-asm-syntax=att | grep {addl 32(%rsp), %r9d}
+; Move result of addition to stack.
+; RUN: llvm-as < %s | llc -tailcallopt -march=x86-64 -x86-asm-syntax=att | grep {movl %r9d, 40(%rsp)}
+; Move param %in2 to stack.
+; RUN: llvm-as < %s | llc -tailcallopt -march=x86-64 -x86-asm-syntax=att | grep {movl %eax, 32(%rsp)}
+
+declare fastcc i32 @tailcallee(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %a, i32 %b)
+
+define fastcc i32 @tailcaller(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %in1, i32 %in2) {
+entry:
+ %tmp = add i32 %in1, %p1
+ %retval = tail call fastcc i32 @tailcallee(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %in2,i32 %tmp)
+ ret i32 %retval
+}
+
Added: llvm/branches/non-call-eh/test/CodeGen/X86/twoaddr-remat.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/twoaddr-remat.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/twoaddr-remat.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/twoaddr-remat.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,67 @@
+; RUN: llvm-as < %s | llc -march=x86 | grep 59796 | count 3
+
+ %Args = type %Value*
+ %Exec = type opaque*
+ %Identifier = type opaque*
+ %JSFunction = type %Value (%Exec, %Scope, %Value, %Args)
+ %PropertyNameArray = type opaque*
+ %Scope = type opaque*
+ %Value = type opaque*
+
+declare i1 @X1(%Exec) readonly
+
+declare %Value @X2(%Exec)
+
+declare i32 @X3(%Exec, %Value)
+
+declare %Value @X4(i32) readnone
+
+define internal %Value @fast3bitlookup(%Exec %exec, %Scope %scope, %Value %this, %Args %args) nounwind {
+prologue:
+ %eh_check = tail call i1 @X1( %Exec %exec ) readonly ; <i1> [#uses=1]
+ br i1 %eh_check, label %exception, label %no_exception
+
+exception: ; preds = %no_exception, %prologue
+ %rethrow_result = tail call %Value @X2( %Exec %exec ) ; <%Value> [#uses=1]
+ ret %Value %rethrow_result
+
+no_exception: ; preds = %prologue
+ %args_intptr = bitcast %Args %args to i32* ; <i32*> [#uses=1]
+ %argc_val = load i32* %args_intptr ; <i32> [#uses=1]
+ %cmpParamArgc = icmp sgt i32 %argc_val, 0 ; <i1> [#uses=1]
+ %arg_ptr = getelementptr %Args %args, i32 1 ; <%Args> [#uses=1]
+ %arg_val = load %Args %arg_ptr ; <%Value> [#uses=1]
+ %ext_arg_val = select i1 %cmpParamArgc, %Value %arg_val, %Value inttoptr (i32 5 to %Value) ; <%Value> [#uses=1]
+ %toInt325 = tail call i32 @X3( %Exec %exec, %Value %ext_arg_val ) ; <i32> [#uses=3]
+ %eh_check6 = tail call i1 @X1( %Exec %exec ) readonly ; <i1> [#uses=1]
+ br i1 %eh_check6, label %exception, label %no_exception7
+
+no_exception7: ; preds = %no_exception
+ %shl_tmp_result = shl i32 %toInt325, 1 ; <i32> [#uses=1]
+ %rhs_masked13 = and i32 %shl_tmp_result, 14 ; <i32> [#uses=1]
+ %ashr_tmp_result = lshr i32 59796, %rhs_masked13 ; <i32> [#uses=1]
+ %and_tmp_result15 = and i32 %ashr_tmp_result, 3 ; <i32> [#uses=1]
+ %ashr_tmp_result3283 = lshr i32 %toInt325, 2 ; <i32> [#uses=1]
+ %rhs_masked38 = and i32 %ashr_tmp_result3283, 14 ; <i32> [#uses=1]
+ %ashr_tmp_result39 = lshr i32 59796, %rhs_masked38 ; <i32> [#uses=1]
+ %and_tmp_result41 = and i32 %ashr_tmp_result39, 3 ; <i32> [#uses=1]
+ %addconv = add i32 %and_tmp_result15, %and_tmp_result41 ; <i32> [#uses=1]
+ %ashr_tmp_result6181 = lshr i32 %toInt325, 5 ; <i32> [#uses=1]
+ %rhs_masked67 = and i32 %ashr_tmp_result6181, 6 ; <i32> [#uses=1]
+ %ashr_tmp_result68 = lshr i32 59796, %rhs_masked67 ; <i32> [#uses=1]
+ %and_tmp_result70 = and i32 %ashr_tmp_result68, 3 ; <i32> [#uses=1]
+ %addconv82 = add i32 %addconv, %and_tmp_result70 ; <i32> [#uses=3]
+ %rangetmp = add i32 %addconv82, 536870912 ; <i32> [#uses=1]
+ %rangecmp = icmp ult i32 %rangetmp, 1073741824 ; <i1> [#uses=1]
+ br i1 %rangecmp, label %NumberLiteralIntFast, label %NumberLiteralIntSlow
+
+NumberLiteralIntFast: ; preds = %no_exception7
+ %imm_shift = shl i32 %addconv82, 2 ; <i32> [#uses=1]
+ %imm_or = or i32 %imm_shift, 3 ; <i32> [#uses=1]
+ %imm_val = inttoptr i32 %imm_or to %Value ; <%Value> [#uses=1]
+ ret %Value %imm_val
+
+NumberLiteralIntSlow: ; preds = %no_exception7
+ %toVal = call %Value @X4( i32 %addconv82 ) ; <%Value> [#uses=1]
+ ret %Value %toVal
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/uint_to_fp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/uint_to_fp.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/uint_to_fp.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/uint_to_fp.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | not grep {sub.*esp}
+; rdar://6034396
+
+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-darwin8"
+
+define void @test(i32 %x, float* %y) nounwind {
+entry:
+ lshr i32 %x, 23 ; <i32>:0 [#uses=1]
+ uitofp i32 %0 to float ; <float>:1 [#uses=1]
+ store float %1, float* %y
+ ret void
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/variadic-node-pic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/variadic-node-pic.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/variadic-node-pic.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/variadic-node-pic.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -relocation-model=pic -code-model=large
+
+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"
+target triple = "x86_64-apple-darwin8"
+
+declare void @xscanf(i64) nounwind
+
+define void @foo() nounwind {
+ call void (i64)* @xscanf( i64 0 ) nounwind
+ unreachable
+}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_add.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_add.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_add.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_add.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | | llc -march=x86 -mattr=+sse2
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
define <2 x i64> @test(<2 x i64> %a, <2 x i64> %b) {
entry:
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_align.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_align.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_align.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_align.ll Sun Jul 6 15:45:41 2008
@@ -7,7 +7,7 @@
@G = external global { float,float,float,float}, align 16
-define %f4 @test1(float %W, float %X, float %Y, float %Z) {
+define %f4 @test1(float %W, float %X, float %Y, float %Z) nounwind {
%tmp = insertelement %f4 undef, float %W, i32 0
%tmp2 = insertelement %f4 %tmp, float %X, i32 1
%tmp4 = insertelement %f4 %tmp2, float %Y, i32 2
@@ -15,7 +15,7 @@
ret %f4 %tmp6
}
-define %f4 @test2() {
+define %f4 @test2() nounwind {
%Wp = getelementptr { float,float,float,float}* @G, i32 0, i32 0
%Xp = getelementptr { float,float,float,float}* @G, i32 0, i32 1
%Yp = getelementptr { float,float,float,float}* @G, i32 0, i32 2
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_clear.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_clear.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_clear.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_clear.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,7 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep and
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin | not grep and
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin | grep psrldq
-define <4 x float> @test(<4 x float>* %v1) {
+define <4 x float> @test(<4 x float>* %v1) nounwind {
%tmp = load <4 x float>* %v1 ; <<4 x float>> [#uses=1]
%tmp15 = bitcast <4 x float> %tmp to <2 x i64> ; <<2 x i64>> [#uses=1]
%tmp24 = and <2 x i64> %tmp15, bitcast (<4 x i32> < i32 0, i32 0, i32 -1, i32 -1 > to <2 x i64>) ; <<2 x i64>> [#uses=1]
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_ctbits.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_ctbits.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_ctbits.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_ctbits.ll Sun Jul 6 15:45:41 2008
@@ -4,15 +4,15 @@
declare <2 x i64> @llvm.ctlz.v2i64(<2 x i64>)
declare <2 x i64> @llvm.ctpop.v2i64(<2 x i64>)
-define <2 x i64> @footz(<2 x i64> %a) {
+define <2 x i64> @footz(<2 x i64> %a) nounwind {
%c = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %a)
ret <2 x i64> %c
}
-define <2 x i64> @foolz(<2 x i64> %a) {
+define <2 x i64> @foolz(<2 x i64> %a) nounwind {
%c = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %a)
ret <2 x i64> %c
}
-define <2 x i64> @foopop(<2 x i64> %a) {
+define <2 x i64> @foopop(<2 x i64> %a) nounwind {
%c = call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %a)
ret <2 x i64> %c
}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_extract-sse4.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_extract-sse4.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_extract-sse4.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_extract-sse4.ll Sun Jul 6 15:45:41 2008
@@ -1,29 +1,30 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse41 -o %t -f
-; RUN: grep extractps %t | count 1
-; RUN: grep pextrd %t | count 2
-; RUN: grep pshufd %t | count 1
+; RUN: grep extractps %t | count 1
+; RUN: grep pextrd %t | count 1
+; RUN: not grep pshufd %t
+; RUN: not grep movss %t
-define void @t1(float* %R, <4 x float>* %P1) {
+define void @t1(float* %R, <4 x float>* %P1) nounwind {
%X = load <4 x float>* %P1
%tmp = extractelement <4 x float> %X, i32 3
store float %tmp, float* %R
ret void
}
-define float @t2(<4 x float>* %P1) {
+define float @t2(<4 x float>* %P1) nounwind {
%X = load <4 x float>* %P1
%tmp = extractelement <4 x float> %X, i32 2
ret float %tmp
}
-define void @t3(i32* %R, <4 x i32>* %P1) {
+define void @t3(i32* %R, <4 x i32>* %P1) nounwind {
%X = load <4 x i32>* %P1
%tmp = extractelement <4 x i32> %X, i32 3
store i32 %tmp, i32* %R
ret void
}
-define i32 @t4(<4 x i32>* %P1) {
+define i32 @t4(<4 x i32>* %P1) nounwind {
%X = load <4 x i32>* %P1
%tmp = extractelement <4 x i32> %X, i32 3
ret i32 %tmp
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_fneg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_fneg.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_fneg.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_fneg.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | | llc -march=x86 -mattr=+sse2
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
define <4 x float> @t1(<4 x float> %Q) {
%tmp15 = sub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, %Q
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-2.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-2.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-2.ll Sun Jul 6 15:45:41 2008
@@ -1,26 +1,26 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep '\$132,' | count 2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep '\$2,' | count 2
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep {\$132,} | count 2
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep {\$2,} | count 2
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep shufps | count 4
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pinsrw | count 1
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movhpd | count 1
; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+sse2 | grep unpcklpd | count 1
-define <4 x float> @t1(float %s, <4 x float> %tmp) {
+define <4 x float> @t1(float %s, <4 x float> %tmp) nounwind {
%tmp1 = insertelement <4 x float> %tmp, float %s, i32 3
ret <4 x float> %tmp1
}
-define <4 x i32> @t2(i32 %s, <4 x i32> %tmp) {
+define <4 x i32> @t2(i32 %s, <4 x i32> %tmp) nounwind {
%tmp1 = insertelement <4 x i32> %tmp, i32 %s, i32 3
ret <4 x i32> %tmp1
}
-define <2 x double> @t3(double %s, <2 x double> %tmp) {
+define <2 x double> @t3(double %s, <2 x double> %tmp) nounwind {
%tmp1 = insertelement <2 x double> %tmp, double %s, i32 1
ret <2 x double> %tmp1
}
-define <8 x i16> @t4(i16 %s, <8 x i16> %tmp) {
+define <8 x i16> @t4(i16 %s, <8 x i16> %tmp) nounwind {
%tmp1 = insertelement <8 x i16> %tmp, i16 %s, i32 5
ret <8 x i16> %tmp1
}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-3.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-3.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-3.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+sse2 | grep punpcklqdq | count 1
-define <2 x i64> @t1(i64 %s, <2 x i64> %tmp) {
+define <2 x i64> @t1(i64 %s, <2 x i64> %tmp) nounwind {
%tmp1 = insertelement <2 x i64> %tmp, i64 %s, i32 1
ret <2 x i64> %tmp1
}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-5.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-5.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-5.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-5.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,32 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 > %t
+; RUN: grep psllq %t | grep 32
+; RUN: grep pslldq %t | grep 12
+; RUN: grep psrldq %t | grep 8
+; RUN: grep psrldq %t | grep 12
+
+define void @t1(i32 %a, <1 x i64>* %P) nounwind {
+ %tmp12 = shl i32 %a, 12
+ %tmp21 = insertelement <2 x i32> undef, i32 %tmp12, i32 1
+ %tmp22 = insertelement <2 x i32> %tmp21, i32 0, i32 0
+ %tmp23 = bitcast <2 x i32> %tmp22 to <1 x i64>
+ store <1 x i64> %tmp23, <1 x i64>* %P
+ ret void
+}
+
+define <4 x float> @t2(<4 x float>* %P) nounwind {
+ %tmp1 = load <4 x float>* %P
+ %tmp2 = shufflevector <4 x float> %tmp1, <4 x float> zeroinitializer, <4 x i32> < i32 4, i32 4, i32 4, i32 0 >
+ ret <4 x float> %tmp2
+}
+
+define <4 x float> @t3(<4 x float>* %P) nounwind {
+ %tmp1 = load <4 x float>* %P
+ %tmp2 = shufflevector <4 x float> %tmp1, <4 x float> zeroinitializer, <4 x i32> < i32 2, i32 3, i32 4, i32 4 >
+ ret <4 x float> %tmp2
+}
+
+define <4 x float> @t4(<4 x float>* %P) nounwind {
+ %tmp1 = load <4 x float>* %P
+ %tmp2 = shufflevector <4 x float> zeroinitializer, <4 x float> %tmp1, <4 x i32> < i32 7, i32 0, i32 0, i32 0 >
+ ret <4 x float> %tmp2
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-6.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-6.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-6.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-6.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep pslldq
+
+define <4 x float> @t3(<4 x float>* %P) nounwind {
+ %tmp1 = load <4 x float>* %P
+ %tmp2 = shufflevector <4 x float> zeroinitializer, <4 x float> %tmp1, <4 x i32> < i32 4, i32 4, i32 4, i32 0 >
+ ret <4 x float> %tmp2
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert_4.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert_4.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert_4.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert_4.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | grep 1084227584 | count 1
+
+; ModuleID = '<stdin>'
+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.2.2"
+
+define <8 x float> @f(<8 x float> %a, i32 %b) nounwind {
+entry:
+ %vecins = insertelement <8 x float> %a, float 5.000000e+00, i32 %b ; <<4 x float>> [#uses=1]
+ ret <8 x float> %vecins
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/vec_loadhl.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_loadhl.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_loadhl.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_loadhl.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,19 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movlpd
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movhpd
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep movsd
+
+define void @t1(<2 x double>* %r, <2 x double>* %A, double %B) nounwind {
+ %tmp3 = load <2 x double>* %A, align 16
+ %tmp7 = insertelement <2 x double> undef, double %B, i32 0
+ %tmp9 = shufflevector <2 x double> %tmp3, <2 x double> %tmp7, <2 x i32> < i32 2, i32 1 >
+ store <2 x double> %tmp9, <2 x double>* %r, align 16
+ ret void
+}
+
+define void @t2(<2 x double>* %r, <2 x double>* %A, double %B) nounwind {
+ %tmp3 = load <2 x double>* %A, align 16
+ %tmp7 = insertelement <2 x double> undef, double %B, i32 0
+ %tmp9 = shufflevector <2 x double> %tmp3, <2 x double> %tmp7, <2 x i32> < i32 0, i32 2 >
+ store <2 x double> %tmp9, <2 x double>* %r, align 16
+ ret void
+}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_logical.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_logical.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_logical.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_logical.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,7 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep xorps | count 2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep andnps
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movaps | count 2
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 > %t
+; RUN: grep xorps %t | count 2
+; RUN: grep andnps %t
+; RUN: grep movaps %t | count 2
define void @t(<4 x float> %A) {
%tmp1277 = sub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, %A
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_return.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_return.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_return.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_return.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,7 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep xorps | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movaps | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep shuf
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 > %t
+; RUN: grep xorps %t | count 1
+; RUN: grep movaps %t | count 1
+; RUN: not grep shuf %t
define <2 x double> @test() {
ret <2 x double> zeroinitializer
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-2.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-2.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-2.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,7 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movss | count 1
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movd | count 1
-define <4 x float> @test1(float %a) {
+define <4 x float> @test1(float %a) nounwind {
%tmp = insertelement <4 x float> zeroinitializer, float %a, i32 0 ; <<4 x float>> [#uses=1]
%tmp5 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
%tmp6 = insertelement <4 x float> %tmp5, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
@@ -9,7 +9,7 @@
ret <4 x float> %tmp7
}
-define <2 x i64> @test(i32 %a) {
+define <2 x i64> @test(i32 %a) nounwind {
%tmp = insertelement <4 x i32> zeroinitializer, i32 %a, i32 0 ; <<8 x i16>> [#uses=1]
%tmp6 = insertelement <4 x i32> %tmp, i32 0, i32 1 ; <<8 x i32>> [#uses=1]
%tmp8 = insertelement <4 x i32> %tmp6, i32 0, i32 2 ; <<8 x i32>> [#uses=1]
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-4.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-4.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-4.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-4.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pinsrw | count 2
-define <2 x i64> @test(i16 %a) {
+define <2 x i64> @test(i16 %a) nounwind {
entry:
%tmp10 = insertelement <8 x i16> zeroinitializer, i16 %a, i32 3 ; <<8 x i16>> [#uses=1]
%tmp12 = insertelement <8 x i16> %tmp10, i16 0, i32 4 ; <<8 x i16>> [#uses=1]
@@ -11,7 +11,7 @@
ret <2 x i64> %tmp19
}
-define <2 x i64> @test2(i8 %a) {
+define <2 x i64> @test2(i8 %a) nounwind {
entry:
%tmp24 = insertelement <16 x i8> zeroinitializer, i8 %a, i32 10 ; <<16 x i8>> [#uses=1]
%tmp26 = insertelement <16 x i8> %tmp24, i8 0, i32 11 ; <<16 x i8>> [#uses=1]
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-5.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-5.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-5.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-5.ll Sun Jul 6 15:45:41 2008
@@ -1,10 +1,9 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f
; RUN: grep movlhps %t | count 1
-; RUN: grep unpcklps %t | count 1
-; RUN: grep punpckldq %t | count 1
; RUN: grep movq %t | count 1
+; RUN: grep movsd %t | count 1
-define <4 x float> @test1(float %a, float %b) {
+define <4 x float> @test1(float %a, float %b) nounwind {
%tmp = insertelement <4 x float> zeroinitializer, float %a, i32 0 ; <<4 x float>> [#uses=1]
%tmp6 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
%tmp8 = insertelement <4 x float> %tmp6, float %b, i32 2 ; <<4 x float>> [#uses=1]
@@ -12,7 +11,7 @@
ret <4 x float> %tmp9
}
-define <4 x float> @test2(float %a, float %b) {
+define <4 x float> @test2(float %a, float %b) nounwind {
%tmp = insertelement <4 x float> zeroinitializer, float %a, i32 0 ; <<4 x float>> [#uses=1]
%tmp7 = insertelement <4 x float> %tmp, float %b, i32 1 ; <<4 x float>> [#uses=1]
%tmp8 = insertelement <4 x float> %tmp7, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
@@ -20,7 +19,7 @@
ret <4 x float> %tmp9
}
-define <2 x i64> @test3(i32 %a, i32 %b) {
+define <2 x i64> @test3(i32 %a, i32 %b) nounwind {
%tmp = insertelement <4 x i32> zeroinitializer, i32 %a, i32 0 ; <<4 x i32>> [#uses=1]
%tmp6 = insertelement <4 x i32> %tmp, i32 %b, i32 1 ; <<4 x i32>> [#uses=1]
%tmp8 = insertelement <4 x i32> %tmp6, i32 0, i32 2 ; <<4 x i32>> [#uses=1]
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-6.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-6.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-6.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-6.ll Sun Jul 6 15:45:41 2008
@@ -1,5 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep unpcklps %t | count 1
+; RUN: grep movss %t | count 1
+; RUN: grep movups %t | count 1
; RUN: grep shufps %t | count 1
define <4 x float> @test(float %a, float %b, float %c) nounwind {
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-7.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-7.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-7.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-7.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movsd | count 1
-define <2 x i64> @test(<2 x i64>* %p) {
+define <2 x i64> @test(<2 x i64>* %p) nounwind {
%tmp = bitcast <2 x i64>* %p to double*
%tmp.upgrd.1 = load double* %tmp
%tmp.upgrd.2 = insertelement <2 x double> undef, double %tmp.upgrd.1, i32 0
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-9.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-9.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-9.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-9.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,7 @@
; RUN: llvm-as < %s | llc -march=x86-64 | grep movd | count 1
; RUN: llvm-as < %s | llc -march=x86-64 | grep {punpcklqdq.*%xmm0, %xmm0}
-define <2 x i64> @test3(i64 %A) {
+define <2 x i64> @test3(i64 %A) nounwind {
entry:
%B = insertelement <2 x i64> undef, i64 %A, i32 1
ret <2 x i64> %B
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-A.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-A.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-A.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-A.ll Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep {movl.*\$1, %}
-define <2 x i64> @test1() {
+define <2 x i64> @test1() nounwind {
entry:
ret <2 x i64> < i64 1, i64 0 >
}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-B.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-B.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-B.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-B.ll Sun Jul 6 15:45:41 2008
@@ -8,14 +8,14 @@
; movd %eax, %xmm0
; ret
-define <2 x i64> @test3(i64 %arg) {
+define <2 x i64> @test3(i64 %arg) nounwind {
entry:
%A = and i64 %arg, 1234567
%B = insertelement <2 x i64> zeroinitializer, i64 %A, i32 0
ret <2 x i64> %B
}
-define <2 x i64> @test2(i64 %arg) {
+define <2 x i64> @test2(i64 %arg) nounwind {
entry:
%A = and i64 %arg, 1234567
%B = insertelement <2 x i64> undef, i64 %A, i32 0
Added: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-C.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-C.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-C.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-C.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movq
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep mov | count 1
+; RUN: llvm-as < %s | llc -march=x86-64 -mattr=+sse2 | grep movd
+
+define <2 x i64> @t1(i64 %x) nounwind {
+ %tmp8 = insertelement <2 x i64> zeroinitializer, i64 %x, i32 0
+ ret <2 x i64> %tmp8
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-D.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-D.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-D.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-D.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movq
+
+define <4 x i32> @t(i32 %x, i32 %y) nounwind {
+ %tmp1 = insertelement <4 x i32> zeroinitializer, i32 %x, i32 0
+ %tmp2 = insertelement <4 x i32> %tmp1, i32 %y, i32 1
+ ret <4 x i32> %tmp2
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-E.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-E.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-E.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-E.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movq
+
+define <4 x float> @t(float %X) nounwind {
+ %tmp11 = insertelement <4 x float> undef, float %X, i32 0
+ %tmp12 = insertelement <4 x float> %tmp11, float %X, i32 1
+ %tmp27 = insertelement <4 x float> %tmp12, float 0.000000e+00, i32 2
+ %tmp28 = insertelement <4 x float> %tmp27, float 0.000000e+00, i32 3
+ ret <4 x float> %tmp28
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-F.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-F.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-F.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-F.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,19 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movq
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movsd
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep mov | count 3
+
+define <2 x i64> @t1(<2 x i64>* %ptr) nounwind {
+ %tmp45 = bitcast <2 x i64>* %ptr to <2 x i32>*
+ %tmp615 = load <2 x i32>* %tmp45
+ %tmp7 = bitcast <2 x i32> %tmp615 to i64
+ %tmp8 = insertelement <2 x i64> zeroinitializer, i64 %tmp7, i32 0
+ ret <2 x i64> %tmp8
+}
+
+define <2 x i64> @t2(i64 %x) nounwind {
+ %tmp717 = bitcast i64 %x to double
+ %tmp8 = insertelement <2 x double> undef, double %tmp717, i32 0
+ %tmp9 = insertelement <2 x double> %tmp8, double 0.000000e+00, i32 1
+ %tmp11 = bitcast <2 x double> %tmp9 to <2 x i64>
+ ret <2 x i64> %tmp11
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-G.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-G.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-G.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-G.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movss
+
+define fastcc void @t(<4 x float> %A) nounwind {
+ %tmp41896 = extractelement <4 x float> %A, i32 0 ; <float> [#uses=1]
+ %tmp14082 = insertelement <4 x float> < float 0.000000e+00, float undef, float undef, float undef >, float %tmp41896, i32 1 ; <<4 x float>> [#uses=1]
+ %tmp14083 = insertelement <4 x float> %tmp14082, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
+ store <4 x float> %tmp14083, <4 x float>* null, align 16
+ ret void
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-H.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-H.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-H.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-H.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep movz
+
+define <2 x i64> @doload64(i16 signext %x) nounwind {
+entry:
+ %tmp36 = insertelement <8 x i16> undef, i16 %x, i32 0 ; <<8 x i16>> [#uses=1]
+ %tmp37 = insertelement <8 x i16> %tmp36, i16 %x, i32 1 ; <<8 x i16>> [#uses=1]
+ %tmp38 = insertelement <8 x i16> %tmp37, i16 %x, i32 2 ; <<8 x i16>> [#uses=1]
+ %tmp39 = insertelement <8 x i16> %tmp38, i16 %x, i32 3 ; <<8 x i16>> [#uses=1]
+ %tmp40 = insertelement <8 x i16> %tmp39, i16 %x, i32 4 ; <<8 x i16>> [#uses=1]
+ %tmp41 = insertelement <8 x i16> %tmp40, i16 %x, i32 5 ; <<8 x i16>> [#uses=1]
+ %tmp42 = insertelement <8 x i16> %tmp41, i16 %x, i32 6 ; <<8 x i16>> [#uses=1]
+ %tmp43 = insertelement <8 x i16> %tmp42, i16 %x, i32 7 ; <<8 x i16>> [#uses=1]
+ %tmp46 = bitcast <8 x i16> %tmp43 to <2 x i64> ; <<2 x i64>> [#uses=1]
+ ret <2 x i64> %tmp46
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-I.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-I.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-I.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-I.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movd
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep xorp
+
+define void @t1() nounwind {
+ %tmp298.i.i = load <4 x float>* null, align 16
+ %tmp304.i.i = bitcast <4 x float> %tmp298.i.i to <4 x i32>
+ %tmp305.i.i = and <4 x i32> %tmp304.i.i, < i32 -1, i32 0, i32 0, i32 0 >
+ store <4 x i32> %tmp305.i.i, <4 x i32>* null, align 16
+ unreachable
+}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_set.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_set.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_set.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_set.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,6 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep punpckl | count 7
-define void @test(<8 x i16>* %b, i16 %a0, i16 %a1, i16 %a2, i16 %a3, i16 %a4, i16 %a5, i16 %a6, i16 %a7) {
+define void @test(<8 x i16>* %b, i16 %a0, i16 %a1, i16 %a2, i16 %a3, i16 %a4, i16 %a5, i16 %a6, i16 %a7) nounwind {
%tmp = insertelement <8 x i16> zeroinitializer, i16 %a0, i32 0 ; <<8 x i16>> [#uses=1]
%tmp2 = insertelement <8 x i16> %tmp, i16 %a1, i32 1 ; <<8 x i16>> [#uses=1]
%tmp4 = insertelement <8 x i16> %tmp2, i16 %a2, i32 2 ; <<8 x i16>> [#uses=1]
Added: llvm/branches/non-call-eh/test/CodeGen/X86/vec_shift3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_shift3.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_shift3.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_shift3.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,26 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep psllq
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep psraw
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movd | count 2
+
+define <2 x i64> @t1(<2 x i64> %x1, i32 %bits) nounwind {
+entry:
+ %tmp3 = tail call <2 x i64> @llvm.x86.sse2.pslli.q( <2 x i64> %x1, i32 %bits ) nounwind readnone ; <<2 x i64>> [#uses=1]
+ ret <2 x i64> %tmp3
+}
+
+define <2 x i64> @t2(<2 x i64> %x1) nounwind {
+entry:
+ %tmp3 = tail call <2 x i64> @llvm.x86.sse2.pslli.q( <2 x i64> %x1, i32 10 ) nounwind readnone ; <<2 x i64>> [#uses=1]
+ ret <2 x i64> %tmp3
+}
+
+define <2 x i64> @t3(<2 x i64> %x1, i32 %bits) nounwind {
+entry:
+ %tmp2 = bitcast <2 x i64> %x1 to <8 x i16> ; <<8 x i16>> [#uses=1]
+ %tmp4 = tail call <8 x i16> @llvm.x86.sse2.psrai.w( <8 x i16> %tmp2, i32 %bits ) nounwind readnone ; <<8 x i16>> [#uses=1]
+ %tmp5 = bitcast <8 x i16> %tmp4 to <2 x i64> ; <<2 x i64>> [#uses=1]
+ ret <2 x i64> %tmp5
+}
+
+declare <8 x i16> @llvm.x86.sse2.psrai.w(<8 x i16>, i32) nounwind readnone
+declare <2 x i64> @llvm.x86.sse2.pslli.q(<2 x i64>, i32) nounwind readnone
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-11.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-11.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-11.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-11.ll Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep mov
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin | not grep mov
define <4 x i32> @test() {
%tmp131 = call <2 x i64> @llvm.x86.sse2.psrl.dq( <2 x i64> < i64 -1, i64 -1 >, i32 96 ) ; <<2 x i64>> [#uses=1]
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-12.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-12.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-12.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-12.ll Sun Jul 6 15:45:41 2008
@@ -1,9 +1,9 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep punpck
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pextrw | count 4
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pinsrw | count 6
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshuflw | count 3
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshufhw | count 2
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 > %t
+; RUN: not grep punpck %t
+; RUN: grep pextrw %t | count 4
+; RUN: grep pinsrw %t | count 6
+; RUN: grep pshuflw %t | count 3
+; RUN: grep pshufhw %t | count 2
define <8 x i16> @t1(<8 x i16>* %A, <8 x i16>* %B) {
%tmp1 = load <8 x i16>* %A
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-13.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-13.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-13.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-13.ll Sun Jul 6 15:45:41 2008
@@ -1,9 +1,9 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movlhps | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movss | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshufd | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshuflw | count 1
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshufhw | count 1
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 > %t
+; RUN: grep movlhps %t | count 1
+; RUN: grep movss %t | count 1
+; RUN: grep pshufd %t | count 1
+; RUN: grep pshuflw %t | count 1
+; RUN: grep pshufhw %t | count 1
define <8 x i16> @t1(<8 x i16> %A, <8 x i16> %B) nounwind {
%tmp = shufflevector <8 x i16> %A, <8 x i16> %B, <8 x i32> < i32 8, i32 9, i32 0, i32 1, i32 10, i32 11, i32 2, i32 3 >
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-16.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-16.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-16.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-16.ll Sun Jul 6 15:45:41 2008
@@ -1,8 +1,8 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse,-sse2 | grep shufps | count 4
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse,-sse2 | grep mov | count 2
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse,-sse2 -mtriple=i386-apple-darwin | grep mov | count 2
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshufd | count 4
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep shufps
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep mov
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin | not grep mov
define <4 x float> @t1(<4 x float> %a, <4 x float> %b) nounwind {
%tmp1 = shufflevector <4 x float> %b, <4 x float> undef, <4 x i32> zeroinitializer
Added: llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-18.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-18.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-18.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-18.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,25 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -mtriple=i686-apple-darwin8.8.0 | grep mov | count 7
+
+ %struct.vector4_t = type { <4 x float> }
+
+define void @swizzle(i8* %a, %struct.vector4_t* %b, %struct.vector4_t* %c) nounwind {
+entry:
+ %tmp9 = getelementptr %struct.vector4_t* %b, i32 0, i32 0 ; <<4 x float>*> [#uses=2]
+ %tmp10 = load <4 x float>* %tmp9, align 16 ; <<4 x float>> [#uses=1]
+ %tmp14 = bitcast i8* %a to double* ; <double*> [#uses=1]
+ %tmp15 = load double* %tmp14 ; <double> [#uses=1]
+ %tmp16 = insertelement <2 x double> undef, double %tmp15, i32 0 ; <<2 x double>> [#uses=1]
+ %tmp18 = bitcast <2 x double> %tmp16 to <4 x float> ; <<4 x float>> [#uses=1]
+ %tmp19 = shufflevector <4 x float> %tmp10, <4 x float> %tmp18, <4 x i32> < i32 4, i32 5, i32 2, i32 3 > ; <<4 x float>> [#uses=1]
+ store <4 x float> %tmp19, <4 x float>* %tmp9, align 16
+ %tmp28 = getelementptr %struct.vector4_t* %c, i32 0, i32 0 ; <<4 x float>*> [#uses=2]
+ %tmp29 = load <4 x float>* %tmp28, align 16 ; <<4 x float>> [#uses=1]
+ %tmp26 = getelementptr i8* %a, i32 8 ; <i8*> [#uses=1]
+ %tmp33 = bitcast i8* %tmp26 to double* ; <double*> [#uses=1]
+ %tmp34 = load double* %tmp33 ; <double> [#uses=1]
+ %tmp35 = insertelement <2 x double> undef, double %tmp34, i32 0 ; <<2 x double>> [#uses=1]
+ %tmp37 = bitcast <2 x double> %tmp35 to <4 x float> ; <<4 x float>> [#uses=1]
+ %tmp38 = shufflevector <4 x float> %tmp29, <4 x float> %tmp37, <4 x i32> < i32 4, i32 5, i32 2, i32 3 > ; <<4 x float>> [#uses=1]
+ store <4 x float> %tmp38, <4 x float>* %tmp28, align 16
+ ret void
+}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-2.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-2.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-2.ll Sun Jul 6 15:45:41 2008
@@ -3,7 +3,7 @@
; RUN: grep pshuflw %t | count 1
; RUN: grep movhps %t | count 1
-define void @test1(<2 x i64>* %res, <2 x i64>* %A) {
+define void @test1(<2 x i64>* %res, <2 x i64>* %A) nounwind {
%tmp = load <2 x i64>* %A ; <<2 x i64>> [#uses=1]
%tmp.upgrd.1 = bitcast <2 x i64> %tmp to <8 x i16> ; <<8 x i16>> [#uses=8]
%tmp0 = extractelement <8 x i16> %tmp.upgrd.1, i32 0 ; <i16> [#uses=1]
@@ -27,7 +27,7 @@
ret void
}
-define void @test2(<4 x float>* %r, <2 x i32>* %A) {
+define void @test2(<4 x float>* %r, <2 x i32>* %A) nounwind {
%tmp = load <4 x float>* %r ; <<4 x float>> [#uses=2]
%tmp.upgrd.3 = bitcast <2 x i32>* %A to double* ; <double*> [#uses=1]
%tmp.upgrd.4 = load double* %tmp.upgrd.3 ; <double> [#uses=1]
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/vec_ss_load_fold.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vec_ss_load_fold.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vec_ss_load_fold.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vec_ss_load_fold.ll Sun Jul 6 15:45:41 2008
@@ -5,7 +5,7 @@
target datalayout = "e-p:32:32"
target triple = "i686-apple-darwin8.7.2"
-define i16 @test1(float %f) {
+define i16 @test1(float %f) nounwind {
%tmp = insertelement <4 x float> undef, float %f, i32 0 ; <<4 x float>> [#uses=1]
%tmp10 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
%tmp11 = insertelement <4 x float> %tmp10, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
@@ -19,7 +19,7 @@
ret i16 %tmp69
}
-define i16 @test2(float %f) {
+define i16 @test2(float %f) nounwind {
%tmp28 = sub float %f, 1.000000e+00 ; <float> [#uses=1]
%tmp37 = mul float %tmp28, 5.000000e-01 ; <float> [#uses=1]
%tmp375 = insertelement <4 x float> undef, float %tmp37, i32 0 ; <<4 x float>> [#uses=1]
Added: llvm/branches/non-call-eh/test/CodeGen/X86/vortex-bug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/vortex-bug.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/vortex-bug.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/vortex-bug.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,21 @@
+; RUN: llvm-as < %s | llc -march=x86-64
+
+ %struct.blktkntype = type { i32, i32 }
+ %struct.fieldstruc = type { [128 x i8], %struct.blktkntype*, i32, i32 }
+
+define fastcc i32 @Env_GetFieldStruc(i8* %FieldName, i32* %Status, %struct.fieldstruc* %FieldStruc) nounwind {
+entry:
+ br label %bb137.i
+
+bb137.i: ; preds = %bb137.i, %entry
+ %FieldName_addr.0209.rec.i = phi i64 [ %tmp139.rec.i, %bb137.i ], [ 0, %entry ] ; <i64> [#uses=1]
+ %tmp147213.i = phi i32 [ %tmp147.i, %bb137.i ], [ 1, %entry ] ; <i32> [#uses=2]
+ %tmp139.rec.i = add i64 %FieldName_addr.0209.rec.i, 1 ; <i64> [#uses=2]
+ %tmp141142.i = sext i32 %tmp147213.i to i64 ; <i64> [#uses=0]
+ %tmp147.i = add i32 %tmp147213.i, 1 ; <i32> [#uses=1]
+ br i1 false, label %bb137.i, label %bb149.i.loopexit
+
+bb149.i.loopexit: ; preds = %bb137.i
+ %tmp139.i = getelementptr i8* %FieldName, i64 %tmp139.rec.i ; <i8*> [#uses=0]
+ unreachable
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-1.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-1.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-1.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f
+; RUN: grep {call f at PLT} %t1
+
+define void @g() {
+entry:
+ call void @f( )
+ ret void
+}
+
+declare void @f()
Added: llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-10.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-10.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-10.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-10.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f
+; RUN: grep {call g at PLT} %t1
+
+ at g = alias weak i32 ()* @f
+
+define void @g() {
+entry:
+ %tmp31 = call i32 @g()
+ ret void
+}
+
+declare extern_weak i32 @f()
Added: llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-11.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-11.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-11.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-11.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f
+; RUN: grep {call __fixunsxfti at PLT} %t1
+
+define i128 @f(x86_fp80 %a) {
+entry:
+ %tmp78 = fptoui x86_fp80 %a to i128
+ ret i128 %tmp78
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-2.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-2.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-2.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f
+; RUN: grep {call f} %t1
+; RUN: not grep {call f at PLT} %t1
+
+define void @g() {
+entry:
+ call void @f( )
+ ret void
+}
+
+declare hidden void @f()
Added: llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-3.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-3.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-3.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f
+; RUN: grep {call f} %t1
+; RUN: not grep {call f at PLT} %t1
+
+define void @g() {
+entry:
+ call void @f( )
+ ret void
+}
+
+define internal void @f() {
+entry:
+ ret void
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-4.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-4.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-4.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-4.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f
+; RUN: grep {movq a at GOTPCREL(%rip),} %t1
+
+ at a = global i32 0
+
+define i32 @get_a() {
+entry:
+ %tmp1 = load i32* @a, align 4
+ ret i32 %tmp1
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-5.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-5.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-5.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-5.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f
+; RUN: grep {movl a(%rip),} %t1
+; RUN: not grep GOTPCREL %t1
+
+ at a = hidden global i32 0
+
+define i32 @get_a() {
+entry:
+ %tmp1 = load i32* @a, align 4
+ ret i32 %tmp1
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-6.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-6.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-6.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-6.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f
+; RUN: grep {movl a(%rip),} %t1
+; RUN: not grep GOTPCREL %t1
+
+ at a = internal global i32 0
+
+define i32 @get_a() {
+entry:
+ %tmp1 = load i32* @a, align 4
+ ret i32 %tmp1
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-7.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-7.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-7.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-7.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f
+; RUN: grep {movq f at GOTPCREL(%rip),} %t1
+
+define void ()* @g() {
+entry:
+ ret void ()* @f
+}
+
+declare void @f()
Added: llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-8.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-8.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-8.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-8.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f
+; RUN: grep {leaq f(%rip),} %t1
+; RUN: not grep GOTPCREL %t1
+
+define void ()* @g() {
+entry:
+ ret void ()* @f
+}
+
+declare hidden void @f()
Added: llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-9.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-9.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-9.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-9.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | \
+; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f
+; RUN: grep {leaq f(%rip),} %t1
+; RUN: not grep GOTPCREL %t1
+
+define void ()* @g() {
+entry:
+ ret void ()* @f
+}
+
+define internal void @f() {
+entry:
+ ret void
+}
Added: llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-sret-return.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-sret-return.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-sret-return.ll (added)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-sret-return.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,54 @@
+; RUN: llvm-as < %s | llc | grep {movq %rdi, %rax}
+
+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"
+target triple = "x86_64-apple-darwin8"
+ %struct.foo = type { [4 x i64] }
+
+define void @bar(%struct.foo* noalias sret %agg.result, %struct.foo* %d) nounwind {
+entry:
+ %d_addr = alloca %struct.foo* ; <%struct.foo**> [#uses=2]
+ %memtmp = alloca %struct.foo, align 8 ; <%struct.foo*> [#uses=1]
+ %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
+ store %struct.foo* %d, %struct.foo** %d_addr
+ %tmp = load %struct.foo** %d_addr, align 8 ; <%struct.foo*> [#uses=1]
+ %tmp1 = getelementptr %struct.foo* %agg.result, i32 0, i32 0 ; <[4 x i64]*> [#uses=4]
+ %tmp2 = getelementptr %struct.foo* %tmp, i32 0, i32 0 ; <[4 x i64]*> [#uses=4]
+ %tmp3 = getelementptr [4 x i64]* %tmp1, i32 0, i32 0 ; <i64*> [#uses=1]
+ %tmp4 = getelementptr [4 x i64]* %tmp2, i32 0, i32 0 ; <i64*> [#uses=1]
+ %tmp5 = load i64* %tmp4, align 8 ; <i64> [#uses=1]
+ store i64 %tmp5, i64* %tmp3, align 8
+ %tmp6 = getelementptr [4 x i64]* %tmp1, i32 0, i32 1 ; <i64*> [#uses=1]
+ %tmp7 = getelementptr [4 x i64]* %tmp2, i32 0, i32 1 ; <i64*> [#uses=1]
+ %tmp8 = load i64* %tmp7, align 8 ; <i64> [#uses=1]
+ store i64 %tmp8, i64* %tmp6, align 8
+ %tmp9 = getelementptr [4 x i64]* %tmp1, i32 0, i32 2 ; <i64*> [#uses=1]
+ %tmp10 = getelementptr [4 x i64]* %tmp2, i32 0, i32 2 ; <i64*> [#uses=1]
+ %tmp11 = load i64* %tmp10, align 8 ; <i64> [#uses=1]
+ store i64 %tmp11, i64* %tmp9, align 8
+ %tmp12 = getelementptr [4 x i64]* %tmp1, i32 0, i32 3 ; <i64*> [#uses=1]
+ %tmp13 = getelementptr [4 x i64]* %tmp2, i32 0, i32 3 ; <i64*> [#uses=1]
+ %tmp14 = load i64* %tmp13, align 8 ; <i64> [#uses=1]
+ store i64 %tmp14, i64* %tmp12, align 8
+ %tmp15 = getelementptr %struct.foo* %memtmp, i32 0, i32 0 ; <[4 x i64]*> [#uses=4]
+ %tmp16 = getelementptr %struct.foo* %agg.result, i32 0, i32 0 ; <[4 x i64]*> [#uses=4]
+ %tmp17 = getelementptr [4 x i64]* %tmp15, i32 0, i32 0 ; <i64*> [#uses=1]
+ %tmp18 = getelementptr [4 x i64]* %tmp16, i32 0, i32 0 ; <i64*> [#uses=1]
+ %tmp19 = load i64* %tmp18, align 8 ; <i64> [#uses=1]
+ store i64 %tmp19, i64* %tmp17, align 8
+ %tmp20 = getelementptr [4 x i64]* %tmp15, i32 0, i32 1 ; <i64*> [#uses=1]
+ %tmp21 = getelementptr [4 x i64]* %tmp16, i32 0, i32 1 ; <i64*> [#uses=1]
+ %tmp22 = load i64* %tmp21, align 8 ; <i64> [#uses=1]
+ store i64 %tmp22, i64* %tmp20, align 8
+ %tmp23 = getelementptr [4 x i64]* %tmp15, i32 0, i32 2 ; <i64*> [#uses=1]
+ %tmp24 = getelementptr [4 x i64]* %tmp16, i32 0, i32 2 ; <i64*> [#uses=1]
+ %tmp25 = load i64* %tmp24, align 8 ; <i64> [#uses=1]
+ store i64 %tmp25, i64* %tmp23, align 8
+ %tmp26 = getelementptr [4 x i64]* %tmp15, i32 0, i32 3 ; <i64*> [#uses=1]
+ %tmp27 = getelementptr [4 x i64]* %tmp16, i32 0, i32 3 ; <i64*> [#uses=1]
+ %tmp28 = load i64* %tmp27, align 8 ; <i64> [#uses=1]
+ store i64 %tmp28, i64* %tmp26, align 8
+ br label %return
+
+return: ; preds = %entry
+ ret void
+}
Modified: llvm/branches/non-call-eh/test/CodeGen/X86/xor_not.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/CodeGen/X86/xor_not.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/CodeGen/X86/xor_not.ll (original)
+++ llvm/branches/non-call-eh/test/CodeGen/X86/xor_not.ll Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep {not} | count 3
-; RUN: llvm-as < %s | llc -march=x86-64 | grep {not} | count 4
+; RUN: llvm-as < %s | llc -march=x86 | grep {not\[lwb\]} | count 3
+; RUN: llvm-as < %s | llc -march=x86-64 | grep {not\[lwb\]} | count 4
define i32 @test(i32 %a, i32 %b) nounwind {
entry:
%tmp1not = xor i32 %b, -2
Modified: llvm/branches/non-call-eh/test/DebugInfo/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/DebugInfo/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/DebugInfo/dg.exp (original)
+++ llvm/branches/non-call-eh/test/DebugInfo/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2002-12-16-ArgTest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2002-12-16-ArgTest.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2002-12-16-ArgTest.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2002-12-16-ArgTest.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
@.LC0 = internal global [10 x i8] c"argc: %d\0A\00" ; <[10 x i8]*> [#uses=1]
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-04-ArgumentBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-04-ArgumentBug.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-04-ArgumentBug.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-04-ArgumentBug.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
define i32 @foo(i32 %X, i32 %Y, double %A) {
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-04-LoopTest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-04-LoopTest.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-04-LoopTest.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-04-LoopTest.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o %t.bc -f
+; RUN: llvm-as %s -o %t.bc -f
; RUN: lli %t.bc > /dev/null
define i32 @main() {
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-04-PhiTest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-04-PhiTest.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-04-PhiTest.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-04-PhiTest.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
define i32 @main() {
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-09-SARTest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-09-SARTest.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-09-SARTest.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-09-SARTest.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
; We were accidentally inverting the signedness of right shifts. Whoops.
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-10-FUCOM.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-10-FUCOM.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-10-FUCOM.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-10-FUCOM.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
define i32 @main() {
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-15-AlignmentTest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-15-AlignmentTest.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-15-AlignmentTest.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-15-AlignmentTest.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
define i32 @bar(i8* %X) {
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2003-05-11-PHIRegAllocBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2003-05-11-PHIRegAllocBug.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2003-05-11-PHIRegAllocBug.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2003-05-11-PHIRegAllocBug.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
target datalayout = "e-p:32:32"
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2003-06-04-bzip2-bug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2003-06-04-bzip2-bug.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2003-06-04-bzip2-bug.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2003-06-04-bzip2-bug.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
; Testcase distilled from 256.bzip2.
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2003-06-05-PHIBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2003-06-05-PHIBug.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2003-06-05-PHIBug.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2003-06-05-PHIBug.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
; Testcase distilled from 256.bzip2.
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2003-08-15-AllocaAssertion.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2003-08-15-AllocaAssertion.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2003-08-15-AllocaAssertion.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2003-08-15-AllocaAssertion.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
; This testcase failed to work because two variable sized allocas confused the
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
;
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
; This testcase exposes a bug in the local register allocator where it runs out
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
@A = global i32 0 ; <i32*> [#uses=1]
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2004-12-04-LazyCompileFuncs.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2004-12-04-LazyCompileFuncs.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2004-12-04-LazyCompileFuncs.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2004-12-04-LazyCompileFuncs.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli -debug-only=jit %t.bc |& not grep {Finished CodeGen of .*Function: F}
@.str_1 = internal constant [7 x i8] c"IN F!\0A\00" ; <[7 x i8]*> [#uses=1]
@.str_2 = internal constant [7 x i8] c"IN G!\0A\00" ; <[7 x i8]*> [#uses=1]
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2007-12-10-APIntLoadStore.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2007-12-10-APIntLoadStore.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2007-12-10-APIntLoadStore.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2007-12-10-APIntLoadStore.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o - | lli -force-interpreter
+; RUN: llvm-as %s -o - | lli -force-interpreter
; PR1836
define i32 @main() {
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2007-12-14-BigEndian.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2007-12-14-BigEndian.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2007-12-14-BigEndian.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2007-12-14-BigEndian.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o - | lli -force-interpreter
+; RUN: llvm-as %s -o - | lli -force-interpreter
target datalayout = "E"
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/2007-12-14-LittleEndian.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2007-12-14-LittleEndian.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2007-12-14-LittleEndian.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2007-12-14-LittleEndian.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -o - | lli -force-interpreter
+; RUN: llvm-as %s -o - | lli -force-interpreter
target datalayout = "e"
Added: llvm/branches/non-call-eh/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll (added)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,60 @@
+; RUN: llvm-as %s -f -o %t.bc
+; RUN: lli -force-interpreter=true %t.bc | grep 1
+
+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"
+ at .str = internal constant [10 x i8] c"MSB = %d\0A\00" ; <[10 x i8]*> [#uses=1]
+
+define i65 @foo(i65 %x) {
+entry:
+ %x_addr = alloca i65 ; <i65*> [#uses=2]
+ %retval = alloca i65 ; <i65*> [#uses=2]
+ %tmp = alloca i65 ; <i65*> [#uses=2]
+ %"alloca point" = bitcast i65 0 to i65 ; <i65> [#uses=0]
+ store i65 %x, i65* %x_addr
+ %tmp1 = load i65* %x_addr, align 4 ; <i65> [#uses=1]
+ %tmp2 = ashr i65 %tmp1, 65 ; <i65> [#uses=1]
+ store i65 %tmp2, i65* %tmp, align 4
+ %tmp3 = load i65* %tmp, align 4 ; <i65> [#uses=1]
+ store i65 %tmp3, i65* %retval, align 4
+ br label %return
+
+return: ; preds = %entry
+ %retval4 = load i65* %retval ; <i65> [#uses=1]
+ ret i65 %retval4
+}
+
+define i32 @main() {
+entry:
+ %retval = alloca i32 ; <i32*> [#uses=1]
+ %iftmp.0 = alloca i32 ; <i32*> [#uses=3]
+ %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
+ %tmp = call i65 @foo( i65 -9 ) ; <i65> [#uses=1]
+ %tmp1 = lshr i65 %tmp, 64 ; <i65> [#uses=1]
+ %tmp2 = xor i65 %tmp1, 1 ; <i65> [#uses=1]
+ %tmp3 = and i65 %tmp2, 1 ; <i65> [#uses=1]
+ %tmp34 = trunc i65 %tmp3 to i8 ; <i8> [#uses=1]
+ %toBool = icmp ne i8 %tmp34, 0 ; <i1> [#uses=1]
+ br i1 %toBool, label %cond_true, label %cond_false
+
+cond_true: ; preds = %entry
+ store i32 0, i32* %iftmp.0, align 4
+ br label %cond_next
+
+cond_false: ; preds = %entry
+ store i32 1, i32* %iftmp.0, align 4
+ br label %cond_next
+
+cond_next: ; preds = %cond_false, %cond_true
+ %tmp5 = getelementptr [10 x i8]* @.str, i32 0, i32 0 ; <i8*> [#uses=1]
+ %tmp6 = load i32* %iftmp.0, align 4 ; <i32> [#uses=1]
+ %tmp7 = call i32 (i8*, ...)* @printf( i8* noalias %tmp5, i32 %tmp6 ) nounwind ; <i32> [#uses=0]
+ br label %return
+
+return: ; preds = %cond_next
+ store i32 0, i32* %retval, align 4
+ %retval8 = load i32* %retval ; <i32> [#uses=1]
+ ret i32 %retval8
+}
+
+declare i32 @printf(i8* noalias , ...) nounwind
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/dg.exp (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/hello.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/hello.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/hello.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/hello.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
@.LC0 = internal global [12 x i8] c"Hello World\00" ; <[12 x i8]*> [#uses=1]
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/hello2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/hello2.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/hello2.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/hello2.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
@X = global i32 7 ; <i32*> [#uses=0]
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/simplesttest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/simplesttest.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/simplesttest.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/simplesttest.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
define i32 @main() {
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/simpletest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/simpletest.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/simpletest.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/simpletest.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
define i32 @bar() {
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/test-branch.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/test-branch.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/test-branch.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/test-branch.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
; test unconditional branch
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/test-call.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/test-call.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/test-call.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/test-call.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
declare void @exit(i32)
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/test-cast.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/test-cast.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/test-cast.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/test-cast.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
define i32 @foo() {
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/test-constantexpr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/test-constantexpr.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/test-constantexpr.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/test-constantexpr.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
; This tests to make sure that we can evaluate weird constant expressions
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/test-fp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/test-fp.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/test-fp.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/test-fp.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
define double @test(double* %DP, double %Arg) {
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/test-loadstore.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/test-loadstore.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/test-loadstore.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/test-loadstore.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
define void @test(i8* %P, i16* %P.upgrd.1, i32* %P.upgrd.2, i64* %P.upgrd.3) {
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/test-logical.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/test-logical.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/test-logical.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/test-logical.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
define i32 @main() {
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/test-loop.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/test-loop.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/test-loop.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/test-loop.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
define i32 @main() {
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/test-malloc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/test-malloc.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/test-malloc.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/test-malloc.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
define i32 @main() {
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/test-phi.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/test-phi.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/test-phi.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/test-phi.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
; test phi node
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/test-ret.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/test-ret.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/test-ret.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/test-ret.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
; test return instructions
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/test-setcond-fp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/test-setcond-fp.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/test-setcond-fp.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/test-setcond-fp.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/test-setcond-int.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/test-setcond-int.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/test-setcond-int.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/test-setcond-int.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
define i32 @main() {
Modified: llvm/branches/non-call-eh/test/ExecutionEngine/test-shift.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/ExecutionEngine/test-shift.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/ExecutionEngine/test-shift.ll (original)
+++ llvm/branches/non-call-eh/test/ExecutionEngine/test-shift.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t.bc
+; RUN: llvm-as %s -f -o %t.bc
; RUN: lli %t.bc > /dev/null
define i32 @main() {
Modified: llvm/branches/non-call-eh/test/Feature/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Feature/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Feature/dg.exp (original)
+++ llvm/branches/non-call-eh/test/Feature/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Modified: llvm/branches/non-call-eh/test/Feature/globalredefinition3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Feature/globalredefinition3.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Feature/globalredefinition3.ll (original)
+++ llvm/branches/non-call-eh/test/Feature/globalredefinition3.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: not llvm-as < %s -o /dev/null -f |& grep \
+; RUN: not llvm-as %s -o /dev/null -f |& grep \
; RUN: "Redefinition of global variable named 'B'"
; END.
Modified: llvm/branches/non-call-eh/test/Feature/llvm2cpp.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Feature/llvm2cpp.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Feature/llvm2cpp.exp (original)
+++ llvm/branches/non-call-eh/test/Feature/llvm2cpp.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm2cpp.exp
-llvm2cpp-test [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx}]]
+llvm2cpp-test [lsort [glob -nocomplain $srcdir/$subdir/*.ll]]
Modified: llvm/branches/non-call-eh/test/Feature/llvm2cpp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Feature/llvm2cpp.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Feature/llvm2cpp.ll (original)
+++ llvm/branches/non-call-eh/test/Feature/llvm2cpp.ll Sun Jul 6 15:45:41 2008
@@ -1,5 +1,5 @@
; RUN: llvm-as < %s | llvm-dis > /dev/null
-; RUN: llvm-as < %s | llvm2cpp -gen-program -o -
+; RUN: llvm-as < %s | llc -march=cpp -cppgen=program -o -
@X = global i32 4, align 16 ; <i32*> [#uses=0]
Modified: llvm/branches/non-call-eh/test/Feature/packed_struct.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Feature/packed_struct.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Feature/packed_struct.ll (original)
+++ llvm/branches/non-call-eh/test/Feature/packed_struct.ll Sun Jul 6 15:45:41 2008
@@ -2,7 +2,7 @@
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
; RUN: not grep cast %t2.ll
-; RUN: grep {\<\{} %t2.ll
+; RUN: grep {\\}>} %t2.ll
; END.
%struct.anon = type <{ i8, i32, i32, i32 }>
Removed: llvm/branches/non-call-eh/test/Feature/unwindto.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Feature/unwindto.ll?rev=53162&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Feature/unwindto.ll (original)
+++ llvm/branches/non-call-eh/test/Feature/unwindto.ll (removed)
@@ -1,92 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | llvm-as -disable-output
-; PR1269
-; END
-; http://nondot.org/sabre/LLVMNotes/ExceptionHandlingChanges.txt
-
-define i1 @test1(i8 %i, i8 %j) {
-entry: unwinds to %target
- %tmp = sub i8 %i, %j ; <i8> [#uses=1]
- %b = icmp eq i8 %tmp, 0 ; <i1> [#uses=1]
- ret i1 %b
-target:
- ret i1 false
-}
-
-define i1 @test2(i8 %i, i8 %j) {
-entry:
- br label %0
-unwinds to %1
- %tmp = sub i8 %i, %j ; <i8> [#uses=1]
- %b = icmp eq i8 %tmp, 0 ; <i1> [#uses=1]
- ret i1 %b
- ; No predecessors!
- ret i1 false
-}
-
-define i1 @test3(i8 %i, i8 %j) {
-entry:
- br label %0
-unwinds to %1
- %tmp = sub i8 %i, %j ; <i8> [#uses=1]
- %b = icmp eq i8 %tmp, 0 ; <i1> [#uses=1]
- ret i1 %b
-unwinds to %0
- ret i1 false
-}
-
-define i1 @test4(i8 %i, i8 %j) {
- %tmp = sub i8 %i, %j ; <i8> [#uses=1]
- %b = icmp eq i8 %tmp, 0 ; <i1> [#uses=1]
- br label %1
-unwinds to %1
- ret i1 false
-}
-
-define void @test5() {
- unwind
-}
-
-define void @test6() {
-entry:
- br label %unwind
-unwind: unwinds to %unwind
- unwind
-}
-
-define i8 @test7(i1 %b) {
-entry: unwinds to %cleanup
- br i1 %b, label %cond_true, label %cond_false
-cond_true: unwinds to %cleanup
- br label %cleanup
-cond_false: unwinds to %cleanup
- br label %cleanup
-cleanup:
- %x = phi i8 [0, %entry], [1, %cond_true], [1, %cond_true],
- [2, %cond_false], [2, %cond_false]
- ret i8 %x
-}
-
-define i1 @test8(i8 %i, i8 %j) {
-entry: unwinds to %target
- %tmp = sub i8 %i, %j ; <i8> [#uses=1]
- %b = icmp eq i8 %tmp, 0 ; <i1> [#uses=1]
- ret i1 %b
-target: nounwind
- ret i1 false
-}
-
-define i1 @test9(i8 %i, i8 %j) {
-entry: nounwind unwinds to %0
- %tmp = sub i8 %i, %j ; <i8> [#uses=1]
- %b = icmp eq i8 %tmp, 0 ; <i1> [#uses=1]
- ret i1 %b
-nounwind unwinds to %0
- ret i1 false
-}
-
-define void @test10() {
-entry:
- br label %unwind
-unwind: nounwind unwinds to %unwind
- unwind
-}
Propchange: llvm/branches/non-call-eh/test/FrontendC/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Jul 6 15:45:41 2008
@@ -0,0 +1 @@
+Output
Propchange: llvm/branches/non-call-eh/test/FrontendC++/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Jul 6 15:45:41 2008
@@ -0,0 +1 @@
+Output
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-08-20-ExceptionFail.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-08-20-ExceptionFail.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-08-20-ExceptionFail.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-08-20-ExceptionFail.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+void foo();
+
+void bar() {
+ struct local {
+ ~local() { foo(); }
+ } local_obj;
+
+ foo();
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-08-21-EmptyClass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-08-21-EmptyClass.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-08-21-EmptyClass.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-08-21-EmptyClass.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+// This tests compilation of EMPTY_CLASS_EXPR's
+
+struct empty {};
+
+void foo(empty) {}
+
+void bar() { foo(empty()); }
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-08-24-Cleanup.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-08-24-Cleanup.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-08-24-Cleanup.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-08-24-Cleanup.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgxx -xc++ %s -c -o - | llvm-dis | grep unwind
+
+struct S { ~S(); };
+
+int mightthrow();
+
+int test() {
+ S s;
+ mightthrow();
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-08-27-TypeNamespaces.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-08-27-TypeNamespaces.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-08-27-TypeNamespaces.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-08-27-TypeNamespaces.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,16 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+
+namespace foo {
+ namespace bar {
+ struct X { X(); };
+
+ X::X() {}
+ }
+}
+
+
+namespace {
+ struct Y { Y(); };
+ Y::Y() {}
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-08-28-ForwardType.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-08-28-ForwardType.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-08-28-ForwardType.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-08-28-ForwardType.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,23 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+// Default placement versions of operator new.
+#include <new>
+
+void* operator new(size_t, void* __p) throw();
+
+
+template<typename _CharT>
+struct stdio_filebuf
+{ stdio_filebuf();
+
+};
+
+extern stdio_filebuf<char> buf_cout;
+
+void foo() {
+ // Create stream buffers for the standard streams and use
+ // those buffers without destroying and recreating the
+ // streams.
+ new (&buf_cout) stdio_filebuf<char>();
+
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-08-28-SaveExprBug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-08-28-SaveExprBug.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-08-28-SaveExprBug.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-08-28-SaveExprBug.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,24 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+
+char* eback();
+
+template<typename foo>
+struct basic_filebuf {
+ char *instancevar;
+
+ void callee() {
+ instancevar += eback() != eback();
+ }
+
+ void caller();
+};
+
+
+template<typename _CharT>
+void basic_filebuf<_CharT>::caller() {
+ callee();
+}
+
+
+template class basic_filebuf<char>;
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-08-29-ArgPassingBug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-08-29-ArgPassingBug.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-08-29-ArgPassingBug.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-08-29-ArgPassingBug.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+
+// RUN: %llvmgcc -xc++ -c -o /dev/null %s |& not grep WARNING
+
+struct iterator {
+ iterator();
+ iterator(const iterator &I);
+};
+
+iterator foo(const iterator &I) { return I; }
+
+void test() {
+ foo(iterator());
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-08-31-StructLayout.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-08-31-StructLayout.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-08-31-StructLayout.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-08-31-StructLayout.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,16 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+// There is a HOLE in the derived2 object due to not wanting to place the two
+// baseclass instances at the same offset!
+
+struct baseclass {};
+
+class derived1 : public baseclass {
+ void * NodePtr;
+};
+
+class derived2 : public baseclass {
+ derived1 current;
+};
+
+derived2 RI;
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-09-22-CompositeExprValue.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-09-22-CompositeExprValue.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-09-22-CompositeExprValue.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-09-22-CompositeExprValue.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+struct duration {
+ duration operator/=(int c) {
+ return *this;
+ }
+};
+
+void a000090() {
+ duration() /= 1;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-09-29-ArgumentNumberMismatch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-09-29-ArgumentNumberMismatch.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-09-29-ArgumentNumberMismatch.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-09-29-ArgumentNumberMismatch.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,17 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+// Non-POD classes cannot be passed into a function by component, because their
+// dtors must be run. Instead, pass them in by reference. The C++ front-end
+// was mistakenly "thinking" that 'foo' took a structure by component.
+
+struct C {
+ int A, B;
+ ~C() {}
+};
+
+void foo(C b);
+
+void test(C *P) {
+ foo(*P);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-CommaExprBug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-09-30-CommaExprBug.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-CommaExprBug.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-CommaExprBug.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+class Empty {};
+
+void foo(Empty E);
+
+void bar() {
+ foo(Empty());
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-ForIncrementExprBug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-09-30-ForIncrementExprBug.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-ForIncrementExprBug.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-ForIncrementExprBug.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+struct C {};
+
+C &foo();
+
+void foox() {
+ for (; ; foo());
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-ForIncrementExprBug2.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-09-30-ForIncrementExprBug2.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-ForIncrementExprBug2.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-ForIncrementExprBug2.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+// Test with an opaque type
+
+struct C;
+
+C &foo();
+
+void foox() {
+ for (; ; foo());
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-NestedFunctionDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-09-30-NestedFunctionDecl.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-NestedFunctionDecl.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-NestedFunctionDecl.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+// The C++ front-end thinks the two foo's are different, the LLVM emitter
+// thinks they are the same. The disconnect causes problems.
+
+void foo() { }
+
+void bar() {
+ void foo();
+
+ foo();
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-10-17-BoolBitfields.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-10-17-BoolBitfields.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-10-17-BoolBitfields.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-10-17-BoolBitfields.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+struct test {
+ bool A : 1;
+ bool B : 1;
+};
+
+void foo(test *T) {
+ T->B = true;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-10-21-InnerClass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-10-21-InnerClass.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-10-21-InnerClass.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-10-21-InnerClass.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc -xc++ -S -o - %s | grep {struct.X::Y}
+struct X {
+
+ struct Y {
+ Y();
+ };
+
+};
+
+X::Y::Y() {
+
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-10-27-VirtualBaseClassCrash.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-10-27-VirtualBaseClassCrash.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-10-27-VirtualBaseClassCrash.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-10-27-VirtualBaseClassCrash.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,17 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+
+template<class T>
+struct super {
+ int Y;
+ void foo();
+};
+
+template <class T>
+struct test : virtual super<int> {};
+
+extern test<int> X;
+
+void foo() {
+ X.foo();
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-11-02-WeakLinkage.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-11-02-WeakLinkage.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-11-02-WeakLinkage.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-11-02-WeakLinkage.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+// RUN: %llvmgcc -xc++ -S -o - %s | not grep weak
+// The template should compile to linkonce linkage, not weak linkage.
+
+template<class T>
+void thefunc();
+
+template<class T>
+inline void thefunc() {}
+
+void test() {
+ thefunc<int>();
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-11-04-ArrayConstructors.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-11-04-ArrayConstructors.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-11-04-ArrayConstructors.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-11-04-ArrayConstructors.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+
+struct Foo {
+ Foo(int);
+ ~Foo();
+};
+void foo() {
+ struct {
+ Foo name;
+ } Int[] = { 1 };
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-11-04-CatchLabelName.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-11-04-CatchLabelName.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-11-04-CatchLabelName.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-11-04-CatchLabelName.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+#include <string>
+
+void bar();
+
+void test() {
+ try {
+ bar();
+ } catch (std::string) {}
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-11-08-ArrayAddress.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-11-08-ArrayAddress.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-11-08-ArrayAddress.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-11-08-ArrayAddress.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgxx -xc++ %s -c -o - | llvm-dis | grep getelementptr
+
+struct foo {
+ int array[100];
+ void *getAddr(unsigned i);
+};
+
+void *foo::getAddr(unsigned i) {
+ return &array[i];
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-11-09-ConstructorTypeSafety.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-11-09-ConstructorTypeSafety.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-11-09-ConstructorTypeSafety.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-11-09-ConstructorTypeSafety.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,21 @@
+// The code generated for this testcase should be completely typesafe!
+// RUN: %llvmgcc -xc++ -S -o - %s | llvm-as | opt -die | llvm-dis | \
+// RUN: notcast
+
+struct contained {
+ unsigned X;
+ contained();
+};
+
+struct base {
+ unsigned A, B;
+};
+
+struct derived : public base {
+ contained _M_value_field;
+};
+
+int test() {
+ derived X;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-11-18-EnumArray.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-11-18-EnumArray.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-11-18-EnumArray.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-11-18-EnumArray.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+enum TchkType {
+ tchkNum, tchkString, tchkSCN, tchkNone
+};
+
+struct Operator {
+ enum TchkType tchk[8];
+};
+
+struct Operator opTab[] = {
+ {{tchkNum, tchkNum, tchkString} }
+};
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-11-18-MemberInitializationCasting.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-11-18-MemberInitializationCasting.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-11-18-MemberInitializationCasting.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-11-18-MemberInitializationCasting.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+// RUN: %llvmgcc -xc++ -S -o - %s | llvm-as | opt -die | llvm-dis | notcast
+
+struct A {
+ A() : i(0) {}
+ int getI() {return i;}
+ int i;
+};
+
+int f(int j)
+{
+ A a;
+ return j+a.getI();
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-11-18-PtrMemConstantInitializer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-11-18-PtrMemConstantInitializer.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-11-18-PtrMemConstantInitializer.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-11-18-PtrMemConstantInitializer.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+struct Gfx {
+ void opMoveSetShowText();
+};
+
+struct Operator {
+ void (Gfx::*func)();
+};
+
+Operator opTab[] = {
+ {&Gfx::opMoveSetShowText},
+};
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-11-25-ReturningOpaqueByValue.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-11-25-ReturningOpaqueByValue.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-11-25-ReturningOpaqueByValue.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-11-25-ReturningOpaqueByValue.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+#include <vector>
+std::vector<int> my_method ();
+
+int
+main ()
+{
+ my_method ();
+ return 0;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-11-27-MultipleInheritanceThunk.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-11-27-MultipleInheritanceThunk.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-11-27-MultipleInheritanceThunk.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-11-27-MultipleInheritanceThunk.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,28 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+
+struct CallSite {
+ int X;
+
+ CallSite(const CallSite &CS);
+};
+
+struct AliasAnalysis {
+ int TD;
+
+ virtual int getModRefInfo(CallSite CS);
+};
+
+
+struct Pass {
+ int X;
+ virtual int foo();
+};
+
+struct AliasAnalysisCounter : public Pass, public AliasAnalysis {
+ int getModRefInfo(CallSite CS) {
+ return 0;
+ }
+};
+
+AliasAnalysisCounter AAC;
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-11-29-DuplicatedCleanupTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-11-29-DuplicatedCleanupTest.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-11-29-DuplicatedCleanupTest.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-11-29-DuplicatedCleanupTest.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,41 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+
+void doesntThrow() throw();
+struct F {
+ ~F() { doesntThrow(); }
+};
+
+void atest() {
+ F A;
+lab:
+ F B;
+ goto lab;
+}
+
+void test(int val) {
+label: {
+ F A;
+ F B;
+ if (val == 0) goto label;
+ if (val == 1) goto label;
+}
+}
+
+void test3(int val) {
+label: {
+ F A;
+ F B;
+ if (val == 0) { doesntThrow(); goto label; }
+ if (val == 1) { doesntThrow(); goto label; }
+}
+}
+
+void test4(int val) {
+label: {
+ F A;
+ F B;
+ if (val == 0) { F C; goto label; }
+ if (val == 1) { F D; goto label; }
+}
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2003-12-08-ArrayOfPtrToMemberFunc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2003-12-08-ArrayOfPtrToMemberFunc.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2003-12-08-ArrayOfPtrToMemberFunc.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2003-12-08-ArrayOfPtrToMemberFunc.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+struct Evil {
+ void fun ();
+};
+int foo();
+typedef void (Evil::*memfunptr) ();
+static memfunptr jumpTable[] = { &Evil::fun };
+
+void Evil::fun() {
+ (this->*jumpTable[foo()]) ();
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2004-01-11-DynamicInitializedConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2004-01-11-DynamicInitializedConstant.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2004-01-11-DynamicInitializedConstant.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2004-01-11-DynamicInitializedConstant.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -xc++ -S -o - %s | not grep { constant }
+
+extern int X;
+const int Y = X;
+const int* foo() { return &Y; }
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2004-03-08-ReinterpretCastCopy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2004-03-08-ReinterpretCastCopy.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2004-03-08-ReinterpretCastCopy.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2004-03-08-ReinterpretCastCopy.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,21 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+struct A {
+ virtual void Method() = 0;
+};
+
+struct B : public A {
+ virtual void Method() { }
+};
+
+typedef void (A::*fn_type_a)(void);
+typedef void (B::*fn_type_b)(void);
+
+int main(int argc, char **argv)
+{
+ fn_type_a f = reinterpret_cast<fn_type_a>(&B::Method);
+ fn_type_b g = reinterpret_cast<fn_type_b>(f);
+ B b;
+ (b.*g)();
+ return 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2004-03-09-UnmangledBuiltinMethods.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2004-03-09-UnmangledBuiltinMethods.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2004-03-09-UnmangledBuiltinMethods.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2004-03-09-UnmangledBuiltinMethods.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -xc++ -c -o - %s | llvm-dis | grep _ZN11AccessFlags6strlenEv
+
+struct AccessFlags {
+ void strlen();
+};
+
+void AccessFlags::strlen() { }
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2004-03-15-CleanupsAndGotos.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2004-03-15-CleanupsAndGotos.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2004-03-15-CleanupsAndGotos.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2004-03-15-CleanupsAndGotos.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+// Testcase from Bug 291
+
+struct X {
+ ~X();
+};
+
+void foo() {
+ X v;
+
+TryAgain:
+ goto TryAgain;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2004-06-08-LateTemplateInstantiation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2004-06-08-LateTemplateInstantiation.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2004-06-08-LateTemplateInstantiation.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2004-06-08-LateTemplateInstantiation.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,19 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+
+
+template<typename Ty>
+struct normal_iterator {
+ int FIELD;
+};
+
+void foo(normal_iterator<int>);
+normal_iterator<int> baz();
+
+void bar() {
+ foo(baz());
+}
+
+void *bar2() {
+ return (void*)foo;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2004-09-27-CompilerCrash.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2004-09-27-CompilerCrash.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2004-09-27-CompilerCrash.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2004-09-27-CompilerCrash.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+struct Pass {} ;
+template<typename PassName>
+Pass *callDefaultCtor() { return new PassName(); }
+
+void foo(Pass *(*C)());
+
+#include <string>
+
+bool foo(std::string &X) {
+ return X.empty();
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2004-09-27-DidntEmitTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2004-09-27-DidntEmitTemplate.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2004-09-27-DidntEmitTemplate.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2004-09-27-DidntEmitTemplate.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,23 @@
+// RUN: %llvmgxx -xc++ %s -c -o - | llvm-dis | grep callDefaultCtor | \
+// RUN: not grep declare
+
+// This is a testcase for LLVM PR445, which was a problem where the
+// instantiation of callDefaultCtor was not being emitted correctly.
+
+struct Pass {};
+
+template<typename PassName>
+Pass *callDefaultCtor() { return new Pass(); }
+
+void foo(Pass *(*C)());
+
+struct basic_string {
+ bool empty() const { return true; }
+};
+
+
+bool foo2(basic_string &X) {
+ return X.empty();
+}
+void baz() { foo(callDefaultCtor<Pass>); }
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-EmitsUnusedInlineFunctions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2004-11-27-EmitsUnusedInlineFunctions.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-EmitsUnusedInlineFunctions.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-EmitsUnusedInlineFunctions.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// The C++ front-end was emitting WAY too many inline functions. This test
+// verifies that it does not emit the body of getchar, because it is not used.
+// This corresponds to PR459
+
+// RUN: %llvmgxx %s -S -o - | not grep {^i32 .getchar}
+
+#include <stdio.h>
Added: llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-ExceptionCleanupAssertion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2004-11-27-ExceptionCleanupAssertion.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-ExceptionCleanupAssertion.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-ExceptionCleanupAssertion.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgxx %s -S -o /dev/null
+
+// This is PR421
+
+struct Strongbad {
+ Strongbad(const char *str );
+ ~Strongbad();
+ operator const char *() const;
+};
+
+void TheCheat () {
+ Strongbad foo(0);
+ Strongbad dirs[] = { Strongbad(0) + 1};
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-FriendDefaultArgCrash.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2004-11-27-FriendDefaultArgCrash.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-FriendDefaultArgCrash.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-FriendDefaultArgCrash.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgxx %s -o /dev/null -S
+
+// PR447
+
+namespace nm {
+ struct str {
+ friend int foo(int arg = 0);
+ };
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-InlineAsmFunctionRedefinition.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2004-11-27-InlineAsmFunctionRedefinition.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-InlineAsmFunctionRedefinition.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-InlineAsmFunctionRedefinition.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,26 @@
+// RUN: %llvmgxx %s -S -o /dev/null
+
+// PR397
+
+struct stat { };
+struct stat64 { };
+
+extern "C" {
+
+extern int lstat(const char *, struct stat *) __asm__("lstat64");
+extern int lstat64(const char *, struct stat64 *);
+
+extern int __lxstat(int, const char *, struct stat *) __asm__("__lxstat64");
+extern int __lxstat64(int, const char *, struct stat64 *);
+
+extern __inline__ int lstat(const char *path, struct stat *statbuf) {
+ return __lxstat(3, path, statbuf);
+}
+extern __inline__ int lstat64(const char *path, struct stat64 *statbuf) {
+ return __lxstat64(3, path, statbuf);
+}
+}
+
+int do_one_file(void) {
+ return lstat(0, 0) + lstat64(0,0);
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2005-01-03-StaticInitializers.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2005-01-03-StaticInitializers.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2005-01-03-StaticInitializers.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2005-01-03-StaticInitializers.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgxx %s -S -o - | not grep llvm.global_ctor
+
+struct S {
+ int A[2];
+};
+
+int XX = (int)(long)&(((struct S*)0)->A[1]);
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2005-02-11-AnonymousUnion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2005-02-11-AnonymousUnion.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2005-02-11-AnonymousUnion.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2005-02-11-AnonymousUnion.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,32 @@
+// RUN: %llvmgxx %s -S -o -
+
+// Test anonymous union with members of the same size.
+int test1(float F) {
+ union {
+ float G;
+ int i;
+ };
+ G = F;
+ return i;
+}
+
+// test anonymous union with members of differing size.
+int test2(short F) {
+ volatile union {
+ short G;
+ int i;
+ };
+ G = F;
+ return i;
+}
+
+// Make sure that normal unions work. duh :)
+volatile union U_t {
+ short S;
+ int i;
+} U;
+
+int test3(short s) {
+ U.S = s;
+ return U.i;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2005-02-13-BadDynamicInit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2005-02-13-BadDynamicInit.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2005-02-13-BadDynamicInit.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2005-02-13-BadDynamicInit.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgxx %s -S -o - | not grep llvm.global_ctors
+// This testcase corresponds to PR509
+struct Data {
+ unsigned *data;
+ unsigned array[1];
+};
+
+Data shared_null = { shared_null.array };
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2005-02-14-BitFieldOffset.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2005-02-14-BitFieldOffset.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2005-02-14-BitFieldOffset.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2005-02-14-BitFieldOffset.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgxx %s -S -o - | not grep {i32 6}
+
+struct QVectorTypedData {
+ int size;
+ unsigned int sharable : 1;
+ unsigned short array[1];
+};
+
+void foo(QVectorTypedData *X) {
+ X->array[0] = 123;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2005-02-19-BitfieldStructCrash.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2005-02-19-BitfieldStructCrash.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2005-02-19-BitfieldStructCrash.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2005-02-19-BitfieldStructCrash.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgxx -S %s -o -
+
+struct QChar {unsigned short X; QChar(unsigned short); } ;
+
+struct Command {
+ Command(QChar c) : c(c) {}
+ unsigned int type : 4;
+ QChar c;
+ };
+
+Command X(QChar('c'));
+
+void Foo(QChar );
+void bar() { Foo(X.c); }
Added: llvm/branches/non-call-eh/test/FrontendC++/2005-02-19-UnnamedVirtualThunkArgument.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2005-02-19-UnnamedVirtualThunkArgument.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2005-02-19-UnnamedVirtualThunkArgument.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2005-02-19-UnnamedVirtualThunkArgument.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,22 @@
+// RUN: %llvmgxx -S %s -o /dev/null
+
+struct Foo {
+ Foo();
+ virtual ~Foo();
+};
+
+struct Bar {
+ Bar();
+ virtual ~Bar();
+ virtual bool test(bool) const;
+};
+
+struct Baz : public Foo, public Bar {
+ Baz();
+ virtual ~Baz();
+ virtual bool test(bool) const;
+};
+
+bool Baz::test(bool) const {
+ return true;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2005-02-20-BrokenReferenceTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2005-02-20-BrokenReferenceTest.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2005-02-20-BrokenReferenceTest.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2005-02-20-BrokenReferenceTest.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgxx %s -S -o /dev/null
+
+void test(unsigned char *b, int rb) {
+ typedef unsigned char imgfoo[10][rb];
+ imgfoo &br = *(imgfoo *)b;
+
+ br[0][0] = 1;
+
+ rb = br[0][0];
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2005-02-27-PlacementArrayNewCrash.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2005-02-27-PlacementArrayNewCrash.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2005-02-27-PlacementArrayNewCrash.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2005-02-27-PlacementArrayNewCrash.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgxx -S %s -o -
+
+#include <new>
+typedef double Ty[4];
+
+void foo(Ty *XX) {
+ new(XX) Ty();
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2005-07-21-VirtualBaseAccess.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2005-07-21-VirtualBaseAccess.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2005-07-21-VirtualBaseAccess.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2005-07-21-VirtualBaseAccess.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgxx -xc++ %s -c -o - | opt -die | llvm-dis | not grep cast
+
+void foo(int*);
+
+struct FOO {
+ int X;
+};
+
+struct BAR : virtual FOO { BAR(); };
+
+int testfn() {
+ BAR B;
+ foo(&B.X);
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2006-03-01-GimplifyCrash.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2006-03-01-GimplifyCrash.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2006-03-01-GimplifyCrash.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2006-03-01-GimplifyCrash.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgxx -S %s -o -
+
+struct PrefMapElem {
+ virtual ~PrefMapElem();
+ unsigned int fPrefId;
+};
+
+int foo() {
+ PrefMapElem* fMap;
+ if (fMap[0].fPrefId == 1)
+ return 1;
+
+ return 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2006-03-06-C++RecurseCrash.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2006-03-06-C%2B%2BRecurseCrash.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2006-03-06-C++RecurseCrash.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2006-03-06-C++RecurseCrash.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,24 @@
+// RUN: %llvmgcc %s -S -o -
+namespace std {
+ class exception { };
+
+ class type_info {
+ public:
+ virtual ~type_info();
+ };
+
+}
+
+namespace __cxxabiv1 {
+ class __si_class_type_info : public std::type_info {
+ ~__si_class_type_info();
+ };
+}
+
+class recursive_init: public std::exception {
+public:
+ virtual ~recursive_init() throw ();
+};
+
+recursive_init::~recursive_init() throw() { }
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2006-09-08-powi.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2006-09-08-powi.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2006-09-08-powi.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2006-09-08-powi.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgxx -O3 -S -o - %s
+
+#include <cmath>
+
+double foo(double X, int Y) {
+ return std::pow(X, Y);
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2006-09-12-OpaqueStructCrash.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2006-09-12-OpaqueStructCrash.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2006-09-12-OpaqueStructCrash.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2006-09-12-OpaqueStructCrash.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,28 @@
+// RUN: %llvmgxx -O3 -S -o - %s
+
+struct A {
+ virtual ~A();
+};
+
+template <typename Ty>
+struct B : public A {
+ ~B () { delete [] val; }
+private:
+ Ty* val;
+};
+
+template <typename Ty>
+struct C : public A {
+ C ();
+ ~C ();
+};
+
+template <typename Ty>
+struct D : public A {
+ D () {}
+ private:
+ B<C<Ty> > blocks;
+};
+
+template class D<double>;
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2006-09-27-Debug-Protection.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2006-09-27-Debug-Protection.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2006-09-27-Debug-Protection.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2006-09-27-Debug-Protection.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+// RUN: %llvmgxx -O0 -emit-llvm -S -g -o - %s | grep {i32 1,}
+// RUN: %llvmgxx -O0 -emit-llvm -S -g -o - %s | grep {i32 2,}
+
+class A {
+public:
+ int x;
+protected:
+ int y;
+private:
+ int z;
+};
+
+A a;
Added: llvm/branches/non-call-eh/test/FrontendC++/2006-10-30-ClassBitfield.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2006-10-30-ClassBitfield.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2006-10-30-ClassBitfield.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2006-10-30-ClassBitfield.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,16 @@
+// RUN: %llvmgxx %s -emit-llvm -S -o -
+// PR954
+
+struct _Refcount_Base {
+ unsigned long _M_ref_count;
+ int _M_ref_count_lock;
+ _Refcount_Base() : _M_ref_count(0) {}
+};
+
+struct _Rope_RopeRep : public _Refcount_Base
+{
+public:
+ int _M_tag:8;
+};
+
+int foo(_Rope_RopeRep* r) { return r->_M_tag; }
Added: llvm/branches/non-call-eh/test/FrontendC++/2006-11-06-StackTrace.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2006-11-06-StackTrace.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2006-11-06-StackTrace.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2006-11-06-StackTrace.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,36 @@
+// This is a regression test on debug info to make sure that we can get a
+// meaningful stack trace from a C++ program.
+// RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | llc --disable-fp-elim -o %t.s -f
+// RUN: %compile_c %t.s -o %t.o
+// RUN: %link %t.o -o %t.exe
+// RUN: echo {break DeepStack::deepest\nrun 17\nwhere\n} > %t.in
+// RUN: gdb -q -batch -n -x %t.in %t.exe | tee %t.out | \
+// RUN: grep {#0 DeepStack::deepest.*(this=.*,.*x=33)}
+// RUN: gdb -q -batch -n -x %t.in %t.exe | \
+// RUN: grep {#7 0x.* in main.*(argc=\[12\],.*argv=.*)}
+
+// Only works on ppc, x86 and x86_64. Should generalize?
+// XFAIL: alpha|ia64|arm
+
+#include <stdlib.h>
+
+class DeepStack {
+ int seedVal;
+public:
+ DeepStack(int seed) : seedVal(seed) {}
+
+ int shallowest( int x ) { return shallower(x + 1); }
+ int shallower ( int x ) { return shallow(x + 2); }
+ int shallow ( int x ) { return deep(x + 3); }
+ int deep ( int x ) { return deeper(x + 4); }
+ int deeper ( int x ) { return deepest(x + 6); }
+ int deepest ( int x ) { return x + 7; }
+
+ int runit() { return shallowest(seedVal); }
+};
+
+int main ( int argc, char** argv) {
+
+ DeepStack DS9( (argc > 1 ? atoi(argv[1]) : 0) );
+ return DS9.runit();
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2006-11-20-GlobalSymbols.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2006-11-20-GlobalSymbols.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2006-11-20-GlobalSymbols.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2006-11-20-GlobalSymbols.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// PR1013
+// Check to make sure debug symbols use the correct name for globals and
+// functions. Will not assemble if it fails to.
+// RUN: %llvmgcc -O0 -g -c %s
+
+int foo __asm__("f\001oo");
+
+int bar() {
+ return foo;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2006-11-30-ConstantExprCrash.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2006-11-30-ConstantExprCrash.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2006-11-30-ConstantExprCrash.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2006-11-30-ConstantExprCrash.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,27 @@
+// RUN: %llvmgxx %s -emit-llvm -S -o -
+// PR1027
+
+struct sys_var {
+ unsigned name_length;
+
+ bool no_support_one_shot;
+ sys_var() {}
+};
+
+
+struct sys_var_thd : public sys_var {
+};
+
+extern sys_var_thd sys_auto_is_null;
+
+sys_var *getsys_variables() {
+ return &sys_auto_is_null;
+}
+
+sys_var *sys_variables = &sys_auto_is_null;
+
+
+
+
+
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2006-11-30-NoCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2006-11-30-NoCompileUnit.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2006-11-30-NoCompileUnit.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2006-11-30-NoCompileUnit.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,60 @@
+// This is a regression test on debug info to make sure we don't hit a compile
+// unit size issue with gdb.
+// RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | \
+// RUN: llc --disable-fp-elim -o NoCompileUnit.s -f
+// RUN: %compile_c NoCompileUnit.s -o NoCompileUnit.o
+// RUN: %link NoCompileUnit.o -o NoCompileUnit.exe
+// RUN: echo {break main\nrun\np NoCompileUnit::pubname} > %t2
+// RUN: gdb -q -batch -n -x %t2 NoCompileUnit.exe | \
+// RUN: tee NoCompileUnit.out | not grep {"low == high"}
+// XFAIL: alpha|ia64|arm
+// XFAIL: *
+// See PR2454
+
+
+class MamaDebugTest {
+private:
+ int N;
+
+protected:
+ MamaDebugTest(int n) : N(n) {}
+
+ int getN() const { return N; }
+
+};
+
+class BabyDebugTest : public MamaDebugTest {
+private:
+
+public:
+ BabyDebugTest(int n) : MamaDebugTest(n) {}
+
+ static int doh;
+
+ int doit() {
+ int N = getN();
+ int Table[N];
+
+ int sum = 0;
+
+ for (int i = 0; i < N; ++i) {
+ int j = i;
+ Table[i] = j;
+ }
+ for (int i = 0; i < N; ++i) {
+ int j = Table[i];
+ sum += j;
+ }
+
+ return sum;
+ }
+
+};
+
+int BabyDebugTest::doh;
+
+
+int main(int argc, const char *argv[]) {
+ BabyDebugTest BDT(20);
+ return BDT.doit();
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2006-11-30-Pubnames.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2006-11-30-Pubnames.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2006-11-30-Pubnames.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2006-11-30-Pubnames.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,20 @@
+// This is a regression test on debug info to make sure that we can access
+// qualified global names.
+// RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | \
+// RUN: llc --disable-fp-elim -o %t.s -f
+// RUN: %compile_c %t.s -o %t.o
+// RUN: %link %t.o -o %t.exe
+// RUN: echo {break main\nrun\np Pubnames::pubname} > %t.in
+// RUN: gdb -q -batch -n -x %t.in %t.exe | tee %t.out | grep {\$1 = 10}
+// XFAIL: alpha|ia64|arm
+
+struct Pubnames {
+ static int pubname;
+};
+
+int Pubnames::pubname = 10;
+
+int main (int argc, char** argv) {
+ Pubnames p;
+ return 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-01-02-UnboundedArray.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-01-02-UnboundedArray.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-01-02-UnboundedArray.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-01-02-UnboundedArray.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// Make sure unbounded arrays compile with debug information.
+//
+// RUN: %llvmgcc -O0 -c -g %s
+
+// PR1068
+
+struct Object {
+ char buffer[];
+};
+
+int main(int argc, char** argv) {
+ new Object;
+ return 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-01-06-ELF-Thunk-Sections.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-01-06-ELF-Thunk-Sections.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-01-06-ELF-Thunk-Sections.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-01-06-ELF-Thunk-Sections.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,49 @@
+// RUN: %llvmgxx %s -emit-llvm -S -o - | not grep gnu.linkonce.
+// PR1085
+
+class
+__attribute__((visibility("default"))) QGenericArgument
+{
+ public:inline QGenericArgument(const char *aName = 0, const void *aData = 0):_data(aData), _name(aName) {
+ }
+ private:const void *_data;
+ const char *_name;
+};
+struct __attribute__ ((
+ visibility("default"))) QMetaObject
+{
+ struct {
+ }
+ d;
+};
+class
+__attribute__((visibility("default"))) QObject
+{
+ virtual const QMetaObject *metaObject() const;
+};
+class
+__attribute__((visibility("default"))) QPaintDevice
+{
+ public:enum PaintDeviceMetric {
+ PdmWidth = 1, PdmHeight, PdmWidthMM, PdmHeightMM, PdmNumColors, PdmDepth, PdmDpiX, PdmDpiY, PdmPhysicalDpiX, PdmPhysicalDpiY
+ };
+ virtual ~ QPaintDevice();
+ union {
+ }
+ ct;
+};
+class
+__attribute__((visibility("default"))) QWidget:public QObject, public QPaintDevice
+{
+};
+class
+__attribute__((visibility("default"))) QDialog:public QWidget
+{
+};
+class TopicChooser:public QDialog {
+ virtual const QMetaObject *metaObject() const;
+};
+const QMetaObject *TopicChooser::
+metaObject() const
+{
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-01-06-PtrMethodInit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-01-06-PtrMethodInit.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-01-06-PtrMethodInit.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-01-06-PtrMethodInit.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,75 @@
+// RUN: %llvmgxx %s -emit-llvm -S -o -
+// PR1084
+
+extern "C"
+{
+ typedef unsigned char PRUint8;
+ typedef unsigned int PRUint32;
+}
+typedef PRUint32 nsresult;
+struct nsID
+{
+};
+typedef nsID nsIID;
+class nsISupports
+{
+};
+extern "C++"
+{
+ template < class T > struct nsCOMTypeInfo
+ {
+ static const nsIID & GetIID ()
+ {
+ }
+ };
+}
+
+class nsIDOMEvent:public nsISupports
+{
+};
+class nsIDOMEventListener:public nsISupports
+{
+public:static const nsIID & GetIID ()
+ {
+ }
+ virtual nsresult
+ __attribute__ ((regparm (0), cdecl)) HandleEvent (nsIDOMEvent * event) =
+ 0;
+};
+class nsIDOMMouseListener:public nsIDOMEventListener
+{
+public:static const nsIID & GetIID ()
+ {
+ static const nsIID iid = {
+ };
+ }
+ virtual nsresult
+ __attribute__ ((regparm (0),
+ cdecl)) MouseDown (nsIDOMEvent * aMouseEvent) = 0;
+};
+typedef
+typeof (&nsIDOMEventListener::HandleEvent)
+ GenericHandler;
+ struct EventDispatchData
+ {
+ PRUint32 message;
+ GenericHandler method;
+ PRUint8 bits;
+ };
+ struct EventTypeData
+ {
+ const EventDispatchData *events;
+ int numEvents;
+ const nsIID *iid;
+ };
+ static const EventDispatchData sMouseEvents[] = {
+ {
+ (300 + 2),
+ reinterpret_cast < GenericHandler > (&nsIDOMMouseListener::MouseDown),
+ 0x01}
+ };
+static const EventTypeData sEventTypes[] = {
+ {
+ sMouseEvents, (sizeof (sMouseEvents) / sizeof (sMouseEvents[0])),
+ &nsCOMTypeInfo < nsIDOMMouseListener >::GetIID ()}
+};
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-03-27-FunctionVarRename.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-03-27-FunctionVarRename.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-03-27-FunctionVarRename.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-03-27-FunctionVarRename.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,17 @@
+// RUN: %llvmgxx %s -emit-llvm -S -o - | not grep eprintf1
+// RUN: %llvmgxx %s -emit-llvm -S -o - | grep eprintf
+
+// Only one eprintf should exist in the output
+
+extern "C"
+void __eprintf();
+
+void foo() {
+
+ __eprintf();
+}
+
+void *bar() {
+ extern void *__eprintf;
+ return &__eprintf;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFields-1.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-04-05-PackedBitFields-1.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFields-1.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFields-1.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,23 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+#ifdef PACKED
+#define P __attribute__((packed))
+#else
+#define P
+#endif
+
+struct P M_Packed {
+ unsigned int l_Packed;
+ unsigned short k_Packed : 6,
+ i_Packed : 15,
+ j_Packed : 11;
+
+};
+
+struct M_Packed sM_Packed;
+
+int testM_Packed (void) {
+ struct M_Packed x;
+ return (x.i_Packed != 0);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap-2.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-04-05-PackedBitFieldsOverlap-2.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap-2.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap-2.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,24 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+#ifdef PACKED
+#define P __attribute__((packed))
+#else
+#define P
+#endif
+
+struct P M_Packed {
+ unsigned long sorted : 1;
+ unsigned long from_array : 1;
+ unsigned long mixed_encoding : 1;
+ unsigned long encoding : 8;
+ unsigned long count : 21;
+
+};
+
+struct M_Packed sM_Packed;
+
+int testM_Packed (void) {
+ struct M_Packed x;
+ return (x.count != 0);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-04-05-PackedBitFieldsOverlap.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,24 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+
+#ifdef PACKED
+#define P __attribute__((packed))
+#else
+#define P
+#endif
+
+struct P M_Packed {
+ unsigned int l_Packed;
+ unsigned short k_Packed : 6,
+ i_Packed : 15;
+ char c;
+
+};
+
+struct M_Packed sM_Packed;
+
+int testM_Packed (void) {
+ struct M_Packed x;
+ return (x.i_Packed != 0);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFieldsSmall.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-04-05-PackedBitFieldsSmall.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFieldsSmall.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFieldsSmall.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,27 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+
+#ifdef PACKED
+// This is an example where size of Packed struct is smaller then
+// the size of bit field type.
+#define P __attribute__((packed))
+#else
+#define P
+#endif
+
+struct P M_Packed {
+ unsigned long long X:50;
+ unsigned Y:2;
+};
+
+struct M_Packed sM_Packed;
+
+int testM_Packed (void) {
+ struct M_Packed x;
+ return (0 != x.Y);
+}
+
+int testM_Packed2 (void) {
+ struct M_Packed x;
+ return (0 != x.X);
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-StructPackedFieldUnpacked.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-04-05-StructPackedFieldUnpacked.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-StructPackedFieldUnpacked.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-StructPackedFieldUnpacked.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,25 @@
+// RUN: %llvmgxx -S %s -o - | llvm-as -f -o /dev/null
+
+#ifdef PACKED
+#define P __attribute__((packed))
+#else
+#define P
+#endif
+
+struct UnPacked {
+ int X;
+ int Y;
+};
+
+struct P M_Packed {
+ unsigned char A;
+ struct UnPacked B;
+};
+
+struct M_Packed sM_Packed;
+
+int testM_Packed (void) {
+ struct M_Packed x;
+ return (x.B.Y != 0);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-04-10-PackedUnion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-04-10-PackedUnion.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-04-10-PackedUnion.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-04-10-PackedUnion.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,41 @@
+// RUN: %llvmgxx -S %s -o /dev/null
+extern "C" {
+
+#pragma pack(push, 2)
+ typedef struct ABC* abc;
+
+ struct ABCS {
+ float red;
+ float green;
+ float blue;
+ float alpha;
+ };
+
+ typedef void (*XYZ)();
+#pragma pack(pop)
+}
+
+
+union ABCU {
+ ABCS color;
+ XYZ bg;
+};
+
+struct AData {
+ ABCU data;
+};
+
+class L {
+ public:
+ L() {}
+ L(const L& other);
+
+ private:
+ AData fdata;
+};
+
+
+L::L(const L& other)
+{
+ fdata = other.fdata;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-04-11-InlineStorageClassC++.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-04-11-InlineStorageClassC%2B%2B.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-04-11-InlineStorageClassC++.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-04-11-InlineStorageClassC++.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,44 @@
+// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xglobWeak | grep linkonce | count 1
+// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xextWeak | grep linkonce | count 1
+// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xWeaknoinline | grep weak | count 1
+// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xWeakextnoinline | grep weak | count 1
+// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xglobnoWeak | grep linkonce | count 1
+// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xstatnoWeak | grep internal | count 1
+// RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xextnoWeak | grep linkonce | count 1
+inline int xglobWeak(int) __attribute__((weak));
+inline int xglobWeak (int i) {
+ return i*2;
+}
+inline int xextWeak(int) __attribute__((weak));
+extern inline int xextWeak (int i) {
+ return i*4;
+}
+int xWeaknoinline(int) __attribute__((weak));
+int xWeaknoinline(int i) {
+ return i*8;
+}
+int xWeakextnoinline(int) __attribute__((weak));
+extern int xWeakextnoinline(int i) {
+ return i*16;
+}
+inline int xglobnoWeak (int i) {
+ return i*32;
+}
+static inline int xstatnoWeak (int i) {
+ return i*64;
+}
+extern inline int xextnoWeak (int i) {
+ return i*128;
+}
+int j(int y) {
+ return xglobnoWeak(y)+xstatnoWeak(y)+xextnoWeak(y)+
+ xglobWeak(y)+xextWeak(y)+
+ xWeakextnoinline(y)+xWeaknoinline(y);
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-04-14-FNoBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-04-14-FNoBuiltin.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-04-14-FNoBuiltin.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-04-14-FNoBuiltin.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc -S %s -O2 -fno-builtin -o - | grep call.*printf
+// Check that -fno-builtin is honored.
+
+extern "C" int printf(const char*, ...);
+void foo(const char *msg) {
+ printf("%s\n",msg);
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-04-31-TryCatch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-04-31-TryCatch.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-04-31-TryCatch.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-04-31-TryCatch.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgxx -S %s -o /dev/null
+
+#include <locale>
+
+namespace std
+{
+ codecvt<char, char, mbstate_t>::
+ codecvt(size_t __refs)
+ : __codecvt_abstract_base<char, char, mbstate_t>(__refs),
+ _M_c_locale_codecvt(_S_get_c_locale())
+ { }
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-05-03-VectorInit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-05-03-VectorInit.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-05-03-VectorInit.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-05-03-VectorInit.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,17 @@
+// RUN: %llvmgxx %s -S -emit-llvm -O0 -o -
+// PR1378
+
+typedef float v4sf __attribute__((vector_size(16)));
+
+typedef v4sf float4;
+
+static float4 splat4(float a)
+{
+ float4 tmp = {a,a,a,a};
+ return tmp;
+}
+
+float4 foo(float a)
+{
+ return splat4(a);
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-05-16-ReverseBitFieldCrash.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-05-16-ReverseBitFieldCrash.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-05-16-ReverseBitFieldCrash.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-05-16-ReverseBitFieldCrash.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,24 @@
+// RUN: %llvmgxx %s -emit-llvm -S -o -
+
+#pragma reverse_bitfields on
+typedef unsigned long UINT32;
+
+extern void abort(void);
+
+typedef struct TestStruct
+{
+ long first: 15,
+ second: 17;
+} TestStruct;
+
+int main (int argc, char * const argv[]) {
+
+ TestStruct testStruct = {1, 0};
+
+ UINT32 dw = *(UINT32 *)(&testStruct);
+
+ if(!(dw & 0xFFFF))
+ abort ();
+
+ return 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-05-23-TryFinally.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-05-23-TryFinally.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-05-23-TryFinally.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-05-23-TryFinally.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,16 @@
+// RUN: %llvmgxx %s -S -emit-llvm -O2 -o - | ignore grep _Unwind_Resume | \
+// RUN: wc -l | grep {\[23\]}
+
+struct One { };
+struct Two { };
+
+void handle_unexpected () {
+ try
+ {
+ throw;
+ }
+ catch (One &)
+ {
+ throw Two ();
+ }
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-07-04-NestedCatches.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-07-04-NestedCatches.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-07-04-NestedCatches.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-07-04-NestedCatches.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,32 @@
+// RUN: %llvmgxx %s -S -O2 -o - | \
+// RUN: ignore grep {eh\.selector.*One.*Two.*Three.*Four.*Five.*Six.*null} | \
+// RUN: wc -l | grep {\[01\]}
+
+extern void X(void);
+
+struct One {};
+struct Two {};
+struct Three {};
+struct Four {};
+struct Five {};
+struct Six {};
+
+static void A(void) throw ()
+{
+ X();
+}
+
+static void B(void) throw (Two)
+{
+ try { A(); } catch (One) {}
+}
+
+static void C(void) throw (Six, Five)
+{
+ try { B(); } catch (Three) {} catch (Four) {}
+}
+
+int main ()
+{
+ try { C(); } catch (...) {}
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-07-29-RestrictPtrArg.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-07-29-RestrictPtrArg.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-07-29-RestrictPtrArg.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-07-29-RestrictPtrArg.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep noalias
+
+void foo(int * __restrict myptr1, int * myptr2) {
+ myptr1[0] = 0;
+ myptr2[0] = 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-07-29-RestrictRefArg.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-07-29-RestrictRefArg.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-07-29-RestrictRefArg.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-07-29-RestrictRefArg.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep noalias
+
+void foo(int & __restrict myptr1, int & myptr2) {
+ myptr1 = 0;
+ myptr2 = 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-08-01-RestrictMethod.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-08-01-RestrictMethod.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-08-01-RestrictMethod.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-08-01-RestrictMethod.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+// RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep noalias
+
+
+class foo {
+ int member[4];
+
+ void bar(int * a);
+
+};
+
+void foo::bar(int * a) __restrict {
+ member[3] = *a;
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-09-10-RecursiveTypeResolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-09-10-RecursiveTypeResolution.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-09-10-RecursiveTypeResolution.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-09-10-RecursiveTypeResolution.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,88 @@
+// RUN: %llvmgxx -c -emit-llvm %s -o -
+// PR1634
+
+namespace Manta
+{
+ class CallbackHandle
+ {
+ protected:virtual ~ CallbackHandle (void)
+ {
+ }
+ };
+template < typename Data1 > class CallbackBase_1Data:public CallbackHandle
+ {
+ };
+}
+
+namespace __gnu_cxx
+{
+ template < typename _Iterator, typename _Container >
+ class __normal_iterator
+ {
+ _Iterator _M_current;
+ };
+}
+
+namespace std
+{
+ template < typename _Tp > struct allocator
+ {
+ typedef _Tp *pointer;
+ };
+ template < typename _InputIterator,
+ typename _Tp > inline void find (_InputIterator __last,
+ const _Tp & __val)
+ {
+ };
+}
+
+namespace Manta
+{
+ template < typename _Tp, typename _Alloc> struct _Vector_base
+ {
+ struct _Vector_impl
+ {
+ _Tp *_M_start;
+ };
+ public:
+ _Vector_impl _M_impl;
+ };
+ template < typename _Tp, typename _Alloc = std::allocator < _Tp > >
+ class vector:protected _Vector_base < _Tp,_Alloc >
+ {
+ public:
+ typedef __gnu_cxx::__normal_iterator < typename _Alloc::pointer,
+ vector < _Tp, _Alloc > > iterator;
+ iterator end ()
+ {
+ }
+ };
+ class MantaInterface
+ {
+ };
+ class RTRT
+ {
+ virtual CallbackHandle *registerTerminationCallback (CallbackBase_1Data <
+ MantaInterface * >*);
+ virtual void unregisterCallback (CallbackHandle *);
+ typedef vector < CallbackBase_1Data < int >*>PRCallbackMapType;
+ PRCallbackMapType parallelPreRenderCallbacks;
+ };
+}
+using namespace Manta;
+CallbackHandle *
+RTRT::registerTerminationCallback (CallbackBase_1Data < MantaInterface * >*cb)
+{
+ return cb;
+}
+
+void
+RTRT::unregisterCallback (CallbackHandle * callback)
+{
+ {
+ typedef CallbackBase_1Data < int > callback_t;
+ callback_t *cb = static_cast < callback_t * >(callback);
+ find (parallelPreRenderCallbacks.end (), cb);
+ }
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2007-10-01-StructResize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2007-10-01-StructResize.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2007-10-01-StructResize.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2007-10-01-StructResize.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgxx -c %s -o /dev/null
+
+#pragma pack(4)
+
+struct Bork {
+ unsigned int f1 : 3;
+ unsigned int f2 : 30;
+};
+
+int Foo(Bork *hdr) {
+ hdr->f1 = 7;
+ hdr->f2 = 927;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2008-01-11-BadWarning.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2008-01-11-BadWarning.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2008-01-11-BadWarning.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2008-01-11-BadWarning.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -xc++ %s -S -o /dev/null |& not grep warning
+// rdar://5683899
+void** f(void **Buckets, unsigned NumBuckets) {
+ return Buckets + NumBuckets;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2008-01-12-VecInit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2008-01-12-VecInit.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2008-01-12-VecInit.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2008-01-12-VecInit.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -xc++ %s -S -o -
+// rdar://5685492
+
+typedef int __attribute__((vector_size(16))) v;
+v vt = {1, 2, 3, 4};
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2008-02-13-sret.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2008-02-13-sret.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2008-02-13-sret.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2008-02-13-sret.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,41 @@
+// RUN: %llvmgxx -S -O1 -m32 -emit-llvm %s -o - | grep {store i32} | count 1
+
+// Test that all 8 bytes of ret in check242 are copied, and only 4 bytes of
+// ret in check93 are copied (the same LLVM struct is used for both).
+
+typedef __builtin_va_list va_list;
+typedef unsigned long size_t;
+void *memset(void *, int, size_t);
+
+struct S93 { __attribute__((aligned (8))) void * a; } ;
+ extern struct S93 s93;
+ struct S93 check93 () {
+ struct S93 ret;
+ memset (&ret, 0, sizeof (ret));
+ ret.a = s93.a;
+ return ret; }
+
+struct S242 { char * a;int b[1]; } ;
+ extern struct S242 s242;
+
+ struct S242 check242 () {
+ struct S242 ret;
+ memset (&ret, 0, sizeof (ret));
+ ret.a = s242.a;
+ ret.b[0] = s242.b[0];
+ return ret; }
+
+void check93va (int z, ...) {
+ struct S93 arg;
+ va_list ap;
+ __builtin_va_start(ap,z);
+ arg = __builtin_va_arg(ap,struct S93);
+ __builtin_va_end(ap); }
+
+void check242va (int z, ...) {
+struct S242 arg;
+va_list ap;
+__builtin_va_start(ap,z);
+ arg = __builtin_va_arg(ap,struct S242);
+ __builtin_va_end(ap); }
+
Added: llvm/branches/non-call-eh/test/FrontendC++/2008-05-07-CrazyOffsetOf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/2008-05-07-CrazyOffsetOf.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/2008-05-07-CrazyOffsetOf.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/2008-05-07-CrazyOffsetOf.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgxx -S %s -o -
+// rdar://5914926
+
+struct bork {
+ struct bork *next_local;
+ char * query;
+};
+int offset = (char *) &(((struct bork *) 0x10)->query) - (char *) 0x10;
Added: llvm/branches/non-call-eh/test/FrontendC++/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/dg.exp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/dg.exp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/dg.exp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,5 @@
+load_lib llvm.exp
+
+if [ llvm_gcc_supports c++ ] then {
+ RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
+}
Added: llvm/branches/non-call-eh/test/FrontendC++/ptr-to-method-devirt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC%2B%2B/ptr-to-method-devirt.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC++/ptr-to-method-devirt.cpp (added)
+++ llvm/branches/non-call-eh/test/FrontendC++/ptr-to-method-devirt.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// PR1602
+// RUN: %llvmgxx -c -emit-llvm %s -o - -O3 | llvm-dis | not grep ptrtoint
+// RUN: %llvmgxx -c -emit-llvm %s -o - -O3 | llvm-dis | grep getelementptr | count 1
+
+
+struct S { virtual void f(); };
+
+typedef void (S::*P)(void);
+
+const P p = &S::f;
+
+void g(S s) {
+ (s.*p)();
+ }
Added: llvm/branches/non-call-eh/test/FrontendC/2002-01-23-LoadQISIReloadFailure.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-01-23-LoadQISIReloadFailure.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-01-23-LoadQISIReloadFailure.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-01-23-LoadQISIReloadFailure.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* Regression test. Just compile .c -> .ll to test */
+int foo(void) {
+ unsigned char *pp;
+ unsigned w_cnt;
+
+ w_cnt += *pp;
+
+ return w_cnt;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-01-24-ComplexSpaceInType.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-01-24-ComplexSpaceInType.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-01-24-ComplexSpaceInType.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-01-24-ComplexSpaceInType.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+// This caused generation of the following type name:
+// %Array = uninitialized global [10 x %complex int]
+//
+// which caused problems because of the space int the complex int type
+//
+
+struct { int X, Y; } Array[10];
+
+void foo() {}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-01-24-HandleCallInsnSEGV.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-01-24-HandleCallInsnSEGV.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-01-24-HandleCallInsnSEGV.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-01-24-HandleCallInsnSEGV.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+void *dlclose(void*);
+
+void ap_os_dso_unload(void *handle)
+{
+ dlclose(handle);
+ return; /* This return triggers the bug: Weird */
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-02-13-ConditionalInCall.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-02-13-ConditionalInCall.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-02-13-ConditionalInCall.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-02-13-ConditionalInCall.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* Test problem where bad code was generated with a ?: statement was
+ in a function call argument */
+
+void foo(int, double, float);
+
+void bar(int x) {
+ foo(x, x ? 1.0 : 12.5, 1.0f);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-02-13-ReloadProblem.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-02-13-ReloadProblem.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-02-13-ReloadProblem.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-02-13-ReloadProblem.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,18 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* This triggered a problem in reload, fixed by disabling most of the
+ * steps of compilation in GCC. Before this change, the code went through
+ * the entire backend of GCC, even though it was unnecessary for LLVM output
+ * now it is skipped entirely, and since reload doesn't run, it can't cause
+ * a problem.
+ */
+
+extern int tolower(int);
+
+const char *rangematch(const char *pattern, int test, int c) {
+
+ if ((c <= test) | (tolower(c) <= tolower((unsigned char)test)))
+ return 0;
+
+ return pattern;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-02-13-TypeVarNameCollision.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-02-13-TypeVarNameCollision.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-02-13-TypeVarNameCollision.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-02-13-TypeVarNameCollision.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,16 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* This testcase causes a symbol table collision. Type names and variable
+ * names should be in distinct namespaces
+ */
+
+typedef struct foo {
+ int X, Y;
+} FOO;
+
+static FOO foo[100];
+
+int test() {
+ return foo[4].Y;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-02-13-UnnamedLocal.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-02-13-UnnamedLocal.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-02-13-UnnamedLocal.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-02-13-UnnamedLocal.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,21 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* Testcase for a problem where GCC allocated xqic to a register,
+ * and did not have a VAR_DECL that explained the stack slot to LLVM.
+ * Now the LLVM code synthesizes a stack slot if one is presented that
+ * has not been previously recognized. This is where alloca's named
+ * 'local' come from now.
+ */
+
+typedef struct {
+ short x;
+} foostruct;
+
+int foo(foostruct ic);
+
+void test() {
+ foostruct xqic;
+ foo(xqic);
+}
+
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-02-14-EntryNodePreds.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-02-14-EntryNodePreds.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-02-14-EntryNodePreds.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-02-14-EntryNodePreds.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,37 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* GCC Used to generate code that contained a branch to the entry node of
+ * the do_merge function. This is illegal LLVM code. To fix this, GCC now
+ * inserts an entry node regardless of whether or not it has to insert allocas.
+ */
+
+struct edge_rec
+{
+ struct VERTEX *v;
+ struct edge_rec *next;
+ int wasseen;
+ int more_data;
+};
+
+typedef struct edge_rec *QUAD_EDGE;
+
+typedef struct {
+ QUAD_EDGE left, right;
+} EDGE_PAIR;
+
+struct EDGE_STACK {
+ int ptr;
+ QUAD_EDGE *elts;
+ int stack_size;
+};
+
+int do_merge(QUAD_EDGE ldo, QUAD_EDGE rdo) {
+ int lvalid;
+ QUAD_EDGE basel,rcand;
+ while (1) {
+ if (!lvalid) {
+ return (int)basel->next;
+ }
+ }
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-02-16-RenamingTest.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-02-16-RenamingTest.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-02-16-RenamingTest.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-02-16-RenamingTest.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,18 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* test that locals are renamed with . notation */
+
+void abc(void *);
+
+void Test5(double X) {
+ abc(&X);
+ {
+ int X;
+ abc(&X);
+ {
+ float X;
+ abc(&X);
+ }
+ }
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-02-17-ArgumentAddress.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-02-17-ArgumentAddress.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-02-17-ArgumentAddress.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-02-17-ArgumentAddress.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,39 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+int test(int X) {
+ return X;
+}
+
+void abc(int *X);
+int def(int Y, int Z) {
+ abc(&Z);
+ return Y;
+}
+
+struct Test { short X, x; int Y, Z; };
+
+int Testing(struct Test *A) {
+ return A->X+A->Y;
+}
+
+int Test2(int X, struct Test A, int Y) {
+ return X+Y+A.X+A.Y;
+}
+int Test3(struct Test A, struct Test B) {
+ return A.X+A.Y+B.Y+B.Z;
+}
+
+struct Test Test4(struct Test A) {
+ return A;
+}
+
+int Test6() {
+ int B[200];
+ return B[4];
+}
+
+struct STest2 { int X; short Y[4]; double Z; };
+
+struct STest2 Test7(struct STest2 X) {
+ return X;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-02-18-64bitConstant.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-02-18-64bitConstant.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-02-18-64bitConstant.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-02-18-64bitConstant.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* GCC wasn't handling 64 bit constants right fixed */
+
+#include <stdio.h>
+
+int main() {
+ long long Var = 123455678902ll;
+ printf("%lld\n", Var);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-02-18-StaticData.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-02-18-StaticData.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-02-18-StaticData.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-02-18-StaticData.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+double FOO = 17;
+double BAR = 12.0;
+float XX = 12.0f;
+
+static char *procnames[] = {
+ "EXIT"
+};
+
+void *Data[] = { &FOO, &BAR, &XX };
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-03-11-LargeCharInString.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-03-11-LargeCharInString.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-03-11-LargeCharInString.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-03-11-LargeCharInString.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+#include <string.h>
+
+int test(char *X) {
+ /* LLVM-GCC used to emit:
+ %.LC0 = internal global [3 x sbyte] c"\1F\FFFFFF8B\00"
+ */
+ return strcmp(X, "\037\213");
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-03-12-ArrayInitialization.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-03-12-ArrayInitialization.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-03-12-ArrayInitialization.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-03-12-ArrayInitialization.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,19 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* GCC would generate bad code if not enough initializers are
+ specified for an array.
+ */
+
+int a[10] = { 0, 2};
+
+char str[10] = "x";
+
+void *Arr[5] = { 0, 0 };
+
+float F[12] = { 1.23f, 34.7f };
+
+struct Test { int X; double Y; };
+
+struct Test Array[10] = { { 2, 12.0 }, { 3, 24.0 } };
+
+int B[4][4] = { { 1, 2, 3, 4}, { 5, 6, 7 }, { 8, 9 } };
Added: llvm/branches/non-call-eh/test/FrontendC/2002-03-12-StructInitialize.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-03-12-StructInitialize.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-03-12-StructInitialize.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-03-12-StructInitialize.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+typedef struct Connection_Type {
+ long to;
+ char type[10];
+ long length;
+} Connection;
+
+Connection link[3]
+= { {1, "link1", 10},
+ {2, "link2", 20},
+ {3, "link3", 30} };
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-03-12-StructInitializer.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-03-12-StructInitializer.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-03-12-StructInitializer.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-03-12-StructInitializer.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,18 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* GCC was not emitting string constants of the correct length when
+ * embedded into a structure field like this. It thought the strlength
+ * was -1.
+ */
+
+typedef struct Connection_Type {
+ long to;
+ char type[10];
+ long length;
+} Connection;
+
+Connection link[3]
+= { {1, "link1", 10},
+ {2, "link2", 20},
+ {3, "link3", 30} };
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-03-14-BrokenPHINode.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-03-14-BrokenPHINode.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-03-14-BrokenPHINode.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-03-14-BrokenPHINode.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,19 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* GCC was generating PHI nodes with an arity < #pred of the basic block the
+ * PHI node lived in. This was breaking LLVM because the number of entries
+ * in a PHI node must equal the number of predecessors for a basic block.
+ */
+
+int trys(char *s, int x)
+{
+ int asa;
+ double Val;
+ int LLS;
+ if (x) {
+ asa = LLS + asa;
+ } else {
+ }
+ return asa+(int)Val;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-03-14-BrokenSSA.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-03-14-BrokenSSA.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-03-14-BrokenSSA.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-03-14-BrokenSSA.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,17 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* This code used to break GCC's SSA computation code. It would create
+ uses of B & C that are not dominated by their definitions. See:
+ http://gcc.gnu.org/ml/gcc/2002-03/msg00697.html
+ */
+int bar();
+int foo()
+{
+ int a,b,c;
+
+ a = b + c;
+ b = bar();
+ c = bar();
+ return a + b + c;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-03-14-QuotesInStrConst.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-03-14-QuotesInStrConst.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-03-14-QuotesInStrConst.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-03-14-QuotesInStrConst.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* GCC was not escaping quotes in string constants correctly, so this would
+ * get emitted:
+ * %.LC1 = internal global [32 x sbyte] c"*** Word "%s" on line %d is not\00"
+ */
+
+const char *Foo() {
+ return "*** Word \"%s\" on line %d is not";
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-04-07-SwitchStmt.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-04-07-SwitchStmt.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-04-07-SwitchStmt.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-04-07-SwitchStmt.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,22 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+int printf(const char *, ...);
+int foo();
+
+int main() {
+ while (foo()) {
+ switch (foo()) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ printf("3");
+ case 4: printf("4");
+ case 5:
+ case 6:
+ default:
+ break;
+ }
+ }
+ return 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-04-08-LocalArray.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-04-08-LocalArray.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-04-08-LocalArray.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-04-08-LocalArray.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* GCC is not outputting the static array to the LLVM backend, so bad things
+ * happen. Note that if this is defined static, everything seems fine.
+ */
+double test(unsigned X) {
+ double student_t[30]={0.0 , 12.706 , 4.303 , 3.182 , 2.776 , 2.571 ,
+ 2.447 , 2.365 , 2.306 , 2.262 , 2.228 ,
+ 2.201 , 2.179 , 2.160 , 2.145 , 2.131 ,
+ 2.120 , 2.110 , 2.101 , 2.093 , 2.086 ,
+ 2.080 , 2.074 , 2.069 , 2.064 , 2.060 ,
+ 2.056 , 2.052 , 2.048 , 2.045 };
+ return student_t[X];
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-04-09-StructRetVal.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-04-09-StructRetVal.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-04-09-StructRetVal.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-04-09-StructRetVal.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+struct S {
+ int i;
+ short s1, s2;
+};
+
+struct S func_returning_struct(void);
+
+void loop(void) {
+ func_returning_struct();
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-04-10-StructParameters.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-04-10-StructParameters.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-04-10-StructParameters.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-04-10-StructParameters.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,25 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+typedef struct {
+ char p;
+ short q;
+ char r;
+ int X;
+ short Y, Z;
+ int Q;
+} foo;
+
+int test(foo X, float);
+int testE(char,short,char,int,int,float);
+void test3(foo *X) {
+ X->q = 1;
+}
+
+void test2(foo Y) {
+ testE(Y.p, Y.q, Y.r, Y.X, Y.Y, 0.1f);
+ test(Y, 0.1f);
+ test2(Y);
+ test3(&Y);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-05-23-StaticValues.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-05-23-StaticValues.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-05-23-StaticValues.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-05-23-StaticValues.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,15 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* Make sure the frontend is correctly marking static stuff as internal! */
+
+int X;
+static int Y = 12;
+
+static void foo(int Z) {
+ Y = Z;
+}
+
+void *test() {
+ foo(12);
+ return &Y;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-05-23-TypeNameCollision.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-05-23-TypeNameCollision.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-05-23-TypeNameCollision.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-05-23-TypeNameCollision.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,19 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* Testcase for when struct tag conflicts with typedef name... grr */
+
+typedef struct foo {
+ struct foo *X;
+ int Y;
+} * foo;
+
+foo F1;
+struct foo *F2;
+
+enum bar { test1, test2 };
+
+typedef float bar;
+
+enum bar B1;
+bar B2;
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-05-24-Alloca.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-05-24-Alloca.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-05-24-Alloca.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-05-24-Alloca.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char **argv) {
+ char *C = (char*)alloca(argc);
+ strcpy(C, argv[0]);
+ puts(C);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-06-25-FWriteInterfaceFailure.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-06-25-FWriteInterfaceFailure.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-06-25-FWriteInterfaceFailure.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-06-25-FWriteInterfaceFailure.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+#include <stdio.h>
+
+void test() {
+ fprintf(stderr, "testing\n");
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscListTests.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscListTests.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscListTests.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscListTests.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,71 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+// Test list stuff
+
+void *malloc(unsigned);
+
+// Test opaque structure support. the list type is defined later
+struct list;
+
+struct list *PassThroughList(struct list *L) {
+ return L;
+}
+
+
+// Recursive data structure tests...
+
+typedef struct list {
+ int Data;
+ struct list *Next;
+} list;
+
+list *Data;
+
+void foo() {
+ static int Foo = 0; // Test static local variable
+ Foo += 1; // Increment static variable
+
+ Data = (list*)malloc(12); // This is not a proper list allocation
+}
+
+extern list ListNode1;
+list ListNode3 = { 4, 0 };
+list ListNode2 = { 3, &ListNode3 };
+list ListNode0 = { 1, &ListNode1 };
+list ListNode1 = { 2, &ListNode2 };
+
+
+list ListArray[10];
+
+// Iterative insert fn
+void InsertIntoListTail(list **L, int Data) {
+ while (*L)
+ L = &(*L)->Next;
+ *L = (list*)malloc(sizeof(list));
+ (*L)->Data = Data;
+ (*L)->Next = 0;
+}
+
+// Recursive list search fn
+list *FindData(list *L, int Data) {
+ if (L == 0) return 0;
+ if (L->Data == Data) return L;
+ return FindData(L->Next, Data);
+}
+
+void foundIt(void);
+
+// Driver fn...
+void DoListStuff() {
+ list *MyList = 0;
+ InsertIntoListTail(&MyList, 100);
+ InsertIntoListTail(&MyList, 12);
+ InsertIntoListTail(&MyList, 42);
+ InsertIntoListTail(&MyList, 1123);
+ InsertIntoListTail(&MyList, 1213);
+
+ if (FindData(MyList, 75)) foundIt();
+ if (FindData(MyList, 42)) foundIt();
+ if (FindData(MyList, 700)) foundIt();
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscTests.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscTests.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscTests.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscTests.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,57 @@
+// RUN: %llvmgcc -w -S %s -o - | llvm-as -f -o /dev/null
+
+/* These are random tests that I used when working on the GCC frontend
+ originally. */
+
+// test floating point comparison!
+int floatcomptest(double *X, double *Y, float *x, float *y) {
+ return *X < *Y || *x < *y;
+}
+
+extern void *malloc(unsigned);
+
+// Exposed a bug
+void *memset_impl(void *dstpp, int c, unsigned len) {
+ long long int dstp = (long long int) dstpp;
+
+ while (dstp % 4 != 0)
+ {
+ ((unsigned char *) dstp)[0] = c;
+ dstp += 1;
+ len -= 1;
+ }
+ return dstpp;
+}
+
+// TEST problem with signed/unsigned versions of the same constants being shared
+// incorrectly!
+//
+static char *temp;
+static int remaining;
+static char *localmalloc(int size) {
+ char *blah;
+
+ if (size>remaining)
+ {
+ temp = (char *) malloc(32768);
+ remaining = 32768;
+ return temp;
+ }
+ return 0;
+}
+
+typedef struct { double X; double Y; int Z; } PBVTest;
+
+PBVTest testRetStruct(float X, double Y, int Z) {
+ PBVTest T = { X, Y, Z };
+ return T;
+}
+PBVTest testRetStruct2(void); // external func no inlining
+
+
+double CallRetStruct(float X, double Y, int Z) {
+ PBVTest T = testRetStruct2();
+ return T.X+X+Y+Z;
+}
+
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscTests2.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscTests2.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscTests2.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscTests2.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+// Test ?: in function calls
+extern fp(int, char*);
+char *Ext;
+void
+__bb_exit_func (void)
+{
+ fp (12, Ext ? Ext : "<none>");
+}
+
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscTests3.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscTests3.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscTests3.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscTests3.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,187 @@
+// RUN: %llvmgcc -w -S %s -o - | llvm-as -f -o /dev/null
+
+
+
+void *malloc(unsigned);
+
+//#include <stdio.h>
+int puts(const char *s);
+
+struct FunStructTest {
+ int Test1;
+ char *Pointer;
+ int Array[12];
+};
+
+struct SubStruct {
+ short X, Y;
+};
+
+struct Quad {
+ int w;
+ struct SubStruct SS;
+ struct SubStruct *SSP;
+ char c;
+ int y;
+};
+
+struct Quad GlobalQuad = { 4, {1, 2}, 0, 3, 156 };
+
+typedef int (*FuncPtr)(int);
+
+unsigned PtrFunc(int (*Func)(int), int X) {
+ return Func(X);
+}
+
+char PtrFunc2(FuncPtr FuncTab[30], int Num) {
+ return FuncTab[Num]('b');
+}
+
+extern char SmallArgs2(char w, char x, long long Zrrk, char y, char z);
+extern int SomeFunc(void);
+char SmallArgs(char w, char x, char y, char z) {
+ SomeFunc();
+ return SmallArgs2(w-1, x+1, y, z, w);
+}
+
+static int F0(struct Quad Q, int i) { /* Pass Q by value */
+ struct Quad R;
+ if (i) R.SS = Q.SS;
+ Q.SSP = &R.SS;
+ Q.w = Q.y = Q.c = 1;
+ return Q.SS.Y + i + R.y - Q.c;
+}
+
+int F1(struct Quad *Q, int i) { /* Pass Q by address */
+ struct Quad R;
+#if 0
+ if (i) R.SS = Q->SS;
+#else
+ if (i) R = *Q;
+#endif
+ Q->w = Q->y = Q->c = 1;
+ return Q->SS.Y+i+R.y-Q->c;
+}
+
+
+int BadFunc(float Val) {
+ int Result;
+ if (Val > 12.345) Result = 4;
+ return Result; /* Test use of undefined value */
+}
+
+int RealFunc(void) {
+ return SomeUndefinedFunction(1, 4, 5);
+}
+
+extern int EF1(int *, char *, int *);
+
+int Func(int Param, long long Param2) {
+ int Result = Param;
+
+ {{{{
+ char c; int X;
+ EF1(&Result, &c, &X);
+ }}}
+
+ { // c & X are duplicate names!
+ char c; int X;
+ EF1(&Result, &c, &X);
+ }
+
+ }
+ return Result;
+}
+
+
+short FunFunc(long long x, char z) {
+ return x+z;
+}
+
+unsigned castTest(int X) { return X; }
+
+double TestAdd(double X, float Y) {
+ return X+Y+.5;
+}
+
+int func(int i, int j) {
+ while (i != 20)
+ i += 2;
+
+ j += func(2, i);
+ return (i * 3 + j*2)*j;
+}
+
+int SumArray(int Array[], int Num) {
+ int i, Result = 0;
+ for (i = 0; i < Num; ++i)
+ Result += Array[i];
+
+ return Result;
+}
+
+int ArrayParam(int Values[100]) {
+ return EF1((int*)Values[50], (char*)1, &Values[50]);
+}
+
+int ArrayToSum(void) {
+ int A[100], i;
+ for (i = 0; i < 100; ++i)
+ A[i] = i*4;
+
+ return A[A[0]]; //SumArray(A, 100);
+}
+
+
+int ExternFunc(long long, unsigned*, short, unsigned char);
+
+int main(int argc, char *argv[]) {
+ unsigned i;
+ puts("Hello world!\n");
+
+ ExternFunc(-1, 0, (short)argc, 2);
+ //func(argc, argc);
+
+ for (i = 0; i < 10; i++)
+ puts(argv[3]);
+ return 0;
+}
+
+double MathFunc(double X, double Y, double Z,
+ double AA, double BB, double CC, double DD,
+ double EE, double FF, double GG, double HH,
+ double aAA, double aBB, double aCC, double aDD,
+ double aEE, double aFF) {
+ return X + Y + Z + AA + BB + CC + DD + EE + FF + GG + HH
+ + aAA + aBB + aCC + aDD + aEE + aFF;
+}
+
+
+
+void strcpy(char *s1, char *s2) {
+ while (*s1++ = *s2++);
+}
+
+void strcat(char *s1, char *s2) {
+ while (*s1++);
+ s1--;
+ while (*s1++ = *s2++);
+}
+
+int strcmp(char *s1, char *s2) {
+ while (*s1++ == *s2++);
+ if (*s1 == 0) {
+ if (*s2 == 0) {
+ return 0;
+ } else {
+ return -1;
+ }
+ } else {
+ if (*s2 == 0) {
+ return 1;
+ } else {
+ return (*(--s1) - *(--s2));
+ }
+ }
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-07-16-HardStringInit.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-07-16-HardStringInit.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-07-16-HardStringInit.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-07-16-HardStringInit.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+ char auto_kibitz_list[100][20] = {
+ {"diepx"},
+ {"ferret"},
+ {"knightc"},
+ {"knightcap"}};
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-07-17-StringConstant.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-07-17-StringConstant.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-07-17-StringConstant.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-07-17-StringConstant.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,4 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+char * foo() { return "\\begin{"; }
Added: llvm/branches/non-call-eh/test/FrontendC/2002-07-29-Casts.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-07-29-Casts.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-07-29-Casts.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-07-29-Casts.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,86 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+int
+main(int argc, char** argv)
+{
+ char c1;
+ short s1, ssf1, ssd1;
+ unsigned char ubs0;
+ signed char bs0;
+ unsigned char ubc0, uc2;
+ unsigned short us2, usf1, usd1;
+ int ic3, is3, sif1, sid1;
+ unsigned int uic4, uis4, uif1, uid1;
+ long slf1, sld1;
+ unsigned long ulf1, uld1;
+ float f1;
+ double d1;
+
+ /* Test integer to integer conversions */
+
+ c1 = (char) (argc >= 2)? atoi(argv[1]) : 0xff64; /* 100 = 'd' */
+ s1 = (short) (argc >= 3)? atoi(argv[2]) : -769; /* 0xf7ff = -769 */
+
+ ubc0 = (unsigned char) c1; /* 100 = 'd' */
+ ubs0 = (unsigned char) s1; /* 0xff = 255 */
+ bs0 = (signed char) s1; /* 0xff = -1 */
+
+ uc2 = (unsigned char) c1; /* 100 = 'd' */
+ us2 = (unsigned short) s1; /* 0xf7ff = 64767 */
+
+ ic3 = (int) c1; /* 100 = 'd' */
+ is3 = (int) s1; /* 0xfffff7ff = -769 */
+
+ uic4 = (unsigned int) c1; /* 100 = 'd' */
+ uis4 = (unsigned int) s1; /* 0xfffff7ff = 4294966527 */
+
+ printf("ubc0 = '%c'\n", ubc0);
+ printf("ubs0 = %u\n", ubs0);
+ printf("bs0 = %d\n", bs0);
+ printf("c1 = '%c'\n", c1);
+ printf("s1 = %d\n", s1);
+ printf("uc2 = '%c'\n", uc2);
+ printf("us2 = %u\n", us2);
+ printf("ic3 = '%c'\n", ic3);
+ printf("is3 = %d\n", is3);
+ printf("uic4 = '%c'\n", uic4);
+ printf("uis4 = %u\n", uis4);
+
+ /* Test floating-point to integer conversions */
+ f1 = (float) (argc >= 4)? atof(argv[3]) : 1.0;
+ d1 = (argc >= 5)? atof(argv[4]) : 2.0;
+
+ usf1 = (unsigned short) f1;
+ usd1 = (unsigned short) d1;
+ uif1 = (unsigned int) f1;
+ uid1 = (unsigned int) d1;
+ ulf1 = (unsigned long) f1;
+ uld1 = (unsigned long) d1;
+
+ ssf1 = (short) f1;
+ ssd1 = (short) d1;
+ sif1 = (int) f1;
+ sid1 = (int) d1;
+ slf1 = (long) f1;
+ sld1 = (long) d1;
+
+ printf("usf1 = %u\n", usf1);
+ printf("usd1 = %u\n", usd1);
+ printf("uif1 = %u\n", uif1);
+ printf("uid1 = %u\n", uid1);
+ printf("ulf1 = %u\n", ulf1);
+ printf("uld1 = %u\n", uld1);
+
+ printf("ssf1 = %d\n", ssf1);
+ printf("ssd1 = %d\n", ssd1);
+ printf("sif1 = %d\n", sif1);
+ printf("sid1 = %d\n", sid1);
+ printf("slf1 = %d\n", slf1);
+ printf("sld1 = %d\n", sld1);
+
+ return 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-07-30-SubregSetAssertion.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-07-30-SubregSetAssertion.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-07-30-SubregSetAssertion.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-07-30-SubregSetAssertion.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+union X {
+ void *B;
+};
+
+union X foo() {
+ union X A;
+ A.B = (void*)123;
+ return A;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-07-30-UnionTest.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-07-30-UnionTest.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-07-30-UnionTest.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-07-30-UnionTest.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,22 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+union X;
+struct Empty {};
+union F {};
+union Q { union Q *X; };
+union X {
+ char C;
+ int A, Z;
+ long long B;
+ void *b1;
+ struct { int A; long long Z; } Q;
+};
+
+union X foo(union X A) {
+ A.C = 123;
+ A.A = 39249;
+ //A.B = (void*)123040123321;
+ A.B = 12301230123123LL;
+ A.Z = 1;
+ return A;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-07-30-VarArgsCallFailure.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-07-30-VarArgsCallFailure.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-07-30-VarArgsCallFailure.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-07-30-VarArgsCallFailure.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+int tcount;
+void test(char *, const char*, int);
+void foo() {
+ char Buf[10];
+ test(Buf, "n%%%d", tcount++);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-07-31-BadAssert.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-07-31-BadAssert.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-07-31-BadAssert.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-07-31-BadAssert.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,16 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+typedef struct
+{
+ unsigned char type; /* Indicates, NORMAL, SUBNORMAL, etc. */
+} InternalFPF;
+
+
+static void SetInternalFPFZero(InternalFPF *dest) {
+ dest->type=0;
+}
+
+void denormalize(InternalFPF *ptr) {
+ SetInternalFPFZero(ptr);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-07-31-SubregFailure.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-07-31-SubregFailure.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-07-31-SubregFailure.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-07-31-SubregFailure.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+typedef union {
+ long (*ap)[4];
+} ptrs;
+
+void DoAssignIteration() {
+ ptrs abase;
+ abase.ap+=27;
+ Assignment(*abase.ap);
+}
+
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-08-02-UnionTest.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-08-02-UnionTest.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-08-02-UnionTest.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-08-02-UnionTest.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,19 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* In this testcase, the return value of foo() is being promotedto a register
+ * which breaks stuff
+ */
+#include <stdio.h>
+
+union X { char X; void *B; int a, b, c, d;};
+
+union X foo() {
+ union X Global;
+ Global.B = (void*)123; /* Interesting part */
+ return Global;
+}
+
+int main() {
+ union X test = foo();
+ printf("0x%p", test.B);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-08-19-RecursiveLocals.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-08-19-RecursiveLocals.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-08-19-RecursiveLocals.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-08-19-RecursiveLocals.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,18 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* This testcase doesn't actually test a bug, it's just the result of me
+ * figuring out the syntax for forward declaring a static variable. */
+struct list {
+ int x;
+ struct list *Next;
+};
+
+static struct list B; /* Forward declare static */
+static struct list A = { 7, &B };
+static struct list B = { 8, &A };
+
+extern struct list D; /* forward declare normal var */
+
+struct list C = { 7, &D };
+struct list D = { 8, &C };
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-09-08-PointerShifts.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-09-08-PointerShifts.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-09-08-PointerShifts.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-09-08-PointerShifts.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+int foo(int *A, unsigned X) {
+ return A[X];
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-09-18-UnionProblem.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-09-18-UnionProblem.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-09-18-UnionProblem.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-09-18-UnionProblem.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,26 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+struct DWstruct {
+ char high, low;
+};
+
+typedef union {
+ struct DWstruct s;
+ short ll;
+} DWunion;
+
+short __udivmodhi4 (char n1, char bm) {
+ DWunion rr;
+
+ if (bm == 0)
+ {
+ rr.s.high = n1;
+ }
+ else
+ {
+ rr.s.high = bm;
+ }
+
+ return rr.ll;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-09-19-StarInLabel.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-09-19-StarInLabel.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-09-19-StarInLabel.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-09-19-StarInLabel.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+extern void start() __asm__("start");
+extern void _start() __asm__("_start");
+extern void __start() __asm__("__start");
+void start() {}
+void _start() {}
+void __start() {}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-10-12-TooManyArguments.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-10-12-TooManyArguments.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-10-12-TooManyArguments.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-10-12-TooManyArguments.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+void foo() {}
+
+void bar() {
+ foo(1, 2, 3); /* Too many arguments passed */
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2002-12-15-GlobalBoolTest.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-12-15-GlobalBoolTest.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-12-15-GlobalBoolTest.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-12-15-GlobalBoolTest.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,5 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+_Bool X = 0;
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-12-15-GlobalConstantTest.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-12-15-GlobalConstantTest.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-12-15-GlobalConstantTest.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-12-15-GlobalConstantTest.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+const char *W = "foo";
+const int X = 7;
+int Y = 8;
+const char * const Z = "bar";
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-12-15-GlobalRedefinition.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-12-15-GlobalRedefinition.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-12-15-GlobalRedefinition.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-12-15-GlobalRedefinition.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,5 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+extern char algbrfile[9];
+char algbrfile[9] = "abcdefgh";
+
Added: llvm/branches/non-call-eh/test/FrontendC/2002-12-15-StructParameters.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2002-12-15-StructParameters.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2002-12-15-StructParameters.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2002-12-15-StructParameters.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,18 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+typedef struct
+{
+ void *stack;
+ unsigned size;
+ unsigned avail;
+} compile_stack_type;
+
+void foo(void*);
+void bar(compile_stack_type T, unsigned);
+
+void test() {
+ compile_stack_type CST;
+ foo(&CST);
+
+ bar(CST, 12);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-01-30-UnionInit.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-01-30-UnionInit.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-01-30-UnionInit.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-01-30-UnionInit.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -S %s -o /dev/null
+
+union foo {
+ struct { char A, B; } X;
+ int C;
+};
+
+union foo V = { {1, 2} };
Added: llvm/branches/non-call-eh/test/FrontendC/2003-03-03-DeferredType.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-03-03-DeferredType.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-03-03-DeferredType.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-03-03-DeferredType.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+
+
+struct foo A;
+
+struct foo {
+ int x;
+double D;
+};
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-06-22-UnionCrash.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-06-22-UnionCrash.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-06-22-UnionCrash.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-06-22-UnionCrash.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+struct Blend_Map_Entry {
+ union {
+ float Colour[5];
+ double Point_Slope[2];
+ } Vals;
+};
+
+void test(struct Blend_Map_Entry* Foo)
+{
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-06-23-GCC-fold-infinite-recursion.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-06-23-GCC-fold-infinite-recursion.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-06-23-GCC-fold-infinite-recursion.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-06-23-GCC-fold-infinite-recursion.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+double Test(double A, double B, double C, double D) {
+ return -(A-B) - (C-D);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-06-26-CFECrash.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-06-26-CFECrash.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-06-26-CFECrash.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-06-26-CFECrash.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,19 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+typedef struct min_info {
+ long offset;
+ unsigned file_attr;
+} min_info;
+
+typedef struct Globals {
+ char answerbuf;
+ min_info info[1];
+ min_info *pInfo;
+} Uz_Globs;
+
+extern Uz_Globs G;
+
+int extract_or_test_files() {
+ G.pInfo = G.info;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-06-29-MultipleFunctionDefinition.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-06-29-MultipleFunctionDefinition.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-06-29-MultipleFunctionDefinition.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-06-29-MultipleFunctionDefinition.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+/* This is apparently legal C.
+ */
+extern __inline__ void test() { }
+
+void test() {
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-07-22-ArrayAccessTypeSafety.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-07-22-ArrayAccessTypeSafety.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-07-22-ArrayAccessTypeSafety.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-07-22-ArrayAccessTypeSafety.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+/* RUN: %llvmgcc -xc %s -S -o - | grep -v alloca | not grep bitcast
+ */
+
+void test(int* array, long long N) {
+ array[N] = N[array] = 33;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-06-BuiltinSetjmpLongjmp.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-06-BuiltinSetjmpLongjmp.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-06-BuiltinSetjmpLongjmp.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-06-BuiltinSetjmpLongjmp.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+/* RUN: %llvmgcc -xc %s -c -o - | llvm-dis | not grep __builtin_
+ *
+ * __builtin_longjmp/setjmp should get transformed into llvm.setjmp/longjmp
+ * just like explicit setjmp/longjmp calls are.
+ */
+
+void jumpaway(int *ptr) {
+ __builtin_longjmp(ptr,1);
+}
+
+int main(void) {
+ __builtin_setjmp(0);
+ jumpaway(0);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-17-DeadCodeShortCircuit.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-17-DeadCodeShortCircuit.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-17-DeadCodeShortCircuit.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-17-DeadCodeShortCircuit.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc -xc %s -c -o %t.o
+
+int test(_Bool pos, _Bool color) {
+ return 0;
+ return (pos && color);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-18-SigSetJmp.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-18-SigSetJmp.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-18-SigSetJmp.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-18-SigSetJmp.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+#include <setjmp.h>
+
+sigjmp_buf B;
+int foo() {
+ sigsetjmp(B, 1);
+ bar();
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-18-StructAsValue.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-18-StructAsValue.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-18-StructAsValue.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-18-StructAsValue.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+typedef struct {
+ int op;
+} event_t;
+
+event_t test(int X) {
+ event_t foo = { 1 }, bar = { 2 };
+ return X ? foo : bar;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-20-BadBitfieldRef.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-20-BadBitfieldRef.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-20-BadBitfieldRef.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-20-BadBitfieldRef.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+void foo()
+{
+ char *ap;
+ ap[1] == '-' && ap[2] == 0;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-20-PrototypeMismatch.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-20-PrototypeMismatch.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-20-PrototypeMismatch.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-20-PrototypeMismatch.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,15 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+
+static int foo(int);
+
+static int foo(C)
+char C;
+{
+ return C;
+}
+
+void test() {
+ foo(7);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-20-vfork-bug.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-20-vfork-bug.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-20-vfork-bug.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-20-vfork-bug.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+extern int vfork(void);
+test() {
+ vfork();
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-21-BinOp-Type-Mismatch.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-21-BinOp-Type-Mismatch.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-21-BinOp-Type-Mismatch.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-21-BinOp-Type-Mismatch.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+struct bar;
+
+void foo()
+{
+ unsigned int frame, focus;
+ (struct bar *) focus == (focus ? ((struct bar *) frame) : 0);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-21-StmtExpr.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-21-StmtExpr.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-21-StmtExpr.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-21-StmtExpr.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+typedef struct {
+ unsigned long val;
+} structty;
+
+void bar(structty new_mask);
+static void foo() {
+ bar(({ structty mask; mask; }));
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-21-WideString.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-21-WideString.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-21-WideString.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-21-WideString.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+#include <wchar.h>
+
+struct {
+ wchar_t *name;
+} syms = { L"NUL" };
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-23-LocalUnionTest.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-23-LocalUnionTest.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-23-LocalUnionTest.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-23-LocalUnionTest.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+
+union foo { int X; };
+
+int test(union foo* F) {
+ {
+ union foo { float X; } A;
+ }
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-29-BitFieldStruct.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-29-BitFieldStruct.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-29-BitFieldStruct.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-29-BitFieldStruct.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+struct Word {
+ short bar;
+ short baz;
+ int final:1;
+ short quux;
+} *word_limit;
+
+void foo ()
+{
+ word_limit->final = (word_limit->final && word_limit->final);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-29-HugeCharConst.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-29-HugeCharConst.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-29-HugeCharConst.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-29-HugeCharConst.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,5 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+void foo() {
+ unsigned char int_latin1[] = "f\200\372b\200\343\200\340";
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-29-StructLayoutBug.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-29-StructLayoutBug.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-29-StructLayoutBug.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-29-StructLayoutBug.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+struct foo {
+ unsigned int I:1;
+ unsigned char J[1];
+ unsigned int K:1;
+ };
+
+void test(struct foo *X) {}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-30-AggregateInitializer.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-30-AggregateInitializer.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-30-AggregateInitializer.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-30-AggregateInitializer.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,16 @@
+// RUN: %llvmgcc -S %s -o /dev/null
+
+struct istruct {
+ unsigned char C;
+};
+
+struct foo {
+ unsigned int I:1;
+ struct istruct J;
+ unsigned char L[1];
+ unsigned int K:1;
+};
+
+struct foo F = { 1, { 7 }, { 123 } , 1 };
+
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-08-30-LargeIntegerBitfieldMember.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-08-30-LargeIntegerBitfieldMember.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-08-30-LargeIntegerBitfieldMember.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-08-30-LargeIntegerBitfieldMember.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+struct foo {
+ unsigned int I:1;
+ unsigned char J[1][123];
+ unsigned int K:1;
+ };
+
+struct foo F;
Added: llvm/branches/non-call-eh/test/FrontendC/2003-09-18-BitfieldTests.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-09-18-BitfieldTests.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-09-18-BitfieldTests.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-09-18-BitfieldTests.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,30 @@
+// RUN: %llvmgcc -w -S %s -o - | llvm-as -f -o /dev/null
+
+
+typedef struct BF {
+ int A : 1;
+ char B;
+ int C : 13;
+} BF;
+
+char *test1(BF *b) {
+ return &b->B; // Must be able to address non-bitfield
+}
+
+void test2(BF *b) { // Increment and decrement operators
+ b->A++;
+ --b->C;
+}
+
+void test3(BF *b) {
+ b->C = 12345; // Store
+}
+
+int test4(BF *b) {
+ return b->C; // Load
+}
+
+void test5(BF *b, int i) { // array ref
+ b[i].C = 12345;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-09-30-StructLayout.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-09-30-StructLayout.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-09-30-StructLayout.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-09-30-StructLayout.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,18 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+enum En {
+ ENUM_VAL
+};
+
+struct St {
+ unsigned char A;
+ enum En B;
+ unsigned char C;
+ enum En D;
+ float E;
+};
+
+
+void func(struct St* A) {
+ A->D = ENUM_VAL;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-10-02-UnionLValueError.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-10-02-UnionLValueError.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-10-02-UnionLValueError.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-10-02-UnionLValueError.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+#include <stdio.h>
+
+union U{
+ int i[8];
+ char s[80];
+};
+
+void format_message(char *buffer, union U *u) {
+ sprintf(buffer, u->s);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-10-06-NegateExprType.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-10-06-NegateExprType.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-10-06-NegateExprType.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-10-06-NegateExprType.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+extern int A[10];
+void Func(int *B) {
+ B - &A[5];
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-10-09-UnionInitializerBug.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-10-09-UnionInitializerBug.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-10-09-UnionInitializerBug.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-10-09-UnionInitializerBug.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,17 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+struct Foo {
+ unsigned a;
+ unsigned b;
+ unsigned c;
+};
+
+struct Bar {
+ union {
+ void **a;
+ struct Foo b;
+ }u;
+};
+
+struct Bar test = {0};
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-10-28-ident.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-10-28-ident.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-10-28-ident.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-10-28-ident.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,4 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+#ident "foo"
Added: llvm/branches/non-call-eh/test/FrontendC/2003-10-29-AsmRename.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-10-29-AsmRename.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-10-29-AsmRename.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-10-29-AsmRename.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,22 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+struct foo { int X; };
+struct bar { int Y; };
+
+extern int Func(struct foo*) __asm__("Func64");
+extern int Func64(struct bar*);
+
+int Func(struct foo *F) {
+ return 1;
+}
+
+int Func64(struct bar* B) {
+ return 0;
+}
+
+
+int test() {
+ Func(0); /* should be renamed to call Func64 */
+ Func64(0);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-01-C99-CompoundLiteral.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-01-C99-CompoundLiteral.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-01-C99-CompoundLiteral.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-01-C99-CompoundLiteral.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+typedef struct { int foo; } spinlock_t;
+typedef struct wait_queue_head_t { spinlock_t lock; } wait_queue_head_t;
+void call_usermodehelper(void) {
+ struct wait_queue_head_t work = { lock: (spinlock_t) { 0 }, };
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-01-EmptyStructCrash.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-01-EmptyStructCrash.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-01-EmptyStructCrash.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-01-EmptyStructCrash.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+typedef struct { } the_coolest_struct_in_the_world;
+extern the_coolest_struct_in_the_world xyzzy;
+void *foo() { return &xyzzy; }
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-01-GlobalUnionInit.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-01-GlobalUnionInit.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-01-GlobalUnionInit.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-01-GlobalUnionInit.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+union bdflush_param {
+ struct { int x; } b_un;
+ int y[1];
+} bdf_prm = {{30}};
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-03-AddrArrayElement.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-03-AddrArrayElement.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-03-AddrArrayElement.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-03-AddrArrayElement.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep getelementptr
+
+// This should be turned into a tasty getelementptr instruction, not a nasty
+// series of casts and address arithmetic.
+
+char Global[100];
+
+char *test1(unsigned i) {
+ return &Global[i];
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-04-EmptyStruct.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-04-EmptyStruct.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-04-EmptyStruct.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-04-EmptyStruct.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+typedef struct { } rwlock_t;
+struct fs_struct { rwlock_t lock; int umask; };
+void __copy_fs_struct(struct fs_struct *fs) { fs->lock = (rwlock_t) { }; }
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-04-OutOfMemory.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-04-OutOfMemory.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-04-OutOfMemory.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-04-OutOfMemory.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+void schedule_timeout(signed long timeout)
+{
+ switch (timeout)
+ {
+ case ((long)(~0UL>>1)): break;
+ }
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-08-PointerSubNotGetelementptr.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-08-PointerSubNotGetelementptr.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-08-PointerSubNotGetelementptr.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-08-PointerSubNotGetelementptr.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep getelementptr
+
+char *test(char* C) {
+ return C-1; // Should turn into a GEP
+}
+
+int *test2(int* I) {
+ return I-1;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-12-VoidString.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-12-VoidString.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-12-VoidString.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-12-VoidString.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,4 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+void query_newnamebuf(void) { ((void)"query_newnamebuf"); }
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-13-TypeSafety.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-13-TypeSafety.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-13-TypeSafety.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-13-TypeSafety.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,5 @@
+// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep getelementptr
+
+int *test(int *X, int Y) {
+ return X + Y;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-16-StaticArrayInit.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-16-StaticArrayInit.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-16-StaticArrayInit.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-16-StaticArrayInit.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+void bar () {
+ static char x[10];
+ static char *xend = x + 10;
+}
+
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-18-CondExprLValue.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-18-CondExprLValue.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-18-CondExprLValue.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-18-CondExprLValue.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+typedef struct { unsigned long pgprot; } pgprot_t;
+
+void split_large_page(unsigned long addr, pgprot_t prot)
+{
+ (addr ? prot : ((pgprot_t) { 0x001 } )).pgprot;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-19-AddressOfRegister.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-19-AddressOfRegister.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-19-AddressOfRegister.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-19-AddressOfRegister.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc -xc %s -S -o /dev/null |& not grep warning
+
+struct item {
+ short delta[4];
+};
+
+int TEST(int nt) {
+ register struct item *aa;
+ aa[nt].delta;
+ return 1;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-19-BitFieldArray.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-19-BitFieldArray.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-19-BitFieldArray.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-19-BitFieldArray.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+struct _GIOChannel {
+ int write_buf;
+ char partial_write_buf[6];
+ int d :1;
+};
+
+void g_io_channel_init (struct _GIOChannel *channel) {
+ channel->partial_write_buf[0];
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-20-Bitfields.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-20-Bitfields.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-20-Bitfields.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-20-Bitfields.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+struct face_cachel {
+ unsigned int reverse :1;
+ unsigned char font_specified[1];
+};
+
+void
+ensure_face_cachel_contains_charset (struct face_cachel *cachel) {
+ cachel->font_specified[0] = 0;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-20-ComplexDivision.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-20-ComplexDivision.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-20-ComplexDivision.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-20-ComplexDivision.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+int test() {
+ __complex__ double C;
+ double D;
+ C / D;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-20-UnionBitfield.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-20-UnionBitfield.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-20-UnionBitfield.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-20-UnionBitfield.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+struct printf_spec {
+ unsigned int minus_flag:1;
+ char converter;
+};
+
+void parse_doprnt_spec () {
+ struct printf_spec spec;
+ spec.minus_flag = 1;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-26-PointerShift.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-26-PointerShift.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-26-PointerShift.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-26-PointerShift.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+unsigned long do_csum(const unsigned char *buff, int len, unsigned long result) {
+ if (2 & (unsigned long) buff) result += 1;
+ return result;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-27-ConstructorCast.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-27-ConstructorCast.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-27-ConstructorCast.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-27-ConstructorCast.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+struct i387_soft_struct {
+ long cwd;
+};
+union i387_union {
+ struct i387_soft_struct soft;
+};
+struct thread_struct {
+ union i387_union i387;
+};
+void _init_task_union(void) {
+ struct thread_struct thread = (struct thread_struct) { {{0}} };
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-11-27-UnionCtorInitialization.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-11-27-UnionCtorInitialization.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-11-27-UnionCtorInitialization.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-11-27-UnionCtorInitialization.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,16 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+struct i387_soft_struct {
+ long cwd;
+ long twd;
+ long fip;
+};
+union i387_union {
+ struct i387_soft_struct soft;
+};
+struct thread_struct {
+ union i387_union i387;
+};
+void _init_task_union(void) {
+ struct thread_struct thread = (struct thread_struct) { {{0}} };
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2003-12-14-ExternInlineSupport.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2003-12-14-ExternInlineSupport.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2003-12-14-ExternInlineSupport.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2003-12-14-ExternInlineSupport.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,3 @@
+// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | not grep dead_function
+
+extern __inline__ void dead_function() {}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-01-01-UnknownInitSize.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-01-01-UnknownInitSize.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-01-01-UnknownInitSize.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-01-01-UnknownInitSize.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgcc -S %s -o /dev/null
+
+/*
+ * This regression test ensures that the C front end can compile initializers
+ * even when it cannot determine the size (as below).
+*/
+struct one
+{
+ int a;
+ int values [];
+};
+
+struct one hobbit = {5, {1, 2, 3}};
+
Added: llvm/branches/non-call-eh/test/FrontendC/2004-01-08-ExternInlineRedefine.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-01-08-ExternInlineRedefine.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-01-08-ExternInlineRedefine.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-01-08-ExternInlineRedefine.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+extern __inline long int
+__strtol_l (int a)
+{
+ return 0;
+}
+
+long int
+__strtol_l (int a)
+{
+ return 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-02-12-LargeAggregateCopy.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-02-12-LargeAggregateCopy.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-02-12-LargeAggregateCopy.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-02-12-LargeAggregateCopy.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep llvm.memcpy
+
+struct X { int V[10000]; };
+struct X Global1, Global2;
+void test() {
+ Global2 = Global1;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2004-02-13-BuiltinFrameReturnAddress.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-02-13-BuiltinFrameReturnAddress.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-02-13-BuiltinFrameReturnAddress.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-02-13-BuiltinFrameReturnAddress.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep llvm.*address | count 4
+
+void *test1() {
+ return __builtin_return_address(1);
+}
+void *test2() {
+ return __builtin_frame_address(0);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-02-13-IllegalVararg.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-02-13-IllegalVararg.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-02-13-IllegalVararg.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-02-13-IllegalVararg.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+// RUN: %llvmgcc -xc %s -w -c -o - | llc
+// XFAIL: *
+// See PR2452
+
+#include <stdarg.h>
+
+float test(int X, ...) {
+ va_list ap;
+ float F;
+ va_start(ap, X);
+ F = va_arg(ap, float);
+ return F;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-02-13-Memset.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-02-13-Memset.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-02-13-Memset.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-02-13-Memset.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep llvm.memset | count 3
+
+#include <memory.h>
+
+void test(int* X, char *Y) {
+ memset(X, 4, 1000);
+ bzero(Y, 100);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-02-14-ZeroInitializer.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-02-14-ZeroInitializer.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-02-14-ZeroInitializer.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-02-14-ZeroInitializer.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,4 @@
+// RUN: %llvmgcc -xc %s -S -o - | grep zeroinitializer
+
+int X[1000];
+
Added: llvm/branches/non-call-eh/test/FrontendC/2004-02-20-Builtins.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-02-20-Builtins.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-02-20-Builtins.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-02-20-Builtins.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -O3 -xc %s -c -o - | llvm-dis | not grep builtin
+
+#include <math.h>
+
+void zsqrtxxx(float num) {
+ num = sqrt(num);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2004-03-07-ComplexDivEquals.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-03-07-ComplexDivEquals.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-03-07-ComplexDivEquals.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-03-07-ComplexDivEquals.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+void test(__complex__ double D, double X) {
+ D /= X;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-03-07-ExternalConstant.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-03-07-ExternalConstant.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-03-07-ExternalConstant.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-03-07-ExternalConstant.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep constant
+
+extern const int a[]; // 'a' should be marked constant even though it's external!
+int foo () {
+ return a[0];
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2004-03-09-LargeArrayInitializers.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-03-09-LargeArrayInitializers.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-03-09-LargeArrayInitializers.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-03-09-LargeArrayInitializers.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,32 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+// Test that these initializers are handled efficiently
+
+int test(int x) {
+ const int XX[1000] = { 0, 0 };
+ const char S [1000] = "foo";
+
+ const int array[] = {
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49,
+ };
+ return array[x];
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-03-15-SimpleIndirectGoto.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-03-15-SimpleIndirectGoto.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-03-15-SimpleIndirectGoto.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-03-15-SimpleIndirectGoto.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,23 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+int code[]={0,0,0,0,1};
+void foo(int x) {
+ volatile int b;
+ b = 0xffffffff;
+}
+void bar(int *pc) {
+ static const void *l[] = {&&lab0, &&end};
+
+ foo(0);
+ goto *l[*pc];
+ lab0:
+ foo(0);
+ pc++;
+ goto *l[*pc];
+ end:
+ return;
+}
+int main() {
+ bar(code);
+ return 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-03-16-AsmRegisterCrash.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-03-16-AsmRegisterCrash.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-03-16-AsmRegisterCrash.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-03-16-AsmRegisterCrash.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+int foo() {
+ register int X __asm__("ebx");
+ return X;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-05-07-VarArrays.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-05-07-VarArrays.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-05-07-VarArrays.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-05-07-VarArrays.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,5 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+int foo(int len, char arr[][len], int X) {
+ return arr[X][0];
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-05-21-IncompleteEnum.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-05-21-IncompleteEnum.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-05-21-IncompleteEnum.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-05-21-IncompleteEnum.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,5 @@
+// RUN: %llvmgcc -w -S %s -o - | llvm-as -f -o /dev/null
+
+void test(enum foo *X) {
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2004-06-08-OpaqueStructArg.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-06-08-OpaqueStructArg.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-06-08-OpaqueStructArg.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-06-08-OpaqueStructArg.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+ struct fu;
+ void foo(struct fu);
+ void bar() {
+ foo;
+ }
Added: llvm/branches/non-call-eh/test/FrontendC/2004-06-17-UnorderedBuiltins.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-06-17-UnorderedBuiltins.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-06-17-UnorderedBuiltins.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-06-17-UnorderedBuiltins.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,24 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+_Bool A, B, C, D, E, F, G, H;
+void TestF(float X, float Y) {
+ A = __builtin_isgreater(X, Y);
+ B = __builtin_isgreaterequal(X, Y);
+ C = __builtin_isless(X, Y);
+ D = __builtin_islessequal(X, Y);
+ E = __builtin_islessgreater(X, Y);
+ F = __builtin_isunordered(X, Y);
+ //G = __builtin_isordered(X, Y); // Our current snapshot of GCC doesn't include this builtin
+ H = __builtin_isunordered(X, Y);
+}
+void TestD(double X, double Y) {
+ A = __builtin_isgreater(X, Y);
+ B = __builtin_isgreaterequal(X, Y);
+ C = __builtin_isless(X, Y);
+ D = __builtin_islessequal(X, Y);
+ E = __builtin_islessgreater(X, Y);
+ F = __builtin_isunordered(X, Y);
+ //G = __builtin_isordered(X, Y); // Our current snapshot doesn't include this builtin. FIXME
+ H = __builtin_isunordered(X, Y);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-06-17-UnorderedCompares.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-06-17-UnorderedCompares.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-06-17-UnorderedCompares.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-06-17-UnorderedCompares.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,21 @@
+// RUN: %llvmgcc -xc -std=c99 %s -c -o - | llvm-dis | grep -v llvm.isunordered | not grep call
+
+#include <math.h>
+
+_Bool A, B, C, D, E, F;
+void TestF(float X, float Y) {
+ A = __builtin_isgreater(X, Y);
+ B = __builtin_isgreaterequal(X, Y);
+ C = __builtin_isless(X, Y);
+ D = __builtin_islessequal(X, Y);
+ E = __builtin_islessgreater(X, Y);
+ F = __builtin_isunordered(X, Y);
+}
+void TestD(double X, double Y) {
+ A = __builtin_isgreater(X, Y);
+ B = __builtin_isgreaterequal(X, Y);
+ C = __builtin_isless(X, Y);
+ D = __builtin_islessequal(X, Y);
+ E = __builtin_islessgreater(X, Y);
+ F = __builtin_isunordered(X, Y);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-06-18-VariableLengthArrayOfStructures.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-06-18-VariableLengthArrayOfStructures.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-06-18-VariableLengthArrayOfStructures.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-06-18-VariableLengthArrayOfStructures.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+struct S { };
+
+int xxxx(int a) {
+ struct S comps[a];
+ comps[0];
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2004-07-06-FunctionCast.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-07-06-FunctionCast.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-07-06-FunctionCast.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-07-06-FunctionCast.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+static int unused_func(void) {
+ return 1;
+}
+
+int foo(void) {
+ (void)unused_func; /* avoid compiler warning */
+ return 2;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-08-06-LargeStructTest.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-08-06-LargeStructTest.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-08-06-LargeStructTest.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-08-06-LargeStructTest.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,19 @@
+// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+
+
+#define A(X) int X;
+#define B(X) A(X##0) A(X##1) A(X##2) A(X##3) A(X##4) A(X##5) A(X##6) A(X##7) \
+ A(X##8) A(X##9) A(X##A) A(X##B) A(X##C) A(X##D) A(X##E) A(X##F)
+#define C(X) B(X##0) B(X##1) B(X##2) B(X##3) B(X##4) B(X##5) B(X##6) B(X##7) \
+ B(X##8) B(X##9) B(X##A) B(X##B) B(X##C) B(X##D) B(X##E) B(X##F)
+
+struct foo {
+ C(x); // 256
+ C(y); // 256
+ C(z);
+};
+
+
+int test(struct foo *F) {
+ return F->xA1 + F->yFF + F->zC4;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-11-25-UnnamedBitfieldPadding.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-11-25-UnnamedBitfieldPadding.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-11-25-UnnamedBitfieldPadding.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-11-25-UnnamedBitfieldPadding.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -S %s -o /dev/null
+// This is a testcase for PR461
+typedef struct {
+ unsigned min_align: 1;
+ unsigned : 1;
+} addr_diff_vec_flags;
+
+addr_diff_vec_flags X;
Added: llvm/branches/non-call-eh/test/FrontendC/2004-11-27-InvalidConstantExpr.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-11-27-InvalidConstantExpr.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-11-27-InvalidConstantExpr.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-11-27-InvalidConstantExpr.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc %s -S -o - | not grep {foo\\* sub}
+// This should not produce a subtrace constantexpr of a pointer
+struct foo {
+ int Y;
+ char X[100];
+} F;
+
+int test(char *Y) {
+ return Y - F.X;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-11-27-StaticFunctionRedeclare.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-11-27-StaticFunctionRedeclare.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-11-27-StaticFunctionRedeclare.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-11-27-StaticFunctionRedeclare.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,15 @@
+// RUN: %llvmgcc -c -emit-llvm %s -o - | \
+// RUN: opt -std-compile-opts | llvm-dis | not grep {declare i32.*func}
+
+// There should not be an unresolved reference to func here. Believe it or not,
+// the "expected result" is a function named 'func' which is internal and
+// referenced by bar().
+
+// This is PR244
+
+static int func();
+void bar() {
+ int func();
+ foo(func);
+}
+static int func(char** A, char ** B) {}
Added: llvm/branches/non-call-eh/test/FrontendC/2004-11-27-VariableSizeInStructure.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2004-11-27-VariableSizeInStructure.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2004-11-27-VariableSizeInStructure.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2004-11-27-VariableSizeInStructure.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgcc %s -S -o /dev/null
+
+// GCC allows variable sized arrays in structures, crazy!
+
+// This is PR360.
+
+int sub1(int i, char *pi) {
+ typedef int foo[i];
+ struct bar {foo f1; int f2;} *p = (struct bar *) pi;
+ return p->f2;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2005-01-02-ConstantInits.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-01-02-ConstantInits.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-01-02-ConstantInits.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-01-02-ConstantInits.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,24 @@
+// RUN: %llvmgcc %s -S -o -
+
+// This tests all kinds of hard cases with initializers and
+// array subscripts. This corresponds to PR487.
+
+struct X { int a[2]; };
+
+int test() {
+ static int i23 = (int) &(((struct X *)0)->a[1]);
+ return i23;
+}
+
+int i = (int) &( ((struct X *)0) -> a[1]);
+
+int Arr[100];
+
+int foo(int i) { return bar(&Arr[49])+bar(&Arr[i]); }
+int foo2(int i) {
+ static const int *X = &Arr[49];
+ static int i23 = (int) &( ((struct X *)0) -> a[0]);
+ int *P = Arr;
+ ++P;
+ return bar(Arr+i);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2005-01-02-PointerDifference.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-01-02-PointerDifference.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-01-02-PointerDifference.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-01-02-PointerDifference.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,3 @@
+// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep -v div
+
+int Diff(int *P, int *Q) { return P-Q; }
Added: llvm/branches/non-call-eh/test/FrontendC/2005-01-02-VAArgError-ICE.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-01-02-VAArgError-ICE.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-01-02-VAArgError-ICE.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-01-02-VAArgError-ICE.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// This file is erroneous, but should not cause the compiler to ICE.
+// PR481
+// RUN: %llvmgcc %s -S -o /dev/null |& not grep {internal compiler error}
+
+#include <stdarg.h>
+int flags(int a, int b, ...) {
+ va_list args;
+ va_start(args,a); // not the last named arg
+ foo(args);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2005-02-20-AggregateSAVEEXPR.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-02-20-AggregateSAVEEXPR.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-02-20-AggregateSAVEEXPR.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-02-20-AggregateSAVEEXPR.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,19 @@
+// RUN: %llvmgcc %s -o /dev/null -S
+// Note:
+// We fail this on Sparc because the C library seems to be missing complex.h
+// and the corresponding C99 complex support.
+//
+// We could modify the test to use only GCC extensions, but I don't know if
+// that would change the nature of the test.
+//
+// XFAIL: sparc
+
+#ifdef __CYGWIN__
+ #include <mingw/complex.h>
+#else
+ #include <complex.h>
+#endif
+
+int foo(complex float c) {
+ return creal(c);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2005-02-27-MarkGlobalConstant.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-02-27-MarkGlobalConstant.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-02-27-MarkGlobalConstant.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-02-27-MarkGlobalConstant.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -xc %s -S -o - | grep {internal constant }
+
+// The synthetic global made by the CFE for big initializer should be marked
+// constant.
+
+void bar();
+void foo() {
+ char Blah[] = "asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd";
+ bar(Blah);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2005-03-05-OffsetOfHack.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-03-05-OffsetOfHack.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-03-05-OffsetOfHack.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-03-05-OffsetOfHack.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc %s -S -o -
+
+struct s {
+ unsigned long int field[0];
+};
+
+#define OFFS \
+ (((char *) &((struct s *) 0)->field[0]) - (char *) 0)
+
+int foo[OFFS];
+
+
Added: llvm/branches/non-call-eh/test/FrontendC/2005-03-06-OffsetOfStructCrash.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-03-06-OffsetOfStructCrash.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-03-06-OffsetOfStructCrash.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-03-06-OffsetOfStructCrash.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgcc %s -S -o -
+
+struct Y {};
+struct XXX {
+ struct Y F;
+};
+
+void test1() {
+ (int)&((struct XXX*)(((void *)0)))->F;
+}
+
+void test2() {
+ &((struct XXX*)(((void *)0)))->F;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2005-03-11-Prefetch.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-03-11-Prefetch.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-03-11-Prefetch.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-03-11-Prefetch.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc %s -S -o - | llvm-as | llvm-dis | grep llvm.prefetch
+
+void foo(int *P) {
+ __builtin_prefetch(P);
+ __builtin_prefetch(P, 1);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2005-04-09-ComplexOps.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-04-09-ComplexOps.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-04-09-ComplexOps.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-04-09-ComplexOps.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc %s -S -o -
+
+#include <math.h>
+#define I 1.0iF
+
+double __complex test(double X) { return ~-(X*I); }
+
+_Bool EQ(double __complex A, double __complex B) { return A == B; }
+_Bool NE(double __complex A, double __complex B) { return A != B; }
Added: llvm/branches/non-call-eh/test/FrontendC/2005-05-06-CountBuiltins.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-05-06-CountBuiltins.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-05-06-CountBuiltins.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-05-06-CountBuiltins.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,17 @@
+// RUN: %llvmgcc %s -S -o - | llvm-as | llvm-dis | not grep call.*__builtin
+
+int G, H, I;
+void foo(int P) {
+ G = __builtin_clz(P);
+ H = __builtin_ctz(P);
+ I = __builtin_popcount(P);
+}
+
+long long g, h, i;
+void fooll(float P) {
+ g = __builtin_clzll(P);
+ g = __builtin_clzll(P);
+ h = __builtin_ctzll(P);
+ i = __builtin_popcountll(P);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2005-05-10-GlobalUnionInit.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-05-10-GlobalUnionInit.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-05-10-GlobalUnionInit.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-05-10-GlobalUnionInit.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc %s -S -o -
+
+union A { // { uint }
+ union B { double *C; } D;
+} E = { { (double*)12312 } };
+
Added: llvm/branches/non-call-eh/test/FrontendC/2005-06-15-ExpandGotoInternalProblem.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-06-15-ExpandGotoInternalProblem.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-06-15-ExpandGotoInternalProblem.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-06-15-ExpandGotoInternalProblem.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgcc -std=c99 %s -S -o - | llvm-as | \
+// RUN: opt -std-compile-opts -disable-output
+// PR580
+
+int X, Y;
+int foo() {
+ int i;
+ for (i=0; i<100; i++ )
+ {
+ break;
+ i = ( X || Y ) ;
+ }
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2005-07-20-SqrtNoErrno.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-07-20-SqrtNoErrno.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-07-20-SqrtNoErrno.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-07-20-SqrtNoErrno.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc %s -S -o - -fno-math-errno | grep llvm.sqrt
+#include <math.h>
+
+float foo(float X) {
+ // Check that this compiles to llvm.sqrt when errno is ignored.
+ return sqrtf(X);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2005-07-26-UnionInitCrash.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-07-26-UnionInitCrash.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-07-26-UnionInitCrash.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-07-26-UnionInitCrash.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,3 @@
+// PR607
+// RUN: %llvmgcc %s -S -o -
+union { char bytes[8]; double alignment; }EQ1 = {0,0,0,0,0,0,0,0};
Added: llvm/branches/non-call-eh/test/FrontendC/2005-07-28-IncorrectWeakGlobal.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-07-28-IncorrectWeakGlobal.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-07-28-IncorrectWeakGlobal.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-07-28-IncorrectWeakGlobal.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,5 @@
+// RUN: %llvmgcc %s -S -o - | grep TheGlobal | not grep weak
+
+extern int TheGlobal;
+int foo() { return TheGlobal; }
+int TheGlobal = 1;
Added: llvm/branches/non-call-eh/test/FrontendC/2005-09-20-ComplexConstants.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-09-20-ComplexConstants.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-09-20-ComplexConstants.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-09-20-ComplexConstants.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,4 @@
+// RUN: %llvmgcc %s -S -o - | llvm-as -o /dev/null -f
+
+const double _Complex x[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+
Added: llvm/branches/non-call-eh/test/FrontendC/2005-09-24-AsmUserPrefix.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-09-24-AsmUserPrefix.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-09-24-AsmUserPrefix.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-09-24-AsmUserPrefix.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc %s -S -o - | llvm-as | opt -std-compile-opts | llc | \
+// RUN: not grep _foo2
+
+void foo() __asm__("foo2");
+
+void bar() {
+ foo();
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2005-09-24-BitFieldCrash.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-09-24-BitFieldCrash.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-09-24-BitFieldCrash.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-09-24-BitFieldCrash.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,33 @@
+// RUN: %llvmgcc %s -S -o -
+
+struct tree_common {};
+
+struct tree_int_cst {
+ struct tree_common common;
+ struct tree_int_cst_lowhi {
+ unsigned long long low;
+ long long high;
+ } int_cst;
+};
+
+enum XXX { yyy };
+
+struct tree_function_decl {
+ struct tree_common common;
+ long long locus, y;
+ __extension__ enum XXX built_in_class : 2;
+
+};
+
+
+union tree_node {
+ struct tree_int_cst int_cst;
+ struct tree_function_decl function_decl;
+};
+
+
+void foo (union tree_node * decl) {
+ decl->function_decl.built_in_class != 0;
+}
+
+
Added: llvm/branches/non-call-eh/test/FrontendC/2005-10-18-VariableSizedElementCrash.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-10-18-VariableSizedElementCrash.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-10-18-VariableSizedElementCrash.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-10-18-VariableSizedElementCrash.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc %s -S -o -
+
+int sub1(int i, char *pi) {
+ typedef int foo[i];
+ struct bar {foo f1; int f2:3; int f3:4;} *p = (struct bar *) pi;
+ xxx(p->f1);
+ return p->f3;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2005-12-04-AttributeUsed.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-12-04-AttributeUsed.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-12-04-AttributeUsed.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-12-04-AttributeUsed.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc %s -S -emit-llvm -o - | llvm-as | llvm-dis | \
+// RUN: grep llvm.used | grep foo | grep X
+
+int X __attribute__((used));
+int Y;
+
+__attribute__((used)) void foo() {}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2005-12-04-DeclarationLineNumbers.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2005-12-04-DeclarationLineNumbers.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2005-12-04-DeclarationLineNumbers.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2005-12-04-DeclarationLineNumbers.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,23 @@
+// RUN: %llvmgcc %s -S -g -o - | grep {llvm.dbg.stoppoint.*i32 14}
+// PR664: ensure that line #'s are emitted for declarations
+
+
+short test(short br_data_0,
+short br_data_1,
+short br_data_2,
+short br_data_3,
+short br_data_4,
+short br_data_5,
+short br_data_6,
+short br_data_7) {
+
+short sm07 = br_data_0 + br_data_7;
+short sm16 = br_data_1 + br_data_6;
+short sm25 = br_data_2 + br_data_5;
+short sm34 = br_data_3 + br_data_4;
+short s0734 = sm07 + sm34;
+short s1625 = sm16 + sm25;
+
+return s0734 + s1625;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2006-01-13-Includes.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-01-13-Includes.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-01-13-Includes.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-01-13-Includes.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc %s -g -S -o - | llvm-as | opt -std-compile-opts | \
+// RUN: llvm-dis | grep {test/FrontendC}
+// PR676
+
+#include <stdio.h>
+
+void test() {
+ printf("Hello World\n");
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2006-01-13-StackSave.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-01-13-StackSave.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-01-13-StackSave.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-01-13-StackSave.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// PR691
+// RUN: %llvmgcc %s -S -o - | llvm-as | opt -std-compile-opts | \
+// RUN: llvm-dis | grep llvm.stacksave
+
+void test(int N) {
+ int i;
+ for (i = 0; i < N; ++i) {
+ int VLA[i];
+ external(VLA);
+ }
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2006-01-16-BitCountIntrinsicsUnsigned.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-01-16-BitCountIntrinsicsUnsigned.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-01-16-BitCountIntrinsicsUnsigned.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-01-16-BitCountIntrinsicsUnsigned.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32( i32} | count 2
+// RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32(i32} | count 1
+
+unsigned t2(unsigned X) {
+ return __builtin_clz(X);
+}
+int t1(int X) {
+ return __builtin_clz(X);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2006-01-23-FileScopeAsm.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-01-23-FileScopeAsm.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-01-23-FileScopeAsm.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-01-23-FileScopeAsm.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc %s -S -o - | llvm-as | opt -std-compile-opts | \
+// RUN: llvm-dis | grep {foo\[12345\]} | count 5
+
+__asm__ ("foo1");
+__asm__ ("foo2");
+__asm__ ("foo3");
+__asm__ ("foo4");
+__asm__ ("foo5");
Added: llvm/branches/non-call-eh/test/FrontendC/2006-03-03-MissingInitializer.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-03-03-MissingInitializer.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-03-03-MissingInitializer.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-03-03-MissingInitializer.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgcc %s -S -o - | llvm-as | opt -std-compile-opts | \
+// RUN: llvm-dis | grep {@nate.*internal global i32 0}
+
+struct X { int *XX; int Y;};
+
+void foo() {
+ static int nate = 0;
+ struct X bob = { &nate, 14 };
+ bar(&bob);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2006-03-16-VectorCtor.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-03-16-VectorCtor.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-03-16-VectorCtor.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-03-16-VectorCtor.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// Test that basic generic vector support works
+// RUN: %llvmgcc %s -S -o -
+
+typedef int v4si __attribute__ ((__vector_size__ (16)));
+void test(v4si *P, v4si *Q, float X) {
+ *P = (v4si){ X, X, X, X } * *Q;
+}
+
+v4si G = (v4si){ 0.1, 1.2, 4.2, 17.2 };
+
Added: llvm/branches/non-call-eh/test/FrontendC/2006-03-17-KnRMismatch.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-03-17-KnRMismatch.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-03-17-KnRMismatch.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-03-17-KnRMismatch.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc %s -S -o -
+
+void regnode(int op);
+
+void regnode(op)
+char op;
+{
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2006-05-01-AppleAlignmentPragma.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-05-01-AppleAlignmentPragma.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-05-01-AppleAlignmentPragma.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-05-01-AppleAlignmentPragma.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc %s -S -o -
+
+#ifdef __APPLE__
+/* test that X is layed out correctly when this pragma is used. */
+#pragma options align=mac68k
+#endif
+
+struct S {
+ unsigned A;
+ unsigned short B;
+} X;
+
Added: llvm/branches/non-call-eh/test/FrontendC/2006-05-19-SingleEltReturn.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-05-19-SingleEltReturn.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-05-19-SingleEltReturn.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-05-19-SingleEltReturn.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,23 @@
+// Test returning a single element aggregate value containing a double.
+// RUN: %llvmgcc %s -S -o -
+
+struct X {
+ double D;
+};
+
+struct Y {
+ struct X x;
+};
+
+struct Y bar();
+
+void foo(struct Y *P) {
+ *P = bar();
+}
+
+struct Y bar() {
+ struct Y a;
+ a.x.D = 0;
+ return a;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2006-07-31-PR854.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-07-31-PR854.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-07-31-PR854.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-07-31-PR854.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgcc -w %s -S -o -
+// PR854
+ struct kernel_symbol {
+ unsigned long value;
+ };
+ unsigned long loops_per_jiffy = (1<<12);
+ static const char __kstrtab_loops_per_jiffy[]
+__attribute__((section("__ksymtab_strings"))) = "loops_per_jiffy";
+ static const struct kernel_symbol __ksymtab_loops_per_jiffy
+__attribute__((__used__)) __attribute__((section("__ksymtab"))) = { (unsigned
+long)&loops_per_jiffy, __kstrtab_loops_per_jiffy };
Added: llvm/branches/non-call-eh/test/FrontendC/2006-09-11-BitfieldRefCrash.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-09-11-BitfieldRefCrash.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-09-11-BitfieldRefCrash.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-09-11-BitfieldRefCrash.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc %s -S -o -
+// PR906
+
+struct state_struct {
+ unsigned long long phys_frame: 50;
+ unsigned valid : 2;
+} s;
+
+int mem_access(struct state_struct *p) {
+ return p->valid;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2006-09-18-fwrite-cast-crash.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-09-18-fwrite-cast-crash.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-09-18-fwrite-cast-crash.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-09-18-fwrite-cast-crash.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,15 @@
+// RUN: %llvmgcc %s -S -o /dev/null
+// PR910
+// XFAIL: *
+// See PR2452
+
+struct l_struct_2E_FILE { char x; };
+unsigned fwrite(signed char *, unsigned , unsigned , signed char *);
+static signed char str301[39];
+static void Usage(signed char *ltmp_611_6) {
+ struct l_struct_2E_FILE *ltmp_6202_16;
+ unsigned ltmp_6203_92;
+ ltmp_6203_92 = /*tail*/ ((unsigned (*) (signed char *, unsigned , unsigned ,
+struct l_struct_2E_FILE *))(void*)fwrite)((&(str301[0u])), 38u, 1u, ltmp_6202_16);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2006-09-21-IncompleteElementType.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-09-21-IncompleteElementType.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-09-21-IncompleteElementType.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-09-21-IncompleteElementType.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,3 @@
+// RUN: not %llvmgcc %s -S -o /dev/null |& not grep {internal compiler error}
+
+struct A X[(927 - 37) / sizeof(struct A)];
Added: llvm/branches/non-call-eh/test/FrontendC/2006-09-25-DebugFilename.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-09-25-DebugFilename.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-09-25-DebugFilename.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-09-25-DebugFilename.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: not %llvmgcc -xc %s -S -o /dev/null |& \
+// RUN: grep fluffy | grep 2006-09-25-DebugFilename.c
+#include "2006-09-25-DebugFilename.h"
+int func1() { return hfunc1(); }
+int func2() { fluffy; return hfunc1(); }
+
Added: llvm/branches/non-call-eh/test/FrontendC/2006-09-25-DebugFilename.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-09-25-DebugFilename.h?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-09-25-DebugFilename.h (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-09-25-DebugFilename.h Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+extern int exfunc(int a);
+
+static inline int hfunc1()
+{
+ return exfunc(1);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2006-09-28-SimpleAsm.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-09-28-SimpleAsm.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-09-28-SimpleAsm.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-09-28-SimpleAsm.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc %s -S -o - | grep {ext: xorl %eax, eax; movl}
+// RUN: %llvmgcc %s -S -o - | grep {nonext: xorl %eax, %eax; mov}
+// PR924
+
+void bar() {
+ // Extended asm
+ asm volatile ("ext: xorl %%eax, eax; movl eax, fs; movl eax, gs %%blah %= %% " : : "r"(1));
+ // Non-extended asm.
+ asm volatile ("nonext: xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs %%blah %= %% ");
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2006-10-30-ArrayCrash.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-10-30-ArrayCrash.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-10-30-ArrayCrash.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-10-30-ArrayCrash.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,17 @@
+// RUN: %llvmgcc -O3 -S -o - %s
+// PR954, PR911
+
+extern void foo();
+
+struct S {
+ short f1[3];
+ unsigned int f2 : 1;
+};
+
+void bar()
+{
+ struct S *A;
+
+ if (A->f2)
+ foo();
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2006-12-14-ordered_expr.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2006-12-14-ordered_expr.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2006-12-14-ordered_expr.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2006-12-14-ordered_expr.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -O3 -S %s -o - | grep {fcmp ord float %X, %Y}
+
+int test2(float X, float Y) {
+ return !__builtin_isunordered(X, Y);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-01-06-KNR-Proto.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-01-06-KNR-Proto.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-01-06-KNR-Proto.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-01-06-KNR-Proto.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -S -o - -emit-llvm %s
+// PR1083
+
+int svc_register (void (*dispatch) (int));
+
+int svc_register (dispatch)
+ void (*dispatch) ();
+{
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-01-20-VectorICE.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-01-20-VectorICE.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-01-20-VectorICE.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-01-20-VectorICE.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgcc %s -S -o -
+
+typedef float __m128 __attribute__((__vector_size__(16)));
+typedef long long __v2di __attribute__((__vector_size__(16)));
+typedef int __v4si __attribute__((__vector_size__(16)));
+
+__v2di bar(void);
+void foo(int X, __v4si *P) {
+ *P = X == 2 ? bar() : bar();
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-01-24-InlineAsmCModifier.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-01-24-InlineAsmCModifier.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-01-24-InlineAsmCModifier.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-01-24-InlineAsmCModifier.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// Verify that the %c modifier works and strips off any prefixes from
+// immediates.
+// RUN: %llvmgcc -S %s -o - | llvm-as | llc | grep {pickANumber: 789514}
+
+void foo() {
+ __asm__ volatile("/* " "pickANumber" ": %c0 */"::"i"(0xC0C0A));
+
+ // Check that non-c modifiers work also (not greped for above).
+ __asm__ volatile("/* " "pickANumber2 " ": %0 */"::"i"(123));
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-02-04-AddrLValue-2.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-02-04-AddrLValue-2.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-02-04-AddrLValue-2.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-02-04-AddrLValue-2.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+// RUN: %llvmgcc %s -O3 -S -o - -emit-llvm
+// PR1173
+
+struct S { char s; };
+struct T { struct S t; };
+
+struct S *const p = &((struct T * const) (0x4000))->t;
+
+void
+foo (void)
+{
+ p->s = 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-02-04-AddrLValue.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-02-04-AddrLValue.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-02-04-AddrLValue.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-02-04-AddrLValue.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,23 @@
+// RUN: %llvmgcc %s -O3 -S -o - -emit-llvm
+// PR1176
+
+typedef struct
+{
+ char *key;
+ char *value;
+} T1;
+
+typedef struct
+{
+ long type;
+ char *value;
+} T3;
+
+T1 a[] =
+{
+ {
+ "",
+ ((char *)&((T3) {1, (char *) 1}))
+ }
+};
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-02-04-EmptyStruct.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-02-04-EmptyStruct.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-02-04-EmptyStruct.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-02-04-EmptyStruct.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc %s -O3 -S -o - -emit-llvm
+// PR1175
+
+struct empty { };
+
+void foo(struct empty *p) {
+ p++;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-02-04-WITH_SIZE_EXPR.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-02-04-WITH_SIZE_EXPR.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-02-04-WITH_SIZE_EXPR.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-02-04-WITH_SIZE_EXPR.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,21 @@
+// RUN: %llvmgcc %s -O3 -S -o - -emit-llvm
+// PR1174
+
+void zzz (char *s1, char *s2, int len, int *q)
+{
+ int z = 5;
+ unsigned int i, b;
+ struct { char a[z]; } x;
+
+ for (i = 0; i < len; i++)
+ s1[i] = s2[i];
+
+ b = z & 0x3;
+
+ len += (b == 0 ? 0 : 1) + z;
+
+ *q = len;
+
+ foo (x, x);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-02-05-nested.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-02-05-nested.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-02-05-nested.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-02-05-nested.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,54 @@
+// RUN: %llvmgcc -S -fnested-functions -O0 -o - -emit-llvm %s
+// PR915
+
+extern void abort(void);
+
+void nest(int n)
+{
+ int a = 0;
+ int b = 5;
+ int c = 0;
+ int d = 7;
+
+ void o(int i, int j)
+ {
+ if (i!=j)
+ abort();
+ }
+
+ void f(x)
+ int x; /* K&R style */
+ {
+ int e = 0;
+ int f = 2;
+ int g = 0;
+
+ void y(void)
+ {
+ c = n;
+ e = 1;
+ g = x;
+ }
+
+ void z(void)
+ {
+ a = 4;
+ g = 3;
+ }
+
+ a = 5;
+ y();
+ c = x;
+ z();
+ o(1,e);
+ o(2,f);
+ o(3,g);
+ }
+
+ c = 2;
+ f(6);
+ o(4,a);
+ o(5,b);
+ o(6,c);
+ o(7,d);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-02-07-AddrLabel.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-02-07-AddrLabel.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-02-07-AddrLabel.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-02-07-AddrLabel.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// PR947
+// RUN: %llvmgcc %s -c -o -
+
+void foo() {
+ void *ptr;
+ label:
+ ptr = &&label;
+
+ goto *ptr;
+ }
Added: llvm/branches/non-call-eh/test/FrontendC/2007-02-16-VariableSizeStructArg.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-02-16-VariableSizeStructArg.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-02-16-VariableSizeStructArg.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-02-16-VariableSizeStructArg.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc -S -w %s -o -
+// PR1170
+int f(int a, struct {int b[a];} c) { return c.b[0]; }
+
+int g(struct {int b[1];} c) {
+ return c.b[0];
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-02-16-VoidPtrDiff.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-02-16-VoidPtrDiff.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-02-16-VoidPtrDiff.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-02-16-VoidPtrDiff.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,5 @@
+// RUN: %llvmgcc %s -S -o - -emit-llvm
+
+void foo(void *ptr, int test) {
+ (ptr - ((void *) test + 0x2000));
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-02-16-WritableStrings.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-02-16-WritableStrings.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-02-16-WritableStrings.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-02-16-WritableStrings.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// Test the -fwritable-strings option.
+
+// RUN: %llvmgcc -O3 -S -o - -emit-llvm -fwritable-strings %s | \
+// RUN: grep {internal global}
+// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep {internal constant}
+
+char *X = "foo";
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-02-25-C-DotDotDot.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-02-25-C-DotDotDot.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-02-25-C-DotDotDot.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-02-25-C-DotDotDot.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc -O0 -S -o - -emit-llvm -fno-inline -fno-unit-at-a-time %s | \
+// RUN: grep {call float @foo}
+
+// Make sure the call to foo is compiled as:
+// call float @foo()
+// not
+// call float (...)* bitcast (float ()* @foo to float (...)*)( )
+
+static float foo() { return 0.0; }
+float bar() { return foo()*10.0;}
+
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-03-01-VarSizeArrayIdx.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-03-01-VarSizeArrayIdx.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-03-01-VarSizeArrayIdx.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-03-01-VarSizeArrayIdx.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc %s -O3 -S -o - -emit-llvm | grep mul
+// PR1233
+
+float foo(int w, float A[][w], int g, int h) {
+ return A[g][0];
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-03-05-DataLayout.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-03-05-DataLayout.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-03-05-DataLayout.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-03-05-DataLayout.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,53 @@
+// Testcase for PR1242
+// RUN: %llvmgcc -S %s -o - | grep datalayout | \
+// RUN: not grep {"\[Ee\]-p:\[36\]\[24\]:\[36\]\[24\]"}
+// END.
+#include <stdlib.h>
+#define NDIM 3
+#define BODY 01
+typedef double vector[NDIM];
+typedef struct bnode* bodyptr;
+// { i16, double, [3 x double], i32, i32, [3 x double], [3 x double], [3 x
+// double], double, \2 *, \2 * }
+struct bnode {
+ short int type;
+ double mass;
+ vector pos;
+ int proc;
+ int new_proc;
+ vector vel;
+ vector acc;
+ vector new_acc;
+ double phi;
+ bodyptr next;
+ bodyptr proc_next;
+} body;
+
+#define Type(x) ((x)->type)
+#define Mass(x) ((x)->mass)
+#define Pos(x) ((x)->pos)
+#define Proc(x) ((x)->proc)
+#define New_Proc(x) ((x)->new_proc)
+#define Vel(x) ((x)->vel)
+#define Acc(x) ((x)->acc)
+#define New_Acc(x) ((x)->new_acc)
+#define Phi(x) ((x)->phi)
+#define Next(x) ((x)->next)
+#define Proc_Next(x) ((x)->proc_next)
+
+bodyptr ubody_alloc(int p)
+{
+ register bodyptr tmp;
+ tmp = (bodyptr)malloc(sizeof(body));
+
+ Type(tmp) = BODY;
+ Proc(tmp) = p;
+ Proc_Next(tmp) = NULL;
+ New_Proc(tmp) = p;
+ return tmp;
+}
+
+int main(int argc, char** argv) {
+ bodyptr b = ubody_alloc(17);
+ return 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-03-06-VarSizeInStruct1.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-03-06-VarSizeInStruct1.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-03-06-VarSizeInStruct1.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-03-06-VarSizeInStruct1.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc %s -w -S -o -
+void* p (int n) {
+ struct f {
+ char w; char x[n]; char z[];
+ } F;
+ F.x[0]='x';
+ return &F;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-03-06-VarSizeInStruct2.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-03-06-VarSizeInStruct2.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-03-06-VarSizeInStruct2.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-03-06-VarSizeInStruct2.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc %s -S -o -
+char p (int n) {
+ struct f {
+ char w; char x[n]; char y[n];
+ } F;
+
+ return F.x[0];
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-03-26-BitfieldAfterZeroWidth.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-03-26-BitfieldAfterZeroWidth.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-03-26-BitfieldAfterZeroWidth.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-03-26-BitfieldAfterZeroWidth.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc %s -S -o -
+struct W {};
+struct Y {
+ struct W w;
+ int i:1;
+} __attribute__ ((packed)) y;
Added: llvm/branches/non-call-eh/test/FrontendC/2007-03-26-ZeroWidthBitfield.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-03-26-ZeroWidthBitfield.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-03-26-ZeroWidthBitfield.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-03-26-ZeroWidthBitfield.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,2 @@
+// RUN: %llvmgcc %s -S -o -
+struct Z { int :0; } z;
Added: llvm/branches/non-call-eh/test/FrontendC/2007-03-27-ArrayCompatible.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-03-27-ArrayCompatible.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-03-27-ArrayCompatible.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-03-27-ArrayCompatible.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -S %s -O2 -o - | grep {ret i8 0}
+static char c(int n) {
+ char x[2][n];
+ x[1][0]=0;
+ return *(n+(char *)x);
+}
+
+char d(void) {
+ return c(2);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-03-27-VarLengthArray.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-03-27-VarLengthArray.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-03-27-VarLengthArray.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-03-27-VarLengthArray.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc -S %s -o - | grep {getelementptr i32}
+extern void f(int *);
+int e(int m, int n) {
+ int x[n];
+ f(x);
+ return x[m];
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PackedBitFields-2.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PackedBitFields-2.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PackedBitFields-2.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PackedBitFields-2.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,16 @@
+// RUN: %llvmgcc %s -S -o -
+
+# define pck __attribute__((packed))
+
+
+struct pck F {
+ unsigned long long i : 12,
+ j : 23,
+ k : 27,
+ l;
+};
+struct F f1;
+
+void foo() {
+ f1.l = 5;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PackedBitFields.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PackedBitFields.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PackedBitFields.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PackedBitFields.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,16 @@
+// RUN: %llvmgcc %s -S -o -
+
+# define pck __attribute__((packed))
+
+
+struct pck E {
+ unsigned long long l,
+ i : 12,
+ j : 23,
+ k : 29; };
+
+struct E e1;
+
+void foo() {
+ e1.k = 5;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PackedStruct.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PackedStruct.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PackedStruct.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PackedStruct.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,18 @@
+// RUN: %llvmgcc %s -S -o -
+
+#pragma pack(push, 2)
+
+enum {
+ tA = 0,
+ tB = 1
+};
+
+struct MyStruct {
+ unsigned long A;
+ char C;
+ void * B;
+};
+
+void bar(){
+struct MyStruct MS = { tB, 0 };
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PadBeforeZeroLengthField.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PadBeforeZeroLengthField.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PadBeforeZeroLengthField.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PadBeforeZeroLengthField.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc %s -S -o -
+struct c__ { unsigned int type:4; };
+union A { struct c__ c; } __attribute__((aligned(8)));
+struct B {
+ unsigned int retainCount;
+ union A objects[];
+};
+void foo(union A * objects, struct B *array, unsigned long k)
+{ array->objects[k] = objects[k]; }
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-05-UnPackedStruct.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-05-UnPackedStruct.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-05-UnPackedStruct.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-05-UnPackedStruct.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,16 @@
+// RUN: %llvmgcc %s -S -o -
+
+
+enum {
+ tA = 0,
+ tB = 1
+};
+
+struct MyStruct {
+ unsigned long A;
+ void * B;
+};
+
+void bar(){
+struct MyStruct MS = { tB, 0 };
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineAsmStruct.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineAsmStruct.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineAsmStruct.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineAsmStruct.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc %s -S -emit-llvm -o - | llvm-as | llc
+
+struct V { short X, Y; };
+int bar() {
+ struct V bar;
+ __asm__ volatile("foo %0\n" : "=r"(bar));
+ return bar.X;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineAsmUnion.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineAsmUnion.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineAsmUnion.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineAsmUnion.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc %s -S -emit-llvm -o - | llvm-as | llc
+
+union U { int x; float p; };
+void foo() {
+ union U bar;
+ __asm__ volatile("foo %0\n" : "=r"(bar));
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineStorageClassC89.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineStorageClassC89.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineStorageClassC89.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineStorageClassC89.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,46 @@
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | grep xglobWeak | \
+// RUN: grep weak | count 1
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | grep xextWeak | \
+// RUN: grep weak | count 1
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xWeaknoinline | grep weak | count 1
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xWeakextnoinline | grep weak | count 1
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xglobnoWeak | grep -v internal | grep -v weak | \
+// RUN: grep -v linkonce | count 1
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xstatnoWeak | grep internal | count 1
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep declare | \
+// RUN: grep xextnoWeak | grep -v internal | grep -v weak | \
+// RUN: grep -v linkonce | count 1
+inline int xglobWeak(int) __attribute__((weak));
+inline int xglobWeak (int i) {
+ return i*2;
+}
+inline int xextWeak(int) __attribute__((weak));
+extern inline int xextWeak (int i) {
+ return i*4;
+}
+int xWeaknoinline(int) __attribute__((weak));
+int xWeaknoinline(int i) {
+ return i*8;
+}
+int xWeakextnoinline(int) __attribute__((weak));
+extern int xWeakextnoinline(int i) {
+ return i*16;
+}
+inline int xglobnoWeak (int i) {
+ return i*32;
+}
+static inline int xstatnoWeak (int i) {
+ return i*64;
+}
+extern inline int xextnoWeak (int i) {
+ return i*128;
+}
+int j(int y) {
+ return xglobnoWeak(y)+xstatnoWeak(y)+xextnoWeak(y)+
+ xglobWeak(y)+xextWeak(y)+
+ xWeakextnoinline(y)+xWeaknoinline(y);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineStorageClassC99.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineStorageClassC99.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineStorageClassC99.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineStorageClassC99.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,46 @@
+// RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep declare | \
+// RUN: grep xglobWeak | grep extern_weak | count 1
+// RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xextWeak | grep weak | count 1
+// RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xWeaknoinline | grep weak | count 1
+// RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xWeakextnoinline | grep weak | count 1
+// RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep declare | \
+// RUN: grep xglobnoWeak | grep -v internal | grep -v weak | \
+// RUN: grep -v linkonce | count 1
+// RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xstatnoWeak | grep internal | count 1
+// RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | \
+// RUN: grep xextnoWeak | grep -v internal | grep -v weak | \
+// RUN: grep -v linkonce | count 1
+inline int xglobWeak(int) __attribute__((weak));
+inline int xglobWeak (int i) {
+ return i*2;
+}
+inline int xextWeak(int) __attribute__((weak));
+extern inline int xextWeak (int i) {
+ return i*4;
+}
+int xWeaknoinline(int) __attribute__((weak));
+int xWeaknoinline(int i) {
+ return i*8;
+}
+int xWeakextnoinline(int) __attribute__((weak));
+extern int xWeakextnoinline(int i) {
+ return i*16;
+}
+inline int xglobnoWeak (int i) {
+ return i*32;
+}
+static inline int xstatnoWeak (int i) {
+ return i*64;
+}
+extern inline int xextnoWeak (int i) {
+ return i*128;
+}
+int j(int y) {
+ return xglobnoWeak(y)+xstatnoWeak(y)+xextnoWeak(y)+
+ xglobWeak(y)+xextWeak(y)+
+ xWeakextnoinline(y)+xWeaknoinline(y);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-11-PR1321.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-11-PR1321.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-11-PR1321.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-11-PR1321.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc %s -S -o /dev/null
+
+struct X {
+ unsigned int e0 : 17;
+ unsigned int e1 : 17;
+ unsigned int e2 : 17;
+ unsigned int e3 : 17;
+ unsigned int e4 : 17;
+ unsigned int e5 : 17;
+ unsigned int e6 : 17;
+ unsigned int e7 : 17;
+} __attribute__((packed)) x;
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-13-InlineAsmStruct2.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-13-InlineAsmStruct2.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-13-InlineAsmStruct2.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-13-InlineAsmStruct2.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc %s -S -emit-llvm -o - | grep {call void asm}
+
+struct V { short X, Y; };
+int bar() {
+ struct V bar;
+ __asm__ volatile("foo %0\n" :: "r"(bar));
+ return bar.X;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-13-InlineAsmUnion2.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-13-InlineAsmUnion2.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-13-InlineAsmUnion2.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-13-InlineAsmUnion2.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc %s -S -emit-llvm -o - | grep {call void asm}
+
+union U { int x; char* p; };
+void foo() {
+ union U bar;
+ __asm__ volatile("foo %0\n" :: "r"(bar));
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-14-FNoBuiltin.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-14-FNoBuiltin.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-14-FNoBuiltin.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-14-FNoBuiltin.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc -S %s -O2 -fno-builtin -o - | grep call.*printf
+// Check that -fno-builtin is honored.
+
+extern int printf(const char*, ...);
+void foo(const char *msg) {
+ printf("%s\n",msg);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-17-ZeroSizeBitFields.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-17-ZeroSizeBitFields.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-17-ZeroSizeBitFields.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-17-ZeroSizeBitFields.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,4 @@
+// PR 1332
+// RUN: %llvmgcc %s -S -o /dev/null
+
+struct Z { int a:1; int :0; int c:1; } z;
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-24-VolatileStructCopy.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-24-VolatileStructCopy.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-24-VolatileStructCopy.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-24-VolatileStructCopy.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep {volatile store}
+// PR1352
+
+struct foo {
+ int x;
+};
+
+void copy(volatile struct foo *p, struct foo *q) {
+ *p = *q;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-24-bit-not-expr.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-24-bit-not-expr.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-24-bit-not-expr.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-24-bit-not-expr.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// PR 1346
+// RUN: %llvmgcc -c %s -o /dev/null
+extern bar(void *);
+
+void f(void *cd) {
+ bar(((void *)((unsigned long)(cd) ^ -1)));
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-04-24-str-const.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-04-24-str-const.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-04-24-str-const.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-04-24-str-const.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,17 @@
+// RUN: %llvmgcc -c %s -o /dev/null
+static char *str;
+
+static const struct {
+ const char *name;
+ unsigned type;
+} scan_special[] = {
+ {"shift", 1},
+ {0, 0}
+};
+
+static void
+sb(void)
+{
+ while (*str == ' ' || *str == '\t')
+ str++;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-05-07-NestedStructReturn.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-05-07-NestedStructReturn.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-05-07-NestedStructReturn.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-05-07-NestedStructReturn.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+// RUN: %llvmgcc %s -S -fnested-functions -o - | grep {sret *%agg.result}
+
+struct X { long m, n, o, p; };
+
+struct X p(int n) {
+ struct X c(int m) {
+ struct X x;
+ x.m = m;
+ x.n = n;
+ return x;
+ }
+ return c(n);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-05-07-PaddingElements.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-05-07-PaddingElements.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-05-07-PaddingElements.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-05-07-PaddingElements.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// PR 1278
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | not grep "4 x i8] zeroinitializer"
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | not grep "i32 0, i32 2"
+struct s {
+ double d1;
+ int s1;
+};
+
+struct s foo(void) {
+ struct s S = {1.1, 2};
+ return S;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-05-08-PCH.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-05-08-PCH.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-05-08-PCH.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-05-08-PCH.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// PR 1400
+// RUN: %llvmgcc -x c-header %s -o /dev/null
+
+int main() {
+ return 0;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-05-11-str-const.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-05-11-str-const.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-05-11-str-const.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-05-11-str-const.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,5 @@
+// RUN: %llvmgcc -c -g %s -o /dev/null
+
+static unsigned char out[]={0,1};
+static const unsigned char str1[]="1";
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-05-15-PaddingElement.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-05-15-PaddingElement.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-05-15-PaddingElement.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-05-15-PaddingElement.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,23 @@
+// PR 1419
+
+// RUN: %llvmgcc -xc -O2 %s -c -o - | llvm-dis | grep "ret i32 1"
+struct A {
+ short x;
+ long long :0;
+};
+
+struct B {
+ char a;
+ char b;
+ unsigned char i;
+};
+
+union X { struct A a; struct B b; };
+
+int check(void) {
+ union X x, y;
+
+ y.b.i = 0xff;
+ x = y;
+ return (x.b.i == 0xff);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-05-16-EmptyStruct.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-05-16-EmptyStruct.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-05-16-EmptyStruct.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-05-16-EmptyStruct.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,5 @@
+// PR 1417
+
+// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep "struct.anon = type \{ \}"
+
+struct { } *X;
Added: llvm/branches/non-call-eh/test/FrontendC/2007-05-29-UnionCopy.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-05-29-UnionCopy.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-05-29-UnionCopy.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-05-29-UnionCopy.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,18 @@
+// RUN: %llvmgcc -S -o - -emit-llvm %s | grep memcpy
+// PR1421
+
+struct A {
+ char c;
+ int i;
+};
+
+struct B {
+ int c;
+ unsigned char x;
+};
+
+union U { struct A a; struct B b; };
+
+void check(union U *u, union U *v) {
+ *u = *v;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-06-05-NoInlineAttribute.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-06-05-NoInlineAttribute.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-06-05-NoInlineAttribute.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-06-05-NoInlineAttribute.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+// RUN: %llvmgcc -c -emit-llvm %s -o - | llvm-dis | grep llvm.noinline
+
+static int bar(int x, int y) __attribute__((noinline));
+
+static int bar(int x, int y)
+{
+ return x + y;
+}
+
+int foo(int a, int b) {
+ return bar(b, a);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-06-15-AnnotateAttribute.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-06-15-AnnotateAttribute.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-06-15-AnnotateAttribute.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-06-15-AnnotateAttribute.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,24 @@
+// RUN: %llvmgcc -c -emit-llvm %s -o - | llvm-dis | grep llvm.global.annotations
+// RUN: %llvmgcc -c -emit-llvm %s -o - | llvm-dis | grep llvm.var.annotation | count 3
+
+#include <stdio.h>
+
+/* Global variable with attribute */
+int X __attribute__((annotate("GlobalValAnnotation")));
+
+/* Function with attribute */
+int foo(int y) __attribute__((annotate("GlobalValAnnotation")))
+ __attribute__((noinline));
+
+int foo(int y __attribute__((annotate("LocalValAnnotation")))) {
+ int x __attribute__((annotate("LocalValAnnotation")));
+ x = 34;
+ return y + x;
+}
+
+int main() {
+ static int a __attribute__((annotate("GlobalValAnnotation")));
+ a = foo(2);
+ printf("hello world%d\n", a);
+ return 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-06-18-SextAttrAggregate.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-06-18-SextAttrAggregate.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-06-18-SextAttrAggregate.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-06-18-SextAttrAggregate.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgcc %s -o - -S -emit-llvm -O3 | grep {i8 signext}
+// PR1513
+
+struct s{
+long a;
+long b;
+};
+
+void f(struct s a, char *b, signed char C) {
+
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-07-29-RestrictPtrArg.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-07-29-RestrictPtrArg.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-07-29-RestrictPtrArg.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-07-29-RestrictPtrArg.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -c -emit-llvm %s -o - | llvm-dis | grep noalias
+
+void foo(int * __restrict myptr1, int * myptr2) {
+ myptr1[0] = 0;
+ myptr2[0] = 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-08-01-LoadStoreAlign.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-08-01-LoadStoreAlign.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-08-01-LoadStoreAlign.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-08-01-LoadStoreAlign.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,17 @@
+// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep {align 1} | count 2
+// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | llvm-as | llc
+
+struct p {
+ char a;
+ int b;
+} __attribute__ ((packed));
+
+struct p t = { 1, 10 };
+struct p u;
+
+int main () {
+ int tmp = t.b;
+ u.b = tmp;
+ return tmp;
+
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-08-21-ComplexCst.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-08-21-ComplexCst.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-08-21-ComplexCst.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-08-21-ComplexCst.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,3 @@
+// RUN: %llvmgcc -O2 -c %s -o /dev/null
+void f(_Complex float z);
+void g() { f(1.0i); }
Added: llvm/branches/non-call-eh/test/FrontendC/2007-08-22-CTTZ.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-08-22-CTTZ.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-08-22-CTTZ.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-08-22-CTTZ.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -O2 -S -o - %s | grep {llvm.cttz.i64} | count 2
+// RUN: %llvmgcc -O2 -S -o - %s | not grep {lshr}
+
+int bork(unsigned long long x) {
+ return __builtin_ctzll(x);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-09-05-ConstCtor.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-09-05-ConstCtor.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-09-05-ConstCtor.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-09-05-ConstCtor.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// RUN: %llvmgcc -xc -Os -c %s -o /dev/null
+// PR1641
+
+struct A {
+ unsigned long l;
+};
+
+void bar(struct A *a);
+
+void bork() {
+ const unsigned long vcgt = 1234;
+ struct A a = { vcgt };
+ bar(&a);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-09-12-PragmaPack.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-09-12-PragmaPack.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-09-12-PragmaPack.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-09-12-PragmaPack.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,30 @@
+// RUN: %llvmgcc -O3 -S -o - %s | grep {18}
+
+#include <stdint.h>
+
+#pragma pack(push, 1)
+typedef struct
+{
+ uint32_t a;
+} foo;
+
+typedef struct {
+ uint8_t major;
+ uint8_t minor;
+ uint16_t build;
+} VERSION;
+
+typedef struct {
+ uint8_t a[5];
+ VERSION version;
+ uint8_t b;
+ foo d;
+ uint32_t guard;
+} bar;
+#pragma pack(pop)
+
+
+unsigned barsize(void) {
+ return sizeof(bar);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-09-14-NegatePointer.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-09-14-NegatePointer.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-09-14-NegatePointer.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-09-14-NegatePointer.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc -S %s -o -
+// PR1662
+
+int foo(unsigned char *test) {
+ return 0U - (unsigned int )test;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-09-17-WeakRef.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-09-17-WeakRef.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-09-17-WeakRef.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-09-17-WeakRef.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -O1 -S %s -o - | grep icmp
+// PR1678
+// XFAIL: llvmgcc4.0.1
+extern void B (void);
+static __typeof(B) A __attribute__ ((__weakref__("B")));
+int active (void)
+{
+ static void *const p = __extension__ (void *) &A;
+ return p != 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-09-20-GcrootAttribute.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-09-20-GcrootAttribute.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-09-20-GcrootAttribute.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-09-20-GcrootAttribute.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,29 @@
+// RUN: %llvmgcc -S -emit-llvm %s -o - | grep llvm.gcroot
+// RUN: %llvmgcc -S -emit-llvm %s -o - | grep llvm.gcroot | count 6
+// RUN: %llvmgcc -S -emit-llvm %s -o - | llvm-as
+
+typedef struct foo_s
+{
+ int a;
+} foo, __attribute__ ((gcroot)) *foo_p;
+
+foo my_foo;
+
+int alpha ()
+{
+ foo my_foo2 = my_foo;
+
+ return my_foo2.a;
+}
+
+int bar (foo a)
+{
+ foo_p b;
+ return b->a;
+}
+
+foo_p baz (foo_p a, foo_p b, foo_p *c)
+{
+ a = b = *c;
+ return a;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-09-26-Alignment.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-09-26-Alignment.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-09-26-Alignment.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-09-26-Alignment.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc -S %s -o - | grep {align 16}
+extern p(int *);
+int q(void) {
+ int x __attribute__ ((aligned (16)));
+ p(&x);
+ return x;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-09-27-ComplexIntCompare.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-09-27-ComplexIntCompare.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-09-27-ComplexIntCompare.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-09-27-ComplexIntCompare.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,17 @@
+// RUN: %llvmgcc -S %s -o -
+// PR1708
+
+#include <stdlib.h>
+
+struct s { _Complex unsigned short x; };
+struct s gs = { 100 + 200i };
+struct s __attribute__((noinline)) foo (void) { return gs; }
+
+int main ()
+{
+ if (foo ().x != gs.x)
+ abort ();
+ exit (0);
+}
+
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-09-28-PackedUnionMember.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-09-28-PackedUnionMember.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-09-28-PackedUnionMember.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-09-28-PackedUnionMember.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,38 @@
+// RUN: %llvmgcc %s -S -o -
+
+#pragma pack(push, 2)
+struct H {
+ unsigned long f1;
+ unsigned long f2;
+ union {
+ struct opaque1 *f3;
+ struct opaque2 *f4;
+ struct {
+ struct opaque3 *f5;
+ unsigned short f6;
+ } f7;
+ } f8;
+};
+#pragma pack(pop)
+
+struct E {
+ unsigned long f1;
+ unsigned long f2;
+};
+
+typedef long (*FuncPtr) ();
+
+extern long bork(FuncPtr handler, const struct E *list);
+
+static long hndlr()
+{
+ struct H cmd = { 4, 412 };
+ return 0;
+}
+void foo(void *inWindow) {
+ static const struct E events[] = {
+ { 123124, 1 }
+ };
+ bork(hndlr, events);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-10-01-BuildArrayRef.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-10-01-BuildArrayRef.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-10-01-BuildArrayRef.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-10-01-BuildArrayRef.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: not %llvmgcc -S %s -o /dev/null |& grep "error: assignment of read-only location"
+// PR 1603
+int func()
+{
+ const int *arr;
+ arr[0] = 1;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-10-02-VolatileArray.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-10-02-VolatileArray.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-10-02-VolatileArray.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-10-02-VolatileArray.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc -S %s -o - | grep volatile
+// PR1647
+
+void foo(volatile int *p)
+{
+p[0] = 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-10-15-VoidPtr.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-10-15-VoidPtr.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-10-15-VoidPtr.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-10-15-VoidPtr.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,4 @@
+// RUN: %llvmgcc -S %s -o /dev/null
+void bork(void **data) {
+ (*(unsigned short *) (&(data[37])[927]) = 0);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-10-30-Volatile.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-10-30-Volatile.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-10-30-Volatile.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-10-30-Volatile.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -S %s -o /dev/null -Wall -Werror
+void bork() {
+ char * volatile p;
+ volatile int cc;
+ p += cc;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-11-07-AlignedMemcpy.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-11-07-AlignedMemcpy.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-11-07-AlignedMemcpy.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-11-07-AlignedMemcpy.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,4 @@
+// RUN: %llvmgcc -c %s -o /dev/null
+void bork() {
+ int Qux[33] = {0};
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2007-11-07-CopyAggregateAlign.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-11-07-CopyAggregateAlign.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-11-07-CopyAggregateAlign.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-11-07-CopyAggregateAlign.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,3 @@
+// RUN: %llvmgcc -S %s -o - | grep "align 2" | count 6
+struct A { char s, t, u, v; short a; };
+void q() { struct A a, b; a = b; }
Added: llvm/branches/non-call-eh/test/FrontendC/2007-11-07-ZeroAggregateAlign.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-11-07-ZeroAggregateAlign.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-11-07-ZeroAggregateAlign.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-11-07-ZeroAggregateAlign.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,3 @@
+// RUN: %llvmgcc -S %s -o - | grep "align 2"
+struct A { short s; short t; int i; };
+void q() { struct A a = {0}; }
Added: llvm/branches/non-call-eh/test/FrontendC/2007-11-27-SExtZExt.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-11-27-SExtZExt.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-11-27-SExtZExt.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-11-27-SExtZExt.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc -S %s -emit-llvm -o - | grep "signext" | count 4
+
+signed char foo1() { return 1; }
+
+void foo2(signed short a) { }
+
+signed char foo3(void) { return 1; }
+
+void foo4(a) signed short a; { }
+
+
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-11-28-GlobalInitializer.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-11-28-GlobalInitializer.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-11-28-GlobalInitializer.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-11-28-GlobalInitializer.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// RUN: %llvmgcc -S %s -o -
+// PR1744
+typedef struct foo { int x; char *p; } FOO;
+extern FOO yy[];
+
+int *y = &((yy + 1)->x);
+void *z = &((yy + 1)->x);
+
Added: llvm/branches/non-call-eh/test/FrontendC/2007-12-16-AsmNoUnwind.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-12-16-AsmNoUnwind.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-12-16-AsmNoUnwind.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-12-16-AsmNoUnwind.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,3 @@
+// RUN: %llvmgcc %s -S -o - | grep nounwind
+
+void bar() { asm (""); }
Added: llvm/branches/non-call-eh/test/FrontendC/2007-12-VarArrayDebug.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2007-12-VarArrayDebug.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2007-12-VarArrayDebug.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2007-12-VarArrayDebug.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,18 @@
+// RUN: %llvmgcc -S -g -O %s -o - | llvm-as | llc
+// RUN: %llvmgcc -S -g %s -o - | llvm-as | llc
+
+extern void foo (void);
+
+static
+void baz (int i)
+{
+ foo ();
+ typedef char A[i];
+ struct { A b; } *x = 0;
+}
+
+void
+bar (i)
+{
+ baz (i);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2008-01-04-WideBitfield.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-01-04-WideBitfield.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-01-04-WideBitfield.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-01-04-WideBitfield.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,13 @@
+// RUN: %llvmgcc -S -o - %s
+// PR1386
+#include <stdint.h>
+
+struct X {
+ unsigned char pad : 4;
+ uint64_t a : 64;
+} __attribute__((packed)) x;
+
+uint64_t f(void)
+{
+ return x.a;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2008-01-07-UnusualIntSize.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-01-07-UnusualIntSize.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-01-07-UnusualIntSize.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-01-07-UnusualIntSize.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,11 @@
+// RUN: %llvmgcc %s -S -o - -O | grep {and.*8589934591}
+// PR1721
+
+struct s {
+ unsigned long long u33: 33;
+} a, b;
+
+// This should turn into a real 33-bit add, not a 64-bit add.
+_Bool test(void) {
+ return a.u33 + b.u33 != 0;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2008-01-11-ChainConsistency.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-01-11-ChainConsistency.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-01-11-ChainConsistency.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-01-11-ChainConsistency.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,3 @@
+// RUN: %llvmgcc -S %s -o - -fnested-functions | not grep nest
+
+void n1(void) { void a(void) { a(); } a(); }
Added: llvm/branches/non-call-eh/test/FrontendC/2008-01-21-PackedBitFields.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-01-21-PackedBitFields.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-01-21-PackedBitFields.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-01-21-PackedBitFields.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc %s -S -o -
+
+typedef double Al1Double __attribute__((aligned(1)));
+struct x { int a:23; Al1Double v; };
+struct x X = { 5, 3.0 };
+double foo() { return X.v; }
+
Added: llvm/branches/non-call-eh/test/FrontendC/2008-01-21-PackedStructField.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-01-21-PackedStructField.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-01-21-PackedStructField.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-01-21-PackedStructField.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,18 @@
+// RUN: %llvmgcc %s -S -o -
+
+struct X { long double b; unsigned char c; double __attribute__((packed)) d; };
+struct X x = { 3.0L, 5, 3.0 };
+
+
+struct S2504 {
+ int e:17;
+ __attribute__((packed)) unsigned long long int f;
+} ;
+int fails;
+ extern struct S2504 s2504;
+void check2504va (int z) {
+ struct S2504 arg, *p;
+ long long int i = 0;
+ arg.f = i;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2008-01-24-StructAlignAndBitFields.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-01-24-StructAlignAndBitFields.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-01-24-StructAlignAndBitFields.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-01-24-StructAlignAndBitFields.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,4 @@
+// RUN: %llvmgcc %s -S -o -
+
+struct U { char a; short b; int c:25; char d; } u;
+
Added: llvm/branches/non-call-eh/test/FrontendC/2008-01-25-ByValReadNone.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-01-25-ByValReadNone.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-01-25-ByValReadNone.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-01-25-ByValReadNone.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,15 @@
+// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | not grep readonly
+// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | not grep readnone
+
+
+// The struct being passed byval means that we cannot mark the
+// function readnone. Readnone would allow stores to the arg to
+// be deleted in the caller. We also don't allow readonly since
+// the callee might write to the byval parameter. The inliner
+// would have to assume the worse and introduce an explicit
+// temporary when inlining such a function, which is costly for
+// the common case in which the byval argument is not written.
+struct S { int A[1000]; };
+int __attribute__ ((const)) f(struct S x) { return x.A[0]; }
+int g(struct S x) __attribute__ ((pure));
+int h(struct S x) { return g(x); }
Added: llvm/branches/non-call-eh/test/FrontendC/2008-01-25-ZeroSizedAggregate.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-01-25-ZeroSizedAggregate.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-01-25-ZeroSizedAggregate.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-01-25-ZeroSizedAggregate.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,39 @@
+// RUN: %llvmgcc %s -S -o -
+
+// Aggregates of size zero should be dropped from argument list.
+typedef long int Tlong;
+struct S2411 {
+ __attribute__((aligned)) Tlong:0;
+};
+
+extern struct S2411 a2411[5];
+extern void checkx2411(struct S2411);
+void test2411(void) {
+ checkx2411(a2411[0]);
+}
+
+// Proper handling of zero sized fields during type conversion.
+typedef unsigned long long int Tal2ullong __attribute__((aligned(2)));
+struct S2525 {
+ Tal2ullong: 0;
+ struct {
+ } e;
+};
+struct S2525 s2525;
+
+struct {
+ signed char f;
+ char :0;
+ struct{}h;
+ char * i[5];
+} data;
+
+// Taking address of a zero sized field.
+struct Z {};
+struct Y {
+ int i;
+ struct Z z;
+};
+void *f(struct Y *y) {
+ return &y->z;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2008-01-28-PragmaMark.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-01-28-PragmaMark.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-01-28-PragmaMark.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-01-28-PragmaMark.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -Werror -c %s -o /dev/null
+#pragma mark LLVM's world
+#ifdef DO_ERROR
+#error LLVM's world
+#endif
+int i;
Added: llvm/branches/non-call-eh/test/FrontendC/2008-01-28-UnionSize.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-01-28-UnionSize.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-01-28-UnionSize.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-01-28-UnionSize.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,24 @@
+// RUN: %llvmgcc %s -S -o -
+// PR 1861
+
+typedef unsigned char __u8;
+typedef unsigned int __u32;
+typedef unsigned short u16;
+typedef __u32 __le32;
+struct bcm43xx_plcp_hdr6 {
+ union {
+ __le32 data;
+ __u8 raw[6];
+ }
+ __attribute__((__packed__));
+}
+ __attribute__((__packed__));
+struct bcm43xx_txhdr {
+ union {
+ struct {
+ struct bcm43xx_plcp_hdr6 plcp;
+ };
+ };
+}
+ __attribute__((__packed__));
+static void bcm43xx_generate_rts(struct bcm43xx_txhdr *txhdr ) { }
Added: llvm/branches/non-call-eh/test/FrontendC/2008-02-11-AnnotateBuiltin.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-02-11-AnnotateBuiltin.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-02-11-AnnotateBuiltin.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-02-11-AnnotateBuiltin.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc %s -S -o - | llvm-as | llvm-dis | grep llvm.annotation
+
+int main() {
+ int x = 0;
+ return __builtin_annotation(x, "annotate");
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2008-03-03-CtorAttrType.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-03-03-CtorAttrType.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-03-03-CtorAttrType.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-03-03-CtorAttrType.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc %s -S -emit-llvm -o - | grep llvm.global_ctors
+int __attribute__((constructor)) foo(void) {
+ return 0;
+}
+void __attribute__((constructor)) bar(void) {}
+
Added: llvm/branches/non-call-eh/test/FrontendC/2008-03-05-syncPtr.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-03-05-syncPtr.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-03-05-syncPtr.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-03-05-syncPtr.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,27 @@
+// RUN: %llvmgcc %s -S -emit-llvm -o - | grep llvm.atomic
+// XFAIL: sparc-sun-solaris2|arm|ia64
+// Feature currently implemented only for x86, alpha, powerpc.
+
+int* foo(int** a, int* b, int* c) {
+return __sync_val_compare_and_swap (a, b, c);
+}
+
+int foo2(int** a, int* b, int* c) {
+return __sync_bool_compare_and_swap (a, b, c);
+}
+
+int* foo3(int** a, int b) {
+ return __sync_fetch_and_add (a, b);
+}
+
+int* foo4(int** a, int b) {
+ return __sync_fetch_and_sub (a, b);
+}
+
+int* foo5(int** a, int* b) {
+ return __sync_lock_test_and_set (a, b);
+}
+
+int* foo6(int** a, int*** b) {
+ return __sync_lock_test_and_set (a, b);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2008-03-24-BitField-And-Alloca.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-03-24-BitField-And-Alloca.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-03-24-BitField-And-Alloca.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-03-24-BitField-And-Alloca.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,88 @@
+// RUN: %llvmgcc -S --emit-llvm %s -o - | not grep "\{ i8, .7 x i8. \}"
+// RUN: %llvmgcc -O2 -S %s -o - | not grep alloca
+enum {
+ PP_C,
+ PP_D,
+ PP_R,
+ PP_2D,
+ PP_1D,
+ PP_SR,
+ PP_S2D,
+ PP_S1D,
+ PP_SC
+};
+
+enum {
+ G_VP,
+ G_FP,
+ G_VS,
+ G_GS,
+ G_FS
+};
+
+enum {
+ G_NONE,
+ G_B,
+ G_R
+};
+
+typedef union _Key {
+ struct {
+ unsigned int count : 2;
+ unsigned int Aconst : 1;
+ unsigned int Bconst : 1;
+ unsigned int Cconst : 1;
+ unsigned int Xused : 1;
+ unsigned int Yused : 1;
+ unsigned int Zused : 1;
+ unsigned int Wused : 1;
+ unsigned int ttype : 3;
+ unsigned int scalar : 1;
+ unsigned int AType : 4;
+ unsigned int BType : 4;
+ unsigned int CType : 4;
+ unsigned int RType : 4;
+ unsigned int Size : 2;
+ unsigned int prec : 1;
+
+ unsigned int ASize : 2;
+ unsigned int BSize : 2;
+ unsigned int CSize : 2;
+ unsigned int tTex : 4;
+ unsigned int proj : 1;
+ unsigned int lod : 2;
+ unsigned int dvts : 1;
+ unsigned int uipad : 18;
+ } key_io;
+ struct {
+ unsigned int key0;
+ unsigned int key1;
+ } key;
+ unsigned long long lkey;
+} Key;
+
+static inline __attribute__ ((always_inline)) void foo(const Key iospec, int* ret)
+{
+ *ret=0;
+ if(((iospec.key_io.lod == G_B) &&
+ (iospec.key_io.ttype != G_VS) &&
+ (iospec.key_io.ttype != G_GS) &&
+ (iospec.key_io.ttype != G_FS)) ||
+
+ (((iospec.key_io.tTex == PP_C) ||
+ (iospec.key_io.tTex == PP_SC)) &&
+ ((iospec.key_io.tTex == PP_SR) ||
+ (iospec.key_io.tTex == PP_S2D) ||
+ (iospec.key_io.tTex == PP_S1D) ||
+ (iospec.key_io.tTex == PP_SC))))
+ *ret=1;
+}
+
+
+extern int bar(unsigned long long key_token2)
+{
+ int ret;
+ __attribute__ ((unused)) Key iospec = (Key) key_token2;
+ foo(iospec, &ret);
+ return ret;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2008-03-26-PackedBitFields.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-03-26-PackedBitFields.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-03-26-PackedBitFields.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-03-26-PackedBitFields.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc %s -S -o -
+
+
+struct S1757 {
+ long double c;
+ long int __attribute__((packed)) e:28;
+} x;
Added: llvm/branches/non-call-eh/test/FrontendC/2008-04-08-NoExceptions.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-04-08-NoExceptions.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-04-08-NoExceptions.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-04-08-NoExceptions.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,7 @@
+// RUN: %llvmgcc -S -o - %s | grep nounwind | count 2
+// RUN: %llvmgcc -S -o - %s | not grep {declare.*nounwind}
+
+void f(void);
+void g(void) {
+ f();
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2008-05-06-CFECrash.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-05-06-CFECrash.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-05-06-CFECrash.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-05-06-CFECrash.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,4 @@
+// RUN: %llvmgcc -S -O2 %s -o /dev/null
+// PR2292.
+__inline__ __attribute__ ((__pure__)) int g (void) {}
+void f (int k) { k = g (); }
Added: llvm/branches/non-call-eh/test/FrontendC/2008-05-12-TempUsedBeforeDef.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-05-12-TempUsedBeforeDef.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-05-12-TempUsedBeforeDef.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-05-12-TempUsedBeforeDef.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -w -S -o /dev/null %s
+// PR2264.
+unsigned foo = 8L;
+unsigned bar = 0L;
+volatile unsigned char baz = 6L;
+int test() {
+ char qux = 1L;
+ for (; baz >= -29; baz--)
+ bork(bar && foo, qux);
+}
Added: llvm/branches/non-call-eh/test/FrontendC/2008-05-19-AlwaysInline.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/2008-05-19-AlwaysInline.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/2008-05-19-AlwaysInline.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/2008-05-19-AlwaysInline.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc %s -S -fno-unit-at-a-time -emit-llvm -O0 -o - | not grep sabrina
+// RUN: %llvmgcc %s -S -funit-at-a-time -emit-llvm -O0 -o - | not grep sabrina
+
+static inline int sabrina (void) __attribute__((always_inline));
+static inline int sabrina (void)
+{
+ return 13;
+}
+int bar (void)
+{
+ return sabrina () + 68;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/BasicInstrs.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/BasicInstrs.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/BasicInstrs.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/BasicInstrs.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,26 @@
+// This file can be used to see what a native C compiler is generating for a
+// variety of interesting operations.
+//
+// RUN: %llvmgcc -S %s -o - | llvm-as | llc
+
+unsigned int udiv(unsigned int X, unsigned int Y) {
+ return X/Y;
+}
+int sdiv(int X, int Y) {
+ return X/Y;
+}
+unsigned int urem(unsigned int X, unsigned int Y) {
+ return X%Y;
+}
+int srem(int X, int Y) {
+ return X%Y;
+}
+
+_Bool setlt(int X, int Y) {
+ return X < Y;
+}
+
+_Bool setgt(int X, int Y) {
+ return X > Y;
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/attribute_constructor.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/attribute_constructor.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/attribute_constructor.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/attribute_constructor.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc %s -c -o - | llvm-dis | grep llvm.global_ctors
+
+void foo() __attribute__((constructor));
+void foo() {
+ bar();
+}
Added: llvm/branches/non-call-eh/test/FrontendC/block-copy.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/block-copy.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/block-copy.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/block-copy.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,20 @@
+/* RUN: %llvmgcc %s -S -o - -emit-llvm -O3 | grep {call.*memcpy}
+
+ This should compile into a memcpy from a global, not 128 stores. */
+
+
+
+void foo();
+
+float bar() {
+ float lookupTable[] = {-1,-1,-1,0, -1,-1,0,-1, -1,-1,0,1, -1,-1,1,0,
+ -1,0,-1,-1, -1,0,-1,1, -1,0,1,-1, -1,0,1,1,
+ -1,1,-1,0, -1,1,0,-1, -1,1,0,1, -1,1,1,0,
+ 0,-1,-1,-1, 0,-1,-1,1, 0,-1,1,-1, 0,-1,1,1,
+ 1,-1,-1,0, 1,-1,0,-1, 1,-1,0,1, 1,-1,1,0,
+ 1,0,-1,-1, 1,0,-1,1, 1,0,1,-1, 1,0,1,1,
+ 1,1,-1,0, 1,1,0,-1, 1,1,0,1, 1,1,1,0,
+ 0,1,-1,-1, 0,1,-1,1, 0,1,1,-1, 0,1,1,1};
+ foo(lookupTable);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/dg.exp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/dg.exp (added)
+++ llvm/branches/non-call-eh/test/FrontendC/dg.exp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,5 @@
+load_lib llvm.exp
+
+if [ llvm_gcc_supports c ] then {
+ RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
+}
Added: llvm/branches/non-call-eh/test/FrontendC/exact-div-expr.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/exact-div-expr.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/exact-div-expr.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/exact-div-expr.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: %llvmgcc -S %s -o - -O1 | grep ashr
+// RUN: %llvmgcc -S %s -o - -O1 | not grep sdiv
+
+long long test(int *A, int *B) {
+ return A-B;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/extern-weak.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/extern-weak.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/extern-weak.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/extern-weak.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep extern_weak
+// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | llvm-as | llc
+
+#if !defined(__linux__) && !defined(__FreeBSD__) && \
+ !defined(__OpenBSD__) && !defined(__CYGWIN__) && !defined(__DragonFly__)
+void foo() __attribute__((weak_import));
+#else
+void foo() __attribute__((weak));
+#endif
+
+void bar() { foo(); }
+
Added: llvm/branches/non-call-eh/test/FrontendC/funccall.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/funccall.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/funccall.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/funccall.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,17 @@
+
+static int q;
+
+void foo() {
+ int t = q;
+ q = t + 1;
+}
+int main() {
+ q = 0;
+ foo();
+ q = q - 1;
+
+ return q;
+}
+
+// This is the source that corresponds to funccall.ll
+// RUN: echo foo
Added: llvm/branches/non-call-eh/test/FrontendC/hidden-visibility.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/hidden-visibility.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/hidden-visibility.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/hidden-visibility.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,3 @@
+// RUN: %llvmgcc %s -emit-llvm -S -o - | grep {hidden global}
+
+int X __attribute__ ((__visibility__ ("hidden"))) = 123;
Added: llvm/branches/non-call-eh/test/FrontendC/inline-asm-mrv.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/inline-asm-mrv.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/inline-asm-mrv.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/inline-asm-mrv.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// RUN: %llvmgcc -S %s -o - -O | not grep alloca
+// PR2094
+
+int sad16_sse2(void *v, unsigned char *blk2, unsigned char *blk1,
+ int stride, int h) {
+ int ret;
+ asm volatile( "%0 %1 %2 %3"
+ : "+r" (h), "+r" (blk1), "+r" (blk2)
+ : "r" ((long)stride));
+ asm volatile("set %0 %1" : "=r"(ret) : "r"(blk1));
+ return ret;
+}
Added: llvm/branches/non-call-eh/test/FrontendC/libcalls.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/libcalls.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/libcalls.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/libcalls.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+// llvm-gcc -O1+ should run simplify libcalls, O0 shouldn't
+// and -fno-builtins shouldn't.
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep {call.*exp2f}
+// RUN: %llvmgcc %s -S -emit-llvm -O1 -o - | grep {call.*ldexp}
+// RUN: %llvmgcc %s -S -emit-llvm -O3 -fno-builtin -o - | grep {call.*exp2f}
+
+float exp2f(float);
+
+float t4(unsigned char x) {
+ return exp2f(x);
+}
+
Added: llvm/branches/non-call-eh/test/FrontendC/nested-functions.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/nested-functions.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/nested-functions.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/nested-functions.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,18 @@
+// RUN: %llvmgcc -S %s -o - -fnested-functions
+// PR1274
+
+void Bork() {
+ void Fork(const int *src, int size) {
+ int i = 1;
+ int x;
+
+ while (i < size)
+ x = src[i];
+ }
+}
+
+void foo(void *a){
+ inline void foo_bar() {
+ a += 1;
+ }
+}
Added: llvm/branches/non-call-eh/test/FrontendC/sret.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/sret.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/sret.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/sret.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,15 @@
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep sret | count 5
+
+struct abc {
+ long a;
+ long b;
+ long c;
+};
+
+struct abc foo1(void);
+struct abc foo2();
+
+void bar() {
+ struct abc dummy1 = foo1();
+ struct abc dummy2 = foo2();
+}
Added: llvm/branches/non-call-eh/test/FrontendC/sret2.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/sret2.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/sret2.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/sret2.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep sret | count 2
+
+struct abc {
+ long a;
+ long b;
+ long c;
+};
+
+struct abc foo2(){}
Added: llvm/branches/non-call-eh/test/FrontendC/unaligned-memcpy.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendC/unaligned-memcpy.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendC/unaligned-memcpy.c (added)
+++ llvm/branches/non-call-eh/test/FrontendC/unaligned-memcpy.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,5 @@
+// RUN: %llvmgcc %s -S -emit-llvm -o - | llvm-as | llc
+
+void bork() {
+ char Qux[33] = {0};
+}
Added: llvm/branches/non-call-eh/test/FrontendFortran/cpow.f90
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendFortran/cpow.f90?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendFortran/cpow.f90 (added)
+++ llvm/branches/non-call-eh/test/FrontendFortran/cpow.f90 Sun Jul 6 15:45:41 2008
@@ -0,0 +1,18 @@
+! RUN: %llvmgcc -c %s
+! PR2443
+
+! Program to test the power (**) operator
+program testpow
+ implicit none
+ real(kind=4) r, s, two
+ real(kind=8) :: q
+ complex(kind=4) :: c, z
+ real, parameter :: del = 0.0001
+ integer i, j
+
+ two = 2.0
+
+ c = (2.0, 3.0)
+ c = c ** two
+ if (abs(c - (-5.0, 12.0)) .gt. del) call abort
+end program
Added: llvm/branches/non-call-eh/test/FrontendFortran/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendFortran/dg.exp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendFortran/dg.exp (added)
+++ llvm/branches/non-call-eh/test/FrontendFortran/dg.exp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+load_lib llvm.exp
+
+if [ llvm_gcc_supports fortran ] then {
+ RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{f,f90}]]
+}
+
Modified: llvm/branches/non-call-eh/test/FrontendObjC/2007-10-03-MetadataPointers.mm
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/FrontendObjC/2007-10-03-MetadataPointers.mm?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/FrontendObjC/2007-10-03-MetadataPointers.mm (original)
+++ llvm/branches/non-call-eh/test/FrontendObjC/2007-10-03-MetadataPointers.mm Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-// RUN: %llvmgcc -x objective-c++ -c %s -o /dev/null
+// RUN: %llvmgcc -w -x objective-c++ -c %s -o /dev/null
@class NSImage;
void bork() {
Modified: llvm/branches/non-call-eh/test/Integer/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Integer/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Integer/dg.exp (original)
+++ llvm/branches/non-call-eh/test/Integer/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Modified: llvm/branches/non-call-eh/test/Integer/packed_struct_bt.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Integer/packed_struct_bt.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Integer/packed_struct_bt.ll (original)
+++ llvm/branches/non-call-eh/test/Integer/packed_struct_bt.ll Sun Jul 6 15:45:41 2008
@@ -2,7 +2,7 @@
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
; RUN: not grep cast %t2.ll
-; RUN: grep {\<\{} %t2.ll
+; RUN: grep {\\}>} %t2.ll
; END.
%struct.anon = type <{ i8, i35, i35, i35 }>
Propchange: llvm/branches/non-call-eh/test/LLVMC/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Jul 6 15:45:41 2008
@@ -0,0 +1 @@
+Output
Added: llvm/branches/non-call-eh/test/LLVMC/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/LLVMC/dg.exp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/LLVMC/dg.exp (added)
+++ llvm/branches/non-call-eh/test/LLVMC/dg.exp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,10 @@
+load_lib llvm.exp
+
+if [ llvm_gcc_supports c ] then {
+ RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{c}]]
+}
+
+if [ llvm_gcc_supports c++ ] then {
+ RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{cpp}]]
+}
+
Added: llvm/branches/non-call-eh/test/LLVMC/false.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/LLVMC/false.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/LLVMC/false.c (added)
+++ llvm/branches/non-call-eh/test/LLVMC/false.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+// Test that we can compile .c files as C++ and vice versa
+// RUN: llvmc2 -x c++ %s -x c %p/test_data/false.cpp -x lisp -x whatnot -x none %p/test_data/false2.cpp -o %t
+// RUN: ./%t | grep hello
+
+#include <iostream>
+
+extern "C" void test();
+extern std::string test2();
+
+int main() {
+ std::cout << "h";
+ test();
+ std::cout << test2() << '\n';
+}
Added: llvm/branches/non-call-eh/test/LLVMC/hello.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/LLVMC/hello.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/LLVMC/hello.c (added)
+++ llvm/branches/non-call-eh/test/LLVMC/hello.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+/*
+ * Check that we can compile helloworld
+ * RUN: llvmc2 %s -o %t
+ * RUN: ./%t | grep hello
+ */
+
+#include <stdio.h>
+
+int main() {
+ printf("hello\n");
+ return 0;
+}
Added: llvm/branches/non-call-eh/test/LLVMC/hello.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/LLVMC/hello.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/LLVMC/hello.cpp (added)
+++ llvm/branches/non-call-eh/test/LLVMC/hello.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+// Test that we can compile C++ code.
+// RUN: llvmc2 %s -o %t
+// RUN: ./%t | grep hello
+#include <iostream>
+
+int main() {
+ std::cout << "hello" << '\n';
+}
Added: llvm/branches/non-call-eh/test/LLVMC/opt-test.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/LLVMC/opt-test.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/LLVMC/opt-test.c (added)
+++ llvm/branches/non-call-eh/test/LLVMC/opt-test.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+/*
+ * Check that the -opt switch works.
+ * RUN: llvmc2 %s -opt -o %t
+ * RUN: ./%t | grep hello
+ */
+
+#include <stdio.h>
+
+int main() {
+ printf("hello\n");
+ return 0;
+}
Added: llvm/branches/non-call-eh/test/LLVMC/sink.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/LLVMC/sink.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/LLVMC/sink.c (added)
+++ llvm/branches/non-call-eh/test/LLVMC/sink.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+/*
+ * Check that the 'sink' options work.
+ * RUN: llvmc2 -v -Wall %s -o %t |& grep "Wall"
+ * RUN: ./%t | grep hello
+ */
+
+#include <stdio.h>
+
+int main() {
+ printf("hello\n");
+ return 0;
+}
Added: llvm/branches/non-call-eh/test/LLVMC/test_data/false.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/LLVMC/test_data/false.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/LLVMC/test_data/false.cpp (added)
+++ llvm/branches/non-call-eh/test/LLVMC/test_data/false.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,17 @@
+/* RUN: ignore */
+#include <stdio.h>
+
+/* Make this invalid C++ */
+typedef struct {
+ int i;
+ char c;
+} a;
+
+static a b = { .i = 65, .c = 'r'};
+
+void test() {
+ b.i = 9;
+ fflush(stdout);
+ printf("el");
+}
+
Added: llvm/branches/non-call-eh/test/LLVMC/test_data/false2.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/LLVMC/test_data/false2.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/LLVMC/test_data/false2.cpp (added)
+++ llvm/branches/non-call-eh/test/LLVMC/test_data/false2.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,6 @@
+// RUN: ignore
+#include <string>
+
+std::string test2() {
+ return "lo";
+}
Added: llvm/branches/non-call-eh/test/LLVMC/test_data/together.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/LLVMC/test_data/together.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/LLVMC/test_data/together.c (added)
+++ llvm/branches/non-call-eh/test/LLVMC/test_data/together.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+/*
+ * RUN: ignore
+ */
+
+#include <stdio.h>
+
+void test() {
+ printf("hello\n");
+}
Added: llvm/branches/non-call-eh/test/LLVMC/together.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/LLVMC/together.cpp?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/LLVMC/together.cpp (added)
+++ llvm/branches/non-call-eh/test/LLVMC/together.cpp Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+// Check that we can compile files of different types together.
+// RUN: llvmc2 %s %p/test_data/together.c -o %t
+// RUN: ./%t | grep hello
+
+extern "C" void test();
+
+int main() {
+ test();
+}
Added: llvm/branches/non-call-eh/test/LLVMC/wall.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/LLVMC/wall.c?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/LLVMC/wall.c (added)
+++ llvm/branches/non-call-eh/test/LLVMC/wall.c Sun Jul 6 15:45:41 2008
@@ -0,0 +1,12 @@
+/*
+ * Check that -Wall works as intended
+ * RUN: llvmc2 -Wall %s -o %t
+ * RUN: ./%t | grep hello
+ */
+
+#include <stdio.h>
+
+int main() {
+ printf("hello\n");
+ return 0;
+}
Modified: llvm/branches/non-call-eh/test/Linker/2003-01-30-LinkerRename.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Linker/2003-01-30-LinkerRename.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Linker/2003-01-30-LinkerRename.ll (original)
+++ llvm/branches/non-call-eh/test/Linker/2003-01-30-LinkerRename.ll Sun Jul 6 15:45:41 2008
@@ -2,7 +2,7 @@
; one...
; RUN: echo {define internal i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc
-; RUN: llvm-as < %s -o %t.2.bc -f
+; RUN: llvm-as %s -o %t.2.bc -f
; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep @foo() | grep -v internal
define i32 @foo() { ret i32 0 }
Modified: llvm/branches/non-call-eh/test/Linker/2003-04-21-Linkage.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Linker/2003-04-21-Linkage.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Linker/2003-04-21-Linkage.ll (original)
+++ llvm/branches/non-call-eh/test/Linker/2003-04-21-Linkage.ll Sun Jul 6 15:45:41 2008
@@ -1,6 +1,6 @@
; RUN: echo {@X = linkonce global i32 5 \
; RUN: define linkonce i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc
-; RUN: llvm-as < %s -o %t.2.bc -f
+; RUN: llvm-as %s -o %t.2.bc -f
; RUN: llvm-link %t.1.bc %t.2.bc
@X = external global i32
Modified: llvm/branches/non-call-eh/test/Linker/2003-04-23-LinkOnceLost.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Linker/2003-04-23-LinkOnceLost.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Linker/2003-04-23-LinkOnceLost.ll (original)
+++ llvm/branches/non-call-eh/test/Linker/2003-04-23-LinkOnceLost.ll Sun Jul 6 15:45:41 2008
@@ -3,7 +3,7 @@
; RUN: echo { define linkonce void @foo() \{ ret void \} } | \
; RUN: llvm-as -o %t.2.bc -f
-; RUN: llvm-as < %s -o %t.1.bc -f
+; RUN: llvm-as %s -o %t.1.bc -f
; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep foo | grep linkonce
declare void @foo()
Modified: llvm/branches/non-call-eh/test/Linker/2003-04-26-NullPtrLinkProblem.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Linker/2003-04-26-NullPtrLinkProblem.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Linker/2003-04-26-NullPtrLinkProblem.ll (original)
+++ llvm/branches/non-call-eh/test/Linker/2003-04-26-NullPtrLinkProblem.ll Sun Jul 6 15:45:41 2008
@@ -2,7 +2,7 @@
; the same type to be created!
; RUN: echo {%T = type i32} | llvm-as > %t.2.bc
-; RUN: llvm-as < %s -f > %t.1.bc
+; RUN: llvm-as %s -f -o %t.1.bc
; RUN: llvm-link %t.1.bc %t.2.bc
%T = type opaque
Modified: llvm/branches/non-call-eh/test/Linker/2003-05-31-LinkerRename.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Linker/2003-05-31-LinkerRename.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Linker/2003-05-31-LinkerRename.ll (original)
+++ llvm/branches/non-call-eh/test/Linker/2003-05-31-LinkerRename.ll Sun Jul 6 15:45:41 2008
@@ -6,7 +6,7 @@
; RUN: echo { define internal i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc
; RUN: llvm-as < %s > %t.2.bc
-; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep internal | not grep %foo(
+; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep internal | not grep @foo(
declare i32 @foo()
Modified: llvm/branches/non-call-eh/test/Linker/2003-10-21-ConflictingTypesTolerance.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Linker/2003-10-21-ConflictingTypesTolerance.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Linker/2003-10-21-ConflictingTypesTolerance.ll (original)
+++ llvm/branches/non-call-eh/test/Linker/2003-10-21-ConflictingTypesTolerance.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,6 @@
; RUN: llvm-as < %s > %t.out1.bc
; RUN: echo { %S = type \[8 x i32\] external global %S } | llvm-as > %t.out2.bc
-; RUN: llvm-link %t.out1.bc %t.out2.bc | llvm-dis | grep %S | grep \{
-
+; RUN: llvm-link %t.out1.bc %t.out2.bc | llvm-dis | grep %S | grep \\{
%S = type { i32 }
Modified: llvm/branches/non-call-eh/test/Linker/2004-05-07-TypeResolution1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Linker/2004-05-07-TypeResolution1.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Linker/2004-05-07-TypeResolution1.ll (original)
+++ llvm/branches/non-call-eh/test/Linker/2004-05-07-TypeResolution1.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t1.bc
+; RUN: llvm-as %s -f -o %t1.bc
; RUN: llvm-as < %p/2004-05-07-TypeResolution2.ll -o %t2.bc -f
; RUN: llvm-link -f -o %t3.bc %t1.bc %t2.bc
Modified: llvm/branches/non-call-eh/test/Linker/2004-12-03-DisagreeingType.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Linker/2004-12-03-DisagreeingType.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Linker/2004-12-03-DisagreeingType.ll (original)
+++ llvm/branches/non-call-eh/test/Linker/2004-12-03-DisagreeingType.ll Sun Jul 6 15:45:41 2008
@@ -1,7 +1,7 @@
; RUN: echo {@G = weak global \{\{\{\{double\}\}\}\} zeroinitializer } | \
; RUN: llvm-as > %t.out2.bc
; RUN: llvm-as < %s > %t.out1.bc
-; RUN: llvm-link %t.out1.bc %t.out2.bc | llvm-dis | not grep {\}}
+; RUN: llvm-link %t.out1.bc %t.out2.bc | llvm-dis | not grep {\\}}
; When linked, the global above should be eliminated, being merged with the
; global below.
Modified: llvm/branches/non-call-eh/test/Linker/2006-01-19-ConstantPacked.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Linker/2006-01-19-ConstantPacked.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Linker/2006-01-19-ConstantPacked.ll (original)
+++ llvm/branches/non-call-eh/test/Linker/2006-01-19-ConstantPacked.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s -f -o %t1.bc
+; RUN: llvm-as %s -f -o %t1.bc
; RUN: llvm-link -f -o %t2.bc %t1.bc
target datalayout = "E-p:32:32"
Added: llvm/branches/non-call-eh/test/Linker/2008-06-13-LinkOnceRedefinition.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Linker/2008-06-13-LinkOnceRedefinition.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Linker/2008-06-13-LinkOnceRedefinition.ll (added)
+++ llvm/branches/non-call-eh/test/Linker/2008-06-13-LinkOnceRedefinition.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,8 @@
+; Test linking two functions with different prototypes and two globals
+; in different modules.
+; RUN: llvm-as %s -o %t.foo1.bc -f
+; RUN: llvm-as %s -o %t.foo2.bc -f
+; RUN: echo {define linkonce void @foo(i32 %x) { ret void }} | llvm-as -o %t.foo3.bc -f
+; RUN: llvm-link %t.foo1.bc %t.foo2.bc | llvm-dis
+; RUN: llvm-link %t.foo1.bc %t.foo3.bc | llvm-dis
+define linkonce void @foo() { ret void }
Added: llvm/branches/non-call-eh/test/Linker/2008-06-26-AddressSpace.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Linker/2008-06-26-AddressSpace.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Linker/2008-06-26-AddressSpace.ll (added)
+++ llvm/branches/non-call-eh/test/Linker/2008-06-26-AddressSpace.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,9 @@
+; Test linking two functions with different prototypes and two globals
+; in different modules.
+; RUN: llvm-as %s -o %t.foo1.bc -f
+; RUN: echo | llvm-as -o %t.foo2.bc -f
+; RUN: llvm-link %t.foo2.bc %t.foo1.bc | llvm-dis | grep {addrspace(2)}
+; RUN: llvm-link %t.foo1.bc %t.foo2.bc | llvm-dis | grep {addrspace(2)}
+; rdar://6038021
+
+ at G = global i32 256 addrspace(2)
Modified: llvm/branches/non-call-eh/test/Linker/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Linker/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Linker/dg.exp (original)
+++ llvm/branches/non-call-eh/test/Linker/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
Modified: llvm/branches/non-call-eh/test/Linker/link-archive.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Linker/link-archive.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Linker/link-archive.ll (original)
+++ llvm/branches/non-call-eh/test/Linker/link-archive.ll Sun Jul 6 15:45:41 2008
@@ -3,8 +3,8 @@
; RUN: llvm-as %s -o %t.bar.bc -f
; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \
; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc -f
-; RUN: llvm-ar rf %t.foo.a %t.foo.bc
-; RUN: llvm-ar rf %t.bar.a %t.bar.bc
+; RUN: llvm-ar rcf %t.foo.a %t.foo.bc
+; RUN: llvm-ar rcf %t.bar.a %t.bar.bc
; RUN: llvm-ld -disable-opt %t.bar.bc %t.foo.a -o %t.bc
; RUN: llvm-ld -disable-opt %t.foo.bc %t.bar.a -o %t.bc
declare i32* @foo(...)
Modified: llvm/branches/non-call-eh/test/Linker/redefinition.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Linker/redefinition.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Linker/redefinition.ll (original)
+++ llvm/branches/non-call-eh/test/Linker/redefinition.ll Sun Jul 6 15:45:41 2008
@@ -6,5 +6,5 @@
; RUN: not llvm-link %t.foo1.bc %t.foo2.bc -o %t.bc |& \
; RUN: grep {Function is already defined}
; RUN: not llvm-link %t.foo1.bc %t.foo3.bc -o %t.bc |& \
-; RUN: grep {Function 'foo' defined as both}
+; RUN: grep {Function is already defined}
define void @foo() { ret void }
Modified: llvm/branches/non-call-eh/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Makefile?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Makefile (original)
+++ llvm/branches/non-call-eh/test/Makefile Sun Jul 6 15:45:41 2008
@@ -98,8 +98,8 @@
@echo 'set compile_c "$(CC) $(CPP.Flags) $(CompileCommonOpts) -c "' >>site.tmp
@echo 'set compile_cxx "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) -c"' >> site.tmp
@echo 'set link "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) $(LD.Flags)"' >>site.tmp
- @echo 'set llvmgcc "$(LLVMGCC)"' >> site.tmp
- @echo 'set llvmgxx "$(LLVMGCC)"' >> site.tmp
+ @echo 'set llvmgcc "$(LLVMGCC) $(EXTRA_OPTIONS)"' >> site.tmp
+ @echo 'set llvmgxx "$(LLVMGCC) $(EXTRA_OPTIONS)"' >> site.tmp
@echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
@echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp
@echo 'set ocamlc "$(OCAMLC) -cc $(CXX) -I $(LibDir)/ocaml"' >> site.tmp
Modified: llvm/branches/non-call-eh/test/Other/2007-06-05-PassID.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Other/2007-06-05-PassID.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Other/2007-06-05-PassID.ll (original)
+++ llvm/branches/non-call-eh/test/Other/2007-06-05-PassID.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-;RUN: llvm-as < %s | opt -analyze -print-cfg-only -disable-output
+;RUN: llvm-as < %s | opt -analyze -print-cfg-only -disable-output 2>/dev/null
;PR 1497
define void @foo() {
Modified: llvm/branches/non-call-eh/test/Other/2007-06-16-Funcname.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Other/2007-06-16-Funcname.ll?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Other/2007-06-16-Funcname.ll (original)
+++ llvm/branches/non-call-eh/test/Other/2007-06-16-Funcname.ll Sun Jul 6 15:45:41 2008
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llvm2cpp -funcname=WAKKA | not grep makeLLVMModule
+; RUN: llvm-as < %s | llc -march=cpp -cppfname=WAKKA | not grep makeLLVMModule
; PR1515
define void @foo() {
Added: llvm/branches/non-call-eh/test/Other/2008-06-04-FieldSizeInPacked.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Other/2008-06-04-FieldSizeInPacked.ll?rev=53163&view=auto
==============================================================================
--- llvm/branches/non-call-eh/test/Other/2008-06-04-FieldSizeInPacked.ll (added)
+++ llvm/branches/non-call-eh/test/Other/2008-06-04-FieldSizeInPacked.ll Sun Jul 6 15:45:41 2008
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep true
+
+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"
+target triple = "x86_64-unknown-linux-gnu"
+ %packed = type <{ x86_fp80, i8 }>
+ %unpacked = type { x86_fp80, i8 }
+
+define i1 @q() nounwind {
+entry:
+ %char_p = getelementptr %packed* null, i32 0, i32 1 ; <i8*> [#uses=1]
+ %char_u = getelementptr %unpacked* null, i32 0, i32 1 ; <i8*> [#uses=1]
+ %res = icmp eq i8* %char_p, %char_u ; <i1> [#uses=1]
+ ret i1 %res
+}
Modified: llvm/branches/non-call-eh/test/Other/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/test/Other/dg.exp?rev=53163&r1=53162&r2=53163&view=diff
==============================================================================
--- llvm/branches/non-call-eh/test/Other/dg.exp (original)
+++ llvm/branches/non-call-eh/test/Other/dg.exp Sun Jul 6 15:45:41 2008
@@ -1,3 +1,3 @@
load_lib llvm.exp
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]]
More information about the llvm-commits
mailing list