[llvm-commits] [llvm] r46510 - in /llvm/trunk/lib/VMCore: Module.cpp Pass.cpp PassManager.cpp
Author: djg Date: Tue Jan 29 06:09:55 2008 New Revision: 46510 URL: http://llvm.org/viewvc/llvm-project?rev=46510&view=rev Log: Fix 80-col violations. Modified: llvm/trunk/lib/VMCore/Module.cpp llvm/trunk/lib/VMCore/Pass.cpp llvm/trunk/lib/VMCore/PassManager.cpp Modified: llvm/trunk/lib/VMCore/Module.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Module.cpp?rev=46510&r1=46509&r2=46510&view=diff == --- llvm/trunk/lib/VMCore/Module.cpp (original) +++ llvm/trunk/lib/VMCore/Module.cpp Tue Jan 29 06:09:55 2008 @@ -46,7 +46,8 @@ return Ret; } GlobalAlias *ilist_traits::createSentinel() { - GlobalAlias *Ret = new GlobalAlias(Type::Int32Ty, GlobalValue::ExternalLinkage); + GlobalAlias *Ret = new GlobalAlias(Type::Int32Ty, + GlobalValue::ExternalLinkage); // This should not be garbage monitored. LeakDetector::removeGarbageObject(Ret); return Ret; Modified: llvm/trunk/lib/VMCore/Pass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Pass.cpp?rev=46510&r1=46509&r2=46510&view=diff == --- llvm/trunk/lib/VMCore/Pass.cpp (original) +++ llvm/trunk/lib/VMCore/Pass.cpp Tue Jan 29 06:09:55 2008 @@ -90,7 +90,8 @@ // run - On a function, we simply initialize, run the function, then finalize. // bool FunctionPass::run(Function &F) { - if (F.isDeclaration()) return false;// Passes are not run on external functions! + // Passes are not run on external functions! + if (F.isDeclaration()) return false; bool Changed = doInitialization(*F.getParent()); Changed |= runOnFunction(F); Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=46510&r1=46509&r2=46510&view=diff == --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Tue Jan 29 06:09:55 2008 @@ -475,7 +475,8 @@ // If Pass not found then check the interfaces implemented by Immutable Pass if (!P) { - const std::vector &ImmPI = PI->getInterfacesImplemented(); + const std::vector &ImmPI = +PI->getInterfacesImplemented(); if (std::find(ImmPI.begin(), ImmPI.end(), AID) != ImmPI.end()) P = *I; } @@ -588,8 +589,9 @@ for (std::vector::iterator I = HigherLevelAnalysis.begin(), E = HigherLevelAnalysis.end(); I != E; ++I) { Pass *P1 = *I; -if (!dynamic_cast(P1) -&& std::find(PreservedSet.begin(), PreservedSet.end(), P1->getPassInfo()) == +if (!dynamic_cast(P1) && +std::find(PreservedSet.begin(), PreservedSet.end(), + P1->getPassInfo()) == PreservedSet.end()) return false; } @@ -642,8 +644,8 @@ I = InheritedAnalysis[Index]->begin(), E = InheritedAnalysis[Index]->end(); I != E; ) { std::map::iterator Info = I++; - if (!dynamic_cast(Info->second) - && std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) == + if (!dynamic_cast(Info->second) && + std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) == PreservedSet.end()) // Remove this analysis InheritedAnalysis[Index]->erase(Info); @@ -974,7 +976,8 @@ if (TheTimeInfo) TheTimeInfo->passEnded(BP); if (Changed) -dumpPassInfo(BP, MODIFICATION_MSG, ON_BASICBLOCK_MSG, I->getNameStart()); +dumpPassInfo(BP, MODIFICATION_MSG, ON_BASICBLOCK_MSG, + I->getNameStart()); dumpAnalysisSetInfo("Preserved", BP, AnUsage.getPreservedSet()); verifyPreservedAnalysis(BP); @@ -1231,7 +1234,8 @@ AnalysisUsage AnUsage; MP->getAnalysisUsage(AnUsage); -dumpPassInfo(MP, EXECUTION_MSG, ON_MODULE_MSG, M.getModuleIdentifier().c_str()); +dumpPassInfo(MP, EXECUTION_MSG, ON_MODULE_MSG, + M.getModuleIdentifier().c_str()); dumpAnalysisSetInfo("Required", MP, AnUsage.getRequiredSet()); initializeAnalysisImpl(MP); @@ -1241,7 +1245,8 @@ if (TheTimeInfo) TheTimeInfo->passEnded(MP); if (Changed) - dumpPassInfo(MP, MODIFICATION_MSG, ON_MODULE_MSG, M.getModuleIdentifier().c_str()); + dumpPassInfo(MP, MODIFICATION_MSG, ON_MODULE_MSG, + M.getModuleIdentifier().c_str()); dumpAnalysisSetInfo("Preserved", MP, AnUsage.getPreservedSet()); verifyPreservedAnalysis(MP); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46507 - /llvm/trunk/include/llvm/CodeGen/LiveVariables.h
Author: djg Date: Tue Jan 29 06:06:33 2008 New Revision: 46507 URL: http://llvm.org/viewvc/llvm-project?rev=46507&view=rev Log: Fix a typo in a comment. Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveVariables.h?rev=46507&r1=46506&r2=46507&view=diff == --- llvm/trunk/include/llvm/CodeGen/LiveVariables.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveVariables.h Tue Jan 29 06:06:33 2008 @@ -14,7 +14,7 @@ // the instruction, but are never used after the instruction (i.e., they are // killed). // -// This class computes live variables using are sparse implementation based on +// This class computes live variables using a sparse implementation based on // the machine code SSA form. This class computes live variable information for // each virtual and _register allocatable_ physical register in a function. It // uses the dominance properties of SSA form to efficiently compute live ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [test-suite] r46516 - in /test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url: search.c url.c
Author: laurov Date: Tue Jan 29 11:25:20 2008 New Revision: 46516 URL: http://llvm.org/viewvc/llvm-project?rev=46516&view=rev Log: Fix memory leaks. Modified: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c Modified: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.c?rev=46516&r1=46515&r2=46516&view=diff == --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.c (original) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.c Tue Jan 29 11:25:20 2008 @@ -281,6 +281,7 @@ } } *lcssize = sub_pat_size; + free(bmBc); return sub_pattern; } Modified: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c?rev=46516&r1=46515&r2=46516&view=diff == --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c (original) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c Tue Jan 29 11:25:20 2008 @@ -139,6 +139,7 @@ are done in route application. */ /* Done for the packet... */ + free(packet); } fprintf (stderr, "URL finished for %d packets \n", num_packets); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46506 - in /llvm/trunk: include/llvm/CodeGen/MachineOperand.h include/llvm/CodeGen/MachineRegisterInfo.h include/llvm/PassSupport.h lib/VMCore/AsmWriter.cpp
Author: djg Date: Tue Jan 29 05:36:12 2008 New Revision: 46506 URL: http://llvm.org/viewvc/llvm-project?rev=46506&view=rev Log: Add explicit keywords. Modified: llvm/trunk/include/llvm/CodeGen/MachineOperand.h llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h llvm/trunk/include/llvm/PassSupport.h llvm/trunk/lib/VMCore/AsmWriter.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineOperand.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineOperand.h?rev=46506&r1=46505&r2=46506&view=diff == --- llvm/trunk/include/llvm/CodeGen/MachineOperand.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineOperand.h Tue Jan 29 05:36:12 2008 @@ -97,7 +97,7 @@ } OffsetedInfo; } Contents; - MachineOperand(MachineOperandType K) : OpKind(K), ParentMI(0) {} + explicit MachineOperand(MachineOperandType K) : OpKind(K), ParentMI(0) {} public: MachineOperand(const MachineOperand &M) { *this = M; Modified: llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h?rev=46506&r1=46505&r2=46506&view=diff == --- llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h Tue Jan 29 05:36:12 2008 @@ -54,7 +54,7 @@ MachineRegisterInfo(const MachineRegisterInfo&); // DO NOT IMPLEMENT void operator=(const MachineRegisterInfo&); // DO NOT IMPLEMENT public: - MachineRegisterInfo(const MRegisterInfo &MRI); + explicit MachineRegisterInfo(const MRegisterInfo &MRI); ~MachineRegisterInfo(); //======// @@ -203,7 +203,7 @@ class defusechain_iterator : public forward_iterator { MachineOperand *Op; -defusechain_iterator(MachineOperand *op) : Op(op) { +explicit defusechain_iterator(MachineOperand *op) : Op(op) { // If the first node isn't one we're interested in, advance to one that // we are interested in. if (op) { Modified: llvm/trunk/include/llvm/PassSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=46506&r1=46505&r2=46506&view=diff == --- llvm/trunk/include/llvm/PassSupport.h (original) +++ llvm/trunk/include/llvm/PassSupport.h Tue Jan 29 05:36:12 2008 @@ -144,7 +144,7 @@ : PIObj(Name, Arg, TI, NormalCtor, CFGOnly) { registerPass(); } - RegisterPassBase(intptr_t TI) + explicit RegisterPassBase(intptr_t TI) : PIObj("", "", TI) { // This ctor may only be used for analysis groups: it does not auto-register // the pass. Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=46506&r1=46505&r2=46506&view=diff == --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Tue Jan 29 05:36:12 2008 @@ -57,10 +57,10 @@ /// @{ public: /// @brief Construct from a module - SlotMachine(const Module *M); + explicit SlotMachine(const Module *M); /// @brief Construct from a function, starting out in incorp state. - SlotMachine(const Function *F); + explicit SlotMachine(const Function *F); /// @} /// @name Accessors ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [test-suite] r46518 - /test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile
Author: laurov Date: Tue Jan 29 12:09:04 2008 New Revision: 46518 URL: http://llvm.org/viewvc/llvm-project?rev=46518&view=rev Log: Define SMALL_PROBLEM_SIZE and add "-lm" to LDFLAGS. Modified: test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile Modified: test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile?rev=46518&r1=46517&r2=46518&view=diff == --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile (original) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile Tue Jan 29 12:09:04 2008 @@ -1,9 +1,12 @@ LEVEL = ../../../.. +LDFLAGS += -lm PROG = beamformer FP_TOLERANCE = 0.01 ifdef LARGE_PROBLEM_SIZE RUN_OPTIONS = -i 400 +else ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = -i 25 else RUN_OPTIONS = -i 140 endif ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46512 - /llvm/trunk/utils/vim/llvm.vim
Author: djg Date: Tue Jan 29 06:35:50 2008 New Revision: 46512 URL: http://llvm.org/viewvc/llvm-project?rev=46512&view=rev Log: Update this file for 2.0 syntax. Modified: llvm/trunk/utils/vim/llvm.vim Modified: llvm/trunk/utils/vim/llvm.vim URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/vim/llvm.vim?rev=46512&r1=46511&r2=46512&view=diff == --- llvm/trunk/utils/vim/llvm.vim (original) +++ llvm/trunk/utils/vim/llvm.vim Tue Jan 29 06:35:50 2008 @@ -11,25 +11,33 @@ syn case match -syn keyword llvmType void bool sbyte ubyte -syn keyword llvmType short ushort int uint -syn keyword llvmType long ulong float double +syn keyword llvmType void float double +syn keyword llvmType x86_fp80 fp128 ppc_fp128 syn keyword llvmType type label opaque +syn match llvmType /\/ -syn keyword llvmStatement add sub mul div rem +syn keyword llvmStatement add sub mul sdiv udiv fdiv srem urem frem syn keyword llvmStatement and or xor -syn keyword llvmStatement setne seteq setlt setgt setle setge - -syn keyword llvmStatement phi tail call cast to select shl shr vaarg vanext +syn keyword llvmStatement icmp fcmp +syn keyword llvmStatement eq ne ugt uge ult ule sgt sge slt sle +syn keyword llvmStatement false oeq ogt oge olt ole one ord ueq ugt uge +syn keyword llvmStatement ult ule une uno true + +syn keyword llvmStatement phi tail call to select shl lshr ashr va_arg +syn keyword llvmStatement trunc zext sext +syn keyword llvmStatement fptrunc fpext fptoui fptosi uitofp sitofp +syn keyword llvmStatement ptrtoint inttoptr bitcast syn keyword llvmStatement ret br switch invoke unwind unreachable syn keyword llvmStatement malloc alloca free load store getelementptr -syn keyword llvmStatement begin end true false zeroinitializer -syn keyword llvmStatement declare global constant const +syn keyword llvmStatement true false zeroinitializer +syn keyword llvmStatement define declare global constant const syn keyword llvmStatement internal uninitialized external implementation syn keyword llvmStatement linkonce weak appending -syn keyword llvmStatement undef null to except target endian pointersize deplibs +syn keyword llvmStatement undef null to except target datalayout triple deplibs syn keyword llvmStatement big little volatile fastcc coldcc cc +syn keyword llvmStatement extractelement insertelement shufflevector +syn keyword llvmStatement module asm align "syn match llvmFunction /%[a-zA-Z\$._\-][a-zA-Z\$._\-0-9]*/ syn match llvmNumber /\<\d\+\>/ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46513 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
Author: djg Date: Tue Jan 29 06:43:50 2008 New Revision: 46513 URL: http://llvm.org/viewvc/llvm-project?rev=46513&view=rev Log: Fix a typo in a comment. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=46513&r1=46512&r2=46513&view=diff == --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Tue Jan 29 06:43:50 2008 @@ -1386,7 +1386,7 @@ if (!SuccSU->Node || !SuccSU->Node->isTargetOpcode()) continue; // Don't constrain nodes with physical register defs if the - // predecessor can cloober them. + // predecessor can clobber them. if (SuccSU->hasPhysRegDefs) { if (canClobberPhysRegDefs(SuccSU, SU, TII, MRI)) continue; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46508 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
Author: djg Date: Tue Jan 29 06:07:11 2008 New Revision: 46508 URL: http://llvm.org/viewvc/llvm-project?rev=46508&view=rev Log: Fix a typo in a comment. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=46508&r1=46507&r2=46508&view=diff == --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Tue Jan 29 06:07:11 2008 @@ -58,7 +58,6 @@ bool isBottomUp; /// AvailableQueue - The priority queue to use for the available SUnits. - ///a SchedulingPriorityQueue *AvailableQueue; /// LiveRegs / LiveRegDefs - A set of physical registers and their definition ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46509 - /llvm/trunk/lib/Support/APFloat.cpp
Author: djg Date: Tue Jan 29 06:08:20 2008 New Revision: 46509 URL: http://llvm.org/viewvc/llvm-project?rev=46509&view=rev Log: Remove top-level const qualifiers from casts, avoiding associated compiler warnings. Modified: llvm/trunk/lib/Support/APFloat.cpp Modified: llvm/trunk/lib/Support/APFloat.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=46509&r1=46508&r2=46509&view=diff == --- llvm/trunk/lib/Support/APFloat.cpp (original) +++ llvm/trunk/lib/Support/APFloat.cpp Tue Jan 29 06:08:20 2008 @@ -627,14 +627,14 @@ category != rhs.category || sign != rhs.sign) return false; - if (semantics==(const llvm::fltSemantics* const)&PPCDoubleDouble && + if (semantics==(const llvm::fltSemantics*)&PPCDoubleDouble && sign2 != rhs.sign2) return false; if (category==fcZero || category==fcInfinity) return true; else if (category==fcNormal && exponent!=rhs.exponent) return false; - else if (semantics==(const llvm::fltSemantics* const)&PPCDoubleDouble && + else if (semantics==(const llvm::fltSemantics*)&PPCDoubleDouble && exponent2!=rhs.exponent2) return false; else { @@ -2435,7 +2435,7 @@ APInt APFloat::convertF80LongDoubleAPFloatToAPInt() const { - assert(semantics == (const llvm::fltSemantics* const)&x87DoubleExtended); + assert(semantics == (const llvm::fltSemantics*)&x87DoubleExtended); assert (partCount()==2); uint64_t myexponent, mysignificand; @@ -2468,7 +2468,7 @@ APInt APFloat::convertPPCDoubleDoubleAPFloatToAPInt() const { - assert(semantics == (const llvm::fltSemantics* const)&PPCDoubleDouble); + assert(semantics == (const llvm::fltSemantics*)&PPCDoubleDouble); assert (partCount()==2); uint64_t myexponent, mysignificand, myexponent2, mysignificand2; @@ -2576,16 +2576,16 @@ APInt APFloat::convertToAPInt() const { - if (semantics == (const llvm::fltSemantics* const)&IEEEsingle) + if (semantics == (const llvm::fltSemantics*)&IEEEsingle) return convertFloatAPFloatToAPInt(); - if (semantics == (const llvm::fltSemantics* const)&IEEEdouble) + if (semantics == (const llvm::fltSemantics*)&IEEEdouble) return convertDoubleAPFloatToAPInt(); - if (semantics == (const llvm::fltSemantics* const)&PPCDoubleDouble) + if (semantics == (const llvm::fltSemantics*)&PPCDoubleDouble) return convertPPCDoubleDoubleAPFloatToAPInt(); - assert(semantics == (const llvm::fltSemantics* const)&x87DoubleExtended && + assert(semantics == (const llvm::fltSemantics*)&x87DoubleExtended && "unknown format!"); return convertF80LongDoubleAPFloatToAPInt(); } @@ -2593,7 +2593,7 @@ float APFloat::convertToFloat() const { - assert(semantics == (const llvm::fltSemantics* const)&IEEEsingle); + assert(semantics == (const llvm::fltSemantics*)&IEEEsingle); APInt api = convertToAPInt(); return api.bitsToFloat(); } @@ -2601,7 +2601,7 @@ double APFloat::convertToDouble() const { - assert(semantics == (const llvm::fltSemantics* const)&IEEEdouble); + assert(semantics == (const llvm::fltSemantics*)&IEEEdouble); APInt api = convertToAPInt(); return api.bitsToDouble(); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46511 - /llvm/trunk/include/llvm/Analysis/LoopInfo.h
Author: djg Date: Tue Jan 29 06:12:40 2008 New Revision: 46511 URL: http://llvm.org/viewvc/llvm-project?rev=46511&view=rev Log: Add comments describing what the loop depth values mean. Also, make a minor simplification to the loop depth calculation code. Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=46511&r1=46510&r2=46511&view=diff == --- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Tue Jan 29 06:12:40 2008 @@ -84,9 +84,12 @@ delete SubLoops[i]; } + /// getLoopDepth - Return the nesting level of this loop. An outer-most + /// loop has depth 1, for consistency with loop depth values used for basic + /// blocks, where depth 0 is used for blocks not inside any loops. unsigned getLoopDepth() const { -unsigned D = 0; -for (const LoopBase *CurLoop = this; CurLoop; +unsigned D = 1; +for (const LoopBase *CurLoop = ParentLoop; CurLoop; CurLoop = CurLoop->ParentLoop) ++D; return D; @@ -603,7 +606,8 @@ return getLoopFor(BB); } - /// getLoopDepth - Return the loop nesting level of the specified block... + /// getLoopDepth - Return the loop nesting level of the specified block. A + /// depth of 0 means the block is not inside any loop. /// unsigned getLoopDepth(const BlockT *BB) const { const LoopBase *L = getLoopFor(BB); @@ -898,7 +902,8 @@ return LI->getLoopFor(BB); } - /// getLoopDepth - Return the loop nesting level of the specified block... + /// getLoopDepth - Return the loop nesting level of the specified block. A + /// depth of 0 means the block is not inside any loop. /// inline unsigned getLoopDepth(const BasicBlock *BB) const { return LI->getLoopDepth(BB); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46514 - in /llvm/trunk/lib: Archive/ Bitcode/Reader/ CodeGen/ CodeGen/SelectionDAG/ ExecutionEngine/Interpreter/ System/Win32/ Transforms/IPO/ Transforms/Scalar/
Author: djg Date: Tue Jan 29 07:02:09 2008 New Revision: 46514 URL: http://llvm.org/viewvc/llvm-project?rev=46514&view=rev Log: Use empty() instead of comparing size() with zero. Modified: llvm/trunk/lib/Archive/ArchiveReader.cpp llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp llvm/trunk/lib/CodeGen/BranchFolding.cpp llvm/trunk/lib/CodeGen/IfConversion.cpp llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp llvm/trunk/lib/System/Win32/Path.inc llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp llvm/trunk/lib/Transforms/Scalar/LICM.cpp llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Modified: llvm/trunk/lib/Archive/ArchiveReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/ArchiveReader.cpp?rev=46514&r1=46513&r2=46514&view=diff == --- llvm/trunk/lib/Archive/ArchiveReader.cpp (original) +++ llvm/trunk/lib/Archive/ArchiveReader.cpp Tue Jan 29 07:02:09 2008 @@ -588,7 +588,7 @@ bool Archive::isBitcodeArchive() { // Make sure the symTab has been loaded. In most cases this should have been // done when the archive was constructed, but still, this is just in case. - if (!symTab.size()) + if (symTab.empty()) if (!loadSymbolTable(0)) return false; Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=46514&r1=46513&r2=46514&view=diff == --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Tue Jan 29 07:02:09 2008 @@ -1327,7 +1327,7 @@ } case bitc::FUNC_CODE_INST_RET: // RET: [opty,opval] - if (Record.size() == 0) { + if (Record.empty()) { I = new ReturnInst(); break; } else { Modified: llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp?rev=46514&r1=46513&r2=46514&view=diff == --- llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp Tue Jan 29 07:02:09 2008 @@ -115,7 +115,7 @@ if (Stream.AtEndOfStream()) return; - assert (Record.size() == 0); + assert (Record.empty()); assert (AbbrevNo >= bitc::UNABBREV_RECORD); RecordCode = Stream.ReadRecord(AbbrevNo,Record); assert (Record.size() > 0); Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=46514&r1=46513&r2=46514&view=diff == --- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original) +++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Tue Jan 29 07:02:09 2008 @@ -646,7 +646,7 @@ } else if (FBB) { if (TBB!=IBB && FBB!=IBB) // cbr then ubr continue; -} else if (Cond.size() == 0) { +} else if (Cond.empty()) { if (TBB!=IBB) // ubr continue; } else { Modified: llvm/trunk/lib/CodeGen/IfConversion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IfConversion.cpp?rev=46514&r1=46513&r2=46514&view=diff == --- llvm/trunk/lib/CodeGen/IfConversion.cpp (original) +++ llvm/trunk/lib/CodeGen/IfConversion.cpp Tue Jan 29 07:02:09 2008 @@ -237,7 +237,7 @@ // Look for root nodes, i.e. blocks without successors. for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) -if (I->succ_size() == 0) +if (I->succ_empty()) Roots.push_back(I); std::vector Tokens; @@ -428,7 +428,7 @@ unsigned Size = TrueBBI.NonPredSize; if (TrueBBI.IsBrAnalyzable) { - if (TrueBBI.TrueBB && TrueBBI.BrCond.size() == 0) + if (TrueBBI.TrueBB && TrueBBI.BrCond.empty()) // End with an unconditional branch. It will be removed. --Size; else { @@ -646,7 +646,7 @@ ScanInstructions(BBI); // Unanalyable or ends with fallthrough or unconditional branch. - if (!BBI.IsBrAnalyzable || BBI.BrCond.size() == 0) { + if (!BBI.IsBrAnalyzable || BBI.BrCond.empty()) { BBI.IsBeingAnalyzed = false; BBI.IsAnalyzed = true;
[llvm-commits] [llvm] r46523 - in /llvm/trunk: lib/Transforms/IPO/GlobalOpt.cpp test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll
Author: lattner Date: Tue Jan 29 13:01:37 2008 New Revision: 46523 URL: http://llvm.org/viewvc/llvm-project?rev=46523&view=rev Log: Don't let globalopt hack on volatile loads or stores. Added: llvm/trunk/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=46523&r1=46522&r2=46523&view=diff == --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Tue Jan 29 13:01:37 2008 @@ -163,12 +163,15 @@ else if (GS.AccessingFunction != F) GS.HasMultipleAccessingFunctions = true; } - if (isa(I)) { + if (LoadInst *LI = dyn_cast(I)) { GS.isLoaded = true; +if (LI->isVolatile()) return true; // Don't hack on volatile loads. } else if (StoreInst *SI = dyn_cast(I)) { // Don't allow a store OF the address, only stores TO the address. if (SI->getOperand(0) == V) return true; +if (SI->isVolatile()) return true; // Don't hack on volatile stores. + // If this is a direct store to the global (i.e., the global is a scalar // value, not an aggregate), keep more specific information about // stores. Added: llvm/trunk/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll?rev=46523&view=auto == --- llvm/trunk/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll (added) +++ llvm/trunk/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll Tue Jan 29 13:01:37 2008 @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {volatile load} [EMAIL PROTECTED] = internal global double 0x3FD5, align 8 ; [#uses=1] + +define double @foo() nounwind { +entry: + %tmp1 = volatile load double* @t0.1441, align 8 ; [#uses=2] + %tmp4 = mul double %tmp1, %tmp1 ; [#uses=1] + ret double %tmp4 +} ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46521 - /llvm/trunk/include/llvm/ADT/APSInt.h
Author: kremenek Date: Tue Jan 29 12:55:14 2008 New Revision: 46521 URL: http://llvm.org/viewvc/llvm-project?rev=46521&view=rev Log: Altered ctor for APSInt to accept an optional "isUnsigned" flag. Default behavior is unchanged. Modified: llvm/trunk/include/llvm/ADT/APSInt.h Modified: llvm/trunk/include/llvm/ADT/APSInt.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APSInt.h?rev=46521&r1=46520&r2=46521&view=diff == --- llvm/trunk/include/llvm/ADT/APSInt.h (original) +++ llvm/trunk/include/llvm/ADT/APSInt.h Tue Jan 29 12:55:14 2008 @@ -25,7 +25,8 @@ public: /// APSInt ctor - Create an APSInt with the specified width, default to /// unsigned. - explicit APSInt(uint32_t BitWidth) : APInt(BitWidth, 0), IsUnsigned(true) {} + explicit APSInt(uint32_t BitWidth, bool isUnsigned = true) + : APInt(BitWidth, 0), IsUnsigned(isUnsigned) {} explicit APSInt(const APInt &I, bool isUnsigned = true) : APInt(I), IsUnsigned(isUnsigned) {} ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46527 - in /llvm/trunk/lib/Target/X86: X86FloatingPoint.cpp X86ISelDAGToDAG.cpp X86ISelLowering.cpp X86ISelLowering.h X86Instr64bit.td X86InstrFPStack.td
Author: evancheng Date: Tue Jan 29 13:34:22 2008 New Revision: 46527 URL: http://llvm.org/viewvc/llvm-project?rev=46527&view=rev Log: Work in progress. This patch *fixes* x86-64 calls which are modelled as StructRet but really should be return in registers, e.g. _Complex long double, some 128-bit aggregates. This is a short term solution that is necessary only because llvm, for now, cannot model i128 nor call's with multiple results. Status: This only works for direct calls, and only the caller side is done. Disabled for now. Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrFPStack.td Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=46527&r1=46526&r2=46527&view=diff == --- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Tue Jan 29 13:34:22 2008 @@ -935,6 +935,11 @@ assert(StackTop == 0 && "Stack should be empty after a call!"); pushReg(getFPReg(MI->getOperand(0))); break; + case X86::FpGETRESULT80x2: +assert(StackTop == 0 && "Stack should be empty after a call!"); +pushReg(getFPReg(MI->getOperand(0))); +pushReg(getFPReg(MI->getOperand(1))); +break; case X86::FpSETRESULT32: case X86::FpSETRESULT64: case X86::FpSETRESULT80: Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=46527&r1=46526&r2=46527&view=diff == --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Tue Jan 29 13:34:22 2008 @@ -1152,6 +1152,26 @@ case X86ISD::GlobalBaseReg: return getGlobalBaseReg(); +case X86ISD::FP_GET_RESULT2: { + SDOperand Chain = N.getOperand(0); + SDOperand InFlag = N.getOperand(1); + AddToISelQueue(Chain); + AddToISelQueue(InFlag); + std::vector Tys; + Tys.push_back(MVT::f80); + Tys.push_back(MVT::f80); + Tys.push_back(MVT::Other); + Tys.push_back(MVT::Flag); + SDOperand Ops[] = { Chain, InFlag }; + SDNode *ResNode = CurDAG->getTargetNode(X86::FpGETRESULT80x2, Tys, + Ops, 2); + Chain = SDOperand(ResNode, 2); + InFlag = SDOperand(ResNode, 3); + ReplaceUses(SDOperand(N.Val, 2), Chain); + ReplaceUses(SDOperand(N.Val, 3), InFlag); + return ResNode; +} + case ISD::ADD: { // Turn ADD X, c to MOV32ri X+c. This cannot be done with tblgen'd // code and is matched first so to prevent it from being turned into Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=46527&r1=46526&r2=46527&view=diff == --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jan 29 13:34:22 2008 @@ -907,6 +907,44 @@ &ResultVals[0], ResultVals.size()).Val; } +/// LowerCallResultToTwo64BitRegs - Lower the result values of an x86-64 +/// ISD::CALL where the results are known to be in two 64-bit registers, +/// e.g. XMM0 and XMM1. This simplify store the two values back to the +/// fixed stack slot allocated for StructRet. +SDNode *X86TargetLowering:: +LowerCallResultToTwo64BitRegs(SDOperand Chain, SDOperand InFlag, + SDNode *TheCall, unsigned Reg1, unsigned Reg2, + MVT::ValueType VT, SelectionDAG &DAG) { + SDOperand RetVal1 = DAG.getCopyFromReg(Chain, Reg1, VT, InFlag); + Chain = RetVal1.getValue(1); + InFlag = RetVal1.getValue(2); + SDOperand RetVal2 = DAG.getCopyFromReg(Chain, Reg2, VT, InFlag); + Chain = RetVal2.getValue(1); + InFlag = RetVal2.getValue(2); + SDOperand FIN = TheCall->getOperand(5); + Chain = DAG.getStore(Chain, RetVal1, FIN, NULL, 0); + FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN, DAG.getIntPtrConstant(8)); + Chain = DAG.getStore(Chain, RetVal2, FIN, NULL, 0); + return Chain.Val; +} + +/// LowerCallResultToTwoX87Regs - Lower the result values of an x86-64 ISD::CALL +/// where the results are known to be in ST0 and ST1. +SDNode *X86TargetLowering:: +LowerCallResultToTwoX87Regs(SDOperand Chain, SDOperand InFlag, +SDNode *TheCall, SelectionDAG &DAG) { + SmallVector ResultVals; + const MVT::ValueType VTs[] = { MVT::f80, MVT::f80, MVT::Other, MVT::Flag }; + SDVTList Tys = DA
[llvm-commits] [llvm] r46525 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
Author: baldrick Date: Tue Jan 29 13:29:08 2008 New Revision: 46525 URL: http://llvm.org/viewvc/llvm-project?rev=46525&view=rev Log: When expanding an operand, it's not the result value type that matters but the operand type. This fixes 2008-01-08-IllegalCMP.ll which crashed with the new legalize infrastructure because SETCC with result type i8 and operand type i64 was being custom expanded by the X86 backend. With this fix, the gcc build gets as far as the first libcall. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp?rev=46525&r1=46524&r2=46525&view=diff == --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Tue Jan 29 13:29:08 2008 @@ -747,8 +747,8 @@ DEBUG(cerr << "Expand node operand: "; N->dump(&DAG); cerr << "\n"); SDOperand Res(0, 0); - if (TLI.getOperationAction(N->getOpcode(), N->getValueType(0)) == - TargetLowering::Custom) + if (TLI.getOperationAction(N->getOpcode(), N->getOperand(OpNo).getValueType()) + == TargetLowering::Custom) Res = TLI.LowerOperation(SDOperand(N, 0), DAG); if (Res.Val == 0) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46526 - /llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c
Author: evancheng Date: Tue Jan 29 13:30:05 2008 New Revision: 46526 URL: http://llvm.org/viewvc/llvm-project?rev=46526&view=rev Log: Update this test case. Modified: llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c Modified: llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c?rev=46526&r1=46525&r2=46526&view=diff == --- llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c (original) +++ llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c Tue Jan 29 13:30:05 2008 @@ -12,8 +12,7 @@ checkx2411(a2411[0]); } -// A field that is an aggregates of size zero should be dropped during -// type conversion. +// Proper handling of zero sized fields during type conversion. typedef unsigned long long int Tal2ullong __attribute__((aligned(2))); struct S2525 { Tal2ullong: 0; @@ -29,3 +28,12 @@ char * i[5]; } data; +// Taking address of a zero sized field. +struct Z {}; +struct Y { + int i; + struct Z z; +}; +void *f(struct Y *y) { + return &y->z; +} ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46538 - in /llvm/trunk: include/llvm/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/ lib/Target/ARM/ lib/Target/CellSPU/ lib/Target/IA64/ lib/Target/PowerPC/
Author: djg Date: Tue Jan 29 18:15:11 2008 New Revision: 46538 URL: http://llvm.org/viewvc/llvm-project?rev=46538&view=rev Log: Factor the addressing mode and the load/store VT out of LoadSDNode and StoreSDNode into their common base class LSBaseSDNode. Member functions getLoadedVT and getStoredVT are replaced with the common getMemoryVT to simplify code that will handle both loads and stores. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/TargetSelectionDAG.td Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=46538&r1=46537&r2=46538&view=diff == --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Tue Jan 29 18:15:11 2008 @@ -1477,6 +1477,12 @@ /// class LSBaseSDNode : public SDNode { private: + // AddrMode - unindexed, pre-indexed, post-indexed. + ISD::MemIndexedMode AddrMode; + + // MemoryVT - VT of in-memory value. + MVT::ValueType MemoryVT; + //! SrcValue - Memory location for alias analysis. const Value *SrcValue; @@ -1497,11 +1503,20 @@ */ SDOperand Ops[4]; public: - LSBaseSDNode(ISD::NodeType NodeTy, SDVTList VTs, const Value *SV, int SVO, - unsigned Align, bool Vol) + LSBaseSDNode(ISD::NodeType NodeTy, SDOperand *Operands, unsigned NumOperands, + SDVTList VTs, ISD::MemIndexedMode AM, MVT::ValueType VT, + const Value *SV, int SVO, unsigned Align, bool Vol) : SDNode(NodeTy, VTs), + AddrMode(AM), MemoryVT(VT), SrcValue(SV), SVOffset(SVO), Alignment(Align), IsVolatile(Vol) - { } + { +for (unsigned i = 0; i != NumOperands; ++i) + Ops[i] = Operands[i]; +InitOperands(Ops, NumOperands); +assert(Align != 0 && "Loads and stores should have non-zero aligment"); +assert((getOffset().getOpcode() == ISD::UNDEF || isIndexed()) && + "Only indexed loads and stores have a non-undef offset operand"); + } const SDOperand getChain() const { return getOperand(0); @@ -1520,10 +1535,22 @@ const Value *getSrcValue() const { return SrcValue; } int getSrcValueOffset() const { return SVOffset; } unsigned getAlignment() const { return Alignment; } + MVT::ValueType getMemoryVT() const { return MemoryVT; } bool isVolatile() const { return IsVolatile; } + ISD::MemIndexedMode getAddressingMode() const { return AddrMode; } + + /// isIndexed - Return true if this is a pre/post inc/dec load/store. + bool isIndexed() const { return AddrMode != ISD::UNINDEXED; } + + /// isUnindexed - Return true if this is NOT a pre/post inc/dec load/store. + bool isUnindexed() const { return AddrMode == ISD::UNINDEXED; } + static bool classof(const LSBaseSDNode *N) { return true; } - static bool classof(const SDNode *N) { return true; } + static bool classof(const SDNode *N) { +return N->getOpcode() == ISD::LOAD || + N->getOpcode() == ISD::STORE; + } }; /// LoadSDNode - This class is used to represent ISD::LOAD nodes. @@ -1531,41 +1558,20 @@ class LoadSDNode : public LSBaseSDNode { virtual void ANCHOR(); // Out-of-line virtual method to give class a home. - // AddrMode - unindexed, pre-indexed, post-indexed. - ISD::MemIndexedMode AddrMode; - // ExtType - non-ext, anyext, sext, zext. ISD::LoadExtType ExtType; - // LoadedVT - VT of loaded value before extension. - MVT::ValueType LoadedVT; protected: friend class SelectionDAG; LoadSDNode(SDOperand *ChainPtrOff, SDVTList VTs, ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT, const Value *SV, int O=0, unsigned Align=0, bool Vol=false) -: LSBaseSDNode(ISD::LOAD, VTs, SV, O, Align, Vol), - AddrMode(AM), ExtType(ETy), LoadedVT(LVT) { -Ops[0] = ChainPtrOff[0]; // Chain -Ops[1] = ChainPtrOff[1]; // Ptr -Ops[2] = ChainPtrOff[2]; // Off -InitOperands(Ops, 3); -assert(Align != 0 && "Loads should have non-zero aligment"); -assert((getOffset().getOpcode() == ISD::UNDEF || -AddrMode != ISD::UNINDEXED) && -
[llvm-commits] [llvm] r46539 - in /llvm/trunk: lib/Transforms/Scalar/ScalarReplAggregates.cpp test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll
Author: lattner Date: Tue Jan 29 18:39:15 2008 New Revision: 46539 URL: http://llvm.org/viewvc/llvm-project?rev=46539&view=rev Log: Fix a bug where scalarrepl would discard offset if type would match. In practice this can only happen on code with already undefined behavior, but this is still a good thing to handle correctly. Added: llvm/trunk/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=46539&r1=46538&r2=46539&view=diff == --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Tue Jan 29 18:39:15 2008 @@ -1078,7 +1078,7 @@ if (LoadInst *LI = dyn_cast(User)) { // The load is a bit extract from NewAI shifted right by Offset bits. Value *NV = new LoadInst(NewAI, LI->getName(), LI); - if (NV->getType() == LI->getType()) { + if (NV->getType() == LI->getType() && Offset == 0) { // We win, no conversion needed. } else if (const VectorType *PTy = dyn_cast(NV->getType())) { // If the result alloca is a vector type, this is either an element @@ -1232,7 +1232,7 @@ SI->eraseFromParent(); } else if (BitCastInst *CI = dyn_cast(User)) { - ConvertUsesToScalar(CI, NewAI, Offset); + ConvertUsesToScalar(CI, NewAI, Offset); CI->eraseFromParent(); } else if (GetElementPtrInst *GEP = dyn_cast(User)) { const PointerType *AggPtrTy = Added: llvm/trunk/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll?rev=46539&view=auto == --- llvm/trunk/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll (added) +++ llvm/trunk/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll Tue Jan 29 18:39:15 2008 @@ -0,0 +1,21 @@ +; RUN: llvm-as < %s | opt -scalarrepl -instcombine | llvm-dis | grep {ret i8 17} +; rdar://5707076 +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i386-apple-darwin9.1.0" + %struct.T = type <{ i8, [3 x i8] }> + +define i8 @f() { +entry: + %s = alloca [1 x %struct.T], align 4; <[1 x %struct.T]*> [#uses=2] + %T3 = bitcast [1 x %struct.T]* %s to i32* + store i32 -61184, i32* %T3 + + %tmp16 = getelementptr [1 x %struct.T]* %s, i32 0, i32 0 ; <%struct.T*> [#uses=1] + %tmp17 = getelementptr %struct.T* %tmp16, i32 0, i32 1 ; <[3 x i8]*> [#uses=1] + %tmp1718 = bitcast [3 x i8]* %tmp17 to i32* ; [#uses=1] + %tmp19 = load i32* %tmp1718, align 4; [#uses=1] + %mask = and i32 %tmp19, 16777215; [#uses=2] + %mask2324 = trunc i32 %mask to i8 ; [#uses=1] + ret i8 %mask2324 +} + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46541 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
Author: resistor Date: Tue Jan 29 19:24:05 2008 New Revision: 46541 URL: http://llvm.org/viewvc/llvm-project?rev=46541&view=rev Log: Fix an issue where, under very specific circumstances, memdep could end up dereferencing the end of one of its internal maps. Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=46541&r1=46540&r2=46541&view=diff == --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Jan 29 19:24:05 2008 @@ -451,8 +451,6 @@ // Figure out the new dep for things that currently depend on rem Instruction* newDep = NonLocal; - reverseDep[depGraphLocal[rem].first].erase(rem); - for (DenseMap::iterator DI = depGraphNonLocal[rem].begin(), DE = depGraphNonLocal[rem].end(); DI != DE; ++DI) @@ -462,6 +460,8 @@ depMapType::iterator depGraphEntry = depGraphLocal.find(rem); if (depGraphEntry != depGraphLocal.end()) { +reverseDep[depGraphLocal[rem].first].erase(rem); + if (depGraphEntry->second.first != NonLocal && depGraphEntry->second.second) { // If we have dep info for rem, set them to it ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46542 - in /llvm/trunk: lib/Transforms/Scalar/DeadStoreElimination.cpp test/Transforms/DeadStoreElimination/memcpy.ll
Author: resistor Date: Tue Jan 29 19:24:47 2008 New Revision: 46542 URL: http://llvm.org/viewvc/llvm-project?rev=46542&view=rev Log: Make DSE much more aggressive by performing DCE earlier. Update a testcase to reflect this increased aggressiveness. Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=46542&r1=46541&r2=46542&view=diff == --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Tue Jan 29 19:24:47 2008 @@ -152,7 +152,7 @@ possiblyDead.insert(D); if (Instruction* D = dyn_cast(last->getOperand(1))) possiblyDead.insert(D); - + last->eraseFromParent(); NumFastStores++; deletedStore = true; @@ -303,7 +303,7 @@ MD.removeInstruction(M); // DCE instructions only used to calculate that memcpy -if (Instruction* D = dyn_cast(M->getSource())) +if (Instruction* D = dyn_cast(M->getRawSource())) possiblyDead.insert(D); if (Instruction* D = dyn_cast(M->getLength())) possiblyDead.insert(D); @@ -325,11 +325,45 @@ // If we encounter a use of the pointer, it is no longer considered dead if (LoadInst* L = dyn_cast(BBI)) { + // However, if this load is unused, we can go ahead and remove it, and + // not have to worry about it making our pointer undead! + if (L->getNumUses() == 0) { +MD.removeInstruction(L); + +// DCE instructions only used to calculate that load +if (Instruction* D = dyn_cast(L->getPointerOperand())) + possiblyDead.insert(D); + +BBI++; +L->eraseFromParent(); +NumFastOther++; +MadeChange = true; +possiblyDead.remove(L); + +continue; + } + killPointer = L->getPointerOperand(); } else if (VAArgInst* V = dyn_cast(BBI)) { killPointer = V->getOperand(0); } else if (AllocaInst* A = dyn_cast(BBI)) { deadPointers.erase(A); + + // Dead alloca's can be DCE'd when we reach them + if (A->getNumUses() == 0) { +MD.removeInstruction(A); + +// DCE instructions only used to calculate that load +if (Instruction* D = dyn_cast(A->getArraySize())) + possiblyDead.insert(D); + +BBI++; +A->eraseFromParent(); +NumFastOther++; +MadeChange = true; +possiblyDead.remove(A); + } + continue; } else if (CallSite::get(BBI).getInstruction() != 0) { // If this call does not access memory, it can't @@ -383,6 +417,25 @@ deadPointers.erase(*I); continue; +} else { + // For any non-memory-affecting non-terminators, DCE them as we reach them + Instruction *CI = BBI; + if (!CI->isTerminator() && CI->getNumUses() == 0) { + +// DCE instructions only used to calculate that load +for (Instruction::op_iterator OI = CI->op_begin(), OE = CI->op_end(); + OI != OE; ++OI) + if (Instruction* D = dyn_cast(OI)) +possiblyDead.insert(D); + +BBI++; +CI->eraseFromParent(); +NumFastOther++; +MadeChange = true; +possiblyDead.remove(CI); + +continue; + } } if (!killPointer) Modified: llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll?rev=46542&r1=46541&r2=46542&view=diff == --- llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll (original) +++ llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll Tue Jan 29 19:24:47 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep tmp180 +; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep alloca ; ModuleID = 'placeholder.adb' target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" target triple = "i686-pc-linux-gnu" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.2] r46164 - in /llvm-gcc-4.2/trunk/gcc/config/i386: llvm-i386-target.h llvm-i386.cpp
On Jan 23, 2008, at 7:05 PM, Evan Cheng wrote: > > On Jan 22, 2008, at 11:23 PM, Duncan Sands wrote: >> >> Can you please clarify the roles of llvm-gcc and the code generators >> in getting ABI compatibility. When generating IR for x86-64, llvm- >> gcc >> sometimes chops by-value structs into pieces, and sometimes passes >> the >> struct as a byval parameter. Since it chops up all-integer structs, >> and this corresponds more or less to what the ABI says, I assumed >> this >> was an attempt to get ABI correctness. Especially as the code >> generators >> don't seem to bother themselves with following the details of the >> ABI (yet), >> and just push byval parameters onto the stack. Since you say > > If ABI specifies the aggregate should be passed in memory, then llvm- > gcc passes it byval. Otherwise, it chops up in pieces following the > ABI specification (only x86-64 uses a mixture of integer and non- > integer registers). Just noticed this...Darwin ppc64 also uses a mix of registers. The same struct can use int, float, vector registers and memory in extreme cases. This is an optimization, not a correctness issue >> >> I guess this means that the plan is to teach the codegenerators how >> to >> pass any aggregate byval in an ABI conformant way (not the case >> right now), >> but still do some chopping up in the front-end to help the >> optimizers. >> Of course this chopping up needs to be done carefully so the final >> result >> squirted out by the codegenerators (once they are ABI conformant) >> is the >> same as if the chopping had not been done... Is this chopping >> really a >> big win? Is it not possible to get an equivalent level of >> optimization >> by enhancing alias analysis? > > We are only doing thise for small integer aggregates that are not > passed through registers. This guarantees ABI compliance. Chopping it > up into small integer pieces ensure the code generator does not make > a copy of the object (among other potential benefits). One day when > the code generator is smarter about it then perhaps we can eliminate > this optimization. > > Evan > >> >> Ciao, >> >> Duncan. > > ___ > 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
[llvm-commits] [llvm] r46546 - /llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
Author: evancheng Date: Tue Jan 29 21:57:33 2008 New Revision: 46546 URL: http://llvm.org/viewvc/llvm-project?rev=46546&view=rev Log: Skip over the label which marks the beginning of the function before inserting prologue code. Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=46546&r1=46545&r2=46546&view=diff == --- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Tue Jan 29 21:57:33 2008 @@ -525,6 +525,12 @@ X86FI->getCalleeSavedFrameSize() +(-TailCallReturnAddrDelta)); uint64_t NumBytes = StackSize - X86FI->getCalleeSavedFrameSize(); + // Skip over the label which mark the beginning of the function. + if (MMI && MMI->needsFrameInfo() && + MBBI != MBB.end() && + MBBI->getOpcode() == X86::LABEL) + ++MBBI; + // Insert stack pointer adjustment for later moving of return addr. Only // applies to tail call optimized functions where the callee argument stack // size is bigger than the callers. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.2] r46164 - in /llvm-gcc-4.2/trunk/gcc/config/i386: llvm-i386-target.h llvm-i386.cpp
On Jan 29, 2008, at 5:52 PM, Dale Johannesen wrote: >> If ABI specifies the aggregate should be passed in memory, then llvm- >> gcc passes it byval. Otherwise, it chops up in pieces following the >> ABI specification (only x86-64 uses a mixture of integer and non- >> integer registers). > > Just noticed this...Darwin ppc64 also uses a mix of registers. The > same > struct can use int, float, vector registers and memory in extreme > cases. Yep, getting darwin/ppc64 abi compliance will require us to do something like Evan did for x86-64, but for ppc. Struct return is even crazier on ppc64 iirc. -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46548 - /llvm/trunk/test/CFrontend/2007-09-12-PragmaPack.c
Author: tbrethou Date: Tue Jan 29 23:15:15 2008 New Revision: 46548 URL: http://llvm.org/viewvc/llvm-project?rev=46548&view=rev Log: Pointers change size depending upon the target. Remove them to make the test more stable. Modified: llvm/trunk/test/CFrontend/2007-09-12-PragmaPack.c Modified: llvm/trunk/test/CFrontend/2007-09-12-PragmaPack.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2007-09-12-PragmaPack.c?rev=46548&r1=46547&r2=46548&view=diff == --- llvm/trunk/test/CFrontend/2007-09-12-PragmaPack.c (original) +++ llvm/trunk/test/CFrontend/2007-09-12-PragmaPack.c Tue Jan 29 23:15:15 2008 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -O3 -S -o - %s | grep {26} +// RUN: %llvmgcc -O3 -S -o - %s | grep {18} #include @@ -6,7 +6,6 @@ typedef struct { uint32_ta; -uint8_t * b; } foo; typedef struct { @@ -19,7 +18,6 @@ uint8_t a[5]; VERSION version; uint8_t b; -char *c; foo d; uint32_t guard; } bar; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46538 - in /llvm/trunk: include/llvm/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/ lib/Target/ARM/ lib/Target/CellSPU/ lib/Target/IA64/ lib/Target/PowerPC/
On Jan 29, 2008, at 4:15 PM, Dan Gohman wrote: > URL: http://llvm.org/viewvc/llvm-project?rev=46538&view=rev > Log: > Factor the addressing mode and the load/store VT out of LoadSDNode > and StoreSDNode into their common base class LSBaseSDNode. Member > functions getLoadedVT and getStoredVT are replaced with the common > getMemoryVT to simplify code that will handle both loads and stores. Nice! -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46553 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
Author: nicholas Date: Wed Jan 30 01:45:37 2008 New Revision: 46553 URL: http://llvm.org/viewvc/llvm-project?rev=46553&view=rev Log: Don't DCE FreeInst's. We were using those! Patch from Owen Anderson. Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=46553&r1=46552&r2=46553&view=diff == --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Wed Jan 30 01:45:37 2008 @@ -420,7 +420,7 @@ } else { // For any non-memory-affecting non-terminators, DCE them as we reach them Instruction *CI = BBI; - if (!CI->isTerminator() && CI->getNumUses() == 0) { + if (!CI->isTerminator() && CI->getNumUses() == 0 && !isa(CI)) { // DCE instructions only used to calculate that load for (Instruction::op_iterator OI = CI->op_begin(), OE = CI->op_end(); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46554 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
Author: nicholas Date: Wed Jan 30 01:54:16 2008 New Revision: 46554 URL: http://llvm.org/viewvc/llvm-project?rev=46554&view=rev Log: Use empty() instead of comparing size() with zero. Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=46554&r1=46553&r2=46554&view=diff == --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Wed Jan 30 01:54:16 2008 @@ -420,7 +420,7 @@ } else { // For any non-memory-affecting non-terminators, DCE them as we reach them Instruction *CI = BBI; - if (!CI->isTerminator() && CI->getNumUses() == 0 && !isa(CI)) { + if (!CI->isTerminator() && CI->use_empty() && !isa(CI)) { // DCE instructions only used to calculate that load for (Instruction::op_iterator OI = CI->op_begin(), OE = CI->op_end(); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits