[llvm-commits] CVS: llvm/projects/Stacker/test/Makefile
Changes in directory llvm/projects/Stacker/test: Makefile updated: 1.10 -> 1.11 --- Log message: Update for llvm-gcc4 build. --- Diffs of the changes: (+1 -1) Makefile |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/projects/Stacker/test/Makefile diff -u llvm/projects/Stacker/test/Makefile:1.10 llvm/projects/Stacker/test/Makefile:1.11 --- llvm/projects/Stacker/test/Makefile:1.10Mon Feb 14 10:04:28 2005 +++ llvm/projects/Stacker/test/Makefile Wed Dec 13 02:03:25 2006 @@ -42,7 +42,7 @@ % : %.st Makefile testing.bc $(Echo) "Building $*" - $(Verb)$(LLVMC) -O4 -o $@ $< testing.bc $(LibDir)/stkr_runtime.bc -lcrtend + $(Verb)$(LLVMC) -O4 -o $@ $< testing.bc -L$(LibDir) testing.bc : testing.st Makefile $(Echo) "Compiling $*" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolutionExpander.cpp
Changes in directory llvm/lib/Analysis: ScalarEvolutionExpander.cpp updated: 1.9 -> 1.10 --- Log message: Change the interface to SCEVExpander::InsertCastOfTo to take a cast opcode so the decision of which opcode to use is pushed upward to the caller. Adjust the callers to pass the expected opcode. --- Diffs of the changes: (+2 -19) ScalarEvolutionExpander.cpp | 21 ++--- 1 files changed, 2 insertions(+), 19 deletions(-) Index: llvm/lib/Analysis/ScalarEvolutionExpander.cpp diff -u llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.9 llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.10 --- llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.9 Tue Dec 12 17:36:14 2006 +++ llvm/lib/Analysis/ScalarEvolutionExpander.cpp Wed Dec 13 02:06:42 2006 @@ -19,25 +19,8 @@ /// InsertCastOfTo - Insert a cast of V to the specified type, doing what /// we can to share the casts. -Value *SCEVExpander::InsertCastOfTo(Value *V, const Type *Ty) { - // Compute the Cast opcode to use - Instruction::CastOps opcode = Instruction::BitCast; - if (Ty->isIntegral()) { -if (V->getType()->getTypeID() == Type::PointerTyID) - opcode = Instruction::PtrToInt; -else { - unsigned SrcBits = V->getType()->getPrimitiveSizeInBits(); - unsigned DstBits = Ty->getPrimitiveSizeInBits(); - opcode = (SrcBits > DstBits ? Instruction::Trunc : -(SrcBits == DstBits ? Instruction::BitCast : - (V->getType()->isSigned() ? Instruction::SExt : - Instruction::ZExt))); -} - } else if (Ty->isFloatingPoint()) -opcode = Instruction::UIToFP; - else if (Ty->getTypeID() == Type::PointerTyID && V->getType()->isIntegral()) -opcode = Instruction::IntToPtr; - +Value *SCEVExpander::InsertCastOfTo(Instruction::CastOps opcode, Value *V, +const Type *Ty) { // FIXME: keep track of the cast instruction. if (Constant *C = dyn_cast(V)) return ConstantExpr::getCast(opcode, C, Ty); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvmc/Makefile
Changes in directory llvm/tools/llvmc: Makefile updated: 1.22 -> 1.23 --- Log message: Ressurrect the Stacker "st" configuration. Someday this will all go away, but until then Stacker needs its configuration. --- Diffs of the changes: (+1 -1) Makefile |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/llvmc/Makefile diff -u llvm/tools/llvmc/Makefile:1.22 llvm/tools/llvmc/Makefile:1.23 --- llvm/tools/llvmc/Makefile:1.22 Mon Sep 4 00:59:09 2006 +++ llvm/tools/llvmc/Makefile Wed Dec 13 02:09:48 2006 @@ -9,7 +9,7 @@ LEVEL = ../.. TOOLNAME = llvmc LINK_COMPONENTS = support system -CONFIG_FILES = c cpp ll +CONFIG_FILES = c cpp ll st EXTRA_DIST = c cpp ll ConfigLexer.cpp.cvs ConfigLexer.l.cvs REQUIRES_EH := 1 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
Changes in directory llvm/lib/Transforms/IPO: SimplifyLibCalls.cpp updated: 1.75 -> 1.76 --- Log message: Fix some casts. isdigit(c) returns 0 or 1, not 0 or -1 --- Diffs of the changes: (+3 -3) SimplifyLibCalls.cpp |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.75 llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.76 --- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.75 Tue Dec 12 18:50:17 2006 +++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cppWed Dec 13 02:04:32 2006 @@ -1747,7 +1747,7 @@ SetCondInst* setcond_inst = new SetCondInst(Instruction::SetLE,sub_inst, ConstantInt::get(Type::UIntTy,9), ci->getOperand(1)->getName()+".cmp",ci); -CastInst* c2 = new SExtInst(setcond_inst, Type::IntTy, +CastInst* c2 = new ZExtInst(setcond_inst, Type::IntTy, ci->getOperand(1)->getName()+".isdigit", ci); ci->replaceAllUsesWith(c2); ci->eraseFromParent(); @@ -1873,7 +1873,7 @@ Value *V = CastInst::createIntegerCast(TheCall->getOperand(1), ArgType, false/*ZExt*/, "tmp", TheCall); Value *V2 = new CallInst(F, V, "tmp", TheCall); -V2 = CastInst::createIntegerCast(V2, Type::IntTy, true/*SExt*/, +V2 = CastInst::createIntegerCast(V2, Type::IntTy, false/*ZExt*/, "tmp", TheCall); V2 = BinaryOperator::createAdd(V2, ConstantInt::get(Type::IntTy, 1), "tmp", TheCall); @@ -2117,7 +2117,7 @@ /// inserting the cast before IP, and return the cast. /// @brief Cast a value to a "C" string. Value *CastToCStr(Value *V, Instruction &IP) { - assert(V->getType()->getTypeID() == Type::PointerTyID && + assert(isa(V->getType()) && "Can't cast non-pointer type to C string type"); const Type *SBPTy = PointerType::get(Type::SByteTy); if (V->getType() != SBPTy) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvmc/st
Changes in directory llvm/tools/llvmc: st updated: 1.9 -> 1.10 --- Log message: Ressurrect this needed file. --- Diffs of the changes: (+63 -0) st | 63 +++ 1 files changed, 63 insertions(+) Index: llvm/tools/llvmc/st diff -u /dev/null llvm/tools/llvmc/st:1.10 --- /dev/null Wed Dec 13 02:10:26 2006 +++ llvm/tools/llvmc/st Wed Dec 13 02:10:16 2006 @@ -0,0 +1,63 @@ +# Stacker Configuration File For llvmc + +## +# Language definitions +## + lang.name=Stacker + lang.opt1=-O1 + lang.opt2=-O2 + lang.opt3=-O3 + lang.opt4=-O4 + lang.opt5=-O5 + +## +# Pre-processor definitions +## + + # Stacker doesn't have a preprocessor but the following + # allows the -E option to be supported + preprocessor.command=cp %in% %out% + preprocessor.required=false + +## +# Translator definitions +## + + # To compile stacker source, we just run the stacker + # compiler with a default stack size of 2048 entries. + translator.command=stkrc -s 2048 %in% -f -o %out% %opt% \ +%time% %stats% %args% + + # stkrc doesn't preprocess but we set this to true so + # that we don't run the cp command by default. + translator.preprocesses=true + + # The translator is required to run. + translator.required=false + + # stkrc doesn't handle the -On options + translator.output=bytecode + +## +# Optimizer definitions +## + + # For optimization, we use the LLVM "opt" program + optimizer.command=stkrc -s 2048 %in% -f -o %out% %opt% \ +%time% %stats% %args% + + optimizer.required = yes + + # opt doesn't translate + optimizer.translates = yes + + # opt doesn't preprocess + optimizer.preprocesses=yes + + # opt produces bytecode + optimizer.output = bc + +## +# Assembler definitions +## + assembler.command=llc %in% -o %out% %target% %time% %stats% ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.566 -> 1.567 --- Log message: Fix and/or/xor (cast A), (cast B) --> cast (and/or/xor A, B) The cast patch introduced the possibility that the wrong cast opcode could be used and that this transform could trigger on different kinds of cast operations. This patch rectifies that. --- Diffs of the changes: (+40 -41) InstructionCombining.cpp | 81 +++ 1 files changed, 40 insertions(+), 41 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.566 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.567 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.566 Tue Dec 12 17:36:14 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Dec 13 02:27:15 2006 @@ -3270,22 +3270,21 @@ } // fold (and (cast A), (cast B)) -> (cast (and A, B)) - if (CastInst *Op1C = dyn_cast(Op1)) { -if (CastInst *Op0C = dyn_cast(Op0)) { - const Type *SrcTy = Op0C->getOperand(0)->getType(); - if (SrcTy == Op1C->getOperand(0)->getType() && SrcTy->isIntegral() && - // Only do this if the casts both really cause code to be generated. - ValueRequiresCast(Op0C->getOperand(0), I.getType(), TD) && - ValueRequiresCast(Op1C->getOperand(0), I.getType(), TD)) { -Instruction *NewOp = BinaryOperator::createAnd(Op0C->getOperand(0), - Op1C->getOperand(0), - I.getName()); -InsertNewInstBefore(NewOp, I); -return CastInst::createIntegerCast(NewOp, I.getType(), - SrcTy->isSigned()); + if (CastInst *Op0C = dyn_cast(Op0)) +if (CastInst *Op1C = dyn_cast(Op1)) + if (Op0C->getOpcode() == Op1C->getOpcode()) { // same cast kind ? +const Type *SrcTy = Op0C->getOperand(0)->getType(); +if (SrcTy == Op1C->getOperand(0)->getType() && SrcTy->isIntegral() && +// Only do this if the casts both really cause code to be generated. +ValueRequiresCast(Op0C->getOperand(0), I.getType(), TD) && +ValueRequiresCast(Op1C->getOperand(0), I.getType(), TD)) { + Instruction *NewOp = BinaryOperator::createAnd(Op0C->getOperand(0), + Op1C->getOperand(0), + I.getName()); + InsertNewInstBefore(NewOp, I); + return CastInst::create(Op0C->getOpcode(), NewOp, I.getType()); +} } -} - } // (X >> Z) & (Y >> Z) -> (X&Y) >> Z for all shifts. if (ShiftInst *SI1 = dyn_cast(Op1)) { @@ -3675,21 +3674,21 @@ } // fold (or (cast A), (cast B)) -> (cast (or A, B)) - if (CastInst *Op0C = dyn_cast(Op0)) { -const Type *SrcTy = Op0C->getOperand(0)->getType(); + if (CastInst *Op0C = dyn_cast(Op0)) if (CastInst *Op1C = dyn_cast(Op1)) - if (SrcTy == Op1C->getOperand(0)->getType() && SrcTy->isIntegral() && - // Only do this if the casts both really cause code to be generated. - ValueRequiresCast(Op0C->getOperand(0), I.getType(), TD) && - ValueRequiresCast(Op1C->getOperand(0), I.getType(), TD)) { -Instruction *NewOp = BinaryOperator::createOr(Op0C->getOperand(0), - Op1C->getOperand(0), - I.getName()); -InsertNewInstBefore(NewOp, I); -return CastInst::createIntegerCast(NewOp, I.getType(), - SrcTy->isSigned()); + if (Op0C->getOpcode() == Op1C->getOpcode()) {// same cast kind ? +const Type *SrcTy = Op0C->getOperand(0)->getType(); +if (SrcTy == Op1C->getOperand(0)->getType() && SrcTy->isIntegral() && +// Only do this if the casts both really cause code to be generated. +ValueRequiresCast(Op0C->getOperand(0), I.getType(), TD) && +ValueRequiresCast(Op1C->getOperand(0), I.getType(), TD)) { + Instruction *NewOp = BinaryOperator::createOr(Op0C->getOperand(0), +Op1C->getOperand(0), +I.getName()); + InsertNewInstBefore(NewOp, I); + return CastInst::create(Op0C->getOpcode(), NewOp, I.getType()); +} } - } return Changed ? &I : 0; @@ -3857,21 +3856,21 @@ return R; // fold (xor (cast A), (cast B)) -> (cast (xor A, B)) - if (CastInst *Op0C = dyn_cast(Op0)) { -const Type *SrcTy = Op0C->getOperand(0)->getType(); + if (CastInst *Op0C = dyn_cast(Op0)) if (CastInst *Op1C = dyn_cast(Op1)) - if (SrcTy == Op1C->getOperand(0)->getType() && SrcTy->isIntegral() && - // Only do
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.567 -> 1.568 --- Log message: For mul transforms, when checking for a cast from bool as either operand, make sure to also check that it is a zext from bool, not any other cast operation type. --- Diffs of the changes: (+4 -2) InstructionCombining.cpp |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.567 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.568 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.567 Wed Dec 13 02:27:15 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Dec 13 02:33:33 2006 @@ -2172,11 +2172,13 @@ // formed. CastInst *BoolCast = 0; if (CastInst *CI = dyn_cast(I.getOperand(0))) -if (CI->getOperand(0)->getType() == Type::BoolTy) +if (CI->getOperand(0)->getType() == Type::BoolTy && +CI->getOpcode() == Instruction::ZExt) BoolCast = CI; if (!BoolCast) if (CastInst *CI = dyn_cast(I.getOperand(1))) - if (CI->getOperand(0)->getType() == Type::BoolTy) + if (CI->getOperand(0)->getType() == Type::BoolTy && +CI->getOpcode() == Instruction::ZExt) BoolCast = CI; if (BoolCast) { if (SetCondInst *SCI = dyn_cast(BoolCast->getOperand(0))) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Analysis/ScalarEvolutionExpander.h
Changes in directory llvm/include/llvm/Analysis: ScalarEvolutionExpander.h updated: 1.9 -> 1.10 --- Log message: Change the interface to SCEVExpander::InsertCastOfTo to take a cast opcode so the decision of which opcode to use is pushed upward to the caller. Adjust the callers to pass the expected opcode. --- Diffs of the changes: (+17 -4) ScalarEvolutionExpander.h | 21 + 1 files changed, 17 insertions(+), 4 deletions(-) Index: llvm/include/llvm/Analysis/ScalarEvolutionExpander.h diff -u llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.9 llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.10 --- llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.9Mon Dec 4 14:18:26 2006 +++ llvm/include/llvm/Analysis/ScalarEvolutionExpander.hWed Dec 13 02:06:42 2006 @@ -88,7 +88,8 @@ /// InsertCastOfTo - Insert a cast of V to the specified type, doing what /// we can to share the casts. -static Value *InsertCastOfTo(Value *V, const Type *Ty); +static Value *InsertCastOfTo(Instruction::CastOps opcode, Value *V, + const Type *Ty); protected: Value *expand(SCEV *S) { @@ -104,8 +105,20 @@ Value *expandInTy(SCEV *S, const Type *Ty) { Value *V = expand(S); - if (Ty && V->getType() != Ty) -return InsertCastOfTo(V, Ty); + if (Ty && V->getType() != Ty) { +if (isa(Ty) && V->getType()->isInteger()) + return InsertCastOfTo(Instruction::IntToPtr, V, Ty); +else if (Ty->isInteger() && isa(V->getType())) + return InsertCastOfTo(Instruction::PtrToInt, V, Ty); +else if (Ty->getPrimitiveSizeInBits() == + V->getType()->getPrimitiveSizeInBits()) + return InsertCastOfTo(Instruction::BitCast, V, Ty); +else if (Ty->getPrimitiveSizeInBits() > + V->getType()->getPrimitiveSizeInBits()) + return InsertCastOfTo(Instruction::ZExt, V, Ty); +else + return InsertCastOfTo(Instruction::Trunc, V, Ty); + } return V; } @@ -119,7 +132,7 @@ } Value *visitZeroExtendExpr(SCEVZeroExtendExpr *S) { - Value *V = expandInTy(S->getOperand(),S->getType()->getUnsignedVersion()); + Value *V = expandInTy(S->getOperand(), S->getType()); return CastInst::createZExtOrBitCast(V, S->getType(), "tmp.", InsertPt); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Changes in directory llvm/lib/Transforms/Scalar: LoopStrengthReduce.cpp updated: 1.99 -> 1.100 --- Log message: Change the interface to SCEVExpander::InsertCastOfTo to take a cast opcode so the decision of which opcode to use is pushed upward to the caller. Adjust the callers to pass the expected opcode. --- Diffs of the changes: (+21 -12) LoopStrengthReduce.cpp | 33 + 1 files changed, 21 insertions(+), 12 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.99 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.100 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.99 Mon Dec 11 23:04:59 2006 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Wed Dec 13 02:06:42 2006 @@ -177,7 +177,7 @@ /// getCastedVersionOf - Return the specified value casted to uintptr_t. /// -Value *getCastedVersionOf(Value *V); +Value *getCastedVersionOf(Instruction::CastOps opcode, Value *V); private: void runOnLoop(Loop *L); bool AddUsersIfInteresting(Instruction *I, Loop *L, @@ -203,19 +203,16 @@ /// getCastedVersionOf - Return the specified value casted to uintptr_t. This /// assumes that the Value* V is of integer or pointer type only. /// -Value *LoopStrengthReduce::getCastedVersionOf(Value *V) { +Value *LoopStrengthReduce::getCastedVersionOf(Instruction::CastOps opcode, + Value *V) { if (V->getType() == UIntPtrTy) return V; if (Constant *CB = dyn_cast(V)) -if (CB->getType()->isInteger()) - return ConstantExpr::getIntegerCast(CB, UIntPtrTy, - CB->getType()->isSigned()); -else - return ConstantExpr::getPtrToInt(CB, UIntPtrTy); +return ConstantExpr::getCast(opcode, CB, UIntPtrTy); Value *&New = CastedPointers[V]; if (New) return New; - New = SCEVExpander::InsertCastOfTo(V, UIntPtrTy); + New = SCEVExpander::InsertCastOfTo(opcode, V, UIntPtrTy); DeadInsts.insert(cast(New)); return New; } @@ -258,7 +255,8 @@ // Build up the base expression. Insert an LLVM cast of the pointer to // uintptr_t first. - SCEVHandle GEPVal = SCEVUnknown::get(getCastedVersionOf(GEP->getOperand(0))); + SCEVHandle GEPVal = SCEVUnknown::get( + getCastedVersionOf(Instruction::PtrToInt, GEP->getOperand(0))); gep_type_iterator GTI = gep_type_begin(GEP); @@ -273,7 +271,13 @@ GEPVal = SCEVAddExpr::get(GEPVal, SCEVUnknown::getIntegerSCEV(Offset, UIntPtrTy)); } else { - Value *OpVal = getCastedVersionOf(GEP->getOperand(i)); + unsigned GEPOpiBits = +GEP->getOperand(i)->getType()->getPrimitiveSizeInBits(); + unsigned IntPtrBits = UIntPtrTy->getPrimitiveSizeInBits(); + Instruction::CastOps opcode = (GEPOpiBits < IntPtrBits ? + Instruction::SExt : (GEPOpiBits > IntPtrBits ? Instruction::Trunc : +Instruction::BitCast)); + Value *OpVal = getCastedVersionOf(opcode, GEP->getOperand(i)); SCEVHandle Idx = SE->getSCEV(OpVal); uint64_t TypeSize = TD->getTypeSize(GTI.getIndexedType()); @@ -1125,8 +1129,13 @@ if (L->contains(User.Inst->getParent())) User.Inst->moveBefore(LatchBlock->getTerminator()); } - if (RewriteOp->getType() != ReplacedTy) -RewriteOp = SCEVExpander::InsertCastOfTo(RewriteOp, ReplacedTy); + if (RewriteOp->getType() != ReplacedTy) { +Instruction::CastOps opcode = Instruction::Trunc; +if (ReplacedTy->getPrimitiveSizeInBits() == +RewriteOp->getType()->getPrimitiveSizeInBits()) + opcode = Instruction::BitCast; +RewriteOp = SCEVExpander::InsertCastOfTo(opcode, RewriteOp, ReplacedTy); + } SCEVHandle RewriteExpr = SCEVUnknown::get(RewriteOp); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm-poolalloc/lib/DSA/DataStructure.cpp
Changes in directory llvm-poolalloc/lib/DSA: DataStructure.cpp updated: 1.248.2.1 -> 1.248.2.2 --- Log message: Do not compile in pool inference code by default. --- Diffs of the changes: (+0 -1) DataStructure.cpp |1 - 1 files changed, 1 deletion(-) Index: llvm-poolalloc/lib/DSA/DataStructure.cpp diff -u llvm-poolalloc/lib/DSA/DataStructure.cpp:1.248.2.1 llvm-poolalloc/lib/DSA/DataStructure.cpp:1.248.2.2 --- llvm-poolalloc/lib/DSA/DataStructure.cpp:1.248.2.1 Tue Dec 12 16:42:42 2006 +++ llvm-poolalloc/lib/DSA/DataStructure.cppWed Dec 13 10:25:34 2006 @@ -35,7 +35,6 @@ using namespace llvm; #define COLLAPSE_ARRAYS_AGGRESSIVELY 0 -#define LLVA_KERNEL 1 namespace { Statistic<> NumFolds ("dsa", "Number of nodes completely folded"); Statistic<> NumCallNodesMerged("dsa", "Number of call nodes merged"); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm-poolalloc/include/dsa/DSGraph.h DSGraphTraits.h DSNode.h
Changes in directory llvm-poolalloc/include/dsa: DSGraph.h updated: 1.110.2.2 -> 1.110.2.3 DSGraphTraits.h updated: 1.25 -> 1.25.2.1 DSNode.h updated: 1.58.2.1 -> 1.58.2.2 --- Log message: Only use DSA header files from this project. --- Diffs of the changes: (+3 -3) DSGraph.h |2 +- DSGraphTraits.h |2 +- DSNode.h|2 +- 3 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-poolalloc/include/dsa/DSGraph.h diff -u llvm-poolalloc/include/dsa/DSGraph.h:1.110.2.2 llvm-poolalloc/include/dsa/DSGraph.h:1.110.2.3 --- llvm-poolalloc/include/dsa/DSGraph.h:1.110.2.2 Tue Dec 12 17:20:47 2006 +++ llvm-poolalloc/include/dsa/DSGraph.hWed Dec 13 10:24:48 2006 @@ -15,7 +15,7 @@ #ifndef LLVM_ANALYSIS_DSGRAPH_H #define LLVM_ANALYSIS_DSGRAPH_H -#include "llvm/Analysis/DataStructure/DSNode.h" +#include "dsa/DSNode.h" #include "llvm/ADT/hash_map" #include "llvm/ADT/EquivalenceClasses.h" #include Index: llvm-poolalloc/include/dsa/DSGraphTraits.h diff -u llvm-poolalloc/include/dsa/DSGraphTraits.h:1.25 llvm-poolalloc/include/dsa/DSGraphTraits.h:1.25.2.1 --- llvm-poolalloc/include/dsa/DSGraphTraits.h:1.25 Thu Nov 2 19:43:47 2006 +++ llvm-poolalloc/include/dsa/DSGraphTraits.h Wed Dec 13 10:24:48 2006 @@ -16,7 +16,7 @@ #ifndef LLVM_ANALYSIS_DSGRAPHTRAITS_H #define LLVM_ANALYSIS_DSGRAPHTRAITS_H -#include "llvm/Analysis/DataStructure/DSGraph.h" +#include "dsa/DSGraph.h" #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/iterator" #include "llvm/ADT/STLExtras.h" Index: llvm-poolalloc/include/dsa/DSNode.h diff -u llvm-poolalloc/include/dsa/DSNode.h:1.58.2.1 llvm-poolalloc/include/dsa/DSNode.h:1.58.2.2 --- llvm-poolalloc/include/dsa/DSNode.h:1.58.2.1Tue Dec 12 16:42:37 2006 +++ llvm-poolalloc/include/dsa/DSNode.h Wed Dec 13 10:24:48 2006 @@ -14,7 +14,7 @@ #ifndef LLVM_ANALYSIS_DSNODE_H #define LLVM_ANALYSIS_DSNODE_H -#include "llvm/Analysis/DataStructure/DSSupport.h" +#include "dsa/DSSupport.h" #include "llvm/ADT/hash_map" namespace llvm { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/LinkAllPasses.h
Changes in directory llvm/include/llvm: LinkAllPasses.h updated: 1.4 -> 1.5 --- Log message: Remove DSA. --- Diffs of the changes: (+0 -11) LinkAllPasses.h | 11 --- 1 files changed, 11 deletions(-) Index: llvm/include/llvm/LinkAllPasses.h diff -u llvm/include/llvm/LinkAllPasses.h:1.4 llvm/include/llvm/LinkAllPasses.h:1.5 --- llvm/include/llvm/LinkAllPasses.h:1.4 Mon Nov 13 23:21:04 2006 +++ llvm/include/llvm/LinkAllPasses.h Wed Dec 13 10:53:17 2006 @@ -57,8 +57,6 @@ (void) llvm::createConstantMergePass(); (void) llvm::createConstantPropagationPass(); (void) llvm::createCorrelatedExpressionEliminationPass(); - (void) llvm::createDSAAPass(); - (void) llvm::createDSOptPass(); (void) llvm::createDeadArgEliminationPass(); (void) llvm::createDeadCodeEliminationPass(); (void) llvm::createDeadInstEliminationPass(); @@ -106,7 +104,6 @@ (void) llvm::createScalarReplAggregatesPass(); (void) llvm::createSimplifyLibCallsPass(); (void) llvm::createSingleLoopExtractorPass(); - (void) llvm::createSteensgaardPass(); (void) llvm::createStripSymbolsPass(); (void) llvm::createTailCallEliminationPass(); (void) llvm::createTailDuplicationPass(); @@ -118,22 +115,14 @@ (void) llvm::createNullProfilerRSPass(); (void) llvm::createRSProfilingPass(); (void) llvm::createIndMemRemPass(); - (void) llvm::createDataStructureStatsPass(); - (void) llvm::createDataStructureGraphCheckerPass(); (void) llvm::createInstCountPass(); (void) llvm::createPredicateSimplifierPass(); - (void)new llvm::LocalDataStructures(); - (void)new llvm::BUDataStructures(); - (void)new llvm::TDDataStructures(); - (void)new llvm::CompleteBUDataStructures(); - (void)new llvm::EquivClassGraphs(); (void)new llvm::IntervalPartition(); (void)new llvm::ImmediateDominators(); (void)new llvm::PostDominatorSet(); (void)new llvm::FindUsedTypes(); (void)new llvm::ScalarEvolution(); - (void)new llvm::CallTargetFinder(); ((llvm::Function*)0)->viewCFGOnly(); llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)0); X.add((llvm::Value*)0, 0); // for -print-alias-sets ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/opt/Makefile
Changes in directory llvm/tools/opt: Makefile updated: 1.59 -> 1.60 --- Log message: Remove DSA. --- Diffs of the changes: (+1 -1) Makefile |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/opt/Makefile diff -u llvm/tools/opt/Makefile:1.59 llvm/tools/opt/Makefile:1.60 --- llvm/tools/opt/Makefile:1.59Mon Sep 4 00:59:09 2006 +++ llvm/tools/opt/Makefile Wed Dec 13 10:54:05 2006 @@ -11,6 +11,6 @@ REQUIRES_EH := 1 LINK_COMPONENTS := bcreader bcwriter instrumentation scalaropts ipo \ - datastructure transforms + transforms include $(LEVEL)/Makefile.common ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/Makefile
Changes in directory llvm/lib/Analysis: Makefile updated: 1.11 -> 1.12 --- Log message: Remove DSA. --- Diffs of the changes: (+1 -1) Makefile |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Analysis/Makefile diff -u llvm/lib/Analysis/Makefile:1.11 llvm/lib/Analysis/Makefile:1.12 --- llvm/lib/Analysis/Makefile:1.11 Sun Oct 23 21:24:54 2005 +++ llvm/lib/Analysis/Makefile Wed Dec 13 10:54:24 2006 @@ -9,7 +9,7 @@ LEVEL = ../.. LIBRARYNAME = LLVMAnalysis -PARALLEL_DIRS = IPA DataStructure +PARALLEL_DIRS = IPA BUILD_ARCHIVE = 1 include $(LEVEL)/Makefile.common ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/bugpoint/Makefile
Changes in directory llvm/tools/bugpoint: Makefile updated: 1.19 -> 1.20 --- Log message: Remove DSA. --- Diffs of the changes: (+1 -1) Makefile |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/bugpoint/Makefile diff -u llvm/tools/bugpoint/Makefile:1.19 llvm/tools/bugpoint/Makefile:1.20 --- llvm/tools/bugpoint/Makefile:1.19 Mon Sep 4 00:59:09 2006 +++ llvm/tools/bugpoint/MakefileWed Dec 13 10:54:08 2006 @@ -11,7 +11,7 @@ TOOLNAME = bugpoint LINK_COMPONENTS := bcreader bcwriter asmparser instrumentation scalaropts ipo \ - datastructure transforms linker + transforms linker REQUIRES_EH := 1 include $(LEVEL)/Makefile.common ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Analysis/DSGraph/.cvsignore
Changes in directory llvm/test/Regression/Analysis/DSGraph: .cvsignore (r1.2) removed --- Log message: Remove DSA tests. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Analysis/DSGraph/dg.exp
Changes in directory llvm/test/Regression/Analysis/DSGraph: dg.exp (r1.3) removed --- Log message: Remove DSA tests. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll 2003-06-29-NodeCollapsing.ll 2003-06-29-NodeCollapsing2.ll 2003-06-30-TopDownResolve.ll 2003-07-01-FieldCollaps
Changes in directory llvm/test/Regression/Analysis/DSGraph: 2003-06-29-IncompleteTDPass.ll (r1.5) removed 2003-06-29-NodeCollapsing.ll (r1.4) removed 2003-06-29-NodeCollapsing2.ll (r1.5) removed 2003-06-30-TopDownResolve.ll (r1.6) removed 2003-07-01-FieldCollapse.ll (r1.5) removed 2003-07-16-ConstantExprCollapse.ll (r1.5) removed 2003-11-02-NodeCollapsing.ll (r1.5) removed 2004-02-13-memcpy.ll (r1.7) removed 2004-03-10-ElimLoad.ll (r1.3) removed 2004-03-10-NoElimLoad.ll (r1.3) removed 2005-03-22-IncompleteGlobal.ll (r1.6) removed 2005-03-24-Global-Arg-Alias.ll (r1.3) removed 2006-03-27-LinkedCollapsed.ll (r1.3) removed 2006-04-13-ZeroArrayStruct.ll (r1.3) removed 2006-04-25-ZeroArrayStructUse.ll (r1.4) removed FunctionPointerTable-const.ll (r1.6) removed GlobalsGraphFuncPtr.ll (r1.6) removed HardBUCase.ll (r1.5) removed PhysicalSubtyping.ll (r1.5) removed SCCSimpleExample.ll (r1.4) removed buglobals.ll (r1.3) removed constant_globals.ll (r1.6) removed constantize.ll (r1.3) removed field-sensitive.ll (r1.2) removed gcsetest.ll (r1.8) removed incompletenode.ll (r1.5) removed mustalias.ll (r1.5) removed strcpy.ll (r1.5) removed --- Log message: Remove DSA tests. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.568 -> 1.569 --- Log message: Implement review feedback. Most of this has to do with removing unnecessary cast instructions. A few are bug fixes. --- Diffs of the changes: (+16 -43) InstructionCombining.cpp | 59 --- 1 files changed, 16 insertions(+), 43 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.568 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.569 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.568 Wed Dec 13 02:33:33 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Dec 13 11:19:09 2006 @@ -2192,11 +2192,6 @@ // Shift the X value right to turn it into "all signbits". Constant *Amt = ConstantInt::get(Type::UByteTy, SCOpTy->getPrimitiveSizeInBits()-1); -if (SCIOp0->getType()->isUnsigned()) { - const Type *NewTy = SCIOp0->getType()->getSignedVersion(); - SCIOp0 = InsertCastBefore(Instruction::BitCast, SCIOp0, NewTy, I); -} - Value *V = InsertNewInstBefore(new ShiftInst(Instruction::AShr, SCIOp0, Amt, BoolCast->getOperand(0)->getName()+ @@ -2871,17 +2866,14 @@ if (Op->hasOneUse()) { Constant *AllOne = ConstantIntegral::getAllOnesValue(AndRHS->getType()); Constant *ShrMask = ConstantExpr::getLShr(AllOne, OpRHS); - Constant *CI = ConstantExpr::getAnd(AndRHS, ShrMask); - if (CI == AndRHS) { // Masking out bits shifted in. + Constant *C = ConstantExpr::getAnd(AndRHS, ShrMask); + if (C == AndRHS) { // Masking out bits shifted in. // (Val ashr C1) & C2 -> (Val lshr C1) & C2 // Make the argument unsigned. Value *ShVal = Op->getOperand(0); -ShVal = InsertNewInstBefore(new ShiftInst(Instruction::LShr, ShVal, - OpRHS, Op->getName()), -TheAnd); -Value *AndRHS2 = ConstantExpr::getBitCast(AndRHS, ShVal->getType()); - -return BinaryOperator::createAnd(ShVal, AndRHS2, TheAnd.getName()); +ShVal = InsertNewInstBefore(new ShiftInst(Instruction::LShr, ShVal, +OpRHS, Op->getName()), TheAnd); +return BinaryOperator::createAnd(ShVal, AndRHS, TheAnd.getName()); } } break; @@ -3929,8 +3921,7 @@ for (unsigned i = 1, e = GEP->getNumOperands(); i != e; ++i, ++GTI) { Value *Op = GEP->getOperand(i); uint64_t Size = TD.getTypeSize(GTI.getIndexedType()) & PtrSizeMask; -Constant *Scale = ConstantExpr::getBitCast(ConstantInt::get(UIntPtrTy, Size), -SIntPtrTy); +Constant *Scale = ConstantInt::get(SIntPtrTy, Size); if (Constant *OpC = dyn_cast(Op)) { if (!OpC->isNullValue()) { OpC = ConstantExpr::getIntegerCast(OpC, SIntPtrTy, true /*SExt*/); @@ -4342,9 +4333,8 @@ // Check to see if there is a noop-cast between the shift and the and. if (!Shift) { if (CastInst *CI = dyn_cast(LHSI->getOperand(0))) - if (CI->getOperand(0)->getType()->isIntegral() && - CI->getOperand(0)->getType()->getPrimitiveSizeInBits() == - CI->getType()->getPrimitiveSizeInBits()) + if (CI->getOpcode() == Instruction::BitCast && + CI->getType()->isIntegral()) Shift = dyn_cast(CI->getOperand(0)); } @@ -4424,12 +4414,8 @@ NS = new ShiftInst(Instruction::Shl, AndCST, Shift->getOperand(1), "tmp"); } else { - // Make sure we insert a logical shift. - Constant *NewAndCST = AndCST; - if (AndCST->getType()->isSigned()) -NewAndCST = ConstantExpr::getBitCast(AndCST, - AndCST->getType()->getUnsignedVersion()); - NS = new ShiftInst(Instruction::LShr, NewAndCST, + // Insert a logical shift. + NS = new ShiftInst(Instruction::LShr, AndCST, Shift->getOperand(1), "tmp"); } InsertNewInstBefore(cast(NS), I); @@ -5434,18 +5420,14 @@ } } else { // (X >>s C1) << C2 where C1 > C2 === (X >>s (C1-C2)) & mask -Op = InsertCastBefore(Instruction::BitCast, Mask, - I.getType()->getSignedVersion(), I); Instruction *Shift = - new ShiftInst(ShiftOp->getOpcode(), Op, + new ShiftInst(ShiftOp->getOpcode(), Mask, ConstantInt::get(Type::UByteTy, ShiftAmt1-ShiftAmt2)); InsertNewInst
Re: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Hi Chris, Feedback below ... On Tue, 2006-12-12 at 22:42 -0800, Chris Lattner wrote: > This code (around line 2173): > >CastInst *BoolCast = 0; >if (CastInst *CI = dyn_cast(I.getOperand(0))) > if (CI->getOperand(0)->getType() == Type::BoolTy) >BoolCast = CI; >if (!BoolCast) > if (CastInst *CI = dyn_cast(I.getOperand(1))) >if (CI->getOperand(0)->getType() == Type::BoolTy) > BoolCast = CI; > > Should *only* allow zext from bool (not any cast). This is a serious > bug from the original cast patch. Committed last night. > > > > @@ -2190,7 +2193,7 @@ > >SCOpTy- > > >getPrimitiveSizeInBits()-1); > > if (SCIOp0->getType()->isUnsigned()) { > >const Type *NewTy = SCIOp0->getType()->getSignedVersion(); > > - SCIOp0 = InsertCastBefore(SCIOp0, NewTy, I); > > + SCIOp0 = InsertCastBefore(Instruction::BitCast, SCIOp0, > > NewTy, I); > > } > > This cast be removed now that ashr is signless. Right. Fixed. When SETCC finally gets in, I'll be looking for all kinds of useless casts, and not only in InstCombine. > > > > @@ -2863,12 +2872,14 @@ > >Constant *ShrMask = ConstantExpr::getLShr(AllOne, OpRHS); > >Constant *CI = ConstantExpr::getAnd(AndRHS, ShrMask); > >if (CI == AndRHS) { // Masking out bits shifted in. > > +// (Val ashr C1) & C2 -> (Val lshr C1) & C2 > > // Make the argument unsigned. > > Value *ShVal = Op->getOperand(0); > > ShVal = InsertNewInstBefore(new ShiftInst > > (Instruction::LShr, ShVal, > >OpRHS, Op- > > >getName()), > > TheAnd); > > -Value *AndRHS2 = ConstantExpr::getCast(AndRHS, ShVal- > > >getType()); > > +Value *AndRHS2 = ConstantExpr::getBitCast(AndRHS, ShVal- > > >getType()); > > + > > This cast looks completely dead, if so, it should just be removed. Removed. > > > @@ -2897,9 +2908,9 @@ > > InsertNewInstBefore(Add, IB); > > // Convert to unsigned for the comparison. > > const Type *UnsType = Add->getType()->getUnsignedVersion(); > > -Value *OffsetVal = InsertCastBefore(Add, UnsType, IB); > > +Value *OffsetVal = InsertCastBefore(Instruction::BitCast, Add, > > UnsType, IB); > > AddCST = ConstantExpr::getAdd(AddCST, Hi); > > -AddCST = ConstantExpr::getCast(AddCST, UnsType); > > +AddCST = ConstantExpr::getBitCast(AddCST, UnsType); > > return new SetCondInst(Instruction::SetLT, OffsetVal, AddCST); > > If only we had signless comparisons! :-) Indeed. I'd like to get back to finishing it off :) > > > @@ -3917,11 +3930,11 @@ > >for (unsigned i = 1, e = GEP->getNumOperands(); i != e; ++i, + > > +GTI) { > > Value *Op = GEP->getOperand(i); > > uint64_t Size = TD.getTypeSize(GTI.getIndexedType()) & > > PtrSizeMask; > > -Constant *Scale = ConstantExpr::getCast(ConstantInt::get > > (UIntPtrTy, Size), > > +Constant *Scale = ConstantExpr::getBitCast(ConstantInt::get > > (UIntPtrTy, Size), > > SIntPtrTy); > > This doesn't fit in 80 columns. Fixed. > Further, you can just use: > > > Constant *Scale = ConstantInt::get(SIntPtrTy, Size); > > Now that Constant[SU]Int got merged into ConstantInt. Yup. Done. > > > This code: >// Check to see if there is a noop-cast between the shift > and the and. >if (!Shift) { > if (CastInst *CI = dyn_cast(LHSI->getOperand(0))) >if (CI->getOperand(0)->getType()->isIntegral() && >CI->getOperand(0)->getType()- > >getPrimitiveSizeInBits() == > CI->getType()->getPrimitiveSizeInBits()) > Shift = dyn_cast(CI->getOperand(0)); >} > > Should check for bitcast with integral src/dest instead of checking > sizes etc. Done. > > > This code: > >// Make sure we insert a logical shift. >Constant *NewAndCST = AndCST; >if (AndCST->getType()->isSigned()) > NewAndCST = ConstantExpr::getBitCast(AndCST, >AndCST->getType()- > >getUnsignedVersion()); >NS = new ShiftInst(Instruction::LShr, NewAndCST, > Shift->getOperand(1), "tmp"); > > You can drop the cast now that the shift is signless. Yup. Done. > > > The two casts here can be eliminated now that shifts are signless: > > // (X >>s C1) << C2 where C1 > C2 === (X >>s (C1-C2)) & mask > Op = InsertCastBefore(Instruction::BitCast, Mask, >I.getType()->getSignedVersion(), I); > Instruction *Shift = >new ShiftInst(ShiftOp->getOpcode(), Op, > ConstantInt::get(Type::UByteTy, ShiftAmt1- > ShiftAmt2)); > I
Re: [llvm-commits] CVS: llvm/lib/Analysis/Makefile
On Wed, 2006-12-13 at 10:54 -0600, John Criswell wrote: > > Changes in directory llvm/lib/Analysis: > > Makefile updated: 1.11 -> 1.12 > --- > Log message: > > Remove DSA. > > > --- > Diffs of the changes: (+1 -1) > > Makefile |2 +- > 1 files changed, 1 insertion(+), 1 deletion(-) > > > Index: llvm/lib/Analysis/Makefile > diff -u llvm/lib/Analysis/Makefile:1.11 llvm/lib/Analysis/Makefile:1.12 > --- llvm/lib/Analysis/Makefile:1.11 Sun Oct 23 21:24:54 2005 > +++ llvm/lib/Analysis/MakefileWed Dec 13 10:54:24 2006 > @@ -9,7 +9,7 @@ > > LEVEL = ../.. > LIBRARYNAME = LLVMAnalysis > -PARALLEL_DIRS = IPA DataStructure > +PARALLEL_DIRS = IPA Not much point in making a single DIR be parallel. > BUILD_ARCHIVE = 1 > > include $(LEVEL)/Makefile.common > > > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Hi Chris, Feedback below ... On Tue, 2006-12-12 at 23:14 -0800, Chris Lattner wrote: > On Dec 12, 2006, at 3:36 PM, Reid Spencer wrote: > > @@ -3286,7 +3281,8 @@ > > Op1C- > > >getOperand(0), > > I.getName()); > > InsertNewInstBefore(NewOp, I); > > -return CastInst::createInferredCast(NewOp, I.getType()); > > +return CastInst::createIntegerCast(NewOp, I.getType(), > > + SrcTy->isSigned()); > >} > > } > >} > > @@ -3690,7 +3686,8 @@ > >Op1C- > > >getOperand(0), > >I.getName()); > > InsertNewInstBefore(NewOp, I); > > -return CastInst::createInferredCast(NewOp, I.getType()); > > +return CastInst::createIntegerCast(NewOp, I.getType(), > > + SrcTy->isSigned()); > >} > >} > > > > @@ -3871,7 +3868,8 @@ > > Op1C- > > >getOperand(0), > > I.getName()); > > InsertNewInstBefore(NewOp, I); > > -return CastInst::createInferredCast(NewOp, I.getType()); > > +return CastInst::createIntegerCast(NewOp, I.getType(), > > + SrcTy->isSigned()); > >} > >} > > These three all point out serious bugs. The code looks like this for > each: > >// fold (and (cast A), (cast B)) -> (cast (and A, B)) >if (CastInst *Op1C = dyn_cast(Op1)) { > if (CastInst *Op0C = dyn_cast(Op0)) { >const Type *SrcTy = Op0C->getOperand(0)->getType(); >if (SrcTy == Op1C->getOperand(0)->getType() && SrcTy- > >isIntegral() && >// Only do this if the casts both really cause code to be > generated. >ValueRequiresCast(Op0C->getOperand(0), I.getType(), TD) && >ValueRequiresCast(Op1C->getOperand(0), I.getType(), TD)) { > Instruction *NewOp = BinaryOperator::createAnd(Op0C- > >getOperand(0), > Op1C- > >getOperand(0), > I.getName()); > InsertNewInstBefore(NewOp, I); > return CastInst::createIntegerCast(NewOp, I.getType(), > SrcTy->isSigned()); >} > } >} > > This xform used to be safe before the cast patch, but now can turn > stuff like: > >(and (sext A), (zext B)) > > into: > >(sext (and A, B)) > > which is very wrong (again, never use SrcTy->isSigned!). > > All three of these cases should verify that Op1C->getOpcode() == Op2C- > >getOpcode(), and it should use the opcode in the inserted cast. > That is, either of these are allowed: > >(and (sext A), (sext B)) -> (sext (and A, B)) >(and (zext A), (zext B)) -> (zext (and A, B)) > > but no mixing. Yup, you're right. This is bad. I committed this fix separately last night. > > > @@ -5392,8 +5389,7 @@ > > > >Value *Op = ShiftOp->getOperand(0); > >if (isShiftOfSignedShift != isSignedShift) > > -Op = InsertNewInstBefore( > > - CastInst::createInferredCast(Op, I.getType(), > > "tmp"), I); > > +Op = InsertNewInstBefore(new BitCastInst(Op, I.getType(), > > "tmp"), I); > > This cast can be removed, now that shifts are signless. Yup. Done. > > > @@ -5681,7 +5677,7 @@ > > /// evaluate the expression. > > Value *InstCombiner::EvaluateInDifferentType(Value *V, const Type > > *Ty) { > >if (Constant *C = dyn_cast(V)) > > -return ConstantExpr::getCast(C, Ty); > > +return ConstantExpr::getIntegerCast(C, Ty, C->getType()- > > >isSigned()); > > This looks extremely unsafe. Why is it ok? The only place EvaluateInDifferentType is called is from commonIntCastTransforms. Those casts are guaranteed to only involve integer operands. Therefore, the only kind of cast that could be involved is an integer cast. What looks "extremely" unsafe about it? > > > @@ -7950,13 +7943,20 @@ > > // the same size. Instead of casting the pointer before > > the store, cast > > // the value to be stored. > > Value *NewCast; > > -if (Constant *C = dyn_cast(SI.getOperand(0))) > > - NewCast = ConstantExpr::getCast(C, SrcPTy); > > +Instruction::CastOps opcode = Instruction::BitCast; > > +Value *SIOp0 = SI.getOperand(0); > > +if (SrcPTy->getTypeID() == Type::PointerTyID) { > > isa(SrcPTy) > > > + if (SIOp0->getType()->isIntegral()) > > +opcode = Instruction::IntToPtr; > > +} else if (SrcPTy->isIntegral()) { > > + if (SIOp0->getType()->getTypeID() == Type::PointerTyID) > > isa Both done. > > -Chris > ___
Re: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
>>> @@ -5681,7 +5677,7 @@ >>> /// evaluate the expression. >>> Value *InstCombiner::EvaluateInDifferentType(Value *V, const Type >>> *Ty) { >>>if (Constant *C = dyn_cast(V)) >>> -return ConstantExpr::getCast(C, Ty); >>> +return ConstantExpr::getIntegerCast(C, Ty, C->getType()- isSigned()); >> >> This looks extremely unsafe. Why is it ok? > > The only place EvaluateInDifferentType is called is from > commonIntCastTransforms. Those casts are guaranteed to only involve > integer operands. Therefore, the only kind of cast that could be > involved is an integer cast. > > What looks "extremely" unsafe about it? I'm specifically concerned that there is nothing controlling whether a zext or sext gets generated other than C->getType()->isSigned(), which I'm not convinced is the right thing. Getting the wrong one is bad :) -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Transforms/ScalarRepl/union-fp-int.ll union-packed.ll
Changes in directory llvm/test/Regression/Transforms/ScalarRepl: union-fp-int.ll updated: 1.1 -> 1.2 union-packed.ll updated: 1.1 -> 1.2 --- Log message: xfail these until I recommit the scalarrepl patch --- Diffs of the changes: (+4 -0) union-fp-int.ll |2 ++ union-packed.ll |2 ++ 2 files changed, 4 insertions(+) Index: llvm/test/Regression/Transforms/ScalarRepl/union-fp-int.ll diff -u llvm/test/Regression/Transforms/ScalarRepl/union-fp-int.ll:1.1 llvm/test/Regression/Transforms/ScalarRepl/union-fp-int.ll:1.2 --- llvm/test/Regression/Transforms/ScalarRepl/union-fp-int.ll:1.1 Sun Dec 10 17:52:28 2006 +++ llvm/test/Regression/Transforms/ScalarRepl/union-fp-int.ll Wed Dec 13 11:42:40 2006 @@ -1,6 +1,8 @@ ; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | not grep alloca && ; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | grep 'bitcast.*float.*int' +; XFAIL: * + int %test(float %X) { %X_addr = alloca float store float %X, float* %X_addr Index: llvm/test/Regression/Transforms/ScalarRepl/union-packed.ll diff -u llvm/test/Regression/Transforms/ScalarRepl/union-packed.ll:1.1 llvm/test/Regression/Transforms/ScalarRepl/union-packed.ll:1.2 --- llvm/test/Regression/Transforms/ScalarRepl/union-packed.ll:1.1 Sun Dec 10 18:34:27 2006 +++ llvm/test/Regression/Transforms/ScalarRepl/union-packed.ll Wed Dec 13 11:42:40 2006 @@ -1,6 +1,8 @@ ; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | not grep alloca && ; RUN: llvm-upgrade < %s | llvm-as | opt -scalarrepl | llvm-dis | grep 'bitcast' +; XFAIL: * + target endian = little <4 x int> %test(<4 x float> %X) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/IntrinsicInst.cpp
Changes in directory llvm/lib/VMCore: IntrinsicInst.cpp updated: 1.11 -> 1.12 --- Log message: Update version in safe guards. --- Diffs of the changes: (+2 -2) IntrinsicInst.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/VMCore/IntrinsicInst.cpp diff -u llvm/lib/VMCore/IntrinsicInst.cpp:1.11 llvm/lib/VMCore/IntrinsicInst.cpp:1.12 --- llvm/lib/VMCore/IntrinsicInst.cpp:1.11 Sun Nov 26 19:05:10 2006 +++ llvm/lib/VMCore/IntrinsicInst.cpp Wed Dec 13 11:49:24 2006 @@ -59,7 +59,7 @@ std::string DbgStopPointInst::getFileName() const { // Once the operand indices are verified, update this assert - assert(LLVMDebugVersion == (5 << 16) && "Verify operand indices"); + assert(LLVMDebugVersion == (6 << 16) && "Verify operand indices"); GlobalVariable *GV = cast(getContext()); if (!GV->hasInitializer()) return ""; ConstantStruct *CS = cast(GV->getInitializer()); @@ -68,7 +68,7 @@ std::string DbgStopPointInst::getDirectory() const { // Once the operand indices are verified, update this assert - assert(LLVMDebugVersion == (5 << 16) && "Verify operand indices"); + assert(LLVMDebugVersion == (6 << 16) && "Verify operand indices"); GlobalVariable *GV = cast(getContext()); if (!GV->hasInitializer()) return ""; ConstantStruct *CS = cast(GV->getInitializer()); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
On Dec 13, 2006, at 9:20 AM, Reid Spencer wrote: >>> +static Value *InsertCastToIntPtrTy(Value *V, const Type *DTy, >>> + Instruction *InsertPoint, >>> + InstCombiner *IC) { >> >> Why did you rename this? > > Because the name doesn't match its action. SExt is only one > possibility. > The type of Value* can be larger, smaller, or equal in size to DTy > so it > can be SExt, Trunc, or BitCast. I figured > InsertSignExtendOrTruncateOrBitCastToPtrTy was a bit long. > >> The previous name was better (indicated >> sign extension). > > The previous name is misleading. It doesn't always do a SExt. > Consider > long GEP index on a 32-bit platform. The cast needed is a Trunc. > Ok. -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
> Implement review feedback. Most of this has to do with removing > unnecessary > cast instructions. A few are bug fixes. Thanks Reid, > @@ -4342,9 +4333,8 @@ >// Check to see if there is a noop-cast between the > shift and the and. >if (!Shift) { > if (CastInst *CI = dyn_cast(LHSI->getOperand > (0))) > - if (CI->getOperand(0)->getType()->isIntegral() && > - CI->getOperand(0)->getType()- > >getPrimitiveSizeInBits() == > - CI->getType()->getPrimitiveSizeInBits()) > + if (CI->getOpcode() == Instruction::BitCast && > + CI->getType()->isIntegral()) > Shift = dyn_cast(CI->getOperand(0)); >} I'm pretty certain you can also drop the 'CI->getType()->isIntegral ()' check here. Shifts can only return/take integral arguments. -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
> Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp > diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.567 > llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.568 > --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.567 Wed > Dec 13 02:27:15 2006 > +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Dec 13 > 02:33:33 2006 > @@ -2172,11 +2172,13 @@ >// formed. >CastInst *BoolCast = 0; >if (CastInst *CI = dyn_cast(I.getOperand(0))) > -if (CI->getOperand(0)->getType() == Type::BoolTy) > +if (CI->getOperand(0)->getType() == Type::BoolTy && > +CI->getOpcode() == Instruction::ZExt) >BoolCast = CI; >if (!BoolCast) > if (CastInst *CI = dyn_cast(I.getOperand(1))) > - if (CI->getOperand(0)->getType() == Type::BoolTy) > + if (CI->getOperand(0)->getType() == Type::BoolTy && > +CI->getOpcode() == Instruction::ZExt) > BoolCast = CI; >if (BoolCast) { > if (SetCondInst *SCI = dyn_cast(BoolCast- > >getOperand(0))) { Why not dyn_cast instead of checking the opcode? Thanks Reid, -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
On Wed, 2006-12-13 at 09:48 -0800, Chris Lattner wrote: > >>> @@ -5681,7 +5677,7 @@ > >>> /// evaluate the expression. > >>> Value *InstCombiner::EvaluateInDifferentType(Value *V, const Type > >>> *Ty) { > >>>if (Constant *C = dyn_cast(V)) > >>> -return ConstantExpr::getCast(C, Ty); > >>> +return ConstantExpr::getIntegerCast(C, Ty, C->getType()- > isSigned()); > >> > >> This looks extremely unsafe. Why is it ok? > > > > The only place EvaluateInDifferentType is called is from > > commonIntCastTransforms. Those casts are guaranteed to only involve > > integer operands. Therefore, the only kind of cast that could be > > involved is an integer cast. > > > > What looks "extremely" unsafe about it? > > I'm specifically concerned that there is nothing controlling whether > a zext or sext gets generated other than C->getType()->isSigned(), > which I'm not convinced is the right thing. Getting the wrong one is > bad :) Ah, okay, that makes sense. I'll look at getting rid of the isSigned() call. > > -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
On Wed, 2006-12-13 at 09:53 -0800, Chris Lattner wrote: > > Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp > > diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.567 > > llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.568 > > --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.567 Wed > > Dec 13 02:27:15 2006 > > +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Dec 13 > > 02:33:33 2006 > > @@ -2172,11 +2172,13 @@ > >// formed. > >CastInst *BoolCast = 0; > >if (CastInst *CI = dyn_cast(I.getOperand(0))) > > -if (CI->getOperand(0)->getType() == Type::BoolTy) > > +if (CI->getOperand(0)->getType() == Type::BoolTy && > > +CI->getOpcode() == Instruction::ZExt) > >BoolCast = CI; > >if (!BoolCast) > > if (CastInst *CI = dyn_cast(I.getOperand(1))) > > - if (CI->getOperand(0)->getType() == Type::BoolTy) > > + if (CI->getOperand(0)->getType() == Type::BoolTy && > > +CI->getOpcode() == Instruction::ZExt) > > BoolCast = CI; > >if (BoolCast) { > > if (SetCondInst *SCI = dyn_cast(BoolCast- > > >getOperand(0))) { > > Why not dyn_cast instead of checking the opcode? Because at midnight I'm not thinking clearly? I've included this in my next round of tests. > > Thanks Reid, > > -Chris > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
On Wed, 2006-12-13 at 09:51 -0800, Chris Lattner wrote: > > Implement review feedback. Most of this has to do with removing > > unnecessary > > cast instructions. A few are bug fixes. > > Thanks Reid, > > > @@ -4342,9 +4333,8 @@ > >// Check to see if there is a noop-cast between the > > shift and the and. > >if (!Shift) { > > if (CastInst *CI = dyn_cast(LHSI->getOperand > > (0))) > > - if (CI->getOperand(0)->getType()->isIntegral() && > > - CI->getOperand(0)->getType()- > > >getPrimitiveSizeInBits() == > > - CI->getType()->getPrimitiveSizeInBits()) > > + if (CI->getOpcode() == Instruction::BitCast && > > + CI->getType()->isIntegral()) > > Shift = dyn_cast(CI->getOperand(0)); > >} > > I'm pretty certain you can also drop the 'CI->getType()->isIntegral > ()' check here. Shifts can only return/take integral arguments. Yup, dropped it. > > -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.569 -> 1.570 --- Log message: Fix a bug in EvaluateInDifferentType. The type of operand should not be used to determine whether a ZExt or SExt cast is performed. Instead, pass an "isSigned" bool to the function and determine its value from the opcode of the cast involved. Also, clean up some cruft from previous patches. --- Diffs of the changes: (+17 -20) InstructionCombining.cpp | 37 + 1 files changed, 17 insertions(+), 20 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.569 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.570 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.569 Wed Dec 13 11:19:09 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Dec 13 12:21:21 2006 @@ -307,7 +307,7 @@ Instruction *PromoteCastOfAllocation(CastInst &CI, AllocationInst &AI); Instruction *MatchBSwap(BinaryOperator &I); -Value *EvaluateInDifferentType(Value *V, const Type *Ty); +Value *EvaluateInDifferentType(Value *V, const Type *Ty, bool isSigned); }; RegisterPass X("instcombine", "Combine redundant instructions"); @@ -2171,14 +2171,12 @@ // See if we can simplify things based on how the boolean was originally // formed. CastInst *BoolCast = 0; - if (CastInst *CI = dyn_cast(I.getOperand(0))) -if (CI->getOperand(0)->getType() == Type::BoolTy && -CI->getOpcode() == Instruction::ZExt) + if (ZExtInst *CI = dyn_cast(I.getOperand(0))) +if (CI->getOperand(0)->getType() == Type::BoolTy) BoolCast = CI; if (!BoolCast) -if (CastInst *CI = dyn_cast(I.getOperand(1))) - if (CI->getOperand(0)->getType() == Type::BoolTy && -CI->getOpcode() == Instruction::ZExt) +if (ZExtInst *CI = dyn_cast(I.getOperand(1))) + if (CI->getOperand(0)->getType() == Type::BoolTy) BoolCast = CI; if (BoolCast) { if (SetCondInst *SCI = dyn_cast(BoolCast->getOperand(0))) { @@ -4333,8 +4331,7 @@ // Check to see if there is a noop-cast between the shift and the and. if (!Shift) { if (CastInst *CI = dyn_cast(LHSI->getOperand(0))) - if (CI->getOpcode() == Instruction::BitCast && - CI->getType()->isIntegral()) + if (CI->getOpcode() == Instruction::BitCast) Shift = dyn_cast(CI->getOperand(0)); } @@ -5375,10 +5372,8 @@ Amt = Op0->getType()->getPrimitiveSizeInBits(); Value *Op = ShiftOp->getOperand(0); - if (isShiftOfSignedShift != isSignedShift) -Op = InsertNewInstBefore(new BitCastInst(Op, I.getType(), "tmp"), I); ShiftInst *ShiftResult = new ShiftInst(I.getOpcode(), Op, - ConstantInt::get(Type::UByteTy, Amt)); + ConstantInt::get(Type::UByteTy, Amt)); if (I.getType() == ShiftResult->getType()) return ShiftResult; InsertNewInstBefore(ShiftResult, I); @@ -5658,9 +5653,10 @@ /// EvaluateInDifferentType - Given an expression that /// CanEvaluateInDifferentType returns true for, actually insert the code to /// evaluate the expression. -Value *InstCombiner::EvaluateInDifferentType(Value *V, const Type *Ty) { +Value *InstCombiner::EvaluateInDifferentType(Value *V, const Type *Ty, + bool isSigned ) { if (Constant *C = dyn_cast(V)) -return ConstantExpr::getIntegerCast(C, Ty, C->getType()->isSigned()); +return ConstantExpr::getIntegerCast(C, Ty, isSigned /*Sext or ZExt*/); // Otherwise, it must be an instruction. Instruction *I = cast(V); @@ -5669,8 +5665,8 @@ case Instruction::And: case Instruction::Or: case Instruction::Xor: { -Value *LHS = EvaluateInDifferentType(I->getOperand(0), Ty); -Value *RHS = EvaluateInDifferentType(I->getOperand(1), Ty); +Value *LHS = EvaluateInDifferentType(I->getOperand(0), Ty, isSigned); +Value *RHS = EvaluateInDifferentType(I->getOperand(1), Ty, isSigned); Res = BinaryOperator::create((Instruction::BinaryOps)I->getOpcode(), LHS, RHS, I->getName()); break; @@ -5678,7 +5674,7 @@ case Instruction::AShr: case Instruction::LShr: case Instruction::Shl: { -Value *LHS = EvaluateInDifferentType(I->getOperand(0), Ty); +Value *LHS = EvaluateInDifferentType(I->getOperand(0), Ty, isSigned); Res = new ShiftInst((Instruction::OtherOps)I->getOpcode(), LHS, I->getOperand(1), I->getName()); break; @@ -5824,7 +5820,8 @@ } if (DoXForm) { - Value *Res = EvaluateInDifferentType(SrcI, DestTy); + Value *Res = EvaluateInDifferentType(SrcI, DestTy, + CI.getOpcode() == Instruction::SExt); assert(Res->getType() == D
[llvm-commits] CVS: llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll arraytest.ll badcases.ll basictest.ll dg.exp fieldmerge.ll goodcases.ll indcalltest.ll misctests.ll physicalsubtype.ll recu
Changes in directory llvm/test/Regression/Transforms/DSAnalysis: arraymerge.ll (r1.5) removed arraytest.ll (r1.6) removed badcases.ll (r1.6) removed basictest.ll (r1.6) removed dg.exp (r1.3) removed fieldmerge.ll (r1.6) removed goodcases.ll (r1.5) removed indcalltest.ll (r1.5) removed misctests.ll (r1.6) removed physicalsubtype.ll (r1.6) removed recursion.ll (r1.5) removed simplest-test.ll (r1.5) removed simpletest.ll (r1.5) removed structpadding.ll (r1.6) removed --- Log message: Remove DSA tests. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] SETCC Patches (For Review Only) #1: llvm-gcc
Chris, I rewrote the llvm-gcc portion of the SETCC patch with your suggestions. It is much cleaner now. The patch is attached. Hopefully this is more to your liking. Reid. Sheng: This is just FYI. On Sun, 2006-12-10 at 18:03 -0800, Chris Lattner wrote: > On Dec 10, 2006, at 3:43 PM, Reid Spencer wrote: > > Here's the SETCC patch to convert SetCondInst (SetCC) instructions > > into > > ICmpInst. Here's somethings you should know about this patch: > > > > > > 3. The SetCondInst instruction is still used for floating point > > comparisons. > > > Ok, this will be changed in the next patch? > > > > 6. The llvm-gcc patch emits ICmp for integer/pointer and SetCC for > > floating > >point. No FCmpInst instructions are emitted. We'll do that in the > > next patch. > > > Ok, sounds great. > > > For the llvm-gcc patch: > > >Value *EmitCompare(tree_node *exp, unsigned Opc, bool isUnordered); > + Value *EmitCompare(tree_node *exp, unsigned Opc); > > > I don't like the subtle overloads here. One way to fix this: > > > + case LT_EXPR: { > +tree Op0Ty = TREE_TYPE(TREE_OPERAND(exp,0)); > +if (!FLOAT_TYPE_P(Op0Ty)) > + Result = > +EmitCompare(exp, TYPE_UNSIGNED(Op0Ty) ? > +ICmpInst::ICMP_ULT : ICmpInst::ICMP_SLT); > +else > + Result = EmitCompare(exp, Instruction::SetLT, 0); > +break; > + } > + case LE_EXPR: { > +tree Op0Ty = TREE_TYPE(TREE_OPERAND(exp,0)); > +if (!FLOAT_TYPE_P(Op0Ty)) > + Result = > +EmitCompare(exp, TYPE_UNSIGNED(Op0Ty) ? > +ICmpInst::ICMP_ULE : ICmpInst::ICMP_SLE); > +else > + Result = EmitCompare(exp, Instruction::SetLE, 0); > +break; > + } > > > This logic shouldn't be duplicated everywhere. I much prefer that you > do something like: > > > case LT_EXPR: > Result = EmitCompare(exp, ICmpInst::ICMP_ULT, > ICmpInst::ICMP_SLT, Instruction::SetLT, 0); > break; > > > ... and move the code for determining which opcode to use into > EmitCompare. The same can be > done for EmitMinMaxExpr. > > > > > @@ -2261,8 +2319,8 @@ >Value *Op = Emit(TREE_OPERAND(exp, 0), 0); >if (!Op->getType()->isFloatingPoint()) { > Instruction *OpN = BinaryOperator::createNeg(Op, > Op->getName()+"neg",CurBB); > -Value *Cmp = new SetCondInst(Instruction::SetGE, Op, > OpN->getOperand(0), > - "abscond", CurBB); > +Value *Cmp = new ICmpInst(ICmpInst::ICMP_SGE, Op, > OpN->getOperand(0), > + "abscond", CurBB); > return new SelectInst(Cmp, Op, OpN, "abs", CurBB); >} else { > // Turn FP abs into fabs/fabsf. > > > This isn't right. You need to emit a signed or unsigned comparison > depending on TYPE_UNSIGNED. It would make sense to just use a call to > EmitCompare here and have it pick the right one. I know that unsigned > abs doesn't make much sense, but this is how expr.c handles it for > GCC: > > > /* Unsigned abs is simply the operand. Testing here means we > don't > risk generating incorrect code below. */ > if (TYPE_UNSIGNED (type)) > return op0; > > > @@ -2464,8 +2542,13 @@ >LHS = NOOPCastToType(LHS, Ty); >RHS = NOOPCastToType(RHS, Ty); > > > > > - Value *Pred = new SetCondInst((Instruction::BinaryOps)CmpOpc, LHS, > RHS, > -"tmp", CurBB); > + Value *Pred; > + if (LHS->getType()->isFloatingPoint()) > +Pred = new SetCondInst((Instruction::BinaryOps)CmpOpc, LHS, RHS, > + "tmp", CurBB); > + else > +Pred = new ICmpInst((ICmpInst::Predicate)CmpOpc, LHS, RHS, > + "tmp", CurBB); >return new SelectInst(Pred, LHS, RHS, > TREE_CODE(exp) == MAX_EXPR ? "max" : "min", > CurBB); > } > > > Likewise this code is wrong (for max). It should also just call > EmitCompare. > > > -Chris Index: gcc/llvm-convert.cpp === --- gcc/llvm-convert.cpp (revision 225) +++ gcc/llvm-convert.cpp (working copy) @@ -537,23 +537,35 @@ case TRUTH_NOT_EXPR: Result = EmitTRUTH_NOT_EXPR(exp); break; // Binary Operators - case LT_EXPR:Result = EmitCompare(exp, Instruction::SetLT, 0); break; - case LE_EXPR:Result = EmitCompare(exp, Instruction::SetLE, 0); break; - case GT_EXPR:Result = EmitCompare(exp, Instruction::SetGT, 0); break; - case GE_EXPR:Result = EmitCompare(exp, Instruction::SetGE, 0); break; - case EQ_EXPR:Result = EmitCompare(exp, Instruction::SetEQ, 0); break; - case NE_EXPR:Result = EmitCompare(exp, Instruction::SetNE, 0); break; - case UNORDERED_EXPR: Result = EmitCompare(exp, 0, 1); break; // not a typo - case ORDERED_EXPR: Result = EmitCompare(exp, 0, 1); break; // not a typo - case UNLT_EXPR: Result = EmitCompare(exp, Instruction::SetLT, 1); break; - case UNLE_EXPR: Result = EmitCo
[llvm-commits] CVS: llvm/test/Regression/Transforms/DSAnalysis/.cvsignore
Changes in directory llvm/test/Regression/Transforms/DSAnalysis: .cvsignore (r1.2) removed --- Log message: Remove DSA tests. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp CallTargets.cpp CompleteBottomUp.cpp DataStructure.cpp DataStructureAA.cpp DataStructureOpt.cpp DataStructureStats.cpp EquivClas
Changes in directory llvm/lib/Analysis/DataStructure: BottomUpClosure.cpp (r1.127) removed CallTargets.cpp (r1.7) removed CompleteBottomUp.cpp (r1.39) removed DataStructure.cpp (r1.255) removed DataStructureAA.cpp (r1.40) removed DataStructureOpt.cpp (r1.14) removed DataStructureStats.cpp (r1.24) removed EquivClassGraphs.cpp (r1.53) removed GraphChecker.cpp (r1.23) removed Local.cpp (r1.163) removed Makefile (r1.5) removed Printer.cpp (r1.91) removed Steensgaard.cpp (r1.67) removed TopDownClosure.cpp (r1.95) removed --- Log message: Remove DSA. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/Makefile
Changes in directory llvm/lib/Analysis: Makefile updated: 1.12 -> 1.13 --- Log message: Changed from PARALLEL_DIRS to DIRS since we're only building one directory. Thanks Reid. --- Diffs of the changes: (+1 -1) Makefile |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Analysis/Makefile diff -u llvm/lib/Analysis/Makefile:1.12 llvm/lib/Analysis/Makefile:1.13 --- llvm/lib/Analysis/Makefile:1.12 Wed Dec 13 10:54:24 2006 +++ llvm/lib/Analysis/Makefile Wed Dec 13 13:42:54 2006 @@ -9,7 +9,7 @@ LEVEL = ../.. LIBRARYNAME = LLVMAnalysis -PARALLEL_DIRS = IPA +DIRS = IPA BUILD_ARCHIVE = 1 include $(LEVEL)/Makefile.common ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] SETCC Patches (For Review Only) #1: llvm-gcc
On Dec 13, 2006, at 11:21 AM, Reid Spencer wrote: > Chris, > > I rewrote the llvm-gcc portion of the SETCC patch with your > suggestions. > It is much cleaner now. The patch is attached. Hopefully this is > more to > your liking. Very nice, -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Analysis/DataStructure/CallTargets.h DSGraph.h DSGraphTraits.h DSNode.h DSSupport.h DataStructure.h
Changes in directory llvm/include/llvm/Analysis/DataStructure: CallTargets.h (r1.1) removed DSGraph.h (r1.112) removed DSGraphTraits.h (r1.25) removed DSNode.h (r1.60) removed DSSupport.h (r1.41) removed DataStructure.h (r1.98) removed --- Log message: Remove DSA. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Pass.h
Changes in directory llvm/include/llvm: Pass.h updated: 1.59 -> 1.60 --- Log message: Move enum PassDebugLevel from PassManagerT.h to Pass.h. Use PDL as the prefix for these enums. Define and use PassDebugging_New in new PassManager. --- Diffs of the changes: (+5 -0) Pass.h |5 + 1 files changed, 5 insertions(+) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.59 llvm/include/llvm/Pass.h:1.60 --- llvm/include/llvm/Pass.h:1.59 Tue Dec 12 20:36:01 2006 +++ llvm/include/llvm/Pass.hWed Dec 13 14:03:48 2006 @@ -355,6 +355,11 @@ /// @brief This is the storage for the -time-passes option. extern bool TimePassesIsEnabled; +// Different debug levels that can be enabled... +enum PassDebugLevel { + PDLNone, PDLArguments, PDLStructure, PDLExecutions, PDLDetails +}; + } // End llvm namespace // Include support files that contain important APIs commonly used by Passes, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp Heuristic.cpp PointerCompress.cpp PoolAllocate.cpp TransformFunctionBody.cpp
Changes in directory llvm-poolalloc/lib/PoolAllocate: AccessTrace.cpp updated: 1.6 -> 1.6.2.1 Heuristic.cpp updated: 1.15 -> 1.15.2.1 PointerCompress.cpp updated: 1.72 -> 1.72.2.1 PoolAllocate.cpp updated: 1.127 -> 1.127.2.1 TransformFunctionBody.cpp updated: 1.57 -> 1.57.2.1 --- Log message: Switch to using DSA header files from the llvm-poolalloc project. --- Diffs of the changes: (+16 -11) AccessTrace.cpp |5 +++-- Heuristic.cpp |3 ++- PointerCompress.cpp |5 +++-- PoolAllocate.cpp |7 --- TransformFunctionBody.cpp |7 --- 5 files changed, 16 insertions(+), 11 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp diff -u llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp:1.6 llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp:1.6.2.1 --- llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp:1.6 Tue Oct 24 16:43:50 2006 +++ llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp Wed Dec 13 14:04:22 2006 @@ -12,9 +12,10 @@ //===--===// #define DEBUG_TYPE "pointercompress" + +#include "dsa/DataStructure.h" +#include "dsa/DSGraph.h" #include "poolalloc/PoolAllocate.h" -#include "llvm/Analysis/DataStructure/DataStructure.h" -#include "llvm/Analysis/DataStructure/DSGraph.h" #include "llvm/Instructions.h" #include "llvm/Module.h" using namespace llvm; Index: llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp diff -u llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp:1.15 llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp:1.15.2.1 --- llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp:1.15 Wed Jul 26 10:07:40 2006 +++ llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp Wed Dec 13 14:04:22 2006 @@ -12,10 +12,11 @@ //===--===// #include "Heuristic.h" + +#include "dsa/DSGraphTraits.h" #include "poolalloc/PoolAllocate.h" #include "llvm/Instructions.h" #include "llvm/Module.h" -#include "llvm/Analysis/DataStructure/DSGraphTraits.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/Support/CommandLine.h" #include "llvm/Target/TargetData.h" Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.72 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.72.2.1 --- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.72Fri Nov 3 14:14:34 2006 +++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Wed Dec 13 14:04:23 2006 @@ -12,13 +12,14 @@ //===--===// #define DEBUG_TYPE "pointercompress" + +#include "dsa/DataStructure.h" +#include "dsa/DSGraph.h" #include "poolalloc/PoolAllocate.h" #include "Heuristic.h" #include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/Module.h" -#include "llvm/Analysis/DataStructure/DataStructure.h" -#include "llvm/Analysis/DataStructure/DSGraph.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/CommandLine.h" Index: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.127 llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.127.2.1 --- llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.127 Fri Nov 3 14:14:34 2006 +++ llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cppWed Dec 13 14:04:23 2006 @@ -13,6 +13,9 @@ //===--===// #define DEBUG_TYPE "poolalloc" + +#include "dsa/DataStructure.h" +#include "dsa/DSGraph.h" #include "poolalloc/PoolAllocate.h" #include "Heuristic.h" #include "llvm/Constants.h" @@ -20,13 +23,11 @@ #include "llvm/Instructions.h" #include "llvm/Module.h" #include "llvm/Constants.h" -#include "llvm/Analysis/DataStructure/DataStructure.h" -#include "llvm/Analysis/DataStructure/DSGraph.h" #include "llvm/Support/CFG.h" #include "llvm/Target/TargetData.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Cloning.h" -#include "llvm/Analysis/DataStructure/CallTargets.h" +#include "dsa/CallTargets.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" Index: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp diff -u llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.57 llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.57.2.1 --- llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.57 Tue Oct 24 16:43:50 2006 +++ llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Wed Dec 13 14:04:23 2006 @@ -12,10 +12,11 @@ //===--===// #define DEBUG_TYPE "PoolAllocator" + +#include "dsa/DataStructure.h" +#include "dsa/DSGraph.h" +#include "dsa/CallTargets.h" #include "poolalloc/PoolAllocate.h" -#include "llvm/Analysis/D
[llvm-commits] CVS: llvm/lib/VMCore/Pass.cpp PassManager.cpp PassManagerT.h
Changes in directory llvm/lib/VMCore: Pass.cpp updated: 1.78 -> 1.79 PassManager.cpp updated: 1.93 -> 1.94 PassManagerT.h updated: 1.72 -> 1.73 --- Log message: Move enum PassDebugLevel from PassManagerT.h to Pass.h. Use PDL as the prefix for these enums. Define and use PassDebugging_New in new PassManager. --- Diffs of the changes: (+42 -21) Pass.cpp|8 PassManager.cpp | 26 ++ PassManagerT.h | 29 - 3 files changed, 42 insertions(+), 21 deletions(-) Index: llvm/lib/VMCore/Pass.cpp diff -u llvm/lib/VMCore/Pass.cpp:1.78 llvm/lib/VMCore/Pass.cpp:1.79 --- llvm/lib/VMCore/Pass.cpp:1.78 Tue Dec 12 20:36:01 2006 +++ llvm/lib/VMCore/Pass.cppWed Dec 13 14:03:48 2006 @@ -122,7 +122,7 @@ void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, Pass *P, Module *M) { - if (PassDebugging >= Executions) { + if (PassDebugging >= PDLExecutions) { cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '" << P->getPassName(); if (M) cerr << "' on Module '" << M->getModuleIdentifier() << "'\n"; @@ -132,7 +132,7 @@ void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, Pass *P, Function *F) { - if (PassDebugging >= Executions) { + if (PassDebugging >= PDLExecutions) { cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '" << P->getPassName(); if (F) cerr << "' on Function '" << F->getName(); @@ -142,7 +142,7 @@ void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, Pass *P, BasicBlock *BB) { - if (PassDebugging >= Executions) { + if (PassDebugging >= PDLExecutions) { cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '" << P->getPassName(); if (BB) cerr << "' on BasicBlock '" << BB->getName(); @@ -152,7 +152,7 @@ void PMDebug::PrintAnalysisSetInfo(unsigned Depth, const char *Msg, Pass *P, const std::vector &Set){ - if (PassDebugging >= Details && !Set.empty()) { + if (PassDebugging >= PDLDetails && !Set.empty()) { cerr << (void*)P << std::string(Depth*2+3, ' ') << Msg << " Analyses:"; for (unsigned i = 0; i != Set.size(); ++i) { if (i) cerr << ","; Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.93 llvm/lib/VMCore/PassManager.cpp:1.94 --- llvm/lib/VMCore/PassManager.cpp:1.93Tue Dec 12 20:36:01 2006 +++ llvm/lib/VMCore/PassManager.cpp Wed Dec 13 14:03:48 2006 @@ -13,6 +13,7 @@ #include "llvm/PassManager.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Module.h" #include "llvm/ModuleProvider.h" #include "llvm/Support/Streams.h" @@ -84,6 +85,27 @@ // ModulePassManagers. //===--===// +namespace llvm { + +//===--===// +// Pass debugging information. Often it is useful to find out what pass is +// running when a crash occurs in a utility. When this library is compiled with +// debugging on, a command line option (--debug-pass) is enabled that causes the +// pass name to be printed before it executes. +// + +static cl::opt +PassDebugging_New("debug-pass", cl::Hidden, + cl::desc("Print PassManager debugging information"), + cl::values( + clEnumVal(PDLNone , "disable debug output"), + clEnumVal(PDLArguments , "print pass arguments to pass to 'opt'"), + clEnumVal(PDLStructure , "print pass structure before run()"), + clEnumVal(PDLExecutions, "print pass name before it is executed"), + clEnumVal(PDLDetails , "print pass details when it is executed"), + clEnumValEnd)); +} // End of llvm namespace + #ifndef USE_OLD_PASSMANAGER namespace llvm { @@ -1241,6 +1263,10 @@ bool PassManagerImpl_New::run(Module &M) { bool Changed = false; + + if (PassDebugging_New >= PDLStructure) +dumpPasses(); + for (std::vector::iterator I = passManagersBegin(), E = passManagersEnd(); I != E; ++I) { ModulePassManager *MP = dynamic_cast(*I); Index: llvm/lib/VMCore/PassManagerT.h diff -u llvm/lib/VMCore/PassManagerT.h:1.72 llvm/lib/VMCore/PassManagerT.h:1.73 --- llvm/lib/VMCore/PassManagerT.h:1.72 Sun Dec 10 01:40:46 2006 +++ llvm/lib/VMCore/PassManagerT.h Wed Dec 13 14:03:48 2006 @@ -37,21 +37,16 @@ // pass name to be printed before it executes. // -// Different debug levels that can be enabled... -enum PassDebugLevel { - None, Arguments, Structure, Executions, Details -}; - static cl::opt PassDebugging("debug-pass", cl::Hidden, - cl::desc("Print PassManager debugging information"), - cl::values( - clEnumVal(None , "disable debug output"), - clEnumVal(Arguments , "print pass arguments to pass to
[llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp PointerCompress.cpp PoolAllocate.cpp PoolOptimize.cpp TransformFunctionBody.cpp
Changes in directory llvm-poolalloc/lib/PoolAllocate: AccessTrace.cpp updated: 1.6 -> 1.7 PointerCompress.cpp updated: 1.72 -> 1.73 PoolAllocate.cpp updated: 1.127 -> 1.128 PoolOptimize.cpp updated: 1.8 -> 1.9 TransformFunctionBody.cpp updated: 1.57 -> 1.58 --- Log message: Updated to LLVM Mainline API. This required changing statistics to be non-templated and switching over to using the new cast instructions. --- Diffs of the changes: (+65 -50) AccessTrace.cpp |4 ++-- PointerCompress.cpp | 41 + PoolAllocate.cpp | 29 - PoolOptimize.cpp |2 +- TransformFunctionBody.cpp | 39 +-- 5 files changed, 65 insertions(+), 50 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp diff -u llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp:1.6 llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp:1.7 --- llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp:1.6 Tue Oct 24 16:43:50 2006 +++ llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp Wed Dec 13 14:06:42 2006 @@ -81,10 +81,10 @@ if (Node == 0) return; Value *PD = FI->PoolDescriptors[Node]; - Ptr = new CastInst(Ptr, VoidPtrTy, Ptr->getName(), I); + Ptr = CastInst::createPointerCast (Ptr, VoidPtrTy, Ptr->getName(), I); if (PD) -PD = new CastInst(PD, VoidPtrTy, PD->getName(), I); +PD = CastInst::createPointerCast (PD, VoidPtrTy, PD->getName(), I); else PD = Constant::getNullValue(VoidPtrTy); Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.72 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.73 --- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.72Fri Nov 3 14:14:34 2006 +++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Wed Dec 13 14:06:42 2006 @@ -54,11 +54,11 @@ cl::desc("Enable Andrew's fixes/hacks")); - Statistic<> NumCompressed("pointercompress", + Statistic NumCompressed("pointercompress", "Number of pools pointer compressed"); - Statistic<> NumNotCompressed("pointercompress", + Statistic NumNotCompressed("pointercompress", "Number of pools not compressible"); - Statistic<> NumCloned("pointercompress", "Number of functions cloned"); + Statistic NumCloned("pointercompress", "Number of functions cloned"); class CompressedPoolInfo; @@ -703,7 +703,7 @@ // Add Idx*sizeof(NewElementType) to the index. const Type *ElTy = cast(NTy)->getElementType(); if (Idx->getType() != SCALARUINTTYPE) - Idx = new CastInst(Idx, SCALARUINTTYPE, Idx->getName(), &GEPI); + Idx = CastInst::createSExtOrBitCast(Idx, SCALARUINTTYPE, Idx->getName(), &GEPI); Constant *Scale = ConstantInt::get(SCALARUINTTYPE, TD.getTypeSize(ElTy)); @@ -729,7 +729,7 @@ // type. if (getPoolInfo(&LI)) { Value *NLI = new LoadInst(LI.getOperand(0), LI.getName()+".cp", &LI); - Value *NC = new CastInst(NLI, SCALARUINTTYPE, NLI->getName(), &LI); + Value *NC = CastInst::createZExtOrBitCast(NLI, SCALARUINTTYPE, NLI->getName(), &LI); setTransformedValue(LI, NC); } return; @@ -746,19 +746,19 @@ std::vector Ops; Ops.push_back(getTransformedValue(LI.getOperand(0))); if (Ops[0]->getType() == Type::UShortTy) -Ops[0] = new CastInst(Ops[0], Type::UIntTy, "extend_idx", &LI); +Ops[0] = CastInst::createZExtOrBitCast(Ops[0], Type::UIntTy, "extend_idx", &LI); Value *SrcPtr = new GetElementPtrInst(BasePtr, Ops, LI.getOperand(0)->getName()+".pp", &LI); const Type *DestTy = LoadingCompressedPtr ? MEMUINTTYPE : LI.getType(); - SrcPtr = new CastInst(SrcPtr, PointerType::get(DestTy), -SrcPtr->getName(), &LI); + SrcPtr = CastInst::createPointerCast(SrcPtr, PointerType::get(DestTy), + SrcPtr->getName(), &LI); std::string OldName = LI.getName(); LI.setName(""); Value *NewLoad = new LoadInst(SrcPtr, OldName, &LI); if (LoadingCompressedPtr) { // Convert from MEMUINTTYPE to SCALARUINTTYPE if different. if (MEMUINTTYPE != SCALARUINTTYPE) - NewLoad = new CastInst(NewLoad, SCALARUINTTYPE, NewLoad->getName(), &LI); + NewLoad = CastInst::createZExtOrBitCast(NewLoad, SCALARUINTTYPE, NewLoad->getName(), &LI); setTransformedValue(LI, NewLoad); } else { @@ -777,8 +777,8 @@ // cast the index to a pointer type and store that. if (getPoolInfo(SI.getOperand(0))) { Value *SrcVal = getTransformedValue(SI.getOperand(0)); - SrcVal = new CastInst(SrcVal, SI.getOperand(0)->getType(), -SrcVal->getName(), &SI); + SrcVal = CastInst::createPointerCast(SrcVal, SI.getOperand(0)->getType(), +
[llvm-commits] CVS: llvm/include/llvm/LinkAllPasses.h
Changes in directory llvm/include/llvm: LinkAllPasses.h updated: 1.5 -> 1.6 --- Log message: Remove DSA header files. --- Diffs of the changes: (+0 -2) LinkAllPasses.h |2 -- 1 files changed, 2 deletions(-) Index: llvm/include/llvm/LinkAllPasses.h diff -u llvm/include/llvm/LinkAllPasses.h:1.5 llvm/include/llvm/LinkAllPasses.h:1.6 --- llvm/include/llvm/LinkAllPasses.h:1.5 Wed Dec 13 10:53:17 2006 +++ llvm/include/llvm/LinkAllPasses.h Wed Dec 13 13:55:53 2006 @@ -22,8 +22,6 @@ #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/PostDominators.h" #include "llvm/Analysis/ScalarEvolution.h" -#include "llvm/Analysis/DataStructure/DataStructure.h" -#include "llvm/Analysis/DataStructure/CallTargets.h" #include "llvm/CodeGen/Passes.h" #include "llvm/Function.h" #include "llvm/Transforms/Instrumentation.h" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h
Changes in directory llvm/include/llvm/Target: TargetLowering.h updated: 1.93 -> 1.94 --- Log message: Add getTypeToExpandTo() which recursively walks TransformToType to determine the intrinsic type to expand to. --- Diffs of the changes: (+20 -0) TargetLowering.h | 20 1 files changed, 20 insertions(+) Index: llvm/include/llvm/Target/TargetLowering.h diff -u llvm/include/llvm/Target/TargetLowering.h:1.93 llvm/include/llvm/Target/TargetLowering.h:1.94 --- llvm/include/llvm/Target/TargetLowering.h:1.93 Wed Dec 13 00:12:35 2006 +++ llvm/include/llvm/Target/TargetLowering.h Wed Dec 13 14:52:00 2006 @@ -176,6 +176,26 @@ return TransformToType[VT]; } + /// getTypeToExpandTo - For types supported by the target, this is an + /// identity function. For types that must be expanded (i.e. integer types + /// that are larger than the largest integer register or illegal floating + /// point types), this returns the largest legal type it will be expanded to. + MVT::ValueType getTypeToExpandTo(MVT::ValueType VT) const { +while (true) { + switch (getTypeAction(VT)) { + case Legal: +return VT; + case Expand: +VT = TransformToType[VT]; +break; + default: +assert(false && "Type is not legal nor is it to be expanded!"); +return VT; + } +} +return VT; + } + /// getPackedTypeBreakdown - Packed types are broken down into some number of /// legal first class types. For example, <8 x float> maps to 2 MVT::v4f32 /// with Altivec or SSE1, or 8 promoted MVT::f64 values with the X86 FP stack. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/README-SSE.txt
Changes in directory llvm/lib/Target/X86: README-SSE.txt updated: 1.11 -> 1.12 --- Log message: Add note. --- Diffs of the changes: (+5 -0) README-SSE.txt |5 + 1 files changed, 5 insertions(+) Index: llvm/lib/Target/X86/README-SSE.txt diff -u llvm/lib/Target/X86/README-SSE.txt:1.11 llvm/lib/Target/X86/README-SSE.txt:1.12 --- llvm/lib/Target/X86/README-SSE.txt:1.11 Sun Dec 10 19:01:03 2006 +++ llvm/lib/Target/X86/README-SSE.txt Wed Dec 13 14:59:43 2006 @@ -535,3 +535,8 @@ Floating point max / min are commutable when -enable-unsafe-fp-path is specified. We should turn int_x86_sse_max_ss and X86ISD::FMIN etc. into other nodes which are selected to max / min instructions that are marked commutable. + +//===-===// + +Add MOVDI2SSrr and MOVDSS2DIrr to X86RegisterInfo::foldMemoryOperand() once the +recent X86 JIT regressions have been identified and fixed. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm-poolalloc/autoconf/AutoRegen.sh
Changes in directory llvm-poolalloc/autoconf: AutoRegen.sh added (r1.1.2.1) --- Log message: Added AutoRegen.sh script from the SAFECode project, which is based on the original one from the LLVM project. --- Diffs of the changes: (+30 -0) AutoRegen.sh | 30 ++ 1 files changed, 30 insertions(+) Index: llvm-poolalloc/autoconf/AutoRegen.sh diff -c /dev/null llvm-poolalloc/autoconf/AutoRegen.sh:1.1.2.1 *** /dev/null Wed Dec 13 14:58:15 2006 --- llvm-poolalloc/autoconf/AutoRegen.shWed Dec 13 14:58:04 2006 *** *** 0 --- 1,30 + #!/bin/sh + die () { + echo "$@" 1>&2 + exit 1 + } + test -d autoconf && test -f autoconf/configure.ac && cd autoconf + test -f configure.ac || die "Can't find 'autoconf' dir; please cd into it first" + autoconf --version | egrep '2\.5[0-9]' > /dev/null + if test $? -ne 0 ; then + die "Your autoconf was not detected as being 2.5x" + fi + cwd=`pwd` + if test -d ../../../autoconf/m4 ; then + cd ../../../autoconf/m4 + llvm_m4=`pwd` + cd $cwd + elif test -d ../../llvm/autoconf/m4 ; then + cd ../../llvm/autoconf/m4 + llvm_m4=`pwd` + cd $cwd + else + die "Can't find the LLVM autoconf/m4 directory. The project should be checked out to projects directory" + fi + echo "Regenerating aclocal.m4 with aclocal" + rm -f aclocal.m4 + aclocal -I $llvm_m4 -I "$llvm_m4/.." || die "aclocal failed" + echo "Regenerating configure with autoconf 2.5x" + autoconf --warnings=all -o ../configure configure.ac || die "autoconf failed" + cd .. + exit 0 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp SelectionDAGISel.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.439 -> 1.440 SelectionDAGISel.cpp updated: 1.330 -> 1.331 --- Log message: More soft-fp work. --- Diffs of the changes: (+41 -37) LegalizeDAG.cpp | 13 +++--- SelectionDAGISel.cpp | 65 +-- 2 files changed, 41 insertions(+), 37 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.439 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.440 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.439 Tue Dec 12 21:19:57 2006 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Dec 13 14:57:08 2006 @@ -488,9 +488,9 @@ } } -/// ExpandConstantFP - Expands the ConstantFP node by either converting it to -/// integer constant or spilling the constant to memory. -static SDOperand ExpandConstantFP(ConstantFPSDNode *CFP, bool ToMem, +/// ExpandConstantFP - Expands the ConstantFP node to an integer constant or +/// a load from the constant pool. +static SDOperand ExpandConstantFP(ConstantFPSDNode *CFP, bool UseCP, SelectionDAG &DAG, TargetLowering &TLI) { bool Extend = false; @@ -502,7 +502,7 @@ bool isDouble = VT == MVT::f64; ConstantFP *LLVMC = ConstantFP::get(isDouble ? Type::DoubleTy : Type::FloatTy, CFP->getValue()); - if (!ToMem) { + if (!UseCP) { double Val = LLVMC->getValue(); return isDouble ? DAG.getConstant(DoubleToBits(Val), MVT::i64) @@ -4434,6 +4434,8 @@ case ISD::ConstantFP: { ConstantFPSDNode *CFP = cast(Node); Lo = ExpandConstantFP(CFP, false, DAG, TLI); +if (getTypeAction(Lo.getValueType()) == Expand) + ExpandOp(Lo, Lo, Hi); break; } case ISD::BUILD_PAIR: @@ -4526,6 +4528,9 @@ // f32->i32 or f64->i64 one to one expansion. // Remember that we legalized the chain. AddLegalizedOperand(SDOperand(Node, 1), LegalizeOp(Lo.getValue(1))); +// Recursively expand the new load. +if (getTypeAction(NVT) == Expand) + ExpandOp(Lo, Lo, Hi); break; } Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.330 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.331 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.330Tue Dec 12 18:50:17 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Dec 13 14:57:08 2006 @@ -346,13 +346,10 @@ // If this value is represented with multiple target registers, make sure // to create enough consecutive registers of the right (smaller) type. - unsigned NT = VT-1; // Find the type to use. - while (TLI.getNumElements((MVT::ValueType)NT) != 1) ---NT; - - unsigned R = MakeReg((MVT::ValueType)NT); + VT = TLI.getTypeToExpandTo(VT); + unsigned R = MakeReg(VT); for (unsigned i = 1; i != NV*NumVectorRegs; ++i) -MakeReg((MVT::ValueType)NT); +MakeReg(VT); return R; } @@ -689,19 +686,26 @@ // If this type is not legal, make it so now. if (VT != MVT::Vector) { -MVT::ValueType DestVT = TLI.getTypeToTransformTo(VT); - -N = DAG.getCopyFromReg(DAG.getEntryNode(), InReg, DestVT); -if (DestVT < VT) { +if (TLI.getTypeAction(VT) == TargetLowering::Expand) { // Source must be expanded. This input value is actually coming from the // register pair VMI->second and VMI->second+1. - N = DAG.getNode(ISD::BUILD_PAIR, VT, N, - DAG.getCopyFromReg(DAG.getEntryNode(), InReg+1, DestVT)); -} else if (DestVT > VT) { // Promotion case - if (MVT::isFloatingPoint(VT)) -N = DAG.getNode(ISD::FP_ROUND, VT, N); - else -N = DAG.getNode(ISD::TRUNCATE, VT, N); + MVT::ValueType DestVT = TLI.getTypeToExpandTo(VT); + unsigned NumVals = TLI.getNumElements(VT); + N = DAG.getCopyFromReg(DAG.getEntryNode(), InReg, DestVT); + if (NumVals == 1) +N = DAG.getNode(ISD::BIT_CONVERT, VT, N); + else { +assert(NumVals == 2 && "1 to 4 (and more) expansion not implemented!"); +N = DAG.getNode(ISD::BUILD_PAIR, VT, N, + DAG.getCopyFromReg(DAG.getEntryNode(), InReg+1, DestVT)); + } +} else { + MVT::ValueType DestVT = TLI.getTypeToTransformTo(VT); + N = DAG.getCopyFromReg(DAG.getEntryNode(), InReg, DestVT); + if (TLI.getTypeAction(VT) == TargetLowering::Promote) // Promotion case +N = MVT::isFloatingPoint(VT) + ? DAG.getNode(ISD::FP_ROUND, VT, N) + : DAG.getNode(ISD::TRUNCATE, VT, N); } } else { // Otherwise, if this is a vector, make it available as a generic vector @@ -2916,12 +2920,8 @@ // If this is a large integer, it needs to be broken up into small // integers. Figure out what the destination type is and how many small // integers it turn
[llvm-commits] CVS: llvm/lib/VMCore/Pass.cpp PassManager.cpp PassManagerT.h
Changes in directory llvm/lib/VMCore: Pass.cpp updated: 1.79 -> 1.80 PassManager.cpp updated: 1.94 -> 1.95 PassManagerT.h updated: 1.73 -> 1.74 --- Log message: Using PDL as a prefix for PassDebugLevel enums is not a good idea. Fix it. --- Diffs of the changes: (+29 -19) Pass.cpp|8 PassManager.cpp | 17 +++-- PassManagerT.h | 23 ++- 3 files changed, 29 insertions(+), 19 deletions(-) Index: llvm/lib/VMCore/Pass.cpp diff -u llvm/lib/VMCore/Pass.cpp:1.79 llvm/lib/VMCore/Pass.cpp:1.80 --- llvm/lib/VMCore/Pass.cpp:1.79 Wed Dec 13 14:03:48 2006 +++ llvm/lib/VMCore/Pass.cppWed Dec 13 15:13:31 2006 @@ -122,7 +122,7 @@ void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, Pass *P, Module *M) { - if (PassDebugging >= PDLExecutions) { + if (PassDebugging >= Executions) { cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '" << P->getPassName(); if (M) cerr << "' on Module '" << M->getModuleIdentifier() << "'\n"; @@ -132,7 +132,7 @@ void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, Pass *P, Function *F) { - if (PassDebugging >= PDLExecutions) { + if (PassDebugging >= Executions) { cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '" << P->getPassName(); if (F) cerr << "' on Function '" << F->getName(); @@ -142,7 +142,7 @@ void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, Pass *P, BasicBlock *BB) { - if (PassDebugging >= PDLExecutions) { + if (PassDebugging >= Executions) { cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '" << P->getPassName(); if (BB) cerr << "' on BasicBlock '" << BB->getName(); @@ -152,7 +152,7 @@ void PMDebug::PrintAnalysisSetInfo(unsigned Depth, const char *Msg, Pass *P, const std::vector &Set){ - if (PassDebugging >= PDLDetails && !Set.empty()) { + if (PassDebugging >= Details && !Set.empty()) { cerr << (void*)P << std::string(Depth*2+3, ' ') << Msg << " Analyses:"; for (unsigned i = 0; i != Set.size(); ++i) { if (i) cerr << ","; Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.94 llvm/lib/VMCore/PassManager.cpp:1.95 --- llvm/lib/VMCore/PassManager.cpp:1.94Wed Dec 13 14:03:48 2006 +++ llvm/lib/VMCore/PassManager.cpp Wed Dec 13 15:13:31 2006 @@ -94,15 +94,20 @@ // pass name to be printed before it executes. // +// Different debug levels that can be enabled... +enum PassDebugLevel { + None, Arguments, Structure, Executions, Details +}; + static cl::opt PassDebugging_New("debug-pass", cl::Hidden, cl::desc("Print PassManager debugging information"), cl::values( - clEnumVal(PDLNone , "disable debug output"), - clEnumVal(PDLArguments , "print pass arguments to pass to 'opt'"), - clEnumVal(PDLStructure , "print pass structure before run()"), - clEnumVal(PDLExecutions, "print pass name before it is executed"), - clEnumVal(PDLDetails , "print pass details when it is executed"), + clEnumVal(None , "disable debug output"), + clEnumVal(Arguments , "print pass arguments to pass to 'opt'"), + clEnumVal(Structure , "print pass structure before run()"), + clEnumVal(Executions, "print pass name before it is executed"), + clEnumVal(Details , "print pass details when it is executed"), clEnumValEnd)); } // End of llvm namespace @@ -1264,7 +1269,7 @@ bool Changed = false; - if (PassDebugging_New >= PDLStructure) + if (PassDebugging_New >= Structure) dumpPasses(); for (std::vector::iterator I = passManagersBegin(), Index: llvm/lib/VMCore/PassManagerT.h diff -u llvm/lib/VMCore/PassManagerT.h:1.73 llvm/lib/VMCore/PassManagerT.h:1.74 --- llvm/lib/VMCore/PassManagerT.h:1.73 Wed Dec 13 14:03:48 2006 +++ llvm/lib/VMCore/PassManagerT.h Wed Dec 13 15:13:31 2006 @@ -37,15 +37,20 @@ // pass name to be printed before it executes. // +// Different debug levels that can be enabled... +enum PassDebugLevel { + None, Arguments, Structure, Executions, Details +}; + static cl::opt PassDebugging("debug-pass", cl::Hidden, cl::desc("Print PassManager debugging information"), cl::values( - clEnumVal(PDLNone , "disable debug output"), - clEnumVal(PDLArguments , "print pass arguments to pass to 'opt'"), - clEnumVal(PDLStructure , "print pass structure before run()"), - clEnumVal(PDLExecutions, "print pass name before it is executed"), - clEnumVal(PDLDetails , "print pass details when it is executed"), + clEnumVal(None , "disable debug output"), + clEnumVal(Arguments , "print pass arguments to pass to 'opt'"), + clEnumVal(Structure , "print pass structure before run()"), + clEnumVal(Executions, "print
[llvm-commits] CVS: llvm/include/llvm/Pass.h
Changes in directory llvm/include/llvm: Pass.h updated: 1.60 -> 1.61 --- Log message: Using PDL as a prefix for PassDebugLevel enums is not a good idea. Fix it. --- Diffs of the changes: (+0 -5) Pass.h |5 - 1 files changed, 5 deletions(-) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.60 llvm/include/llvm/Pass.h:1.61 --- llvm/include/llvm/Pass.h:1.60 Wed Dec 13 14:03:48 2006 +++ llvm/include/llvm/Pass.hWed Dec 13 15:13:31 2006 @@ -355,11 +355,6 @@ /// @brief This is the storage for the -time-passes option. extern bool TimePassesIsEnabled; -// Different debug levels that can be enabled... -enum PassDebugLevel { - PDLNone, PDLArguments, PDLStructure, PDLExecutions, PDLDetails -}; - } // End llvm namespace // Include support files that contain important APIs commonly used by Passes, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/PassAnalysisSupport.h
Changes in directory llvm/include/llvm: PassAnalysisSupport.h updated: 1.25 -> 1.26 --- Log message: fit in 80 cols --- Diffs of the changes: (+3 -4) PassAnalysisSupport.h |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) Index: llvm/include/llvm/PassAnalysisSupport.h diff -u llvm/include/llvm/PassAnalysisSupport.h:1.25 llvm/include/llvm/PassAnalysisSupport.h:1.26 --- llvm/include/llvm/PassAnalysisSupport.h:1.25Tue Dec 12 20:36:01 2006 +++ llvm/include/llvm/PassAnalysisSupport.h Wed Dec 13 15:55:30 2006 @@ -213,10 +213,9 @@ #ifdef USE_OLD_PASSMANAGER assert(Resolver && "Pass has not been inserted into a PassManager object!"); #else - assert(Resolver_New && "Pass has not been inserted into a PassManager object!"); + assert(Resolver_New&&"Pass has not been inserted into a PassManager object!"); #endif - const PassInfo *PI = getClassPassInfo(); - return getAnalysisID(PI); + return getAnalysisID(getClassPassInfo()); } template @@ -239,7 +238,7 @@ } } #else - assert(Resolver_New && "Pass has not been inserted into a PassManager object!"); + assert(Resolver_New&&"Pass has not been inserted into a PassManager object!"); // PI *must* appear in AnalysisImpls. Because the number of passes used // should be a small number, we just do a linear search over a (dense) // vector. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm-poolalloc/include/poolalloc/Config/config.h.in
Changes in directory llvm-poolalloc/include/poolalloc/Config: config.h.in updated: 1.3 -> 1.3.2.1 --- Log message: Grab configuration information from configure script. --- Diffs of the changes: (+10 -0) config.h.in | 10 ++ 1 files changed, 10 insertions(+) Index: llvm-poolalloc/include/poolalloc/Config/config.h.in diff -u llvm-poolalloc/include/poolalloc/Config/config.h.in:1.3 llvm-poolalloc/include/poolalloc/Config/config.h.in:1.3.2.1 --- llvm-poolalloc/include/poolalloc/Config/config.h.in:1.3 Wed May 18 14:56:23 2005 +++ llvm-poolalloc/include/poolalloc/Config/config.h.in Wed Dec 13 15:58:21 2006 @@ -463,3 +463,13 @@ /* Define to `unsigned' if does not define. */ #undef size_t + +/* Define to 1 if enabling SAFECode */ +#undef SAFECODE + +/* Define to 1 if enabling SAFECode bounds checking */ +#undef BOUNDS_CHECK + +/* Define to 1 if compiling for pool inference */ +#undef LLVA_KERNEL + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm-poolalloc/lib/DSA/DataStructure.cpp Local.cpp
Changes in directory llvm-poolalloc/lib/DSA: DataStructure.cpp updated: 1.248.2.2 -> 1.248.2.3 Local.cpp updated: 1.158.2.1 -> 1.158.2.2 --- Log message: Grab configuration information from configure script. --- Diffs of the changes: (+2 -0) DataStructure.cpp |1 + Local.cpp |1 + 2 files changed, 2 insertions(+) Index: llvm-poolalloc/lib/DSA/DataStructure.cpp diff -u llvm-poolalloc/lib/DSA/DataStructure.cpp:1.248.2.2 llvm-poolalloc/lib/DSA/DataStructure.cpp:1.248.2.3 --- llvm-poolalloc/lib/DSA/DataStructure.cpp:1.248.2.2 Wed Dec 13 10:25:34 2006 +++ llvm-poolalloc/lib/DSA/DataStructure.cppWed Dec 13 15:58:21 2006 @@ -30,6 +30,7 @@ #include "llvm/ADT/Statistic.h" #include "llvm/Support/Timer.h" #include "llvm/ADT/hash_map" +#include "poolalloc/Config/config.h" #include #include using namespace llvm; Index: llvm-poolalloc/lib/DSA/Local.cpp diff -u llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.1 llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.2 --- llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.1 Tue Dec 12 16:42:42 2006 +++ llvm-poolalloc/lib/DSA/Local.cppWed Dec 13 15:58:21 2006 @@ -27,6 +27,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Timer.h" +#include "poolalloc/Config/config.h" #include // FIXME: This should eventually be a FunctionPass that is automatically ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm-poolalloc/include/dsa/DSGraph.h DataStructure.h
Changes in directory llvm-poolalloc/include/dsa: DSGraph.h updated: 1.110.2.3 -> 1.110.2.4 DataStructure.h updated: 1.98.2.2 -> 1.98.2.3 --- Log message: Grab configuration information from configure script. --- Diffs of the changes: (+3 -2) DSGraph.h |2 ++ DataStructure.h |3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) Index: llvm-poolalloc/include/dsa/DSGraph.h diff -u llvm-poolalloc/include/dsa/DSGraph.h:1.110.2.3 llvm-poolalloc/include/dsa/DSGraph.h:1.110.2.4 --- llvm-poolalloc/include/dsa/DSGraph.h:1.110.2.3 Wed Dec 13 10:24:48 2006 +++ llvm-poolalloc/include/dsa/DSGraph.hWed Dec 13 15:58:18 2006 @@ -18,6 +18,8 @@ #include "dsa/DSNode.h" #include "llvm/ADT/hash_map" #include "llvm/ADT/EquivalenceClasses.h" +#include "poolalloc/Config/config.h" + #include #include #include Index: llvm-poolalloc/include/dsa/DataStructure.h diff -u llvm-poolalloc/include/dsa/DataStructure.h:1.98.2.2 llvm-poolalloc/include/dsa/DataStructure.h:1.98.2.3 --- llvm-poolalloc/include/dsa/DataStructure.h:1.98.2.2 Tue Dec 12 17:20:47 2006 +++ llvm-poolalloc/include/dsa/DataStructure.h Wed Dec 13 15:58:18 2006 @@ -20,8 +20,7 @@ #include "llvm/ADT/hash_map" #include "llvm/ADT/hash_set" #include "llvm/ADT/EquivalenceClasses.h" - - +#include "poolalloc/Config/config.h" namespace llvm { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp
Changes in directory llvm-poolalloc/lib/PoolAllocate: PoolAllocate.cpp updated: 1.127.2.1 -> 1.127.2.2 --- Log message: Grab configuration information from configure script. --- Diffs of the changes: (+1 -1) PoolAllocate.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.127.2.1 llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.127.2.2 --- llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.127.2.1 Wed Dec 13 14:04:23 2006 +++ llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cppWed Dec 13 15:58:21 2006 @@ -16,6 +16,7 @@ #include "dsa/DataStructure.h" #include "dsa/DSGraph.h" +#include "dsa/CallTargets.h" #include "poolalloc/PoolAllocate.h" #include "Heuristic.h" #include "llvm/Constants.h" @@ -27,7 +28,6 @@ #include "llvm/Target/TargetData.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Cloning.h" -#include "dsa/CallTargets.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.95 -> 1.96 --- Log message: fit in 80 cols --- Diffs of the changes: (+7 -6) PassManager.cpp | 13 +++-- 1 files changed, 7 insertions(+), 6 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.95 llvm/lib/VMCore/PassManager.cpp:1.96 --- llvm/lib/VMCore/PassManager.cpp:1.95Wed Dec 13 15:13:31 2006 +++ llvm/lib/VMCore/PassManager.cpp Wed Dec 13 15:56:10 2006 @@ -366,10 +366,10 @@ //===--===// // FunctionPassManagerImpl_New // -/// FunctionPassManagerImpl_New manages FunctionPasses and BasicBlockPassManagers. -/// It batches all function passes and basic block pass managers together and -/// sequence them to process one function at a time before processing next -/// function. +/// FunctionPassManagerImpl_New manages FunctionPasses and +/// BasicBlockPassManagers. It batches all function passes and basic block pass +/// managers together and sequence them to process one function at a time before +/// processing next function. class FunctionPassManagerImpl_New : public ModulePass, public PMDataManager, public PMTopLevelManager { @@ -1184,8 +1184,9 @@ activeFunctionPassManager->setTopLevelManager(this->getTopLevelManager()); // Add new manager into top level manager's indirect passes list - PMDataManager *PMD = dynamic_cast(activeFunctionPassManager); - assert (PMD && "Manager is not Pass Manager"); + PMDataManager *PMD = +dynamic_cast(activeFunctionPassManager); + assert(PMD && "Manager is not Pass Manager"); TPM->addIndirectPassManager(PMD); // Add pass into new manager. This time it must succeed. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.96 -> 1.97 --- Log message: Add -pass-debug=Arguments support in new manager. --- Diffs of the changes: (+29 -1) PassManager.cpp | 30 +- 1 files changed, 29 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.96 llvm/lib/VMCore/PassManager.cpp:1.97 --- llvm/lib/VMCore/PassManager.cpp:1.96Wed Dec 13 15:56:10 2006 +++ llvm/lib/VMCore/PassManager.cpp Wed Dec 13 16:10:00 2006 @@ -192,6 +192,7 @@ // Print passes managed by this top level manager. void dumpPasses(); + void dumpArguments(); private: @@ -299,6 +300,18 @@ } } + void dumpPassArguments() { +for(std::vector::iterator I = PassVector.begin(), + E = PassVector.end(); I != E; ++I) { + if (PMDataManager *PMD = dynamic_cast(*I)) +PMD->dumpPassArguments(); + else +if (const PassInfo *PI = (*I)->getPassInfo()) + if (!PI->isAnalysisGroup()) +cerr << " -" << PI->getPassArgument(); +} + } + protected: // Collection of pass whose last user asked this manager to claim @@ -360,7 +373,6 @@ dumpLastUses(*I, Offset+1); } } - }; //===--===// @@ -651,6 +663,21 @@ } +void PMTopLevelManager::dumpArguments() { + + if (PassDebugging_New < Arguments) +return; + + cerr << "Pass Arguments: "; + for (std::vector::iterator I = PassManagers.begin(), + E = PassManagers.end(); I != E; ++I) { +PMDataManager *PMD = dynamic_cast(*I); +assert(PMD && "This is not a PassManager"); +PMD->dumpPassArguments(); + } + cerr << "\n"; +} + //===--===// // PMDataManager implementation @@ -1270,6 +1297,7 @@ bool Changed = false; + dumpArguments(); if (PassDebugging_New >= Structure) dumpPasses(); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm-poolalloc/include/poolalloc/PoolAllocate.h
Changes in directory llvm-poolalloc/include/poolalloc: PoolAllocate.h updated: 1.51 -> 1.51.2.1 --- Log message: Grab configuration information from configure script. --- Diffs of the changes: (+2 -3) PoolAllocate.h |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm-poolalloc/include/poolalloc/PoolAllocate.h diff -u llvm-poolalloc/include/poolalloc/PoolAllocate.h:1.51 llvm-poolalloc/include/poolalloc/PoolAllocate.h:1.51.2.1 --- llvm-poolalloc/include/poolalloc/PoolAllocate.h:1.51Wed Jul 26 10:37:25 2006 +++ llvm-poolalloc/include/poolalloc/PoolAllocate.h Wed Dec 13 15:58:21 2006 @@ -16,15 +16,14 @@ #ifndef POOLALLOCATE_H #define POOLALLOCATE_H -//#define SAFECODE 1 -//#define BOUNDS_CHECK 1 -//comment the above two for normal poolallocation + #include "llvm/Pass.h" #include "llvm/DerivedTypes.h" #include "llvm/Support/CallSite.h" #include "llvm/ADT/EquivalenceClasses.h" #include "llvm/ADT/VectorExtras.h" #include "llvm/ADT/hash_set" +#include "poolalloc/Config/config.h" #ifdef SAFECODE //FIXME : make this use some configuration options ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm-poolalloc/configure
Changes in directory llvm-poolalloc: configure updated: 1.11.2.1 -> 1.11.2.2 --- Log message: Fix configuration when srcdir != objdir. --- Diffs of the changes: (+2 -1) configure |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm-poolalloc/configure diff -u llvm-poolalloc/configure:1.11.2.1 llvm-poolalloc/configure:1.11.2.2 --- llvm-poolalloc/configure:1.11.2.1 Wed Dec 13 15:57:18 2006 +++ llvm-poolalloc/configureWed Dec 13 17:22:40 2006 @@ -1315,8 +1315,9 @@ -LLVM_SRC_ROOT="`(cd ../..; pwd)`" +LLVM_SRC_ROOT="`(cd $srcdir/../..; pwd)`" LLVM_OBJ_ROOT="`(cd ../..; pwd)`" + ac_aux_dir= for ac_dir in $LLVM_SRC_ROOT/autoconf $srcdir/$LLVM_SRC_ROOT/autoconf; do if test -f $ac_dir/install-sh; then ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm-poolalloc/lib/DSA/Local.cpp
Changes in directory llvm-poolalloc/lib/DSA: Local.cpp updated: 1.158.2.2 -> 1.158.2.3 --- Log message: By default, compile without pool inference code. --- Diffs of the changes: (+4 -3) Local.cpp |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm-poolalloc/lib/DSA/Local.cpp diff -u llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.2 llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.3 --- llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.2 Wed Dec 13 15:58:21 2006 +++ llvm-poolalloc/lib/DSA/Local.cppWed Dec 13 17:18:48 2006 @@ -13,7 +13,6 @@ // //===--===// -#define LLVA_KERNEL 1 #include "llvm/ADT/Statistic.h" #include "dsa/DataStructure.h" #include "dsa/DSGraph.h" @@ -384,6 +383,7 @@ void GraphBuilder::visitGetElementPtrInst(User &GEP) { +#ifdef LLVA_KERNEL #if 1 int debug = 0; if (isa(GEP)) { @@ -400,6 +400,7 @@ } } #endif +#endif DSNodeHandle Value = getValueDest(*GEP.getOperand(0)); if (Value.isNull()) @@ -436,7 +437,6 @@ // If the node had to be folded... exit quickly setDestTo(GEP, Value); // GEP result points to folded node -if (debug) std::cerr << "LLVA: GEP: Funny Return\n"; return; } @@ -551,7 +551,6 @@ } #endif -if (debug) std::cerr << "LLVA: GEP: Normal Return\n"; } void GraphBuilder::visitLoadInst(LoadInst &LI) { @@ -587,6 +586,7 @@ // Avoid adding edges from null, or processing non-"pointer" stores if (isPointerType(StoredTy)) Dest.addEdgeTo(getValueDest(*SI.getOperand(0))); +#ifdef LLVA_KERNEL #if 1 { if (SI.getParent()->getParent()->getName() == "alloc_vfsmnt") { @@ -597,6 +597,7 @@ } } #endif +#endif } void GraphBuilder::visitReturnInst(ReturnInst &RI) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm-poolalloc/autoconf/AutoRegen.sh configure.ac
Changes in directory llvm-poolalloc/autoconf: AutoRegen.sh updated: 1.1.2.2 -> 1.1.2.3 configure.ac updated: 1.10.2.1 -> 1.10.2.2 --- Log message: Fix configuration when srcdir != objdir. --- Diffs of the changes: (+4 -3) AutoRegen.sh |4 ++-- configure.ac |3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) Index: llvm-poolalloc/autoconf/AutoRegen.sh diff -u llvm-poolalloc/autoconf/AutoRegen.sh:1.1.2.2 llvm-poolalloc/autoconf/AutoRegen.sh:1.1.2.3 --- llvm-poolalloc/autoconf/AutoRegen.sh:1.1.2.2Wed Dec 13 15:56:38 2006 +++ llvm-poolalloc/autoconf/AutoRegen.shWed Dec 13 17:22:45 2006 @@ -41,8 +41,8 @@ fi # Patch the LLVM_ROOT in configure.ac, if it needs it cp configure.ac configure.bak -sed -e "s#^LLVM_SRC_ROOT=.*#LLVM_SRC_ROOT=\"$llvm_src_root\"#" \ --e "s#^LLVM_OBJ_ROOT=.*#LLVM_OBJ_ROOT=\"$llvm_obj_root\"#" configure.bak > configure.ac +#sed -e "s#^LLVM_SRC_ROOT=.*#LLVM_SRC_ROOT=\"$llvm_src_root\"#" \ +#-e "s#^LLVM_OBJ_ROOT=.*#LLVM_OBJ_ROOT=\"$llvm_obj_root\"#" configure.bak > configure.ac echo "Regenerating aclocal.m4 with aclocal" rm -f aclocal.m4 aclocal -I $llvm_m4 -I "$llvm_m4/.." || die "aclocal failed" Index: llvm-poolalloc/autoconf/configure.ac diff -u llvm-poolalloc/autoconf/configure.ac:1.10.2.1 llvm-poolalloc/autoconf/configure.ac:1.10.2.2 --- llvm-poolalloc/autoconf/configure.ac:1.10.2.1 Wed Dec 13 15:56:38 2006 +++ llvm-poolalloc/autoconf/configure.acWed Dec 13 17:22:45 2006 @@ -4,8 +4,9 @@ AC_INIT([[[Pool Allocation]]],[[[1.0]]],[EMAIL PROTECTED]) dnl Identify where LLVM source tree is -LLVM_SRC_ROOT="`(cd ../..; pwd)`" +LLVM_SRC_ROOT="`(cd $srcdir/../..; pwd)`" LLVM_OBJ_ROOT="`(cd ../..; pwd)`" + dnl Tell autoconf that the auxilliary files are actually located in dnl the LLVM autoconf directory, not here. AC_CONFIG_AUX_DIR($LLVM_SRC_ROOT/autoconf) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.97 -> 1.98 --- Log message: Add debug-pass=Executions support in new pass manager. --- Diffs of the changes: (+27 -6) PassManager.cpp | 33 +++-- 1 files changed, 27 insertions(+), 6 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.97 llvm/lib/VMCore/PassManager.cpp:1.98 --- llvm/lib/VMCore/PassManager.cpp:1.97Wed Dec 13 16:10:00 2006 +++ llvm/lib/VMCore/PassManager.cpp Wed Dec 13 17:50:44 2006 @@ -244,7 +244,7 @@ void removeNotPreservedAnalysis(Pass *P); /// Remove dead passes - void removeDeadPasses(Pass *P); + void removeDeadPasses(Pass *P, std::string &Msg); /// Add pass P into the PassVector. Update /// AvailableAnalysis appropriately if ProcessAnalysis is true. @@ -312,6 +312,15 @@ } } + void dumpPassInfo(Pass *P, std::string &Msg1, std::string &Msg2) { +if (PassDebugging_New < Executions) + return; +cerr << (void*)this << std::string(getDepth()*2+1, ' '); +cerr << Msg1; +cerr << P->getPassName(); +cerr << Msg2; + } + protected: // Collection of pass whose last user asked this manager to claim @@ -572,7 +581,6 @@ LastUser[LUI->first] = P; } } - } /// Collect passes whose last user is P @@ -734,13 +742,17 @@ } /// Remove analysis passes that are not used any longer -void PMDataManager::removeDeadPasses(Pass *P) { +void PMDataManager::removeDeadPasses(Pass *P, std::string &Msg) { std::vector DeadPasses; TPM->collectLastUses(DeadPasses, P); for (std::vector::iterator I = DeadPasses.begin(), E = DeadPasses.end(); I != E; ++I) { + +std::string Msg1 = " Freeing Pass '"; +dumpPassInfo(*I, Msg1, Msg); + (*I)->releaseMemory(); std::map::iterator Pos = @@ -910,12 +922,15 @@ for (std::vector::iterator itr = passVectorBegin(), e = passVectorEnd(); itr != e; ++itr) { Pass *P = *itr; + std::string Msg1 = "Executing Pass '"; + std::string Msg2 = "' on BasicBlock '" + (*I).getName() + "'...\n"; + dumpPassInfo(P, Msg1, Msg2); initializeAnalysisImpl(P); BasicBlockPass *BP = dynamic_cast(P); Changed |= BP->runOnBasicBlock(*I); removeNotPreservedAnalysis(P); recordAvailableAnalysis(P); - removeDeadPasses(P); + removeDeadPasses(P, Msg2); } return Changed | doFinalization(F); } @@ -1129,12 +1144,15 @@ for (std::vector::iterator itr = passVectorBegin(), e = passVectorEnd(); itr != e; ++itr) { Pass *P = *itr; +std::string Msg1 = "Executing Pass '"; +std::string Msg2 = "' on Function '" + F.getName() + "'...\n"; +dumpPassInfo(P, Msg1, Msg2); initializeAnalysisImpl(P); FunctionPass *FP = dynamic_cast(P); Changed |= FP->runOnFunction(F); removeNotPreservedAnalysis(P); recordAvailableAnalysis(P); -removeDeadPasses(P); +removeDeadPasses(P, Msg2); } return Changed; } @@ -1258,12 +1276,15 @@ for (std::vector::iterator itr = passVectorBegin(), e = passVectorEnd(); itr != e; ++itr) { Pass *P = *itr; +std::string Msg1 = "Executing Pass '"; +std::string Msg2 = "' on Module '" + M.getModuleIdentifier() + "'...\n"; +dumpPassInfo(P, Msg1, Msg2); initializeAnalysisImpl(P); ModulePass *MP = dynamic_cast(P); Changed |= MP->runOnModule(M); removeNotPreservedAnalysis(P); recordAvailableAnalysis(P); -removeDeadPasses(P); +removeDeadPasses(P, Msg2); } return Changed; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.98 -> 1.99 --- Log message: Add " Made Modification " messages in debug-pass=Executions output. --- Diffs of the changes: (+26 -3) PassManager.cpp | 29 ++--- 1 files changed, 26 insertions(+), 3 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.98 llvm/lib/VMCore/PassManager.cpp:1.99 --- llvm/lib/VMCore/PassManager.cpp:1.98Wed Dec 13 17:50:44 2006 +++ llvm/lib/VMCore/PassManager.cpp Wed Dec 13 18:08:04 2006 @@ -918,16 +918,23 @@ bool Changed = doInitialization(F); initializeAnalysisInfo(); + std::string Msg1 = "Executing Pass '"; + std::string Msg3 = "' Made Modification '"; + for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) for (std::vector::iterator itr = passVectorBegin(), e = passVectorEnd(); itr != e; ++itr) { Pass *P = *itr; - std::string Msg1 = "Executing Pass '"; std::string Msg2 = "' on BasicBlock '" + (*I).getName() + "'...\n"; dumpPassInfo(P, Msg1, Msg2); initializeAnalysisImpl(P); + BasicBlockPass *BP = dynamic_cast(P); Changed |= BP->runOnBasicBlock(*I); + + if (Changed) +dumpPassInfo(P, Msg3, Msg2); + removeNotPreservedAnalysis(P); recordAvailableAnalysis(P); removeDeadPasses(P, Msg2); @@ -1141,15 +1148,23 @@ initializeAnalysisInfo(); + std::string Msg1 = "Executing Pass '"; + std::string Msg3 = "' Made Modification '"; + for (std::vector::iterator itr = passVectorBegin(), e = passVectorEnd(); itr != e; ++itr) { Pass *P = *itr; -std::string Msg1 = "Executing Pass '"; + std::string Msg2 = "' on Function '" + F.getName() + "'...\n"; dumpPassInfo(P, Msg1, Msg2); + initializeAnalysisImpl(P); FunctionPass *FP = dynamic_cast(P); Changed |= FP->runOnFunction(F); + +if (Changed) + dumpPassInfo(P, Msg3, Msg2); + removeNotPreservedAnalysis(P); recordAvailableAnalysis(P); removeDeadPasses(P, Msg2); @@ -1273,15 +1288,23 @@ bool Changed = false; initializeAnalysisInfo(); + std::string Msg1 = "Executing Pass '"; + std::string Msg3 = "' Made Modification '"; + for (std::vector::iterator itr = passVectorBegin(), e = passVectorEnd(); itr != e; ++itr) { Pass *P = *itr; -std::string Msg1 = "Executing Pass '"; + std::string Msg2 = "' on Module '" + M.getModuleIdentifier() + "'...\n"; dumpPassInfo(P, Msg1, Msg2); + initializeAnalysisImpl(P); ModulePass *MP = dynamic_cast(P); Changed |= MP->runOnModule(M); + +if (Changed) + dumpPassInfo(P, Msg3, Msg2); + removeNotPreservedAnalysis(P); recordAvailableAnalysis(P); removeDeadPasses(P, Msg2); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.99 -> 1.100 --- Log message: Add debug-pass=Details support to print Required and Preserved Set info. --- Diffs of the changes: (+26 -1) PassManager.cpp | 27 ++- 1 files changed, 26 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.99 llvm/lib/VMCore/PassManager.cpp:1.100 --- llvm/lib/VMCore/PassManager.cpp:1.99Wed Dec 13 18:08:04 2006 +++ llvm/lib/VMCore/PassManager.cpp Wed Dec 13 18:25:06 2006 @@ -321,6 +321,17 @@ cerr << Msg2; } + void dumpAnalysisSetInfo(const char *Msg, Pass *P, + const std::vector &Set) { +if (PassDebugging_New >= Details && !Set.empty()) { + cerr << (void*)P << std::string(getDepth()*2+3, ' ') << Msg << " Analyses:"; + for (unsigned i = 0; i != Set.size(); ++i) { +if (i) cerr << ","; +cerr << " " << Set[i]->getPassName(); + } + cerr << "\n"; +} + } protected: // Collection of pass whose last user asked this manager to claim @@ -925,8 +936,13 @@ for (std::vector::iterator itr = passVectorBegin(), e = passVectorEnd(); itr != e; ++itr) { Pass *P = *itr; + AnalysisUsage AnUsage; + P->getAnalysisUsage(AnUsage); + std::string Msg2 = "' on BasicBlock '" + (*I).getName() + "'...\n"; dumpPassInfo(P, Msg1, Msg2); + dumpAnalysisSetInfo("Required", P, AnUsage.getRequiredSet()); + initializeAnalysisImpl(P); BasicBlockPass *BP = dynamic_cast(P); @@ -934,6 +950,7 @@ if (Changed) dumpPassInfo(P, Msg3, Msg2); + dumpAnalysisSetInfo("Preserved", P, AnUsage.getPreservedSet()); removeNotPreservedAnalysis(P); recordAvailableAnalysis(P); @@ -1154,9 +1171,12 @@ for (std::vector::iterator itr = passVectorBegin(), e = passVectorEnd(); itr != e; ++itr) { Pass *P = *itr; +AnalysisUsage AnUsage; +P->getAnalysisUsage(AnUsage); std::string Msg2 = "' on Function '" + F.getName() + "'...\n"; dumpPassInfo(P, Msg1, Msg2); +dumpAnalysisSetInfo("Required", P, AnUsage.getRequiredSet()); initializeAnalysisImpl(P); FunctionPass *FP = dynamic_cast(P); @@ -1164,6 +1184,7 @@ if (Changed) dumpPassInfo(P, Msg3, Msg2); +dumpAnalysisSetInfo("Preserved", P, AnUsage.getPreservedSet()); removeNotPreservedAnalysis(P); recordAvailableAnalysis(P); @@ -1294,9 +1315,12 @@ for (std::vector::iterator itr = passVectorBegin(), e = passVectorEnd(); itr != e; ++itr) { Pass *P = *itr; +AnalysisUsage AnUsage; +P->getAnalysisUsage(AnUsage); std::string Msg2 = "' on Module '" + M.getModuleIdentifier() + "'...\n"; dumpPassInfo(P, Msg1, Msg2); +dumpAnalysisSetInfo("Required", P, AnUsage.getRequiredSet()); initializeAnalysisImpl(P); ModulePass *MP = dynamic_cast(P); @@ -1304,7 +1328,8 @@ if (Changed) dumpPassInfo(P, Msg3, Msg2); - +dumpAnalysisSetInfo("Preserved", P, AnUsage.getPreservedSet()); + removeNotPreservedAnalysis(P); recordAvailableAnalysis(P); removeDeadPasses(P, Msg2); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.100 -> 1.101 --- Log message: Add -time-passes support. --- Diffs of the changes: (+87 -1) PassManager.cpp | 88 +++- 1 files changed, 87 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.100 llvm/lib/VMCore/PassManager.cpp:1.101 --- llvm/lib/VMCore/PassManager.cpp:1.100 Wed Dec 13 18:25:06 2006 +++ llvm/lib/VMCore/PassManager.cpp Wed Dec 13 18:59:42 2006 @@ -14,9 +14,11 @@ #include "llvm/PassManager.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Timer.h" #include "llvm/Module.h" #include "llvm/ModuleProvider.h" #include "llvm/Support/Streams.h" +#include "llvm/Support/ManagedStatic.h" #include #include using namespace llvm; @@ -571,6 +573,55 @@ ModulePassManager *activeManager; }; +//===--===// +// TimingInfo Class - This class is used to calculate information about the +// amount of time each pass takes to execute. This only happens when +// -time-passes is enabled on the command line. +// + +class TimingInfo { + std::map TimingData; + TimerGroup TG; + +public: + // Use 'create' member to get this. + TimingInfo() : TG("... Pass execution timing report ...") {} + + // TimingDtor - Print out information about timing information + ~TimingInfo() { +// Delete all of the timers... +TimingData.clear(); +// TimerGroup is deleted next, printing the report. + } + + // createTheTimeInfo - This method either initializes the TheTimeInfo pointer + // to a non null value (if the -time-passes option is enabled) or it leaves it + // null. It may be called multiple times. + static void createTheTimeInfo(); + + void passStarted(Pass *P) { + +if (dynamic_cast(P)) + return; + +std::map::iterator I = TimingData.find(P); +if (I == TimingData.end()) + I=TimingData.insert(std::make_pair(P, Timer(P->getPassName(), TG))).first; +I->second.startTimer(); + } + void passEnded(Pass *P) { + +if (dynamic_cast(P)) + return; + +std::map::iterator I = TimingData.find(P); +assert (I != TimingData.end() && "passStarted/passEnded not nested right!"); +I->second.stopTimer(); + } +}; + +static TimingInfo *TheTimeInfo; + } // End of llvm namespace //===--===// @@ -764,8 +815,10 @@ std::string Msg1 = " Freeing Pass '"; dumpPassInfo(*I, Msg1, Msg); +if (TheTimeInfo) TheTimeInfo->passStarted(P); (*I)->releaseMemory(); - +if (TheTimeInfo) TheTimeInfo->passEnded(P); + std::map::iterator Pos = AvailableAnalysis.find((*I)->getPassInfo()); @@ -946,7 +999,9 @@ initializeAnalysisImpl(P); BasicBlockPass *BP = dynamic_cast(P); + if (TheTimeInfo) TheTimeInfo->passStarted(P); Changed |= BP->runOnBasicBlock(*I); + if (TheTimeInfo) TheTimeInfo->passEnded(P); if (Changed) dumpPassInfo(P, Msg3, Msg2); @@ -1180,7 +1235,10 @@ initializeAnalysisImpl(P); FunctionPass *FP = dynamic_cast(P); + +if (TheTimeInfo) TheTimeInfo->passStarted(P); Changed |= FP->runOnFunction(F); +if (TheTimeInfo) TheTimeInfo->passEnded(P); if (Changed) dumpPassInfo(P, Msg3, Msg2); @@ -1324,7 +1382,10 @@ initializeAnalysisImpl(P); ModulePass *MP = dynamic_cast(P); + +if (TheTimeInfo) TheTimeInfo->passStarted(P); Changed |= MP->runOnModule(M); +if (TheTimeInfo) TheTimeInfo->passEnded(P); if (Changed) dumpPassInfo(P, Msg3, Msg2); @@ -1366,6 +1427,8 @@ bool Changed = false; + TimingInfo::createTheTimeInfo(); + dumpArguments(); if (PassDebugging_New >= Structure) dumpPasses(); @@ -1408,4 +1471,27 @@ return PM->run(M); } +//===--===// +// TimingInfo Class - This class is used to calculate information about the +// amount of time each pass takes to execute. This only happens with +// -time-passes is enabled on the command line. +// +bool llvm::TimePassesIsEnabled = false; +static cl::opt +EnableTiming("time-passes", cl::location(TimePassesIsEnabled), +cl::desc("Time each pass, printing elapsed time for each on exit")); + +// createTheTimeInfo - This method either initializes the TheTimeInfo pointer to +// a non null value (if the -time-passes option is enabled) or it leaves it +// null. It may be called multiple times. +void TimingInfo::createTheTimeInfo() { + if (!TimePassesIsEnabled || TheTimeInfo) return; + + // Constructed the first time this is called, iff -time-passes is enabled. + // This guarantees that the object will be constructed before static globals, + // thus it will be destroyed before them. + static ManagedStatic TTI; + TheTimeInfo = &*TTI
[llvm-commits] CVS: llvm-poolalloc/include/poolalloc/Config/config.h.in
Changes in directory llvm-poolalloc/include/poolalloc/Config: config.h.in updated: 1.3 -> 1.4 --- Log message: Merged from release_19 branch. This adds correct compilation of DSA, pool inference, and configure script fixes to mainline. --- Diffs of the changes: (+10 -0) config.h.in | 10 ++ 1 files changed, 10 insertions(+) Index: llvm-poolalloc/include/poolalloc/Config/config.h.in diff -u llvm-poolalloc/include/poolalloc/Config/config.h.in:1.3 llvm-poolalloc/include/poolalloc/Config/config.h.in:1.4 --- llvm-poolalloc/include/poolalloc/Config/config.h.in:1.3 Wed May 18 14:56:23 2005 +++ llvm-poolalloc/include/poolalloc/Config/config.h.in Wed Dec 13 23:51:06 2006 @@ -463,3 +463,13 @@ /* Define to `unsigned' if does not define. */ #undef size_t + +/* Define to 1 if enabling SAFECode */ +#undef SAFECODE + +/* Define to 1 if enabling SAFECode bounds checking */ +#undef BOUNDS_CHECK + +/* Define to 1 if compiling for pool inference */ +#undef LLVA_KERNEL + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-poolalloc/lib/Makefile
Changes in directory llvm-poolalloc/lib: Makefile updated: 1.3 -> 1.4 --- Log message: Merged from release_19 branch. This adds correct compilation of DSA, pool inference, and configure script fixes to mainline. --- Diffs of the changes: (+1 -1) Makefile |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-poolalloc/lib/Makefile diff -u llvm-poolalloc/lib/Makefile:1.3 llvm-poolalloc/lib/Makefile:1.4 --- llvm-poolalloc/lib/Makefile:1.3 Wed May 18 14:56:25 2005 +++ llvm-poolalloc/lib/Makefile Wed Dec 13 23:51:06 2006 @@ -6,6 +6,6 @@ # # List all of the subdirectories that we will compile. # -DIRS=PoolAllocate +PARALLEL_DIRS=DSA PoolAllocate include $(LEVEL)/Makefile.common ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-poolalloc/include/poolalloc/PoolAllocate.h
Changes in directory llvm-poolalloc/include/poolalloc: PoolAllocate.h updated: 1.51 -> 1.52 --- Log message: Merged from release_19 branch. This adds correct compilation of DSA, pool inference, and configure script fixes to mainline. --- Diffs of the changes: (+3 -4) PoolAllocate.h |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) Index: llvm-poolalloc/include/poolalloc/PoolAllocate.h diff -u llvm-poolalloc/include/poolalloc/PoolAllocate.h:1.51 llvm-poolalloc/include/poolalloc/PoolAllocate.h:1.52 --- llvm-poolalloc/include/poolalloc/PoolAllocate.h:1.51Wed Jul 26 10:37:25 2006 +++ llvm-poolalloc/include/poolalloc/PoolAllocate.h Wed Dec 13 23:51:06 2006 @@ -16,19 +16,18 @@ #ifndef POOLALLOCATE_H #define POOLALLOCATE_H -//#define SAFECODE 1 -//#define BOUNDS_CHECK 1 -//comment the above two for normal poolallocation + #include "llvm/Pass.h" #include "llvm/DerivedTypes.h" #include "llvm/Support/CallSite.h" #include "llvm/ADT/EquivalenceClasses.h" #include "llvm/ADT/VectorExtras.h" #include "llvm/ADT/hash_set" +#include "poolalloc/Config/config.h" #ifdef SAFECODE //FIXME : make this use some configuration options -#include "/home/vadve/dhurjati/llvm/projects/safecode.typesafe/include/ConvertUnsafeAllocas.h" +#include "/home/vadve/criswell/src/latestllvm/projects/safecode/include/ConvertUnsafeAllocas.h" #endif ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-poolalloc/lib/DSA/BottomUpClosure.cpp CallTargets.cpp CompleteBottomUp.cpp DataStructure.cpp DataStructureAA.cpp DataStructureOpt.cpp DataStructureStats.cpp EquivClassGraphs.c
Changes in directory llvm-poolalloc/lib/DSA: BottomUpClosure.cpp updated: 1.127 -> 1.128 CallTargets.cpp updated: 1.7 -> 1.8 CompleteBottomUp.cpp updated: 1.39 -> 1.40 DataStructure.cpp updated: 1.255 -> 1.256 DataStructureAA.cpp updated: 1.40 -> 1.41 DataStructureOpt.cpp updated: 1.14 -> 1.15 DataStructureStats.cpp updated: 1.24 -> 1.25 EquivClassGraphs.cpp updated: 1.53 -> 1.54 GraphChecker.cpp updated: 1.23 -> 1.24 Local.cpp updated: 1.163 -> 1.164 Makefile updated: 1.5 -> 1.6 Printer.cpp updated: 1.91 -> 1.92 Steensgaard.cpp updated: 1.67 -> 1.68 TopDownClosure.cpp updated: 1.95 -> 1.96 --- Log message: Merged from release_19 branch. This adds correct compilation of DSA, pool inference, and configure script fixes to mainline. --- Diffs of the changes: (+708 -62) BottomUpClosure.cpp| 14 - CallTargets.cpp|6 CompleteBottomUp.cpp |4 DataStructure.cpp | 249 ++ DataStructureAA.cpp|4 DataStructureOpt.cpp |4 DataStructureStats.cpp |4 EquivClassGraphs.cpp |4 GraphChecker.cpp |4 Local.cpp | 456 ++--- Makefile |4 Printer.cpp|6 Steensgaard.cpp|5 TopDownClosure.cpp |6 14 files changed, 708 insertions(+), 62 deletions(-) Index: llvm-poolalloc/lib/DSA/BottomUpClosure.cpp diff -u llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.127 llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.128 --- llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.127Wed Dec 6 19:30:31 2006 +++ llvm-poolalloc/lib/DSA/BottomUpClosure.cpp Wed Dec 13 23:51:06 2006 @@ -15,8 +15,8 @@ //===--===// #define DEBUG_TYPE "bu_dsa" -#include "llvm/Analysis/DataStructure/DataStructure.h" -#include "llvm/Analysis/DataStructure/DSGraph.h" +#include "dsa/DataStructure.h" +#include "dsa/DSGraph.h" #include "llvm/Module.h" #include "llvm/DerivedTypes.h" #include "llvm/ADT/Statistic.h" @@ -588,11 +588,11 @@ ++NumBUInlines; } else { if (!Printed) - cerr << "In Fns: " << Graph.getFunctionNames() << "\n"; -cerr << " calls " << CalledFuncs.size() - << " fns from site: " << CS.getCallSite().getInstruction() - << " " << *CS.getCallSite().getInstruction(); -cerr << " Fns ="; + DEBUG(std::cerr << "In Fns: " << Graph.getFunctionNames() << "\n"); + DEBUG(std::cerr << " calls " << CalledFuncs.size() + << " fns from site: " << CS.getCallSite().getInstruction() + << " " << *CS.getCallSite().getInstruction()); +DEBUG(std::cerr << " Fns ="); unsigned NumPrinted = 0; for (std::vector::iterator I = CalledFuncs.begin(), Index: llvm-poolalloc/lib/DSA/CallTargets.cpp diff -u llvm-poolalloc/lib/DSA/CallTargets.cpp:1.7 llvm-poolalloc/lib/DSA/CallTargets.cpp:1.8 --- llvm-poolalloc/lib/DSA/CallTargets.cpp:1.7 Wed Dec 6 19:30:31 2006 +++ llvm-poolalloc/lib/DSA/CallTargets.cpp Wed Dec 13 23:51:06 2006 @@ -17,11 +17,11 @@ // //===--===// -#include "llvm/Analysis/DataStructure/CallTargets.h" #include "llvm/Module.h" #include "llvm/Instructions.h" -#include "llvm/Analysis/DataStructure/DataStructure.h" -#include "llvm/Analysis/DataStructure/DSGraph.h" +#include "dsa/DataStructure.h" +#include "dsa/DSGraph.h" +#include "dsa/CallTargets.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Streams.h" #include "llvm/Constants.h" Index: llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp diff -u llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp:1.39 llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp:1.40 --- llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp:1.39Wed Dec 6 11:46:31 2006 +++ llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp Wed Dec 13 23:51:06 2006 @@ -14,9 +14,9 @@ //===--===// #define DEBUG_TYPE "cbudatastructure" -#include "llvm/Analysis/DataStructure/DataStructure.h" +#include "dsa/DataStructure.h" #include "llvm/Module.h" -#include "llvm/Analysis/DataStructure/DSGraph.h" +#include "dsa/DSGraph.h" #include "llvm/Support/Debug.h" #include "llvm/ADT/SCCIterator.h" #include "llvm/ADT/Statistic.h" Index: llvm-poolalloc/lib/DSA/DataStructure.cpp diff -u llvm-poolalloc/lib/DSA/DataStructure.cpp:1.255 llvm-poolalloc/lib/DSA/DataStructure.cpp:1.256 --- llvm-poolalloc/lib/DSA/DataStructure.cpp:1.255 Thu Dec 7 14:28:15 2006 +++ llvm-poolalloc/lib/DSA/DataStructure.cppWed Dec 13 23:51:06 2006 @@ -1,3 +1,4 @@ +#define JTC 0 //===- DataStructure.cpp - Implement the core data structure analysis -===// // // The LLVM Compiler Infrastructure @@ -11,7 +12,9 @@ // //===--===// -#inclu
[llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp Heuristic.cpp PointerCompress.cpp PoolAllocate.cpp TransformFunctionBody.cpp
Changes in directory llvm-poolalloc/lib/PoolAllocate: AccessTrace.cpp updated: 1.7 -> 1.8 Heuristic.cpp updated: 1.15 -> 1.16 PointerCompress.cpp updated: 1.73 -> 1.74 PoolAllocate.cpp updated: 1.128 -> 1.129 TransformFunctionBody.cpp updated: 1.58 -> 1.59 --- Log message: Merged from release_19 branch. This adds correct compilation of DSA, pool inference, and configure script fixes to mainline. --- Diffs of the changes: (+16 -11) AccessTrace.cpp |5 +++-- Heuristic.cpp |3 ++- PointerCompress.cpp |5 +++-- PoolAllocate.cpp |7 --- TransformFunctionBody.cpp |7 --- 5 files changed, 16 insertions(+), 11 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp diff -u llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp:1.7 llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp:1.8 --- llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp:1.7 Wed Dec 13 14:06:42 2006 +++ llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp Wed Dec 13 23:51:06 2006 @@ -12,9 +12,10 @@ //===--===// #define DEBUG_TYPE "pointercompress" + +#include "dsa/DataStructure.h" +#include "dsa/DSGraph.h" #include "poolalloc/PoolAllocate.h" -#include "llvm/Analysis/DataStructure/DataStructure.h" -#include "llvm/Analysis/DataStructure/DSGraph.h" #include "llvm/Instructions.h" #include "llvm/Module.h" using namespace llvm; Index: llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp diff -u llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp:1.15 llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp:1.16 --- llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp:1.15 Wed Jul 26 10:07:40 2006 +++ llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp Wed Dec 13 23:51:07 2006 @@ -12,10 +12,11 @@ //===--===// #include "Heuristic.h" + +#include "dsa/DSGraphTraits.h" #include "poolalloc/PoolAllocate.h" #include "llvm/Instructions.h" #include "llvm/Module.h" -#include "llvm/Analysis/DataStructure/DSGraphTraits.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/Support/CommandLine.h" #include "llvm/Target/TargetData.h" Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.73 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.74 --- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.73Wed Dec 13 14:06:42 2006 +++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Wed Dec 13 23:51:07 2006 @@ -12,13 +12,14 @@ //===--===// #define DEBUG_TYPE "pointercompress" + +#include "dsa/DataStructure.h" +#include "dsa/DSGraph.h" #include "poolalloc/PoolAllocate.h" #include "Heuristic.h" #include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/Module.h" -#include "llvm/Analysis/DataStructure/DataStructure.h" -#include "llvm/Analysis/DataStructure/DSGraph.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/CommandLine.h" Index: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.128 llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.129 --- llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.128 Wed Dec 13 14:06:42 2006 +++ llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cppWed Dec 13 23:51:07 2006 @@ -13,6 +13,10 @@ //===--===// #define DEBUG_TYPE "poolalloc" + +#include "dsa/DataStructure.h" +#include "dsa/DSGraph.h" +#include "dsa/CallTargets.h" #include "poolalloc/PoolAllocate.h" #include "Heuristic.h" #include "llvm/Constants.h" @@ -20,13 +24,10 @@ #include "llvm/Instructions.h" #include "llvm/Module.h" #include "llvm/Constants.h" -#include "llvm/Analysis/DataStructure/DataStructure.h" -#include "llvm/Analysis/DataStructure/DSGraph.h" #include "llvm/Support/CFG.h" #include "llvm/Target/TargetData.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Cloning.h" -#include "llvm/Analysis/DataStructure/CallTargets.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" Index: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp diff -u llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.58 llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.59 --- llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.58 Wed Dec 13 14:06:42 2006 +++ llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Wed Dec 13 23:51:07 2006 @@ -12,10 +12,11 @@ //===--===// #define DEBUG_TYPE "PoolAllocator" + +#include "dsa/DataStructure.h" +#include "dsa/DSGraph.h" +#include "dsa/CallTargets.h" #include "poolalloc/PoolAllocate.h" -#inc
[llvm-commits] CVS: llvm-poolalloc/include/dsa/DSGraph.h DSGraphTraits.h DSNode.h DataStructure.h
Changes in directory llvm-poolalloc/include/dsa: DSGraph.h updated: 1.112 -> 1.113 DSGraphTraits.h updated: 1.25 -> 1.26 DSNode.h updated: 1.60 -> 1.61 DataStructure.h updated: 1.98 -> 1.99 --- Log message: Merged from release_19 branch. This adds correct compilation of DSA, pool inference, and configure script fixes to mainline. --- Diffs of the changes: (+113 -11) DSGraph.h | 103 DSGraphTraits.h |2 - DSNode.h| 11 - DataStructure.h |8 +++- 4 files changed, 113 insertions(+), 11 deletions(-) Index: llvm-poolalloc/include/dsa/DSGraph.h diff -u llvm-poolalloc/include/dsa/DSGraph.h:1.112 llvm-poolalloc/include/dsa/DSGraph.h:1.113 --- llvm-poolalloc/include/dsa/DSGraph.h:1.112 Wed Dec 6 19:30:30 2006 +++ llvm-poolalloc/include/dsa/DSGraph.hWed Dec 13 23:51:06 2006 @@ -15,13 +15,18 @@ #ifndef LLVM_ANALYSIS_DSGRAPH_H #define LLVM_ANALYSIS_DSGRAPH_H -#include "llvm/Analysis/DataStructure/DSNode.h" +#include "dsa/DSNode.h" #include "llvm/ADT/hash_map" #include "llvm/ADT/EquivalenceClasses.h" -#include +#include "poolalloc/Config/config.h" +#include +#include +#include namespace llvm { + //typedef map PoolDescriptorMapType; + class GlobalValue; //===--===// @@ -170,6 +175,62 @@ }; +#ifdef LLVA_KERNEL +class MetaPool; +class MetaPoolHandle { + MetaPool *Rep; + Instruction * Creator; +public: + MetaPoolHandle(MetaPool *mp, Instruction * Maker = 0); + + MetaPool *getMetaPool() { +return Rep; + } + void setMetaPool(MetaPool *v) { +Rep = v; + } + ~MetaPoolHandle() { +//do nothing for now + } + const std::string &getName(); + Value *getMetaPoolValue(); + void merge(MetaPoolHandle *other); +}; + + class MetaPool { +Value *MPD; +hash_set HandleSet; + + public: +MetaPool(Value *mpd) : MPD(mpd) { +} +void addMetaPoolHandles(hash_set & mpHS) { + HandleSet.insert(mpHS.begin(), mpHS.end()); +} +hash_set& getHandleSet() { + return HandleSet; +} +Value * getMetaPoolValue() { + return MPD; +} +void setMetaPoolValue(Value *V) { + MPD = V; +} +void insert(MetaPoolHandle *mph) { + HandleSet.insert(mph); +} +const std::string& getName() { + return MPD->getName(); +} +~MetaPool() { + HandleSet.clear(); +} + }; + +#endif + + + //===--===// /// DSGraph - The graph that represents a function. /// @@ -219,13 +280,18 @@ /// constructed for. const TargetData &TD; +#ifdef LLVA_KERNEL + hash_map PoolDescriptors; +#endif + + + void operator=(const DSGraph &); // DO NOT IMPLEMENT DSGraph(const DSGraph&); // DO NOT IMPLEMENT public: // Create a new, empty, DSGraph. DSGraph(EquivalenceClasses &ECs, const TargetData &td) -: GlobalsGraph(0), PrintAuxCalls(false), ScalarMap(ECs), TD(td) {} - +: GlobalsGraph(0), PrintAuxCalls(false), ScalarMap(ECs), TD(td) { } // Compute the local DSGraph DSGraph(EquivalenceClasses &ECs, const TargetData &TD, Function &F, DSGraph *GlobalsGraph); @@ -238,13 +304,38 @@ // source. You need to set a new GlobalsGraph with the setGlobalsGraph // method. // - DSGraph(const DSGraph &DSG, EquivalenceClasses &ECs, + DSGraph( DSGraph &DSG, EquivalenceClasses &ECs, unsigned CloneFlags = 0); ~DSGraph(); DSGraph *getGlobalsGraph() const { return GlobalsGraph; } void setGlobalsGraph(DSGraph *G) { GlobalsGraph = G; } +#ifdef LLVA_KERNEL +#if 1 + hash_map& getPoolDescriptorsMap() { +return PoolDescriptors; + } + MetaPoolHandle *getPoolForNode(const DSNode *N) { +if (PoolDescriptors.count(N) > 0) { + return PoolDescriptors[N]; +} +return 0; + } +#else + hash_map& getPoolDescriptorsMap() { +return PoolDescriptors; + } + MetaPoolHandle *getPoolForNode(const DSNodeHandle *N) { +if (PoolDescriptors.count(N) > 0) { + return PoolDescriptors[N]; +} +return 0; + } +#endif + +#endif + /// getGlobalECs - Return the set of equivalence classes that the global /// variables in the program form. EquivalenceClasses &getGlobalECs() const { @@ -472,7 +563,7 @@ /// /// The CloneFlags member controls various aspects of the cloning process. /// - void cloneInto(const DSGraph &G, unsigned CloneFlags = 0); + void cloneInto(DSGraph &G, unsigned CloneFlags = 0); /// getFunctionArgumentsForCall - Given a function that is currently in this /// graph, return the DSNodeHandles that correspond to the pointer-compatible Index: llvm-poolalloc/include/dsa/DSGraphTraits.h diff -u llvm-poolalloc/include/dsa/DSGraphTraits.h:1.25 llvm-poolalloc/include/dsa/DSGraphTraits.h:1.26 --- llvm-poolalloc/include/dsa/DSGraphTraits.h:1.25 Thu Nov 2 19:43:47 2006 +++ llvm-poolalloc/includ
[llvm-commits] CVS: llvm/lib/CodeGen/VirtRegMap.cpp
Changes in directory llvm/lib/CodeGen: VirtRegMap.cpp updated: 1.88 -> 1.89 --- Log message: Fix a long-standing spiller bug: If a spillslot value is available in a register, and there is a noop copy that targets that register, the spiller correctly decide not to invalidate the spillslot register. However, even though the noop copy does not clobbers the value. It does start a new intersecting live range. That means the spillslot register is available for use but should not be reused for a two-address instruction modref operand which would clobber the new live range. When we remove the noop copy, update the available information by clearing the canClobber bit. --- Diffs of the changes: (+35 -1) VirtRegMap.cpp | 36 +++- 1 files changed, 35 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/VirtRegMap.cpp diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.88 llvm/lib/CodeGen/VirtRegMap.cpp:1.89 --- llvm/lib/CodeGen/VirtRegMap.cpp:1.88Fri Dec 8 12:45:48 2006 +++ llvm/lib/CodeGen/VirtRegMap.cpp Thu Dec 14 01:54:05 2006 @@ -272,6 +272,8 @@ // invalidate entries in SpillSlotsAvailable when a physreg is modified. std::multimap PhysRegsAvailable; + void disallowClobberPhysRegOnly(unsigned PhysReg); + void ClobberPhysRegOnly(unsigned PhysReg); public: AvailableSpills(const MRegisterInfo *mri, const TargetInstrInfo *tii) @@ -303,7 +305,7 @@ DOUT << "Remembering SS#" << Slot << " in physreg " << MRI->getName(Reg) << "\n"; } - + /// canClobberPhysReg - Return true if the spiller is allowed to change the /// value of the specified stackslot register if it desires. The specified /// stack slot must be available in a physreg for this query to make sense. @@ -312,6 +314,11 @@ return SpillSlotsAvailable.find(Slot)->second & 1; } + /// disallowClobberPhysReg - Unset the CanClobber bit of the specified + /// stackslot register. The register is still available but is no longer + /// allowed to be modifed. + void disallowClobberPhysReg(unsigned PhysReg); + /// ClobberPhysReg - This is called when the specified physreg changes /// value. We use this to invalidate any info about stuff we thing lives in /// it and any of its aliases. @@ -324,6 +331,32 @@ }; } +/// disallowClobberPhysRegOnly - Unset the CanClobber bit of the specified +/// stackslot register. The register is still available but is no longer +/// allowed to be modifed. +void AvailableSpills::disallowClobberPhysRegOnly(unsigned PhysReg) { + std::multimap::iterator I = +PhysRegsAvailable.lower_bound(PhysReg); + while (I != PhysRegsAvailable.end() && I->first == PhysReg) { +int Slot = I->second; +I++; +assert((SpillSlotsAvailable[Slot] >> 1) == PhysReg && + "Bidirectional map mismatch!"); +SpillSlotsAvailable[Slot] &= ~1; +DOUT << "PhysReg " << MRI->getName(PhysReg) + << " copied, it is available for use but can no longer be modified\n"; + } +} + +/// disallowClobberPhysReg - Unset the CanClobber bit of the specified +/// stackslot register and its aliases. The register and its aliases may +/// still available but is no longer allowed to be modifed. +void AvailableSpills::disallowClobberPhysReg(unsigned PhysReg) { + for (const unsigned *AS = MRI->getAliasSet(PhysReg); *AS; ++AS) +disallowClobberPhysRegOnly(*AS); + disallowClobberPhysRegOnly(PhysReg); +} + /// ClobberPhysRegOnly - This is called when the specified physreg changes /// value. We use this to invalidate any info about stuff we thing lives in it. void AvailableSpills::ClobberPhysRegOnly(unsigned PhysReg) { @@ -822,6 +855,7 @@ DOUT << "Removing now-noop copy: " << MI; MBB.erase(&MI); VRM.RemoveFromFoldedVirtMap(&MI); +Spills.disallowClobberPhysReg(VirtReg); goto ProcessNextInst; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits