[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.241 -> 1.242 --- Log message: - When performing pre-/post- indexed load/store transformation, do not worry about whether the new base ptr would be live below the load/store. Let two address pass split it back to non-indexed ops. - Minor tweaks / fixes. --- Diffs of the changes: (+30 -91) DAGCombiner.cpp | 121 +--- 1 files changed, 30 insertions(+), 91 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.241 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.242 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.241 Wed Nov 8 00:56:05 2006 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Nov 8 02:30:28 2006 @@ -208,61 +208,26 @@ // Try turning it into a pre-indexed load / store except when // 1) Another use of base ptr is a predecessor of N. If ptr is folded //that would create a cycle. - // 2) All uses are load / store ops that use it as base ptr and offset - //is just an addressing mode immediate. - // 3) If the would-be new base may not to be dead at N. - - bool OffIsAMImm = Offset.getOpcode() == ISD::Constant && TLI. -isLegalAddressImmediate(cast(Offset)->getValue()); - - // Check for #3. - for (SDNode::use_iterator I = BasePtr.Val->use_begin(), - E = BasePtr.Val->use_end(); I != E; ++I) { + // 2) All uses are load / store ops that use it as base ptr. + + // Now check for #1 and #2. + bool RealUse = false; + for (SDNode::use_iterator I = Ptr.Val->use_begin(), + E = Ptr.Val->use_end(); I != E; ++I) { SDNode *Use = *I; -if (Use == Ptr.Val) +if (Use == N) continue; -if (Use->getOpcode() == ISD::CopyToReg) +if (Use->isPredecessor(N)) return false; -if (OffIsAMImm && (Use->getOpcode() == ISD::ADD || - Use->getOpcode() == ISD::SUB)) { - for (SDNode::use_iterator II = Use->use_begin(), - EE = Use->use_end(); II != EE; ++II) { -SDNode *UseUse = *II; -if (UseUse->getOpcode() == ISD::LOAD && -cast(UseUse)->getBasePtr().Val == Use) - return false; -else if (UseUse->getOpcode() == ISD::STORE && - cast(UseUse)->getBasePtr().Val == Use) - return false; - } -} - } - // Now check for #1 and #2. - if (OffIsAMImm) { -unsigned NumRealUses = 0; -for (SDNode::use_iterator I = Ptr.Val->use_begin(), - E = Ptr.Val->use_end(); I != E; ++I) { - SDNode *Use = *I; - if (Use == N) -continue; - if (Use->isPredecessor(N)) -return false; - - if (!OffIsAMImm) { -NumRealUses++; - } else if (Use->getOpcode() == ISD::LOAD) { -if (cast(Use)->getBasePtr().Val != Ptr.Val) - NumRealUses++; - } else if (Use->getOpcode() == ISD::STORE) { -if (cast(Use)->getBasePtr().Val != Ptr.Val) - NumRealUses++; - } else -NumRealUses++; -} -if (NumRealUses == 0) - return false; +if (!((Use->getOpcode() == ISD::LOAD && + cast(Use)->getBasePtr() == Ptr) || + (Use->getOpcode() == ISD::STORE) && + cast(Use)->getBasePtr() == Ptr)) + RealUse = true; } + if (!RealUse) +return false; SDOperand Result = isLoad ? DAG.getIndexedLoad(SDOperand(N,0), BasePtr, Offset, AM) @@ -343,12 +308,7 @@ // 1) Op must be independent of N, i.e. Op is neither a predecessor //nor a successor of N. Otherwise, if Op is folded that would //create a cycle. -// 2) All uses are load / store ops that use it as base ptr and offset -//is just an addressing mode immediate. -// 3) If the would-be new base may not to be dead at N. - -bool OffIsAMImm = Offset.getOpcode() == ISD::Constant && TLI. - isLegalAddressImmediate(cast(Offset)->getValue()); +// 2) All uses are load / store ops that use it as base ptr. // Check for #3. bool TryNext = false; @@ -357,51 +317,30 @@ SDNode *Use = *II; if (Use == Ptr.Val) continue; - if (Use->getOpcode() == ISD::CopyToReg) { -TryNext = true; -break; -
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.7 -> 1.8 --- Log message: Move BasicBlockPassManager_New, FunctionPassManager_New and ModulePassManager_New class declarations from PassManager.h to PassManager.cpp --- Diffs of the changes: (+86 -1) PassManager.cpp | 87 +++- 1 files changed, 86 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.7 llvm/lib/VMCore/PassManager.cpp:1.8 --- llvm/lib/VMCore/PassManager.cpp:1.7 Tue Nov 7 19:31:28 2006 +++ llvm/lib/VMCore/PassManager.cpp Wed Nov 8 04:05:38 2006 @@ -2,7 +2,7 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by Devang Patel and is distributed under +// This file was developed by Devang Patel and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===--===// @@ -17,6 +17,91 @@ using namespace llvm; +namespace llvm { + +/// BasicBlockPassManager_New manages BasicBlockPass. It batches all the +/// pass together and sequence them to process one basic block before +/// processing next basic block. +class BasicBlockPassManager_New : public Pass, + public PassManagerAnalysisHelper { + +public: + BasicBlockPassManager_New() { } + + /// Add a pass into a passmanager queue. + bool addPass(Pass *p); + + /// Execute all of the passes scheduled for execution. Keep track of + /// whether any of the passes modifies the function, and if so, return true. + bool runOnFunction(Function &F); + +private: + // Collection of pass that are managed by this manager + std::vector PassVector; +}; + +/// FunctionPassManager_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 FunctionPassManager_New : public Pass, +public PassManagerAnalysisHelper { +public: + FunctionPassManager_New(ModuleProvider *P) { /* TODO */ } + FunctionPassManager_New() { +activeBBPassManager = NULL; + } + ~FunctionPassManager_New() { /* TODO */ }; + + /// add - Add a pass to the queue of passes to run. This passes + /// ownership of the Pass to the PassManager. When the + /// PassManager_X is destroyed, the pass will be destroyed as well, so + /// there is no need to delete the pass. (TODO delete passes.) + /// This implies that all passes MUST be allocated with 'new'. + void add(Pass *P) { /* TODO*/ } + + /// Add pass into the pass manager queue. + bool addPass(Pass *P); + + /// Execute all of the passes scheduled for execution. Keep + /// track of whether any of the passes modifies the function, and if + /// so, return true. + bool runOnModule(Module &M); + +private: + // Collection of pass that are manged by this manager + std::vector PassVector; + + // Active Pass Managers + BasicBlockPassManager_New *activeBBPassManager; +}; + +/// ModulePassManager_New manages ModulePasses and function pass managers. +/// It batches all Module passes passes and function pass managers together and +/// sequence them to process one module. +class ModulePassManager_New : public Pass, + public PassManagerAnalysisHelper { + +public: + ModulePassManager_New() { activeFunctionPassManager = NULL; } + + /// Add a pass into a passmanager queue. + bool addPass(Pass *p); + + /// run - Execute all of the passes scheduled for execution. Keep track of + /// whether any of the passes modifies the module, and if so, return true. + bool runOnModule(Module &M); + +private: + // Collection of pass that are managed by this manager + std::vector PassVector; + + // Active Pass Manager + FunctionPassManager_New *activeFunctionPassManager; +}; + +} // End of llvm namespace + // PassManagerAnalysisHelper implementation /// Return true IFF pass P's required analysis set does not required new ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/PassManager.h
Changes in directory llvm/include/llvm: PassManager.h updated: 1.24 -> 1.25 --- Log message: Split PassManager_New into PassManager_New and PassManagerImpl_New. PassManagerImpl_New implements the pass manager. PassManager_New is the public interface. --- Diffs of the changes: (+6 -14) PassManager.h | 20 ++-- 1 files changed, 6 insertions(+), 14 deletions(-) Index: llvm/include/llvm/PassManager.h diff -u llvm/include/llvm/PassManager.h:1.24 llvm/include/llvm/PassManager.h:1.25 --- llvm/include/llvm/PassManager.h:1.24Wed Nov 8 04:05:38 2006 +++ llvm/include/llvm/PassManager.h Wed Nov 8 04:29:57 2006 @@ -89,6 +89,7 @@ }; class ModulePassManager_New; +class PassManagerImpl_New; /// PassManagerAnalysisHelper helps pass manager analysis required by /// the managed passes. It provides methods to add/remove analysis @@ -127,6 +128,8 @@ public: + PassManager_New(); + /// add - Add a pass to the queue of passes to run. This passes ownership of /// the Pass to the PassManager. When the PassManager is destroyed, the pass /// will be destroyed as well, so there is no need to delete the pass. This @@ -138,22 +141,11 @@ bool run(Module &M); private: - - /// Add a pass into a passmanager queue. This is used by schedulePasses - bool addPass(Pass *p); - /// Schedule all passes collected in pass queue using add(). Add all the - /// schedule passes into various manager's queue using addPass(). - void schedulePasses(); + /// PassManagerImpl_New is the actual class. PassManager_New is just the + /// wraper to publish simple pass manager interface + PassManagerImpl_New *PM; - // Collection of pass managers - std::vector PassManagers; - - // Collection of pass that are not yet scheduled - std::vector PassVector; - - // Active Pass Manager - ModulePassManager_New *activeManager; }; } // End llvm namespace ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/PassManager.h
Changes in directory llvm/include/llvm: PassManager.h updated: 1.23 -> 1.24 --- Log message: Move BasicBlockPassManager_New, FunctionPassManager_New and ModulePassManager_New class declarations from PassManager.h to PassManager.cpp --- Diffs of the changes: (+2 -81) PassManager.h | 83 +- 1 files changed, 2 insertions(+), 81 deletions(-) Index: llvm/include/llvm/PassManager.h diff -u llvm/include/llvm/PassManager.h:1.23 llvm/include/llvm/PassManager.h:1.24 --- llvm/include/llvm/PassManager.h:1.23Tue Nov 7 18:19:31 2006 +++ llvm/include/llvm/PassManager.h Wed Nov 8 04:05:38 2006 @@ -88,6 +88,8 @@ bool doFinalization(); }; +class ModulePassManager_New; + /// PassManagerAnalysisHelper helps pass manager analysis required by /// the managed passes. It provides methods to add/remove analysis /// available and query if certain analysis is available or not. @@ -119,87 +121,6 @@ std::vector RequiredSet; }; -/// BasicBlockPassManager_New manages BasicBlockPass. It batches all the -/// pass together and sequence them to process one basic block before -/// processing next basic block. -class BasicBlockPassManager_New : public Pass, - public PassManagerAnalysisHelper { - -public: - BasicBlockPassManager_New() { } - - /// Add a pass into a passmanager queue. - bool addPass(Pass *p); - - /// Execute all of the passes scheduled for execution. Keep track of - /// whether any of the passes modifies the function, and if so, return true. - bool runOnFunction(Function &F); - -private: - // Collection of pass that are managed by this manager - std::vector PassVector; -}; - -/// FunctionPassManager_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 FunctionPassManager_New : public Pass, -public PassManagerAnalysisHelper { -public: - FunctionPassManager_New(ModuleProvider *P) { /* TODO */ } - FunctionPassManager_New() { -activeBBPassManager = NULL; - } - ~FunctionPassManager_New() { /* TODO */ }; - - /// add - Add a pass to the queue of passes to run. This passes - /// ownership of the Pass to the PassManager. When the - /// PassManager_X is destroyed, the pass will be destroyed as well, so - /// there is no need to delete the pass. (TODO delete passes.) - /// This implies that all passes MUST be allocated with 'new'. - void add(Pass *P) { /* TODO*/ } - - /// Add pass into the pass manager queue. - bool addPass(Pass *P); - - /// Execute all of the passes scheduled for execution. Keep - /// track of whether any of the passes modifies the function, and if - /// so, return true. - bool runOnModule(Module &M); - -private: - // Collection of pass that are manged by this manager - std::vector PassVector; - - // Active Pass Managers - BasicBlockPassManager_New *activeBBPassManager; -}; - -/// ModulePassManager_New manages ModulePasses and function pass managers. -/// It batches all Module passes passes and function pass managers together and -/// sequence them to process one module. -class ModulePassManager_New : public Pass, - public PassManagerAnalysisHelper { - -public: - ModulePassManager_New() { activeFunctionPassManager = NULL; } - - /// Add a pass into a passmanager queue. - bool addPass(Pass *p); - - /// run - Execute all of the passes scheduled for execution. Keep track of - /// whether any of the passes modifies the module, and if so, return true. - bool runOnModule(Module &M); - -private: - // Collection of pass that are managed by this manager - std::vector PassVector; - - // Active Pass Manager - FunctionPassManager_New *activeFunctionPassManager; -}; - /// PassManager_New manages ModulePassManagers class PassManager_New : public Pass, public PassManagerAnalysisHelper { ___ 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.8 -> 1.9 --- Log message: Split PassManager_New into PassManager_New and PassManagerImpl_New. PassManagerImpl_New implements the pass manager. PassManager_New is the public interface. --- Diffs of the changes: (+61 -4) PassManager.cpp | 65 1 files changed, 61 insertions(+), 4 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.8 llvm/lib/VMCore/PassManager.cpp:1.9 --- llvm/lib/VMCore/PassManager.cpp:1.8 Wed Nov 8 04:05:38 2006 +++ llvm/lib/VMCore/PassManager.cpp Wed Nov 8 04:29:57 2006 @@ -100,6 +100,41 @@ FunctionPassManager_New *activeFunctionPassManager; }; +/// PassManager_New manages ModulePassManagers +class PassManagerImpl_New : public Pass, +public PassManagerAnalysisHelper { + +public: + + /// add - Add a pass to the queue of passes to run. This passes ownership of + /// the Pass to the PassManager. When the PassManager is destroyed, the pass + /// will be destroyed as well, so there is no need to delete the pass. This + /// implies that all passes MUST be allocated with 'new'. + void add(Pass *P); + + /// run - Execute all of the passes scheduled for execution. Keep track of + /// whether any of the passes modifies the module, and if so, return true. + bool run(Module &M); + +private: + + /// Add a pass into a passmanager queue. This is used by schedulePasses + bool addPass(Pass *p); + + /// Schedule all passes collected in pass queue using add(). Add all the + /// schedule passes into various manager's queue using addPass(). + void schedulePasses(); + + // Collection of pass managers + std::vector PassManagers; + + // Collection of pass that are not yet scheduled + std::vector PassVector; + + // Active Pass Manager + ModulePassManager_New *activeManager; +}; + } // End of llvm namespace // PassManagerAnalysisHelper implementation @@ -304,13 +339,13 @@ /// Schedule all passes from the queue by adding them in their /// respective manager's queue. void -PassManager_New::schedulePasses() { +PassManagerImpl_New::schedulePasses() { /* TODO */ } /// Add pass P to the queue of passes to run. void -PassManager_New::add(Pass *P) { +PassManagerImpl_New::add(Pass *P) { /* TODO */ } @@ -318,7 +353,7 @@ /// Add P into active pass manager or use new module pass manager to /// manage it. bool -PassManager_New::addPass(Pass *P) { +PassManagerImpl_New::addPass(Pass *P) { if (!activeManager) { activeManager = new ModulePassManager_New(); @@ -331,7 +366,7 @@ /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. bool -PassManager_New::run(Module &M) { +PassManagerImpl_New::run(Module &M) { schedulePasses(); bool Changed = false; @@ -342,3 +377,25 @@ } return Changed; } + +/// Create new pass manager +PassManager_New::PassManager_New() { + PM = new PassManagerImpl_New(); +} + +/// add - Add a pass to the queue of passes to run. This passes ownership of +/// the Pass to the PassManager. When the PassManager is destroyed, the pass +/// will be destroyed as well, so there is no need to delete the pass. This +/// implies that all passes MUST be allocated with 'new'. +void +PassManager_New::add(Pass *P) { + PM->add(P); +} + +/// run - Execute all of the passes scheduled for execution. Keep track of +/// whether any of the passes modifies the module, and if so, return true. +bool +PassManager_New::run(Module &M) { + return PM->run(M); +} + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/PassManager.h
Changes in directory llvm/include/llvm: PassManager.h updated: 1.25 -> 1.26 --- Log message: Split FunctionPassManager_New into FunctionPassManager_New and FunctionPassManagerImpl_New. FunctionPassManagerImpl_New implements the pass manager. FunctionPassManager_New is the public interface. --- Diffs of the changes: (+28 -0) PassManager.h | 28 1 files changed, 28 insertions(+) Index: llvm/include/llvm/PassManager.h diff -u llvm/include/llvm/PassManager.h:1.25 llvm/include/llvm/PassManager.h:1.26 --- llvm/include/llvm/PassManager.h:1.25Wed Nov 8 04:29:57 2006 +++ llvm/include/llvm/PassManager.h Wed Nov 8 04:44:40 2006 @@ -90,6 +90,7 @@ class ModulePassManager_New; class PassManagerImpl_New; +class FunctionPassManagerImpl_New; /// PassManagerAnalysisHelper helps pass manager analysis required by /// the managed passes. It provides methods to add/remove analysis @@ -148,6 +149,33 @@ }; +/// FunctionPassManager_New manages FunctionPasses and BasicBlockPassManagers. +class FunctionPassManager_New : public Pass, +public PassManagerAnalysisHelper { +public: + FunctionPassManager_New(ModuleProvider *P) { /* TODO */ } + FunctionPassManager_New(); + ~FunctionPassManager_New() { /* TODO */ }; + + /// add - Add a pass to the queue of passes to run. This passes + /// ownership of the Pass to the PassManager. When the + /// PassManager_X is destroyed, the pass will be destroyed as well, so + /// there is no need to delete the pass. (TODO delete passes.) + /// This implies that all passes MUST be allocated with 'new'. + void add(Pass *P); + + /// Execute all of the passes scheduled for execution. Keep + /// track of whether any of the passes modifies the function, and if + /// so, return true. + bool runOnModule(Module &M); + +private: + + FunctionPassManagerImpl_New *FPM; + +}; + + } // End llvm namespace #endif ___ 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.9 -> 1.10 --- Log message: Split FunctionPassManager_New into FunctionPassManager_New and FunctionPassManagerImpl_New. FunctionPassManagerImpl_New implements the pass manager. FunctionPassManager_New is the public interface. --- Diffs of the changes: (+34 -10) PassManager.cpp | 44 ++-- 1 files changed, 34 insertions(+), 10 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.9 llvm/lib/VMCore/PassManager.cpp:1.10 --- llvm/lib/VMCore/PassManager.cpp:1.9 Wed Nov 8 04:29:57 2006 +++ llvm/lib/VMCore/PassManager.cpp Wed Nov 8 04:44:40 2006 @@ -40,18 +40,18 @@ std::vector PassVector; }; -/// FunctionPassManager_New manages FunctionPasses and BasicBlockPassManagers. +/// 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 FunctionPassManager_New : public Pass, +class FunctionPassManagerImpl_New : public Pass, public PassManagerAnalysisHelper { public: - FunctionPassManager_New(ModuleProvider *P) { /* TODO */ } - FunctionPassManager_New() { + FunctionPassManagerImpl_New(ModuleProvider *P) { /* TODO */ } + FunctionPassManagerImpl_New() { activeBBPassManager = NULL; } - ~FunctionPassManager_New() { /* TODO */ }; + ~FunctionPassManagerImpl_New() { /* TODO */ }; /// add - Add a pass to the queue of passes to run. This passes /// ownership of the Pass to the PassManager. When the @@ -97,7 +97,7 @@ std::vector PassVector; // Active Pass Manager - FunctionPassManager_New *activeFunctionPassManager; + FunctionPassManagerImpl_New *activeFunctionPassManager; }; /// PassManager_New manages ModulePassManagers @@ -219,6 +219,30 @@ } // FunctionPassManager_New implementation +/// Create new Function pass manager +FunctionPassManager_New::FunctionPassManager_New() { + FPM = new FunctionPassManagerImpl_New(); +} + +/// add - Add a pass to the queue of passes to run. This passes +/// ownership of the Pass to the PassManager. When the +/// PassManager_X is destroyed, the pass will be destroyed as well, so +/// there is no need to delete the pass. (TODO delete passes.) +/// This implies that all passes MUST be allocated with 'new'. +void +FunctionPassManager_New::add(Pass *P) { + FPM->add(P); +} + +/// Execute all of the passes scheduled for execution. Keep +/// track of whether any of the passes modifies the function, and if +/// so, return true. +bool +FunctionPassManager_New::runOnModule(Module &M) { + return FPM->runOnModule(M); +} + +// FunctionPassManagerImpl_New implementation // FunctionPassManager @@ -226,7 +250,7 @@ /// either use it into active basic block pass manager or create new basic /// block pass manager to handle pass P. bool -FunctionPassManager_New::addPass(Pass *P) { +FunctionPassManagerImpl_New::addPass(Pass *P) { // If P is a BasicBlockPass then use BasicBlockPassManager_New. if (BasicBlockPass *BP = dynamic_cast(P)) { @@ -264,7 +288,7 @@ /// runOnFunction method. Keep track of whether any of the passes modifies /// the function, and if so, return true. bool -FunctionPassManager_New::runOnModule(Module &M) { +FunctionPassManagerImpl_New::runOnModule(Module &M) { bool Changed = false; for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) @@ -281,7 +305,7 @@ // ModulePassManager implementation /// Add P into pass vector if it is manageble. If P is a FunctionPass -/// then use FunctionPassManager_New to manage it. Return false if P +/// then use FunctionPassManagerImpl_New to manage it. Return false if P /// is not manageable by this manager. bool ModulePassManager_New::addPass(Pass *P) { @@ -294,7 +318,7 @@ if (!activeFunctionPassManager || !activeFunctionPassManager->addPass(P)) { - activeFunctionPassManager = new FunctionPassManager_New(); + activeFunctionPassManager = new FunctionPassManagerImpl_New(); PassVector.push_back(activeFunctionPassManager); if (!activeFunctionPassManager->addPass(FP)) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc4] SHR Patch (Please Apply!)
Will be in today's mirror. On Nov 8, 2006, at 3:24 AM, Chris Lattner wrote: applied, thanks -Chris On Nov 7, 2006, at 11:20 PM, Reid Spencer wrote: This patch for llvm-gcc4 is needed to make llvm-gcc4 work correctly with the just committed SHR patch. Please commit at earliest convenience. If you're building llvm-gcc4 and you have updated your LLVM tree to include the SHR patch, please apply this to your llvm-gcc4 tree so that it will compile correctly. Thanks, Reid. ___ 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 smime.p7s Description: S/MIME cryptographic signature ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineDebugInfo.h
Changes in directory llvm/include/llvm/CodeGen: MachineDebugInfo.h updated: 1.45 -> 1.46 --- Log message: Wasn't handling case of when machine move labels were undefined. --- Diffs of the changes: (+6 -1) MachineDebugInfo.h |7 ++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/MachineDebugInfo.h diff -u llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.45 llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.46 --- llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.45 Tue Nov 7 13:33:46 2006 +++ llvm/include/llvm/CodeGen/MachineDebugInfo.hWed Nov 8 08:16:39 2006 @@ -1046,13 +1046,18 @@ /// RemapLabel - Indicate that a label has been merged into another. /// void RemapLabel(unsigned OldLabelID, unsigned NewLabelID) { +assert(0 < OldLabelID && OldLabelID <= LabelIDList.size() && + "Old debug label ID out of range."); +assert(NewLabelID <= LabelIDList.size() && + "New debug label ID out of range."); LabelIDList[OldLabelID - 1] = NewLabelID; } /// MappedLabel - Find out the label's final ID. Zero indicates deletion. /// ID != Mapped ID indicates that the label was folded into another label. unsigned MappedLabel(unsigned LabelID) const { -return LabelIDList[LabelID - 1]; +assert(LabelID <= LabelIDList.size() && "Debug label ID out of range."); +return LabelID ? LabelIDList[LabelID - 1] : 0; } /// RecordSource - Register a source file with debug info. Returns an source ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/MachineDebugInfo.cpp
Changes in directory llvm/lib/CodeGen: MachineDebugInfo.cpp updated: 1.58 -> 1.59 --- Log message: Now can re-enable debug label folding. --- Diffs of the changes: (+0 -3) MachineDebugInfo.cpp |3 --- 1 files changed, 3 deletions(-) Index: llvm/lib/CodeGen/MachineDebugInfo.cpp diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.58 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.59 --- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.58 Tue Nov 7 15:58:55 2006 +++ llvm/lib/CodeGen/MachineDebugInfo.cpp Wed Nov 8 08:17:45 2006 @@ -1629,9 +1629,6 @@ }; bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) { - // FIXME - Missing label mapping. - return false; - // Get machine debug info. MachineDebugInfo *MDI = getAnalysisToUpdate(); if (!MDI) return false; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Support/Allocator.cpp
Changes in directory llvm/lib/Support: Allocator.cpp updated: 1.1 -> 1.2 --- Log message: Include llvm/Support/DataTypes.h to define intptr_t. This fixes the build on OpenBSD and potentially other systems. --- Diffs of the changes: (+1 -0) Allocator.cpp |1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Support/Allocator.cpp diff -u llvm/lib/Support/Allocator.cpp:1.1 llvm/lib/Support/Allocator.cpp:1.2 --- llvm/lib/Support/Allocator.cpp:1.1 Sun Oct 29 16:08:03 2006 +++ llvm/lib/Support/Allocator.cpp Wed Nov 8 09:04:35 2006 @@ -12,6 +12,7 @@ //===--===// #include "llvm/Support/Allocator.h" +#include "llvm/Support/DataTypes.h" #include using namespace llvm; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp RegAllocLinearScan.cpp
Dear Mr. Laskey, This change broke the LLVM build on OpenBSD. Would it be possible to use FLT_MAX instead of HUGE_VALF? FLT_MAX from float.h looks more portable. -- John T. Jim Laskey wrote: > Changes in directory llvm/lib/CodeGen: > > LiveIntervalAnalysis.cpp updated: 1.190 -> 1.191 > RegAllocLinearScan.cpp updated: 1.129 -> 1.130 > --- > Log message: > > Use correct value for float HUGH_VAL. > > --- > Diffs of the changes: (+6 -6) > > LiveIntervalAnalysis.cpp |8 > RegAllocLinearScan.cpp |4 ++-- > 2 files changed, 6 insertions(+), 6 deletions(-) > > > Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp > diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.190 > llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.191 > --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.190 Tue Nov 7 01:18:40 2006 > +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Nov 7 06:25:45 2006 > @@ -219,7 +219,7 @@ >// range the use follows def immediately, it doesn't make sense to > spill >// it and hope it will be easier to allocate for this li. >if (isZeroLengthInterval(&LI)) > -LI.weight = float(HUGE_VAL); > +LI.weight = HUGE_VALF; > >if (EnableReweight) { > // Divide the weight of the interval by its size. This encourages > @@ -265,7 +265,7 @@ > >std::vector added; > > - assert(li.weight != HUGE_VAL && > + assert(li.weight != HUGE_VALF && > "attempt to spill already spilled interval!"); > >DEBUG(std::cerr << "\t\t\t\tadding intervals for spills for interval: "; > @@ -340,7 +340,7 @@ > > // the spill weight is now infinity as it > // cannot be spilled again > -nI.weight = float(HUGE_VAL); > +nI.weight = HUGE_VALF; > > if (HasUse) { >LiveRange LR(getLoadIndex(index), getUseIndex(index), > @@ -1362,6 +1362,6 @@ > > LiveInterval LiveIntervals::createInterval(unsigned reg) { >float Weight = MRegisterInfo::isPhysicalRegister(reg) ? > - (float)HUGE_VAL : 0.0F; > + HUGE_VALF : 0.0F; >return LiveInterval(reg, Weight); > } > > > Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp > diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.129 > llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.130 > --- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.129 Tue Oct 24 09:35:25 2006 > +++ llvm/lib/CodeGen/RegAllocLinearScan.cpp Tue Nov 7 06:25:45 2006 > @@ -545,7 +545,7 @@ >DEBUG(std::cerr << "\tassigning stack slot at interval "<< *cur << ":\n"); > >// Find a register to spill. > - float minWeight = float(HUGE_VAL); > + float minWeight = HUGE_VALF; >unsigned minReg = 0; >for (TargetRegisterClass::iterator i = RC->allocation_order_begin(*mf_), > e = RC->allocation_order_end(*mf_); i != e; ++i) { > @@ -582,7 +582,7 @@ >// if the current has the minimum weight, we need to spill it and >// add any added intervals back to unhandled, and restart >// linearscan. > - if (cur->weight != float(HUGE_VAL) && cur->weight <= minWeight) { > + if (cur->weight != HUGE_VALF && cur->weight <= minWeight) { > DEBUG(std::cerr << "\t\t\tspilling(c): " << *cur << '\n';); > int slot = vrm_->assignVirt2StackSlot(cur->reg); > std::vector added = > > > > ___ > 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/CodeGen/LiveIntervalAnalysis.cpp RegAllocLinearScan.cpp
John,Both are defined on Darwin, FLT_MAX in float.h and HUGE_VALF in math.h. However, neither header seems to be based on a BSD header. I choose HUGE_VALF because it was also defined in the LINUX and FREEBSD math.h headers (seemed like confirmation to me.) I'll wait for Chris to make the call. (might uses a #ifndef HUGE_VALF thingame.)Cheers,-- JimOn Nov 8, 2006, at 12:03 PM, John Criswell wrote:Dear Mr. Laskey,This change broke the LLVM build on OpenBSD. Would it be possible touse FLT_MAX instead of HUGE_VALF? FLT_MAX from float.h looks more portable.-- John T.Jim Laskey wrote: Changes in directory llvm/lib/CodeGen:LiveIntervalAnalysis.cpp updated: 1.190 -> 1.191RegAllocLinearScan.cpp updated: 1.129 -> 1.130---Log message:Use correct value for float HUGH_VAL.---Diffs of the changes: (+6 -6) LiveIntervalAnalysis.cpp | 8 RegAllocLinearScan.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cppdiff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.190 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.191--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.190 Tue Nov 7 01:18:40 2006+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Nov 7 06:25:45 2006@@ -219,7 +219,7 @@ // range the use follows def immediately, it doesn't make sense to spill // it and hope it will be easier to allocate for this li. if (isZeroLengthInterval(&LI))- LI.weight = float(HUGE_VAL);+ LI.weight = HUGE_VALF; if (EnableReweight) { // Divide the weight of the interval by its size. This encourages @@ -265,7 +265,7 @@ std::vector added;- assert(li.weight != HUGE_VAL &&+ assert(li.weight != HUGE_VALF && "attempt to spill already spilled interval!"); DEBUG(std::cerr << "\t\t\t\tadding intervals for spills for interval: ";@@ -340,7 +340,7 @@ // the spill weight is now infinity as it // cannot be spilled again- nI.weight = float(HUGE_VAL);+ nI.weight = HUGE_VALF; if (HasUse) { LiveRange LR(getLoadIndex(index), getUseIndex(index),@@ -1362,6 +1362,6 @@ LiveInterval LiveIntervals::createInterval(unsigned reg) { float Weight = MRegisterInfo::isPhysicalRegister(reg) ?- (float)HUGE_VAL : 0.0F;+ HUGE_VALF : 0.0F; return LiveInterval(reg, Weight); }Index: llvm/lib/CodeGen/RegAllocLinearScan.cppdiff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.129 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.130--- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.129 Tue Oct 24 09:35:25 2006+++ llvm/lib/CodeGen/RegAllocLinearScan.cpp Tue Nov 7 06:25:45 2006@@ -545,7 +545,7 @@ DEBUG(std::cerr << "\tassigning stack slot at interval "<< *cur << ":\n"); // Find a register to spill.- float minWeight = float(HUGE_VAL);+ float minWeight = HUGE_VALF; unsigned minReg = 0; for (TargetRegisterClass::iterator i = RC->allocation_order_begin(*mf_), e = RC->allocation_order_end(*mf_); i != e; ++i) {@@ -582,7 +582,7 @@ // if the current has the minimum weight, we need to spill it and // add any added intervals back to unhandled, and restart // linearscan.- if (cur->weight != float(HUGE_VAL) && cur->weight <= minWeight) {+ if (cur->weight != HUGE_VALF && cur->weight <= minWeight) { DEBUG(std::cerr << "\t\t\tspilling(c): " << *cur << '\n';); int slot = vrm_->assignVirt2StackSlot(cur->reg); std::vector added =___llvm-commits mailing listllvm-commits@cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits smime.p7s Description: S/MIME cryptographic signature ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cpp
Changes in directory llvm/test/Regression/DebugInfo: 2006-11-06-StackTrace.cpp updated: 1.3 -> 1.4 --- Log message: Make it work on Darwin. --- Diffs of the changes: (+4 -3) 2006-11-06-StackTrace.cpp |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cpp diff -u llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cpp:1.3 llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cpp:1.4 --- llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cpp:1.3Wed Nov 8 00:43:16 2006 +++ llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cppWed Nov 8 10:38:45 2006 @@ -1,10 +1,11 @@ // This is a regression test on debug info to make sure that we can get a // meaningful stack trace from a C++ program. // RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | llc -o Output/StackTrace.s -f -// RUN: gcc -g Output/StackTrace.s -o Output/StackTrace.exe -lstdc++ +// RUN: as Output/StackTrace.s -o Output/StackTrace.o +// RUN: g++ Output/StackTrace.o -o Output/StackTrace.exe // RUN: ( echo "break DeepStack::deepest"; echo "run 17" ; echo "where" ) > Output/StackTrace.gdbin -// RUN: gdb -q -batch -n -x Output/StackTrace.gdbin Output/StackTrace.exe | tee Output/StackTrace.out | grep '#0 DeepStack::deepest (this=.*,x=33)' -// RUN: gdb -q -batch -n -x Output/StackTrace.gdbin Output/StackTrace.exe | grep '#7 0x.* in main(argc=1, argv=.*)' +// RUN: gdb -q -batch -n -x Output/StackTrace.gdbin Output/StackTrace.exe | tee Output/StackTrace.out | grep '#0 DeepStack::deepest.*(this=.*,.*x=33)' +// RUN: gdb -q -batch -n -x Output/StackTrace.gdbin Output/StackTrace.exe | grep '#7 0x.* in main.*(argc=[12],.*argv=.*)' // XFAIL: linux ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp ARMISelDAGToDAG.cpp ARMInstrInfo.td ARMRegisterInfo.cpp
Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.27 -> 1.28 ARMISelDAGToDAG.cpp updated: 1.82 -> 1.83 ARMInstrInfo.td updated: 1.73 -> 1.74 ARMRegisterInfo.cpp updated: 1.24 -> 1.25 --- Log message: initial implementation of addressing mode 2 TODO: fix lea_addri --- Diffs of the changes: (+72 -15) ARMAsmPrinter.cpp | 19 +++ ARMISelDAGToDAG.cpp | 32 +++- ARMInstrInfo.td | 18 +- ARMRegisterInfo.cpp | 18 +- 4 files changed, 72 insertions(+), 15 deletions(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.27 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.28 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.27 Thu Nov 2 09:00:02 2006 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Wed Nov 8 11:07:31 2006 @@ -76,6 +76,7 @@ } void printAddrMode1(const MachineInstr *MI, int opNum); +void printAddrMode2(const MachineInstr *MI, int opNum); void printAddrMode5(const MachineInstr *MI, int opNum); void printMemRegImm(const MachineInstr *MI, int opNum, @@ -215,6 +216,24 @@ } } +void ARMAsmPrinter::printAddrMode2(const MachineInstr *MI, int opNum) { + const MachineOperand &Arg= MI->getOperand(opNum); + const MachineOperand &Offset = MI->getOperand(opNum + 1); + assert(Offset.isImmediate()); + + if (Arg.isConstantPoolIndex()) { +assert(Offset.getImmedValue() == 0); +printOperand(MI, opNum); + } else { +assert(Arg.isRegister()); +O << '['; +printOperand(MI, opNum); +O << ", "; +printOperand(MI, opNum + 1); +O << ']'; + } +} + void ARMAsmPrinter::printAddrMode5(const MachineInstr *MI, int opNum) { const MachineOperand &Arg= MI->getOperand(opNum); const MachineOperand &Offset = MI->getOperand(opNum + 1); Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.82 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.83 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.82Thu Nov 2 09:00:02 2006 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Wed Nov 8 11:07:32 2006 @@ -754,6 +754,7 @@ bool SelectAddrRegImm(SDOperand N, SDOperand &Offset, SDOperand &Base); bool SelectAddrMode1(SDOperand N, SDOperand &Arg, SDOperand &Shift, SDOperand &ShiftType); + bool SelectAddrMode2(SDOperand N, SDOperand &Arg, SDOperand &Offset); bool SelectAddrMode5(SDOperand N, SDOperand &Arg, SDOperand &Offset); // Include the pieces autogenerated from the target description. @@ -820,7 +821,7 @@ int alignment = 2; SDOperand Addr = CurDAG->getTargetConstantPool(C, MVT::i32, alignment); SDOperandZ = CurDAG->getTargetConstant(0, MVT::i32); - SDNode *n = CurDAG->getTargetNode(ARM::ldr, MVT::i32, Z, Addr); + SDNode *n = CurDAG->getTargetNode(ARM::LDR, MVT::i32, Addr, Z); Arg= SDOperand(n, 0); } else Arg= CurDAG->getTargetConstant(val,MVT::i32); @@ -852,6 +853,35 @@ return true; } +bool ARMDAGToDAGISel::SelectAddrMode2(SDOperand N, SDOperand &Arg, + SDOperand &Offset) { + //TODO: complete and cleanup! + SDOperand Zero = CurDAG->getTargetConstant(0, MVT::i32); + if (FrameIndexSDNode *FIN = dyn_cast(N)) { +Arg= CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32); +Offset = Zero; +return true; + } + if (N.getOpcode() == ISD::ADD) { +short imm = 0; +if (isInt12Immediate(N.getOperand(1), imm)) { + Offset = CurDAG->getTargetConstant(imm, MVT::i32); + if (FrameIndexSDNode *FI = dyn_cast(N.getOperand(0))) { + Arg = CurDAG->getTargetFrameIndex(FI->getIndex(), N.getValueType()); + } else { + Arg = N.getOperand(0); + } + return true; // [r+i] +} + } + Offset = Zero; + if (FrameIndexSDNode *FI = dyn_cast(N)) +Arg = CurDAG->getTargetFrameIndex(FI->getIndex(), N.getValueType()); + else +Arg = N; + return true; +} + bool ARMDAGToDAGISel::SelectAddrMode5(SDOperand N, SDOperand &Arg, SDOperand &Offset) { //TODO: detect offset Index: llvm/lib/Target/ARM/ARMInstrInfo.td diff -u llvm/lib/Target/ARM/ARMInstrInfo.td:1.73 llvm/lib/Target/ARM/ARMInstrInfo.td:1.74 --- llvm/lib/Target/ARM/ARMInstrInfo.td:1.73Fri Nov 3 17:47:46 2006 +++ llvm/lib/Target/ARM/ARMInstrInfo.td Wed Nov 8 11:07:32 2006 @@ -18,6 +18,11 @@ let MIOperandInfo = (ops ptr_rc, ptr_rc, i32imm); } +def op_addr_mode2 : Operand { + let PrintMethod = "printAddrMode2"; + let MIOperandInfo = (ops ptr_rc, i32imm); +} + def op_addr_mode5 : Operand { let PrintMethod = "printAddrMode5"; let MIOperandInfo = (ops ptr_rc, i32imm); @@ -33,6 +38,9 @@ def addr_mode1 : ComplexPattern; +//Addressing Mode 2: Load and Store Word or Unsigned Byte +def addr_mode2 : ComplexPattern; + //Addressing Mode 5: VFP load/store def addr
Re: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp RegAllocLinearScan.cpp
John,Adding declaration to DataTypes.h(.in).Cheers,-- JimOn Nov 8, 2006, at 12:30 PM, Jim Laskey wrote:John,Both are defined on Darwin, FLT_MAX in float.h and HUGE_VALF in math.h. However, neither header seems to be based on a BSD header. I choose HUGE_VALF because it was also defined in the LINUX and FREEBSD math.h headers (seemed like confirmation to me.) I'll wait for Chris to make the call. (might uses a #ifndef HUGE_VALF thingame.)Cheers,-- JimOn Nov 8, 2006, at 12:03 PM, John Criswell wrote:Dear Mr. Laskey,This change broke the LLVM build on OpenBSD. Would it be possible touse FLT_MAX instead of HUGE_VALF? FLT_MAX from float.h looks more portable.-- John T.Jim Laskey wrote: Changes in directory llvm/lib/CodeGen:LiveIntervalAnalysis.cpp updated: 1.190 -> 1.191RegAllocLinearScan.cpp updated: 1.129 -> 1.130---Log message:Use correct value for float HUGH_VAL.---Diffs of the changes: (+6 -6) LiveIntervalAnalysis.cpp | 8 RegAllocLinearScan.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cppdiff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.190 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.191--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.190 Tue Nov 7 01:18:40 2006+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Nov 7 06:25:45 2006@@ -219,7 +219,7 @@ // range the use follows def immediately, it doesn't make sense to spill // it and hope it will be easier to allocate for this li. if (isZeroLengthInterval(&LI))- LI.weight = float(HUGE_VAL);+ LI.weight = HUGE_VALF; if (EnableReweight) { // Divide the weight of the interval by its size. This encourages @@ -265,7 +265,7 @@ std::vector added;- assert(li.weight != HUGE_VAL &&+ assert(li.weight != HUGE_VALF && "attempt to spill already spilled interval!"); DEBUG(std::cerr << "\t\t\t\tadding intervals for spills for interval: ";@@ -340,7 +340,7 @@ // the spill weight is now infinity as it // cannot be spilled again- nI.weight = float(HUGE_VAL);+ nI.weight = HUGE_VALF; if (HasUse) { LiveRange LR(getLoadIndex(index), getUseIndex(index),@@ -1362,6 +1362,6 @@ LiveInterval LiveIntervals::createInterval(unsigned reg) { float Weight = MRegisterInfo::isPhysicalRegister(reg) ?- (float)HUGE_VAL : 0.0F;+ HUGE_VALF : 0.0F; return LiveInterval(reg, Weight); }Index: llvm/lib/CodeGen/RegAllocLinearScan.cppdiff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.129 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.130--- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.129 Tue Oct 24 09:35:25 2006+++ llvm/lib/CodeGen/RegAllocLinearScan.cpp Tue Nov 7 06:25:45 2006@@ -545,7 +545,7 @@ DEBUG(std::cerr << "\tassigning stack slot at interval "<< *cur << ":\n"); // Find a register to spill.- float minWeight = float(HUGE_VAL);+ float minWeight = HUGE_VALF; unsigned minReg = 0; for (TargetRegisterClass::iterator i = RC->allocation_order_begin(*mf_), e = RC->allocation_order_end(*mf_); i != e; ++i) {@@ -582,7 +582,7 @@ // if the current has the minimum weight, we need to spill it and // add any added intervals back to unhandled, and restart // linearscan.- if (cur->weight != float(HUGE_VAL) && cur->weight <= minWeight) {+ if (cur->weight != HUGE_VALF && cur->weight <= minWeight) { DEBUG(std::cerr << "\t\t\tspilling(c): " << *cur << '\n';); int slot = vrm_->assignVirt2StackSlot(cur->reg); std::vector added =___llvm-commits mailing listllvm-commits@cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___llvm-commits mailing listllvm-commits@cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits smime.p7s Description: S/MIME cryptographic signature ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Support/DataTypes.h.in
Changes in directory llvm/include/llvm/Support: DataTypes.h.in updated: 1.23 -> 1.24 --- Log message: Add backup support for HUGH_VALF. --- Diffs of the changes: (+4 -0) DataTypes.h.in |4 1 files changed, 4 insertions(+) Index: llvm/include/llvm/Support/DataTypes.h.in diff -u llvm/include/llvm/Support/DataTypes.h.in:1.23 llvm/include/llvm/Support/DataTypes.h.in:1.24 --- llvm/include/llvm/Support/DataTypes.h.in:1.23 Wed Apr 19 19:18:39 2006 +++ llvm/include/llvm/Support/DataTypes.h.inWed Nov 8 11:19:29 2006 @@ -117,4 +117,8 @@ #define END_WITH_NULL #endif +#ifndef HUGE_VALF +#define HUGE_VALF (float)HUGE_VAL +#endif + #endif /* SUPPORT_DATATYPES_H */ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm/lib/CodeGen/DwarfWriter.cpp
Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.97 -> 1.97.2.1 --- Log message: Merging from mainline --- Diffs of the changes: (+2 -0) DwarfWriter.cpp |2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.97 llvm/lib/CodeGen/DwarfWriter.cpp:1.97.2.1 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.97 Mon Nov 6 10:23:59 2006 +++ llvm/lib/CodeGen/DwarfWriter.cppWed Nov 8 11:38:54 2006 @@ -2418,6 +2418,8 @@ /// EmitFunctionDebugFrame - Emit per function frame info into a debug frame /// section. void EmitFunctionDebugFrame() { +if (!TAI->getDwarfRequiresFrameSection()) + return; // Start the dwarf frame section. Asm->SwitchToDataSection(TAI->getDwarfFrameSection()); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm/lib/AsmParser/llvmAsmParser.y
Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.272 -> 1.272.2.1 --- Log message: Merging from mainline. --- Diffs of the changes: (+2 -2) llvmAsmParser.y |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.272 llvm/lib/AsmParser/llvmAsmParser.y:1.272.2.1 --- llvm/lib/AsmParser/llvmAsmParser.y:1.272Wed Nov 1 19:53:58 2006 +++ llvm/lib/AsmParser/llvmAsmParser.y Wed Nov 8 11:41:32 2006 @@ -2102,8 +2102,8 @@ }; FnDeclareLinkage: /*default*/ | - DLLIMPORT { CurFun.Linkage = GlobalValue::DLLImportLinkage } | - EXTERN_WEAK { CurFun.Linkage = GlobalValue::DLLImportLinkage }; + DLLIMPORT { CurFun.Linkage = GlobalValue::DLLImportLinkage; } | + EXTERN_WEAK { CurFun.Linkage = GlobalValue::DLLImportLinkage; }; FunctionProto : DECLARE { CurFun.isDeclare = true; } FnDeclareLinkage FunctionHeaderH { $$ = CurFun.CurrentFunction; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/include/llvm/Support/DataTypes.h.in
> > #ifndef HUGE_VALF > #ifndef HUGE_VAL > #ifndef MAX_FLT > #warning don't know how to define HUGE_VALF > #else > #define HUGE_VALF MAX_FLT > #endif > #else > #define HUGE_VALF (float)HUGE_VAL > #endif > #endif More significantly, neither of these will work unless you #include and/or float.h. -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/include/llvm/Support/DataTypes.h.in
Jim, Perhaps this ... On Wed, 2006-11-08 at 11:19 -0600, Jim Laskey wrote: > > Changes in directory llvm/include/llvm/Support: > > DataTypes.h.in updated: 1.23 -> 1.24 > --- > Log message: > > Add backup support for HUGH_VALF. > > --- > Diffs of the changes: (+4 -0) > > DataTypes.h.in |4 > 1 files changed, 4 insertions(+) > > > Index: llvm/include/llvm/Support/DataTypes.h.in > diff -u llvm/include/llvm/Support/DataTypes.h.in:1.23 > llvm/include/llvm/Support/DataTypes.h.in:1.24 > --- llvm/include/llvm/Support/DataTypes.h.in:1.23 Wed Apr 19 19:18:39 2006 > +++ llvm/include/llvm/Support/DataTypes.h.in Wed Nov 8 11:19:29 2006 > @@ -117,4 +117,8 @@ > #define END_WITH_NULL > #endif > > +#ifndef HUGE_VALF > +#define HUGE_VALF (float)HUGE_VAL > +#endif How about: #ifndef HUGE_VALF #ifndef HUGE_VAL #ifndef MAX_FLT #warning don't know how to define HUGE_VALF #else #define HUGE_VALF MAX_FLT #endif #else #define HUGE_VALF (float)HUGE_VAL #endif #endif ? > + > #endif /* SUPPORT_DATATYPES_H */ > > > > ___ > 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/include/llvm/Support/DataTypes.h.in
We know (float)HUGE_VAL works because that's where we started. -- Jim On Nov 8, 2006, at 1:41 PM, Chris Lattner wrote: #ifndef HUGE_VALF #ifndef HUGE_VAL #ifndef MAX_FLT #warning don't know how to define HUGE_VALF #else #define HUGE_VALF MAX_FLT #endif #else #define HUGE_VALF (float)HUGE_VAL #endif #endif More significantly, neither of these will work unless you #include and/or float.h. -Chris smime.p7s Description: S/MIME cryptographic signature ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/include/llvm/Support/DataTypes.h.in
On Nov 8, 2006, at 9:50 AM, Jim Laskey wrote: > We know (float)HUGE_VAL works because that's where we started. Right, but if DataTypes.in.h doesn't #include before checking for HUGE_VALF, HUGE_VALF will never be defined. -Chris > -- Jim > > > On Nov 8, 2006, at 1:41 PM, Chris Lattner wrote: > >>> >>> #ifndef HUGE_VALF >>> #ifndef HUGE_VAL >>> #ifndef MAX_FLT >>> #warning don't know how to define HUGE_VALF >>> #else >>> #define HUGE_VALF MAX_FLT >>> #endif >>> #else >>> #define HUGE_VALF (float)HUGE_VAL >>> #endif >>> #endif >> >> More significantly, neither of these will work unless you #include >> and/or float.h. >> >> -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
[llvm-commits] [release_19] CVS: llvm/lib/Support/Allocator.cpp
Changes in directory llvm/lib/Support: Allocator.cpp updated: 1.1 -> 1.1.2.1 --- Log message: Merging from mainline. --- Diffs of the changes: (+1 -0) Allocator.cpp |1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Support/Allocator.cpp diff -u llvm/lib/Support/Allocator.cpp:1.1 llvm/lib/Support/Allocator.cpp:1.1.2.1 --- llvm/lib/Support/Allocator.cpp:1.1 Sun Oct 29 16:08:03 2006 +++ llvm/lib/Support/Allocator.cpp Wed Nov 8 12:00:14 2006 @@ -12,6 +12,7 @@ //===--===// #include "llvm/Support/Allocator.h" +#include "llvm/Support/DataTypes.h" #include using namespace llvm; ___ 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.537 -> 1.538 --- Log message: disable this factoring optzn for GEPs for now, this severely pessimizes some loops. --- Diffs of the changes: (+1 -1) InstructionCombining.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.537 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.538 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.537 Wed Nov 8 00:47:33 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Nov 8 12:49:31 2006 @@ -6878,7 +6878,7 @@ !isSafeToSinkLoad(LI)) return 0; } else if (isa(FirstInst)) { -if (FirstInst->getNumOperands() == 2) +if (0 && FirstInst->getNumOperands() == 2) return FoldPHIArgBinOpIntoPHI(PN); // Can't handle general GEPs yet. return 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/Support/DataTypes.h.in
Changes in directory llvm/include/llvm/Support: DataTypes.h.in updated: 1.24 -> 1.25 --- Log message: Make sure comes first --- Diffs of the changes: (+2 -0) DataTypes.h.in |2 ++ 1 files changed, 2 insertions(+) Index: llvm/include/llvm/Support/DataTypes.h.in diff -u llvm/include/llvm/Support/DataTypes.h.in:1.24 llvm/include/llvm/Support/DataTypes.h.in:1.25 --- llvm/include/llvm/Support/DataTypes.h.in:1.24 Wed Nov 8 11:19:29 2006 +++ llvm/include/llvm/Support/DataTypes.h.inWed Nov 8 12:48:14 2006 @@ -50,6 +50,8 @@ #include #endif +#include + #ifdef _AIX #include "llvm/Support/AIXDataTypesFix.h" #endif ___ 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/DAGCombiner.cpp SelectionDAG.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.242 -> 1.243 SelectionDAG.cpp updated: 1.370 -> 1.371 --- Log message: Remove redundant . --- Diffs of the changes: (+0 -2) DAGCombiner.cpp |1 - SelectionDAG.cpp |1 - 2 files changed, 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.242 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.243 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.242 Wed Nov 8 02:30:28 2006 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Nov 8 13:16:43 2006 @@ -38,7 +38,6 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/CommandLine.h" #include -#include #include #include using namespace llvm; Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.370 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.371 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.370Sun Nov 5 13:31:28 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Nov 8 13:16:43 2006 @@ -28,7 +28,6 @@ #include "llvm/ADT/StringExtras.h" #include #include -#include #include using namespace llvm; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/ConstantFolding.cpp ScalarEvolution.cpp
Changes in directory llvm/lib/Analysis: ConstantFolding.cpp updated: 1.5 -> 1.6 ScalarEvolution.cpp updated: 1.57 -> 1.58 --- Log message: Remove redundant . --- Diffs of the changes: (+0 -2) ConstantFolding.cpp |1 - ScalarEvolution.cpp |1 - 2 files changed, 2 deletions(-) Index: llvm/lib/Analysis/ConstantFolding.cpp diff -u llvm/lib/Analysis/ConstantFolding.cpp:1.5 llvm/lib/Analysis/ConstantFolding.cpp:1.6 --- llvm/lib/Analysis/ConstantFolding.cpp:1.5 Fri Oct 20 02:07:24 2006 +++ llvm/lib/Analysis/ConstantFolding.cpp Wed Nov 8 13:16:43 2006 @@ -20,7 +20,6 @@ #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/MathExtras.h" #include -#include using namespace llvm; //===--===// Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.57 llvm/lib/Analysis/ScalarEvolution.cpp:1.58 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.57 Wed Nov 1 19:53:58 2006 +++ llvm/lib/Analysis/ScalarEvolution.cpp Wed Nov 8 13:16:43 2006 @@ -75,7 +75,6 @@ #include "llvm/Support/InstIterator.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/ADT/Statistic.h" -#include #include #include using namespace llvm; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp
Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.98 -> 1.99 --- Log message: Remove redundant . --- Diffs of the changes: (+0 -1) ConstantFolding.cpp |1 - 1 files changed, 1 deletion(-) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.98 llvm/lib/VMCore/ConstantFolding.cpp:1.99 --- llvm/lib/VMCore/ConstantFolding.cpp:1.98Wed Nov 8 00:47:33 2006 +++ llvm/lib/VMCore/ConstantFolding.cpp Wed Nov 8 13:16:44 2006 @@ -28,7 +28,6 @@ #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/MathExtras.h" #include -#include using namespace llvm; namespace { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp
Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.51 -> 1.52 --- Log message: Remove redundant . --- Diffs of the changes: (+0 -1) FileUtilities.cpp |1 - 1 files changed, 1 deletion(-) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.51 llvm/lib/Support/FileUtilities.cpp:1.52 --- llvm/lib/Support/FileUtilities.cpp:1.51 Wed Oct 18 15:23:52 2006 +++ llvm/lib/Support/FileUtilities.cpp Wed Nov 8 13:16:44 2006 @@ -16,7 +16,6 @@ #include "llvm/System/Path.h" #include "llvm/System/MappedFile.h" #include "llvm/ADT/StringExtras.h" -#include #include #include using namespace llvm; ___ 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.538 -> 1.539 --- Log message: make this code more efficient by not creating a phi node we are just going to delete in the first place. This also makes it simpler. --- Diffs of the changes: (+33 -36) InstructionCombining.cpp | 69 ++- 1 files changed, 33 insertions(+), 36 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.538 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.539 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.538 Wed Nov 8 12:49:31 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Nov 8 13:29:23 2006 @@ -6766,8 +6766,11 @@ assert(isa(FirstInst) || isa(FirstInst) || isa(FirstInst)); unsigned Opc = FirstInst->getOpcode(); - const Type *LHSType = FirstInst->getOperand(0)->getType(); - const Type *RHSType = FirstInst->getOperand(1)->getType(); + Value *LHSVal = FirstInst->getOperand(0); + Value *RHSVal = FirstInst->getOperand(1); + + const Type *LHSType = LHSVal->getType(); + const Type *RHSType = RHSVal->getType(); // Scan to see if all operands are the same opcode, all have one use, and all // kill their operands (i.e. the operands have one use). @@ -6779,52 +6782,46 @@ I->getOperand(0)->getType() != LHSType || I->getOperand(1)->getType() != RHSType) return 0; + +// Keep track of which operand needs a phi node. +if (I->getOperand(0) != LHSVal) LHSVal = 0; +if (I->getOperand(1) != RHSVal) RHSVal = 0; } - // Otherwise, this is safe and profitable to transform. Create two phi nodes. - PHINode *NewLHS = new PHINode(FirstInst->getOperand(0)->getType(), -FirstInst->getOperand(0)->getName()+".pn"); - NewLHS->reserveOperandSpace(PN.getNumOperands()/2); - PHINode *NewRHS = new PHINode(FirstInst->getOperand(1)->getType(), -FirstInst->getOperand(1)->getName()+".pn"); - NewRHS->reserveOperandSpace(PN.getNumOperands()/2); - + // Otherwise, this is safe and profitable to transform. Create up to two phi + // nodes. + PHINode *NewLHS = 0, *NewRHS = 0; Value *InLHS = FirstInst->getOperand(0); - NewLHS->addIncoming(InLHS, PN.getIncomingBlock(0)); Value *InRHS = FirstInst->getOperand(1); - NewRHS->addIncoming(InRHS, PN.getIncomingBlock(0)); - // Add all operands to the new PHsI. - for (unsigned i = 1, e = PN.getNumIncomingValues(); i != e; ++i) { -Value *NewInLHS = cast(PN.getIncomingValue(i))->getOperand(0); -Value *NewInRHS = cast(PN.getIncomingValue(i))->getOperand(1); -if (NewInLHS != InLHS) InLHS = 0; -if (NewInRHS != InRHS) InRHS = 0; -NewLHS->addIncoming(NewInLHS, PN.getIncomingBlock(i)); -NewRHS->addIncoming(NewInRHS, PN.getIncomingBlock(i)); - } - - Value *LHSVal; - if (InLHS) { -// The new PHI unions all of the same values together. This is really -// common, so we handle it intelligently here for compile-time speed. -LHSVal = InLHS; -delete NewLHS; - } else { + if (LHSVal == 0) { +NewLHS = new PHINode(LHSType, FirstInst->getOperand(0)->getName()+".pn"); +NewLHS->reserveOperandSpace(PN.getNumOperands()/2); +NewLHS->addIncoming(InLHS, PN.getIncomingBlock(0)); InsertNewInstBefore(NewLHS, PN); LHSVal = NewLHS; } - Value *RHSVal; - if (InRHS) { -// The new PHI unions all of the same values together. This is really -// common, so we handle it intelligently here for compile-time speed. -RHSVal = InRHS; -delete NewRHS; - } else { + + if (RHSVal == 0) { +NewRHS = new PHINode(RHSType, FirstInst->getOperand(1)->getName()+".pn"); +NewRHS->reserveOperandSpace(PN.getNumOperands()/2); +NewRHS->addIncoming(InRHS, PN.getIncomingBlock(0)); InsertNewInstBefore(NewRHS, PN); RHSVal = NewRHS; } + // Add all operands to the new PHIs. + for (unsigned i = 1, e = PN.getNumIncomingValues(); i != e; ++i) { +if (NewLHS) { + Value *NewInLHS =cast(PN.getIncomingValue(i))->getOperand(0); + NewLHS->addIncoming(NewInLHS, PN.getIncomingBlock(i)); +} +if (NewRHS) { + Value *NewInRHS =cast(PN.getIncomingValue(i))->getOperand(1); + NewRHS->addIncoming(NewInRHS, PN.getIncomingBlock(i)); +} + } + if (BinaryOperator *BinOp = dyn_cast(FirstInst)) return BinaryOperator::create(BinOp->getOpcode(), LHSVal, RHSVal); else if (ShiftInst *SI = dyn_cast(FirstInst)) ___ 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.539 -> 1.540 --- Log message: reenable factoring of GEP expressions, being more precise about the case that it bad to do. --- Diffs of the changes: (+10 -5) InstructionCombining.cpp | 15 ++- 1 files changed, 10 insertions(+), 5 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.539 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.540 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.539 Wed Nov 8 13:29:23 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Nov 8 13:42:28 2006 @@ -6788,12 +6788,17 @@ if (I->getOperand(1) != RHSVal) RHSVal = 0; } - // Otherwise, this is safe and profitable to transform. Create up to two phi - // nodes. - PHINode *NewLHS = 0, *NewRHS = 0; + // Otherwise, this is safe to transform, determine if it is profitable. + + // If this is a GEP, and if the index (not the pointer) needs a PHI, bail out. + // Indexes are often folded into load/store instructions, so we don't want to + // hide them behind a phi. + if (isa(FirstInst) && RHSVal == 0) +return 0; + Value *InLHS = FirstInst->getOperand(0); Value *InRHS = FirstInst->getOperand(1); - + PHINode *NewLHS = 0, *NewRHS = 0; if (LHSVal == 0) { NewLHS = new PHINode(LHSType, FirstInst->getOperand(0)->getName()+".pn"); NewLHS->reserveOperandSpace(PN.getNumOperands()/2); @@ -6875,7 +6880,7 @@ !isSafeToSinkLoad(LI)) return 0; } else if (isa(FirstInst)) { -if (0 && FirstInst->getNumOperands() == 2) +if (FirstInst->getNumOperands() == 2) return FoldPHIArgBinOpIntoPHI(PN); // Can't handle general GEPs yet. return 0; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp ExternalFunctions.cpp
Changes in directory llvm/lib/ExecutionEngine/Interpreter: Execution.cpp updated: 1.146 -> 1.147 ExternalFunctions.cpp updated: 1.88 -> 1.89 --- Log message: Remove redundant . --- Diffs of the changes: (+0 -2) Execution.cpp |1 - ExternalFunctions.cpp |1 - 2 files changed, 2 deletions(-) Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.146 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.147 --- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.146Wed Nov 8 00:47:33 2006 +++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Wed Nov 8 13:16:44 2006 @@ -20,7 +20,6 @@ #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Debug.h" -#include // For fmod using namespace llvm; namespace { Index: llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.88 llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.89 --- llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.88 Tue Aug 15 20:24:12 2006 +++ llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp Wed Nov 8 13:16:44 2006 @@ -24,7 +24,6 @@ #include "llvm/Module.h" #include "llvm/System/DynamicLibrary.h" #include "llvm/Target/TargetData.h" -#include #include #include using std::vector; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Utils/Local.cpp
Changes in directory llvm/lib/Transforms/Utils: Local.cpp updated: 1.60 -> 1.61 --- Log message: Remove redundant . --- Diffs of the changes: (+0 -1) Local.cpp |1 - 1 files changed, 1 deletion(-) Index: llvm/lib/Transforms/Utils/Local.cpp diff -u llvm/lib/Transforms/Utils/Local.cpp:1.60 llvm/lib/Transforms/Utils/Local.cpp:1.61 --- llvm/lib/Transforms/Utils/Local.cpp:1.60Wed Nov 8 00:47:33 2006 +++ llvm/lib/Transforms/Utils/Local.cpp Wed Nov 8 13:16:44 2006 @@ -21,7 +21,6 @@ #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/MathExtras.h" #include -#include using namespace llvm; //===--===// ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp RegAllocLinearScan.cpp
Changes in directory llvm/lib/CodeGen: LiveIntervalAnalysis.cpp updated: 1.192 -> 1.193 RegAllocLinearScan.cpp updated: 1.130 -> 1.131 --- Log message: Remove redundant . --- Diffs of the changes: (+0 -2) LiveIntervalAnalysis.cpp |1 - RegAllocLinearScan.cpp |1 - 2 files changed, 2 deletions(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.192 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.193 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.192 Tue Nov 7 12:04:58 2006 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Wed Nov 8 13:16:43 2006 @@ -33,7 +33,6 @@ #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include -#include #include using namespace llvm; Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.130 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.131 --- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.130 Tue Nov 7 06:25:45 2006 +++ llvm/lib/CodeGen/RegAllocLinearScan.cpp Wed Nov 8 13:16:43 2006 @@ -29,7 +29,6 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/Compiler.h" #include -#include #include #include #include ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm/test/Regression/C++Frontend/2006-09-27-Debug-Protection.cpp
Changes in directory llvm/test/Regression/C++Frontend: 2006-09-27-Debug-Protection.cpp updated: 1.1 -> 1.1.4.1 --- Log message: This test should be marked to xfail on llvmgcc-3.4 --- Diffs of the changes: (+1 -0) 2006-09-27-Debug-Protection.cpp |1 + 1 files changed, 1 insertion(+) Index: llvm/test/Regression/C++Frontend/2006-09-27-Debug-Protection.cpp diff -u llvm/test/Regression/C++Frontend/2006-09-27-Debug-Protection.cpp:1.1 llvm/test/Regression/C++Frontend/2006-09-27-Debug-Protection.cpp:1.1.4.1 --- llvm/test/Regression/C++Frontend/2006-09-27-Debug-Protection.cpp:1.1 Wed Sep 27 11:55:19 2006 +++ llvm/test/Regression/C++Frontend/2006-09-27-Debug-Protection.cppWed Nov 8 14:05:36 2006 @@ -1,3 +1,4 @@ +// XFAIL: llvmgcc3 // RUN: %llvmgxx -O0 -emit-llvm -S -g -o - %s | grep 'uint 1,' && // RUN: %llvmgxx -O0 -emit-llvm -S -g -o - %s | grep 'uint 2,' ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/BytecodeFormat.html
Changes in directory llvm/docs: BytecodeFormat.html updated: 1.54 -> 1.55 --- Log message: Update the instruction opcodes for release 1.9 --- Diffs of the changes: (+36 -34) BytecodeFormat.html | 70 ++-- 1 files changed, 36 insertions(+), 34 deletions(-) Index: llvm/docs/BytecodeFormat.html diff -u llvm/docs/BytecodeFormat.html:1.54 llvm/docs/BytecodeFormat.html:1.55 --- llvm/docs/BytecodeFormat.html:1.54 Sat Oct 14 19:11:05 2006 +++ llvm/docs/BytecodeFormat.html Wed Nov 8 14:06:36 2006 @@ -1587,45 +1587,47 @@ Add711.0 Sub811.0 Mul911.0 - Div1011.0 - Rem.0 + UDiv1011.9 + SDiv.9 + FDiv1211.9 + URem1311.9 + SRem1411.9 + FRem1511.9 Logical Operators - And1211.0 - Or1311.0 - Xor1411.0 + And1611.0 + Or1711.0 + Xor1811.0 Binary Comparison Operators - SetEQ1511.0 - SetNE1611.0 - SetLE1711.0 - SetGE1811.0 - SetLT1911.0 - SetGT2011.0 + SetEQ1911.0 + SetNE2011.0 + SetLE2111.0 + SetGE2211.0 + SetLT2311.0 + SetGT2411.0 Memory Operators - Malloc2111.0 - Free2211.0 - Alloca2311.0 - Load2411.0 - Store2511.0 - GetElementPtr2611.0 + Malloc2511.0 + Free2611.0 + Alloca2711.0 + Load2811.0 + Store2911.0 + GetElementPtr3011.0 Other Operators - PHI2711.0 - Cast2811.0 - Call2911.0 - Shl3011.0 - Shr3111.0 - VANext3211.0,unused since 1.5 - VAArg3311.0,unused sine 1.5 - Select3421.2 - UserOp13511.0 - UserOp23611.0 - VAArg3751.5 - ExtractElement3851.5 - InsertElement3951.5 - ShuffleElement4051.5 + PHI3111.0 + Cast3211.0 + Call3311.0 + Shl3411.0 + Shr3511.0 + Select3621.2 + UserOp13711.0 + UserOp23811.0 + VAArg3951.5 + ExtractElement4051.5 + InsertElement4151.5 + ShuffleElement4251.5 Pseudo Instructions* @@ -2167,7 +2169,7 @@ mailto:[EMAIL PROTECTED]">Reid Spencer and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure -Last modified: $Date: 2006/10/15 00:11:05 $ +Last modified: $Date: 2006/11/08 20:06:36 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/BytecodeFormat.html
Changes in directory llvm/docs: BytecodeFormat.html updated: 1.55 -> 1.56 --- Log message: Document correct opcodes for post 1.9 release. --- Diffs of the changes: (+8 -11) BytecodeFormat.html | 19 --- 1 files changed, 8 insertions(+), 11 deletions(-) Index: llvm/docs/BytecodeFormat.html diff -u llvm/docs/BytecodeFormat.html:1.55 llvm/docs/BytecodeFormat.html:1.56 --- llvm/docs/BytecodeFormat.html:1.55 Wed Nov 8 14:06:36 2006 +++ llvm/docs/BytecodeFormat.html Wed Nov 8 14:07:40 2006 @@ -1616,18 +1616,15 @@ Cast3211.0 Call3311.0 Shl3411.0 - Shr3511.0 - - Select3621.2 - UserOp13711.0 - UserOp23811.0 - VAArg3951.5 - ExtractElement4051.5 - InsertElement4151.5 - ShuffleElement4251.5 + Select3721.2 + UserOp13811.0 + UserOp23911.0 + VAArg4051.5 + ExtractElement4151.5 + InsertElement4251.5 + ShuffleElement4351.5 Pseudo Instructions* @@ -2169,7 +2166,7 @@ mailto:[EMAIL PROTECTED]">Reid Spencer and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure -Last modified: $Date: 2006/11/08 20:06:36 $ +Last modified: $Date: 2006/11/08 20:07:40 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm/docs/BytecodeFormat.html
Changes in directory llvm/docs: BytecodeFormat.html updated: 1.54 -> 1.54.4.1 --- Log message: Merge from head. Bytecode doc update for 1.9 release. --- Diffs of the changes: (+36 -34) BytecodeFormat.html | 70 ++-- 1 files changed, 36 insertions(+), 34 deletions(-) Index: llvm/docs/BytecodeFormat.html diff -u llvm/docs/BytecodeFormat.html:1.54 llvm/docs/BytecodeFormat.html:1.54.4.1 --- llvm/docs/BytecodeFormat.html:1.54 Sat Oct 14 19:11:05 2006 +++ llvm/docs/BytecodeFormat.html Wed Nov 8 14:11:33 2006 @@ -1587,45 +1587,47 @@ Add711.0 Sub811.0 Mul911.0 - Div1011.0 - Rem.0 + UDiv1011.9 + SDiv.9 + FDiv1211.9 + URem1311.9 + SRem1411.9 + FRem1511.9 Logical Operators - And1211.0 - Or1311.0 - Xor1411.0 + And1611.0 + Or1711.0 + Xor1811.0 Binary Comparison Operators - SetEQ1511.0 - SetNE1611.0 - SetLE1711.0 - SetGE1811.0 - SetLT1911.0 - SetGT2011.0 + SetEQ1911.0 + SetNE2011.0 + SetLE2111.0 + SetGE2211.0 + SetLT2311.0 + SetGT2411.0 Memory Operators - Malloc2111.0 - Free2211.0 - Alloca2311.0 - Load2411.0 - Store2511.0 - GetElementPtr2611.0 + Malloc2511.0 + Free2611.0 + Alloca2711.0 + Load2811.0 + Store2911.0 + GetElementPtr3011.0 Other Operators - PHI2711.0 - Cast2811.0 - Call2911.0 - Shl3011.0 - Shr3111.0 - VANext3211.0,unused since 1.5 - VAArg3311.0,unused sine 1.5 - Select3421.2 - UserOp13511.0 - UserOp23611.0 - VAArg3751.5 - ExtractElement3851.5 - InsertElement3951.5 - ShuffleElement4051.5 + PHI3111.0 + Cast3211.0 + Call3311.0 + Shl3411.0 + Shr3511.0 + Select3621.2 + UserOp13711.0 + UserOp23811.0 + VAArg3951.5 + ExtractElement4051.5 + InsertElement4151.5 + ShuffleElement4251.5 Pseudo Instructions* @@ -2167,7 +2169,7 @@ mailto:[EMAIL PROTECTED]">Reid Spencer and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure -Last modified: $Date: 2006/10/15 00:11:05 $ +Last modified: $Date: 2006/11/08 20:11:33 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp RegAllocLinearScan.cpp
On 11/8/06, Jim Laskey <[EMAIL PROTECTED]> wrote: > > John, > > Both are defined on Darwin, FLT_MAX in float.h and HUGE_VALF in math.h. > However, neither header seems to be based on a BSD header. I choose > HUGE_VALF because it was also defined in the LINUX and FREEBSD math.h > headers (seemed like confirmation to me.) I'll wait for Chris to make the > call. (might uses a #ifndef HUGE_VALF thingame.) > Would it be possible to use std::numeric_limits::infinity in instead? -bw ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/C++Frontend/2006-09-27-Debug-Protection.cpp
Changes in directory llvm/test/Regression/C++Frontend: 2006-09-27-Debug-Protection.cpp updated: 1.1 -> 1.2 --- Log message: Should be xfailed for llvm-gcc3.4 --- Diffs of the changes: (+1 -0) 2006-09-27-Debug-Protection.cpp |1 + 1 files changed, 1 insertion(+) Index: llvm/test/Regression/C++Frontend/2006-09-27-Debug-Protection.cpp diff -u llvm/test/Regression/C++Frontend/2006-09-27-Debug-Protection.cpp:1.1 llvm/test/Regression/C++Frontend/2006-09-27-Debug-Protection.cpp:1.2 --- llvm/test/Regression/C++Frontend/2006-09-27-Debug-Protection.cpp:1.1 Wed Sep 27 11:55:19 2006 +++ llvm/test/Regression/C++Frontend/2006-09-27-Debug-Protection.cppWed Nov 8 14:16:05 2006 @@ -1,3 +1,4 @@ +// XFAIL: llvmgcc3 // RUN: %llvmgxx -O0 -emit-llvm -S -g -o - %s | grep 'uint 1,' && // RUN: %llvmgxx -O0 -emit-llvm -S -g -o - %s | grep 'uint 2,' ___ 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/DAGCombiner.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.243 -> 1.244 --- Log message: Match more post-indexed ops. --- Diffs of the changes: (+6 -2) DAGCombiner.cpp |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.243 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.244 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.243 Wed Nov 8 13:16:43 2006 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Nov 8 14:27:27 2006 @@ -301,8 +301,12 @@ SDOperand BasePtr; SDOperand Offset; ISD::MemOpAddrMode AM = ISD::UNINDEXED; - if (TLI.getPostIndexedAddressParts(Op, VT, BasePtr, Offset, AM,DAG) && - BasePtr == Ptr) { + if (TLI.getPostIndexedAddressParts(Op, VT, BasePtr, Offset, AM,DAG)) { +if (Ptr == Offset) + std::swap(BasePtr, Offset); +if (Ptr != BasePtr) + continue; + // Try turning it into a post-indexed load / store except when // 1) Op must be independent of N, i.e. Op is neither a predecessor //nor a successor of N. Otherwise, if Op is folded that would ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp
Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.279 -> 1.280 --- Log message: Always pass the root node to ComplexPattern isel matching function. --- Diffs of the changes: (+3 -4) DAGISelEmitter.cpp |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.279 llvm/utils/TableGen/DAGISelEmitter.cpp:1.280 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.279Fri Nov 3 23:12:02 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Wed Nov 8 14:31:10 2006 @@ -2464,7 +2464,7 @@ emitCode("SDOperand Chain" + ChainSuffix + ";"); } - std::string Code = Fn + "(" + RootName; + std::string Code = Fn + "(" + RootName + ", " + RootName; for (unsigned i = 0; i < NumOps; i++) Code += ", CPTmp" + utostr(i); if (CP->hasProperty(SDNPHasChain)) { @@ -2531,10 +2531,10 @@ emitCode("SDOperand " + ChainName + ";"); } - std::string Code = Fn + "("; + std::string Code = Fn + "(N, "; if (CP->hasProperty(SDNPHasChain)) { std::string ParentName(RootName.begin(), RootName.end()-1); -Code += "N, " + ParentName + ", "; +Code += ParentName + ", "; } Code += RootName; for (unsigned i = 0; i < NumOps; i++) @@ -2662,7 +2662,6 @@ // value if used multiple times by this pattern result. Val = "Tmp"+utostr(ResNo); } else if (N->isLeaf() && (CP = NodeGetComplexPattern(N, ISE))) { -std::string Fn = CP->getSelectFunc(); for (unsigned i = 0; i < CP->getNumOperands(); ++i) { emitCode("AddToISelQueue(CPTmp" + utostr(i) + ");"); NodeOps.push_back("CPTmp" + utostr(i)); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
Changes in directory llvm/lib/Target/ARM: ARMISelDAGToDAG.cpp updated: 1.83 -> 1.84 --- Log message: Match tblegen changes. --- Diffs of the changes: (+16 -10) ARMISelDAGToDAG.cpp | 26 -- 1 files changed, 16 insertions(+), 10 deletions(-) Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.83 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.84 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.83Wed Nov 8 11:07:32 2006 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Wed Nov 8 14:32:04 2006 @@ -751,11 +751,14 @@ SDNode *Select(SDOperand Op); virtual void InstructionSelectBasicBlock(SelectionDAG &DAG); - bool SelectAddrRegImm(SDOperand N, SDOperand &Offset, SDOperand &Base); - bool SelectAddrMode1(SDOperand N, SDOperand &Arg, SDOperand &Shift, - SDOperand &ShiftType); - bool SelectAddrMode2(SDOperand N, SDOperand &Arg, SDOperand &Offset); - bool SelectAddrMode5(SDOperand N, SDOperand &Arg, SDOperand &Offset); + bool SelectAddrRegImm(SDOperand Op, SDOperand N, SDOperand &Offset, +SDOperand &Base); + bool SelectAddrMode1(SDOperand Op, SDOperand N, SDOperand &Arg, + SDOperand &Shift, SDOperand &ShiftType); + bool SelectAddrMode2(SDOperand Op, SDOperand N, SDOperand &Arg, + SDOperand &Offset); + bool SelectAddrMode5(SDOperand Op, SDOperand N, SDOperand &Arg, + SDOperand &Offset); // Include the pieces autogenerated from the target description. #include "ARMGenDAGISel.inc" @@ -809,7 +812,8 @@ return false; } -bool ARMDAGToDAGISel::SelectAddrMode1(SDOperand N, +bool ARMDAGToDAGISel::SelectAddrMode1(SDOperand Op, + SDOperand N, SDOperand &Arg, SDOperand &Shift, SDOperand &ShiftType) { @@ -853,8 +857,8 @@ return true; } -bool ARMDAGToDAGISel::SelectAddrMode2(SDOperand N, SDOperand &Arg, - SDOperand &Offset) { +bool ARMDAGToDAGISel::SelectAddrMode2(SDOperand Op, SDOperand N, + SDOperand &Arg, SDOperand &Offset) { //TODO: complete and cleanup! SDOperand Zero = CurDAG->getTargetConstant(0, MVT::i32); if (FrameIndexSDNode *FIN = dyn_cast(N)) { @@ -882,7 +886,8 @@ return true; } -bool ARMDAGToDAGISel::SelectAddrMode5(SDOperand N, SDOperand &Arg, +bool ARMDAGToDAGISel::SelectAddrMode5(SDOperand Op, + SDOperand N, SDOperand &Arg, SDOperand &Offset) { //TODO: detect offset Offset = CurDAG->getTargetConstant(0, MVT::i32); @@ -891,7 +896,8 @@ } //register plus/minus 12 bit offset -bool ARMDAGToDAGISel::SelectAddrRegImm(SDOperand N, SDOperand &Offset, +bool ARMDAGToDAGISel::SelectAddrRegImm(SDOperand Op, + SDOperand N, SDOperand &Offset, SDOperand &Base) { if (FrameIndexSDNode *FIN = dyn_cast(N)) { Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.214 -> 1.215 --- Log message: Match tblegen changes. --- Diffs of the changes: (+12 -9) PPCISelDAGToDAG.cpp | 21 - 1 files changed, 12 insertions(+), 9 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.214 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.215 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.214 Tue Nov 7 20:15:41 2006 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Wed Nov 8 14:33:09 2006 @@ -104,27 +104,31 @@ /// SelectAddrImm - Returns true if the address N can be represented by /// a base register plus a signed 16-bit displacement [r+imm]. -bool SelectAddrImm(SDOperand N, SDOperand &Disp, SDOperand &Base) { +bool SelectAddrImm(SDOperand Op, SDOperand N, SDOperand &Disp, + SDOperand &Base) { return PPCLowering.SelectAddressRegImm(N, Disp, Base, *CurDAG); } /// SelectAddrIdx - Given the specified addressed, check to see if it can be /// represented as an indexed [r+r] operation. Returns false if it can /// be represented by [r+imm], which are preferred. -bool SelectAddrIdx(SDOperand N, SDOperand &Base, SDOperand &Index) { +bool SelectAddrIdx(SDOperand Op, SDOperand N, SDOperand &Base, + SDOperand &Index) { return PPCLowering.SelectAddressRegReg(N, Base, Index, *CurDAG); } /// SelectAddrIdxOnly - Given the specified addressed, force it to be /// represented as an indexed [r+r] operation. -bool SelectAddrIdxOnly(SDOperand N, SDOperand &Base, SDOperand &Index) { +bool SelectAddrIdxOnly(SDOperand Op, SDOperand N, SDOperand &Base, + SDOperand &Index) { return PPCLowering.SelectAddressRegRegOnly(N, Base, Index, *CurDAG); } /// SelectAddrImmShift - Returns true if the address N can be represented by /// a base register plus a signed 14-bit displacement [r+imm*4]. Suitable /// for use by STD and friends. -bool SelectAddrImmShift(SDOperand N, SDOperand &Disp, SDOperand &Base) { +bool SelectAddrImmShift(SDOperand Op, SDOperand N, SDOperand &Disp, +SDOperand &Base) { return PPCLowering.SelectAddressRegImmShift(N, Disp, Base, *CurDAG); } @@ -138,18 +142,18 @@ switch (ConstraintCode) { default: return true; case 'm': // memory -if (!SelectAddrIdx(Op, Op0, Op1)) - SelectAddrImm(Op, Op0, Op1); +if (!SelectAddrIdx(Op, Op, Op0, Op1)) + SelectAddrImm(Op, Op, Op0, Op1); break; case 'o': // offsetable -if (!SelectAddrImm(Op, Op0, Op1)) { +if (!SelectAddrImm(Op, Op, Op0, Op1)) { Op0 = Op; AddToISelQueue(Op0); // r+0. Op1 = getSmallIPtrImm(0); } break; case 'v': // not offsetable -SelectAddrIdxOnly(Op, Op0, Op1); +SelectAddrIdxOnly(Op, Op, Op0, Op1); break; } @@ -480,7 +484,6 @@ return 0; } - /// SelectCC - Select a comparison of the specified values with the specified /// condition code, returning the CR# of the expression. SDOperand PPCDAGToDAGISel::SelectCC(SDOperand LHS, SDOperand RHS, ___ 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/X86Subtarget.cpp
Changes in directory llvm/lib/Target/X86: X86Subtarget.cpp updated: 1.38 -> 1.39 --- Log message: Use movl+xchgl instead of pushl+popl. --- Diffs of the changes: (+2 -3) X86Subtarget.cpp |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/lib/Target/X86/X86Subtarget.cpp diff -u llvm/lib/Target/X86/X86Subtarget.cpp:1.38 llvm/lib/Target/X86/X86Subtarget.cpp:1.39 --- llvm/lib/Target/X86/X86Subtarget.cpp:1.38 Mon Oct 16 19:24:49 2006 +++ llvm/lib/Target/X86/X86Subtarget.cppWed Nov 8 14:35:37 2006 @@ -44,10 +44,9 @@ return false; #elif defined(i386) || defined(__i386__) || defined(__x86__) || defined(_M_IX86) #if defined(__GNUC__) - asm ("pushl\t%%ebx\n\t" + asm ("movl\t%%ebx, %%esi\n\t" "cpuid\n\t" - "movl\t%%ebx, %%esi\n\t" - "popl\t%%ebx" + "xchgl\t%%ebx, %%esi\n\t" : "=a" (*rEAX), "=S" (*rEBX), "=c" (*rECX), ___ 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/X86ISelDAGToDAG.cpp
Changes in directory llvm/lib/Target/X86: X86ISelDAGToDAG.cpp updated: 1.122 -> 1.123 --- Log message: Match tblegen changes. --- Diffs of the changes: (+16 -15) X86ISelDAGToDAG.cpp | 31 --- 1 files changed, 16 insertions(+), 15 deletions(-) Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.122 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.123 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.122 Sun Nov 5 13:31:28 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Nov 8 14:34:28 2006 @@ -143,11 +143,11 @@ SDNode *Select(SDOperand N); bool MatchAddress(SDOperand N, X86ISelAddressMode &AM, bool isRoot = true); -bool SelectAddr(SDOperand N, SDOperand &Base, SDOperand &Scale, -SDOperand &Index, SDOperand &Disp); -bool SelectLEAAddr(SDOperand N, SDOperand &Base, SDOperand &Scale, - SDOperand &Index, SDOperand &Disp); -bool SelectScalarSSELoad(SDOperand Root, SDOperand Pred, +bool SelectAddr(SDOperand Op, SDOperand N, SDOperand &Base, +SDOperand &Scale, SDOperand &Index, SDOperand &Disp); +bool SelectLEAAddr(SDOperand Op, SDOperand N, SDOperand &Base, + SDOperand &Scale, SDOperand &Index, SDOperand &Disp); +bool SelectScalarSSELoad(SDOperand Op, SDOperand Pred, SDOperand N, SDOperand &Base, SDOperand &Scale, SDOperand &Index, SDOperand &Disp, SDOperand &InChain, SDOperand &OutChain); @@ -773,8 +773,9 @@ /// SelectAddr - returns true if it is able pattern match an addressing mode. /// It returns the operands which make up the maximal addressing mode it can /// match by reference. -bool X86DAGToDAGISel::SelectAddr(SDOperand N, SDOperand &Base, SDOperand &Scale, - SDOperand &Index, SDOperand &Disp) { +bool X86DAGToDAGISel::SelectAddr(SDOperand Op, SDOperand N, SDOperand &Base, + SDOperand &Scale, SDOperand &Index, + SDOperand &Disp) { X86ISelAddressMode AM; if (MatchAddress(N, AM)) return false; @@ -805,7 +806,7 @@ /// SelectScalarSSELoad - Match a scalar SSE load. In particular, we want to /// match a load whose top elements are either undef or zeros. The load flavor /// is derived from the type of N, which is either v4f32 or v2f64. -bool X86DAGToDAGISel::SelectScalarSSELoad(SDOperand Root, SDOperand Pred, +bool X86DAGToDAGISel::SelectScalarSSELoad(SDOperand Op, SDOperand Pred, SDOperand N, SDOperand &Base, SDOperand &Scale, SDOperand &Index, SDOperand &Disp, SDOperand &InChain, @@ -814,9 +815,9 @@ InChain = N.getOperand(0).getValue(1); if (ISD::isNON_EXTLoad(InChain.Val) && InChain.getValue(0).hasOneUse() && -CanBeFoldedBy(N.Val, Pred.Val, Root.Val)) { +CanBeFoldedBy(N.Val, Pred.Val, Op.Val)) { LoadSDNode *LD = cast(InChain); - if (!SelectAddr(LD->getBasePtr(), Base, Scale, Index, Disp)) + if (!SelectAddr(Op, LD->getBasePtr(), Base, Scale, Index, Disp)) return false; OutChain = LD->getChain(); return true; @@ -856,7 +857,7 @@ // Okay, this is a zero extending load. Fold it. LoadSDNode *LD = cast(N.getOperand(1).getOperand(0)); - if (!SelectAddr(LD->getBasePtr(), Base, Scale, Index, Disp)) + if (!SelectAddr(Op, LD->getBasePtr(), Base, Scale, Index, Disp)) return false; OutChain = LD->getChain(); InChain = SDOperand(LD, 1); @@ -869,8 +870,8 @@ /// SelectLEAAddr - it calls SelectAddr and determines if the maximal addressing /// mode it matches can be cost effectively emitted as an LEA instruction. -bool X86DAGToDAGISel::SelectLEAAddr(SDOperand N, SDOperand &Base, -SDOperand &Scale, +bool X86DAGToDAGISel::SelectLEAAddr(SDOperand Op, SDOperand N, +SDOperand &Base, SDOperand &Scale, SDOperand &Index, SDOperand &Disp) { X86ISelAddressMode AM; if (MatchAddress(N, AM)) @@ -927,7 +928,7 @@ if (ISD::isNON_EXTLoad(N.Val) && N.hasOneUse() && CanBeFoldedBy(N.Val, P.Val, P.Val)) -return SelectAddr(N.getOperand(1), Base, Scale, Index, Disp); +return SelectAddr(P, N.getOperand(1), Base, Scale, Index, Disp); return false; } @@ -1288,7 +1289,7 @@ case 'v': // not offsetable?? default: return true; case 'm': // memory -if (!SelectAddr(Op, Op0, Op1, Op2, Op3)) +if (!SelectAddr(Op, Op, Op0, Op1, Op2, Op3)) return true; break; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-comm
[llvm-commits] CVS: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp
Changes in directory llvm/lib/Target/Sparc: SparcISelDAGToDAG.cpp updated: 1.113 -> 1.114 --- Log message: Match tblegen changes. --- Diffs of the changes: (+7 -6) SparcISelDAGToDAG.cpp | 13 +++-- 1 files changed, 7 insertions(+), 6 deletions(-) Index: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp diff -u llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.113 llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.114 --- llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.113 Mon Oct 30 02:02:39 2006 +++ llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Wed Nov 8 14:33:40 2006 @@ -968,8 +968,9 @@ SDNode *Select(SDOperand Op); // Complex Pattern Selectors. - bool SelectADDRrr(SDOperand N, SDOperand &R1, SDOperand &R2); - bool SelectADDRri(SDOperand N, SDOperand &Base, SDOperand &Offset); + bool SelectADDRrr(SDOperand Op, SDOperand N, SDOperand &R1, SDOperand &R2); + bool SelectADDRri(SDOperand Op, SDOperand N, SDOperand &Base, +SDOperand &Offset); /// InstructionSelectBasicBlock - This callback is invoked by /// SelectionDAGISel when it has created a SelectionDAG for us to codegen. @@ -997,8 +998,8 @@ ScheduleAndEmitDAG(DAG); } -bool SparcDAGToDAGISel::SelectADDRri(SDOperand Addr, SDOperand &Base, - SDOperand &Offset) { +bool SparcDAGToDAGISel::SelectADDRri(SDOperand Op, SDOperand Addr, + SDOperand &Base, SDOperand &Offset) { if (FrameIndexSDNode *FIN = dyn_cast(Addr)) { Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32); Offset = CurDAG->getTargetConstant(0, MVT::i32); @@ -1038,8 +1039,8 @@ return true; } -bool SparcDAGToDAGISel::SelectADDRrr(SDOperand Addr, SDOperand &R1, - SDOperand &R2) { +bool SparcDAGToDAGISel::SelectADDRrr(SDOperand Op, SDOperand Addr, + SDOperand &R1, SDOperand &R2) { if (Addr.getOpcode() == ISD::FrameIndex) return false; if (Addr.getOpcode() == ISD::TargetExternalSymbol || Addr.getOpcode() == ISD::TargetGlobalAddress) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Reader.h
Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.203 -> 1.204 Reader.h updated: 1.35 -> 1.36 --- Log message: Bump the bytecode version number to 7. Implement upgrade of version 6 and version 6 bytecode. --- Diffs of the changes: (+106 -28) Reader.cpp | 110 + Reader.h | 24 + 2 files changed, 106 insertions(+), 28 deletions(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.203 llvm/lib/Bytecode/Reader/Reader.cpp:1.204 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.203 Wed Nov 8 00:47:33 2006 +++ llvm/lib/Bytecode/Reader/Reader.cpp Wed Nov 8 15:27:54 2006 @@ -574,7 +574,7 @@ // instruction generation should be used, but with the new Opcode value. // Instruction* -BytecodeReader::handleObsoleteOpcodes( +BytecodeReader::upgradeInstrOpcodes( unsigned &Opcode, ///< The old opcode, possibly updated by this function std::vector &Oprnds, ///< The operands to the instruction unsigned &iType,///< The type code from the bytecode file @@ -583,24 +583,53 @@ ) { // First, short circuit this if no conversion is required. When signless - // instructions were implemented the entire opcode sequence was revised so - // we key on this first which means that the opcode value read is the one - // we should use. - if (!hasSignlessInstructions) + // instructions were implemented the entire opcode sequence was revised in + // two stages: first Div/Rem became signed, then Shr/Cast/Setcc became + // signed. If all of these instructions are signed then we don't have to + // upgrade the opcode. + if (!hasSignlessDivRem && !hasSignlessShrCastSetcc) return 0; // The opcode is fine the way it is. + // If this is a bytecode format that did not include the unreachable + // instruction, bump up the opcode number to adjust it. + if (hasNoUnreachableInst) +if (Opcode >= 6 && Opcode < 62) + ++Opcode; + + // If this is bytecode version 6, that only had signed Rem and Div + // instructions, then we must compensate for those two instructions only. + // So that the switch statement below works, we're trying to turn this into + // a version 5 opcode. To do that we must adjust the opcode to 10 (Div) if its + // any of the UDiv, SDiv or FDiv instructions; or, adjust the opcode to + // 11 (Rem) if its any of the URem, SRem, or FRem instructions; or, simply + // decrement the instruction code if its beyond FRem. + if (!hasSignlessDivRem) { +// If its one of the signed Div/Rem opcodes, its fine the way it is +if (Opcode >= 10 && Opcode <= 12) // UDiv through FDiv + Opcode = 10; // Div +else if (Opcode >=13 && Opcode <= 15) // URem through FRem + Opcode = 11; // Rem +else if (Opcode >= 16 && Opcode <= 35) // And through Shr + // Adjust for new instruction codes + Opcode -= 4; +else if (Opcode >= 36 && Opcode <= 42) // Everything after Select + // In vers 6 bytecode we eliminated the placeholders for the obsolete + // VAARG and VANEXT instructions. Consequently those two slots were + // filled starting with Select (36) which was 34. So now we only need + // to subtract two. This circumvents hitting opcodes 32 and 33 + Opcode -= 2; +else { // Opcode < 10 or > 42 + // No upgrade necessary. + return 0; +} + } + // Declare the resulting instruction we might build. In general we just // change the Opcode argument but in a few cases we need to generate the // Instruction here because the upgrade case is significantly different from // the normal case. Instruction *Result = 0; - // If this is a bytecode format that did not include the unreachable - // instruction, bump up the opcode number to adjust it. - if (hasNoUnreachableInst) -if (Opcode >= Instruction::Unreachable && Opcode < 62) - ++Opcode; - // We're dealing with an upgrade situation. For each of the opcode values, // perform the necessary conversion. switch (Opcode) { @@ -899,7 +928,7 @@ // Make the necessary adjustments for dealing with backwards compatibility // of opcodes. Instruction* Result = -handleObsoleteOpcodes(Opcode, Oprnds, iType, InstTy, BB); +upgradeInstrOpcodes(Opcode, Oprnds, iType, InstTy, BB); // We have enough info to inform the handler now. if (Handler) @@ -1636,13 +1665,43 @@ // values used after ver 6. bytecode format. The operands are provided to the // function so that decisions based on the operand type can be made when // auto-upgrading obsolete opcodes to the new ones. -// NOTE: This code needs to be kept synchronized with handleObsoleteOpcodes. +// NOTE: This code needs to be kept synchronized with upgradeInstrOpcodes. // We can't use that function because of that functions argument requirements. // This function only deals with the subset of opcodes that are applicable to -// constant expressions and i
Re: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp RegAllocLinearScan.cpp
On Nov 8, 2006, at 9:24 AM, Bill Wendling wrote: > On 11/8/06, Jim Laskey <[EMAIL PROTECTED]> wrote: >> >> John, >> >> Both are defined on Darwin, FLT_MAX in float.h and HUGE_VALF in >> math.h. >> However, neither header seems to be based on a BSD header. I choose >> HUGE_VALF because it was also defined in the LINUX and FREEBSD math.h >> headers (seemed like confirmation to me.) I'll wait for Chris to >> make the >> call. (might uses a #ifndef HUGE_VALF thingame.) >> > Would it be possible to use std::numeric_limits::infinity in > instead? I think that had some other problems, it is broken in some version of GCC, IIRC. -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/Bytecode/ver6.ll ver6.ll.bc
Changes in directory llvm/test/Regression/Bytecode: ver6.ll added (r1.1) ver6.ll.bc added (r1.1) --- Log message: Ensure we don't regress on reading version 6 bytecode. --- Diffs of the changes: (+2 -0) ver6.ll|2 ++ ver6.ll.bc |0 2 files changed, 2 insertions(+) Index: llvm/test/Regression/Bytecode/ver6.ll diff -c /dev/null llvm/test/Regression/Bytecode/ver6.ll:1.1 *** /dev/null Wed Nov 8 15:28:40 2006 --- llvm/test/Regression/Bytecode/ver6.ll Wed Nov 8 15:28:30 2006 *** *** 0 --- 1,2 + ; Just see if we can disassemble the ver6.ll.bc bc file for upgrade purposes. + ; RUN: llvm-dis < %s.bc | llvm-as | llc -o /dev/null -f -march=c Index: llvm/test/Regression/Bytecode/ver6.ll.bc ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp
Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.280 -> 1.281 --- Log message: Divide select methods into groups by SelectionDAG node opcodes (ISD::ADD, X86ISD::CMP, etc.) instead of SDNode names (add, x86cmp, etc). We now allow multiple SDNodes to map to the same SelectionDAG node (e.g. store, indexed store). --- Diffs of the changes: (+35 -46) DAGISelEmitter.cpp | 81 ++--- 1 files changed, 35 insertions(+), 46 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.280 llvm/utils/TableGen/DAGISelEmitter.cpp:1.281 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.280Wed Nov 8 14:31:10 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Wed Nov 8 17:01:03 2006 @@ -3374,19 +3374,16 @@ OS << std::string(Indent-2, ' ') << "}\n"; } +static std::string getOpcodeName(Record *Op, DAGISelEmitter &ISE) { + const SDNodeInfo &OpcodeInfo = ISE.getSDNodeInfo(Op); + return OpcodeInfo.getEnumName(); +} - -namespace { - /// CompareByRecordName - An ordering predicate that implements less-than by - /// comparing the names records. - struct CompareByRecordName { -bool operator()(const Record *LHS, const Record *RHS) const { - // Sort by name first. - if (LHS->getName() < RHS->getName()) return true; - // If both names are equal, sort by pointer. - return LHS->getName() == RHS->getName() && LHS < RHS; -} - }; +static std::string getLegalCName(std::string OpName) { + std::string::size_type pos = OpName.find("::"); + if (pos != std::string::npos) +OpName.replace(pos, 2, "_"); + return OpName; } void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { @@ -3394,23 +3391,25 @@ if (!InstNS.empty()) InstNS += "::"; // Group the patterns by their top-level opcodes. - std::map, -CompareByRecordName> PatternsByOpcode; + std::map > PatternsByOpcode; // All unique target node emission functions. std::map EmitFunctions; for (unsigned i = 0, e = PatternsToMatch.size(); i != e; ++i) { TreePatternNode *Node = PatternsToMatch[i].getSrcPattern(); if (!Node->isLeaf()) { - PatternsByOpcode[Node->getOperator()].push_back(&PatternsToMatch[i]); + PatternsByOpcode[getOpcodeName(Node->getOperator(), *this)]. +push_back(&PatternsToMatch[i]); } else { const ComplexPattern *CP; if (dynamic_cast(Node->getLeafValue())) { -PatternsByOpcode[getSDNodeNamed("imm")].push_back(&PatternsToMatch[i]); +PatternsByOpcode[getOpcodeName(getSDNodeNamed("imm"), *this)]. + push_back(&PatternsToMatch[i]); } else if ((CP = NodeGetComplexPattern(Node, *this))) { std::vector OpNodes = CP->getRootNodes(); for (unsigned j = 0, e = OpNodes.size(); j != e; j++) { - PatternsByOpcode[OpNodes[j]] -.insert(PatternsByOpcode[OpNodes[j]].begin(), &PatternsToMatch[i]); + PatternsByOpcode[getOpcodeName(OpNodes[j], *this)] +.insert(PatternsByOpcode[getOpcodeName(OpNodes[j], *this)].begin(), +&PatternsToMatch[i]); } } else { std::cerr << "Unrecognized opcode '"; @@ -3432,11 +3431,10 @@ // Emit one Select_* method for each top-level opcode. We do this instead of // emitting one giant switch statement to support compilers where this will // result in the recursive functions taking less stack space. - for (std::map, - CompareByRecordName>::iterator PBOI = PatternsByOpcode.begin(), - E = PatternsByOpcode.end(); PBOI != E; ++PBOI) { -const std::string &OpName = PBOI->first->getName(); -const SDNodeInfo &OpcodeInfo = getSDNodeInfo(PBOI->first); + for (std::map >::iterator + PBOI = PatternsByOpcode.begin(), E = PatternsByOpcode.end(); + PBOI != E; ++PBOI) { +const std::string &OpName = PBOI->first; std::vector &PatternsOfOp = PBOI->second; assert(!PatternsOfOp.empty() && "No patterns but map has entry?"); @@ -3451,8 +3449,6 @@ for (unsigned i = 0, e = PatternsOfOp.size(); i != e; ++i) { PatternToMatch *Pat = PatternsOfOp[i]; TreePatternNode *SrcPat = Pat->getSrcPattern(); - if (OpcodeInfo.getNumResults() == 0 && SrcPat->getNumChildren() > 0) -SrcPat = SrcPat->getChild(0); MVT::ValueType VT = SrcPat->getTypeNum(0); std::map >::iterator TI = PatternsByType.find(VT); @@ -3595,7 +3591,8 @@ } else OpVTI->second.push_back(OpVTStr); - OS << "SDNode *Select_" << OpName << (OpVTStr != "" ? "_" : "") + OS << "SDNode *Select_" << getLegalCName(OpName) + << (OpVTStr != "" ? "_" : "") << OpVTStr << "(const SDOperand &N) {\n"; // Loop through and reverse all of the CodeList vectors, as we will be @@ -3616,9 +3613,9 @@ // catch the case where nothing handles a pattern. if (mightNotMatch) { OS << " std::ce
[llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp
Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.127 -> 1.128 --- Log message: Bump the bytecode version number to 7. Implement upgrade of version 6 and version 6 bytecode. --- Diffs of the changes: (+1 -1) Writer.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.127 llvm/lib/Bytecode/Writer/Writer.cpp:1.128 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.127 Thu Nov 2 14:25:49 2006 +++ llvm/lib/Bytecode/Writer/Writer.cpp Wed Nov 8 15:27:54 2006 @@ -40,7 +40,7 @@ /// so that the reader can distinguish which format of the bytecode file has /// been written. /// @brief The bytecode version number -const unsigned BCVersionNum = 6; +const unsigned BCVersionNum = 7; static RegisterPass X("emitbytecode", "Bytecode Writer"); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CFrontend/2006-09-28-SimpleAsm.c
Changes in directory llvm/test/Regression/CFrontend: 2006-09-28-SimpleAsm.c updated: 1.1 -> 1.2 --- Log message: Should be xfailed for llvmgcc3 --- Diffs of the changes: (+1 -0) 2006-09-28-SimpleAsm.c |1 + 1 files changed, 1 insertion(+) Index: llvm/test/Regression/CFrontend/2006-09-28-SimpleAsm.c diff -u llvm/test/Regression/CFrontend/2006-09-28-SimpleAsm.c:1.1 llvm/test/Regression/CFrontend/2006-09-28-SimpleAsm.c:1.2 --- llvm/test/Regression/CFrontend/2006-09-28-SimpleAsm.c:1.1 Thu Sep 28 13:58:02 2006 +++ llvm/test/Regression/CFrontend/2006-09-28-SimpleAsm.c Wed Nov 8 17:26:16 2006 @@ -1,6 +1,7 @@ // RUN: %llvmgcc %s -S -o /dev/null && // RUN: %llvmgcc %s -S -o - | grep 'ext: xorl %eax, eax; movl' && // RUN: %llvmgcc %s -S -o - | grep 'nonext: xorl %eax, %eax; mov' +// XFAIL: llvmgcc3 // PR924 void bar() { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm/test/Regression/CFrontend/2006-09-28-SimpleAsm.c
Changes in directory llvm/test/Regression/CFrontend: 2006-09-28-SimpleAsm.c updated: 1.1 -> 1.1.4.1 --- Log message: Merging from mainline --- Diffs of the changes: (+1 -0) 2006-09-28-SimpleAsm.c |1 + 1 files changed, 1 insertion(+) Index: llvm/test/Regression/CFrontend/2006-09-28-SimpleAsm.c diff -u llvm/test/Regression/CFrontend/2006-09-28-SimpleAsm.c:1.1 llvm/test/Regression/CFrontend/2006-09-28-SimpleAsm.c:1.1.4.1 --- llvm/test/Regression/CFrontend/2006-09-28-SimpleAsm.c:1.1 Thu Sep 28 13:58:02 2006 +++ llvm/test/Regression/CFrontend/2006-09-28-SimpleAsm.c Wed Nov 8 17:27:54 2006 @@ -1,6 +1,7 @@ // RUN: %llvmgcc %s -S -o /dev/null && // RUN: %llvmgcc %s -S -o - | grep 'ext: xorl %eax, eax; movl' && // RUN: %llvmgcc %s -S -o - | grep 'nonext: xorl %eax, %eax; mov' +// XFAIL: llvmgcc3 // PR924 void bar() { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_19] CVS: llvm/test/Regression/C++Frontend/2003-11-02-WeakLinkage.cpp.tr
Changes in directory llvm/test/Regression/C++Frontend: 2003-11-02-WeakLinkage.cpp.tr updated: 1.2 -> 1.2.2.1 --- Log message: Merging from mainline --- Diffs of the changes: (+1 -1) 2003-11-02-WeakLinkage.cpp.tr |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/C++Frontend/2003-11-02-WeakLinkage.cpp.tr diff -u llvm/test/Regression/C++Frontend/2003-11-02-WeakLinkage.cpp.tr:1.2 llvm/test/Regression/C++Frontend/2003-11-02-WeakLinkage.cpp.tr:1.2.2.1 --- llvm/test/Regression/C++Frontend/2003-11-02-WeakLinkage.cpp.tr:1.2 Sun Nov 5 17:27:36 2006 +++ llvm/test/Regression/C++Frontend/2003-11-02-WeakLinkage.cpp.tr Wed Nov 8 17:27:39 2006 @@ -1,5 +1,5 @@ // RUN: %llvmgcc -xc++ -S -o - %s | not grep weak -// XFAIL: * +// XFAIL: llvmgcc4 template void thefunc(); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/C++Frontend/2003-11-02-WeakLinkage.cpp.tr
Changes in directory llvm/test/Regression/C++Frontend: 2003-11-02-WeakLinkage.cpp.tr updated: 1.2 -> 1.3 --- Log message: Should be xfailed for llvmgcc4 and NOT *. * means all platforms regardless of what llvmgcc you use. --- Diffs of the changes: (+1 -1) 2003-11-02-WeakLinkage.cpp.tr |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/C++Frontend/2003-11-02-WeakLinkage.cpp.tr diff -u llvm/test/Regression/C++Frontend/2003-11-02-WeakLinkage.cpp.tr:1.2 llvm/test/Regression/C++Frontend/2003-11-02-WeakLinkage.cpp.tr:1.3 --- llvm/test/Regression/C++Frontend/2003-11-02-WeakLinkage.cpp.tr:1.2 Sun Nov 5 17:27:36 2006 +++ llvm/test/Regression/C++Frontend/2003-11-02-WeakLinkage.cpp.tr Wed Nov 8 17:25:58 2006 @@ -1,5 +1,5 @@ // RUN: %llvmgcc -xc++ -S -o - %s | not grep weak -// XFAIL: * +// XFAIL: llvmgcc4 template void thefunc(); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/findmisopt
Changes in directory llvm/utils: findmisopt added (r1.1) --- Log message: Add a utility script to find a mis-optimization problem. This sometimes helps when bugpoint can't find the problem directly because it needs the set of optimizations that cause the program to fail. --- Diffs of the changes: (+125 -0) findmisopt | 125 + 1 files changed, 125 insertions(+) Index: llvm/utils/findmisopt diff -c /dev/null llvm/utils/findmisopt:1.1 *** /dev/null Wed Nov 8 18:26:27 2006 --- llvm/utils/findmisopt Wed Nov 8 18:26:17 2006 *** *** 0 --- 1,125 + #!/bin/bash + # + # findmisopt + # + # This is a quick and dirty hack to potentially find a misoptimization + # problem. Mostly its to work around problems in bugpoint that prevent + # it from finding a problem unless the set of failing optimizations are + # known and given to it on the command line. + # + # Given a bytecode file that produces correct output (or return code), + # this script will run through all the optimizations passes that gccas + # uses (in the same order) and will narrow down which optimizations + # cause the program either generate different output or return a + # different result code. When the passes have been narrowed down, + # bugpoint is invoked to further refine the problem to its origin. + # + # Usage: + # findmisopt bcfile outdir progargs [match] + # + # Where: + # bcfile + # is the bytecode file input (the unoptimized working case) + # outdir + # is a directory into which intermediate results are placed + # progargs + # is a single argument containing all the arguments the program needs + # match + # if specified to any value causes the result code of the program to + # be used to determine success/fail. If not specified success/fail is + # determined by diffing the program's output with the non-optimized + # output. + # + bcfile="$1" + outdir="$2" + args="$3" + match="$4" + name=`basename $bcfile .bc` + ll="$outdir/${name}.ll" + s="$outdir/${name}.s" + prog="$outdir/${name}" + out="$outdir/${name}.out" + optbc="$outdir/${name}.opt.bc" + optll="$outdir/${name}.opt.ll" + opts="$outdir/${name}.opt.s" + optprog="$outdir/${name}.opt" + optout="$outdir/${name}.opt.out" + + echo "Test Name: $name" + echo "Unoptimized program: $prog" + echo " Optimized program: $optprog" + + + # Generate the disassembly + llvm-dis "$bcfile" -o "$ll" -f || exit 1 + + # Generate the non-optimized program + llc "$bcfile" -o "$s" -f || exit 1 + gcc "$s" -o "$prog" || exit 1 + + # Define the list of optimizations to run + all_switches="-verify -lowersetjmp -funcresolve -raiseallocs -simplifycfg -mem2reg -globalopt -globaldce -ipconstprop -deadargelim -instcombine -simplifycfg -prune-eh -inline -simplify-libcalls -argpromotion -raise -tailduplicate -simplifycfg -scalarrepl -instcombine -predsimplify -condprop -tailcallelim -simplifycfg -reassociate -licm -loop-unswitch -instcombine -indvars -loop-unroll -instcombine -load-vn -gcse -sccp -instcombine -condprop -dse -dce -simplifycfg -deadtypeelim -constmerge" + + # Current set of switches is empty + function tryit { + switches_to_use="$1" + opt $switches_to_use "$bcfile" -o "$optbc" -f || exit + llvm-dis "$optbc" -o "$optll" -f || exit + llc "$optbc" -o "$opts" -f || exit + gcc "$opts" -o "$optprog" || exit + "$prog" $args > "$out" + ex1=$? + "$optprog" $args > "$optout" + ex2=$? + + if [ -n "$match" ] ; then + if [ "$ex1" -ne "$ex2" ] ; then + echo "Return code not the same with these switches:" + echo $switches + echo "Unoptimized returned: $ex1" + echo "Optimized returned: $ex2" + return 0 + fi + else + diff "$out" "$optout" > /dev/null + if [ $? -ne 0 ] ; then + echo "Diff fails with these switches:" + echo $switches + echo "Differences:" + diff "$out" "$optout" + return 0; + fi + fi + return 1 + } + + for sw in $all_switches ; do + switches="$switches $sw" + if tryit "$switches" ; then + break; + fi + done + + final="" + while [ ! -z "$switches" ] ; do + trimmed=`echo "$switches" | sed -e 's/^ *\(-[^ ]*\).*/\1/'` + switches=`echo "$switches" | sed -e 's/^ *-[^ ]* *//'` + echo "Trimmed $trimmed from left" + tryit "$final $switches" + if [ "$?" -eq "0" ] ; then + echo "Still Failing .. continuing ..." + continue + else + echo "Found required early pass: $trimmed" + final="$final $trimmed" + continue + fi + echo "Next Loop" + done + + echo "Smallest Optimization list= $final" + bpcmd="bugpoint -run-llc --output "$out" --input /dev/null $bcfile $final --args $args" + + echo "Running: $bpcmd" + $bpcmd + echo "Finished." ___ llvm-commits mailing list
[llvm-commits] CVS: llvm/utils/findmisopt
Changes in directory llvm/utils: findmisopt updated: 1.1 -> 1.2 --- Log message: Print a usage message if too few arguments to program. --- Diffs of the changes: (+5 -0) findmisopt |5 + 1 files changed, 5 insertions(+) Index: llvm/utils/findmisopt diff -u llvm/utils/findmisopt:1.1 llvm/utils/findmisopt:1.2 --- llvm/utils/findmisopt:1.1 Wed Nov 8 18:26:17 2006 +++ llvm/utils/findmisopt Wed Nov 8 18:50:32 2006 @@ -30,6 +30,11 @@ # determined by diffing the program's output with the non-optimized # output. # +if [ "$#" -lt 3 ] ; then + echo "usage: findmisopt bcfile outdir progargs [match]" + exit 1 +fi + bcfile="$1" outdir="$2" args="$3" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/TargetSelectionDAG.td
Changes in directory llvm/lib/Target: TargetSelectionDAG.td updated: 1.74 -> 1.75 --- Log message: Added indexed store node and patfrag's. --- Diffs of the changes: (+131 -11) TargetSelectionDAG.td | 142 ++ 1 files changed, 131 insertions(+), 11 deletions(-) Index: llvm/lib/Target/TargetSelectionDAG.td diff -u llvm/lib/Target/TargetSelectionDAG.td:1.74 llvm/lib/Target/TargetSelectionDAG.td:1.75 --- llvm/lib/Target/TargetSelectionDAG.td:1.74 Thu Oct 26 16:55:50 2006 +++ llvm/lib/Target/TargetSelectionDAG.td Wed Nov 8 17:02:11 2006 @@ -164,6 +164,10 @@ SDTCisPtrTy<1> ]>; +def SDTIStore : SDTypeProfile<1, 3, [ // indexed store + SDTCisSameAs<0, 2>, SDTCisPtrTy<0>, SDTCisPtrTy<3> +]>; + def SDTVecShuffle : SDTypeProfile<1, 3, [ SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>, SDTCisIntVectorOfSameSize<3, 0> ]>; @@ -299,6 +303,7 @@ // and truncst (see below). def ld : SDNode<"ISD::LOAD" , SDTLoad, [SDNPHasChain]>; def st : SDNode<"ISD::STORE" , SDTStore, [SDNPHasChain]>; +def ist: SDNode<"ISD::STORE" , SDTIStore, [SDNPHasChain]>; def vector_shuffle : SDNode<"ISD::VECTOR_SHUFFLE", SDTVecShuffle, []>; def build_vector : SDNode<"ISD::BUILD_VECTOR", SDTypeProfile<1, 0, []>, []>; @@ -505,38 +510,153 @@ // store fragments. def store : PatFrag<(ops node:$val, node:$ptr), (st node:$val, node:$ptr), [{ - return ISD::isNON_TRUNCStore(N); + if (StoreSDNode *ST = dyn_cast(N)) +return !ST->isTruncatingStore(); + return false; }]>; // truncstore fragments. def truncstorei1 : PatFrag<(ops node:$val, node:$ptr), (st node:$val, node:$ptr), [{ - if (ISD::isTRUNCStore(N)) -return cast(N)->getStoredVT() == MVT::i1; + if (StoreSDNode *ST = dyn_cast(N)) +return ST->isTruncatingStore() && ST->getStoredVT() == MVT::i1; return false; }]>; def truncstorei8 : PatFrag<(ops node:$val, node:$ptr), (st node:$val, node:$ptr), [{ - if (ISD::isTRUNCStore(N)) -return cast(N)->getStoredVT() == MVT::i8; + if (StoreSDNode *ST = dyn_cast(N)) +return ST->isTruncatingStore() && ST->getStoredVT() == MVT::i8; return false; }]>; def truncstorei16 : PatFrag<(ops node:$val, node:$ptr), (st node:$val, node:$ptr), [{ - if (ISD::isTRUNCStore(N)) -return cast(N)->getStoredVT() == MVT::i16; + if (StoreSDNode *ST = dyn_cast(N)) +return ST->isTruncatingStore() && ST->getStoredVT() == MVT::i16; return false; }]>; def truncstorei32 : PatFrag<(ops node:$val, node:$ptr), (st node:$val, node:$ptr), [{ - if (ISD::isTRUNCStore(N)) -return cast(N)->getStoredVT() == MVT::i32; + if (StoreSDNode *ST = dyn_cast(N)) +return ST->isTruncatingStore() && ST->getStoredVT() == MVT::i32; return false; }]>; def truncstoref32 : PatFrag<(ops node:$val, node:$ptr), (st node:$val, node:$ptr), [{ - if (ISD::isTRUNCStore(N)) -return cast(N)->getStoredVT() == MVT::f32; + if (StoreSDNode *ST = dyn_cast(N)) +return ST->isTruncatingStore() && ST->getStoredVT() == MVT::f32; + return false; +}]>; + +// indexed store fragments. +def pre_store : PatFrag<(ops node:$val, node:$base, node:$offset), +(ist node:$val, node:$base, node:$offset), [{ + if (StoreSDNode *ST = dyn_cast(N)) { +ISD::MemOpAddrMode AM = ST->getAddressingMode(); +return (AM == ISD::PRE_INC || AM == ISD::PRE_DEC) && + !ST->isTruncatingStore(); + } + return false; +}]>; + +def pre_truncsti1 : PatFrag<(ops node:$val, node:$base, node:$offset), +(ist node:$val, node:$base, node:$offset), [{ + if (StoreSDNode *ST = dyn_cast(N)) { +ISD::MemOpAddrMode AM = ST->getAddressingMode(); +return (AM == ISD::PRE_INC || AM == ISD::PRE_DEC) && + ST->isTruncatingStore() && ST->getStoredVT() == MVT::i1; + } + return false; +}]>; +def pre_truncsti8 : PatFrag<(ops node:$val, node:$base, node:$offset), +(ist node:$val, node:$base, node:$offset), [{ + if (StoreSDNode *ST = dyn_cast(N)) { +ISD::MemOpAddrMode AM = ST->getAddressingMode(); +return (AM == ISD::PRE_INC || AM == ISD::PRE_DEC) && + ST->isTruncatingStore() && ST->getStoredVT() == MVT::i8; + } + return false; +}]>; +def pre_truncsti16 : PatFrag<(ops node:$val, node:$base, node:$offset), + (ist node:$val, node:$base, node:$offset), [{ + if (StoreSDNode *ST = dyn_cast(N)) { +ISD::MemOpAddrMode AM = ST->getAddressingMode(); +return (AM == ISD::PRE_INC || AM == ISD::PRE_DEC) && + ST->isTruncatingStore() && ST->getStoredVT() == MVT::i16; + } + return false; +}]>; +def pre_truncsti32 : PatFrag<(ops node:$val, node:$base, node:$offset), + (ist node:$val, node:$base, node:$offset), [{ + if (StoreSDNode *ST = dyn_cast(N)) {
[llvm-commits] CVS: llvm/utils/findmisopt
Changes in directory llvm/utils: findmisopt updated: 1.2 -> 1.3 --- Log message: Don't run bugpoint if we can't find a misoptimization. --- Diffs of the changes: (+6 -2) findmisopt |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) Index: llvm/utils/findmisopt diff -u llvm/utils/findmisopt:1.2 llvm/utils/findmisopt:1.3 --- llvm/utils/findmisopt:1.2 Wed Nov 8 18:50:32 2006 +++ llvm/utils/findmisopt Wed Nov 8 19:47:04 2006 @@ -122,9 +122,13 @@ echo "Next Loop" done -echo "Smallest Optimization list= $final" +if [ "$final" == " $all_switches" ] ; then + echo "findmisopt: Can't find a set of optimizations that make it fail" + exit 0 +fi +echo "Smallest Optimization list=$final" bpcmd="bugpoint -run-llc --output "$out" --input /dev/null $bcfile $final --args $args" echo "Running: $bpcmd" $bpcmd -echo "Finished." +echo "findmisopt finished." ___ 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/TargetInstrInfo.h
Changes in directory llvm/include/llvm/Target: TargetInstrInfo.h updated: 1.104 -> 1.105 --- Log message: Remove M_2_ADDR_FLAG. --- Diffs of the changes: (+7 -13) TargetInstrInfo.h | 20 +++- 1 files changed, 7 insertions(+), 13 deletions(-) Index: llvm/include/llvm/Target/TargetInstrInfo.h diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.104 llvm/include/llvm/Target/TargetInstrInfo.h:1.105 --- llvm/include/llvm/Target/TargetInstrInfo.h:1.104Mon Nov 6 17:53:08 2006 +++ llvm/include/llvm/Target/TargetInstrInfo.h Wed Nov 8 20:20:58 2006 @@ -52,37 +52,34 @@ const unsigned M_LOAD_FLAG = 1 << 5; const unsigned M_STORE_FLAG= 1 << 6; -// M_2_ADDR_FLAG - 3-addr instructions which really work like 2-addr ones. -const unsigned M_2_ADDR_FLAG = 1 << 7; - -// M_CONVERTIBLE_TO_3_ADDR - This is a M_2_ADDR_FLAG instruction which can be +// M_CONVERTIBLE_TO_3_ADDR - This is a 2-address instruction which can be // changed into a 3-address instruction if the first two operands cannot be // assigned to the same register. The target must implement the // TargetInstrInfo::convertToThreeAddress method for this instruction. -const unsigned M_CONVERTIBLE_TO_3_ADDR = 1 << 8; +const unsigned M_CONVERTIBLE_TO_3_ADDR = 1 << 7; // This M_COMMUTABLE - is a 2- or 3-address instruction (of the form X = op Y, // Z), which produces the same result if Y and Z are exchanged. -const unsigned M_COMMUTABLE= 1 << 9; +const unsigned M_COMMUTABLE= 1 << 8; // M_TERMINATOR_FLAG - Is this instruction part of the terminator for a basic // block? Typically this is things like return and branch instructions. // Various passes use this to insert code into the bottom of a basic block, but // before control flow occurs. -const unsigned M_TERMINATOR_FLAG = 1 << 10; +const unsigned M_TERMINATOR_FLAG = 1 << 9; // M_USES_CUSTOM_DAG_SCHED_INSERTION - Set if this instruction requires custom // insertion support when the DAG scheduler is inserting it into a machine basic // block. -const unsigned M_USES_CUSTOM_DAG_SCHED_INSERTION = 1 << 11; +const unsigned M_USES_CUSTOM_DAG_SCHED_INSERTION = 1 << 10; // M_VARIABLE_OPS - Set if this instruction can have a variable number of extra // operands in addition to the minimum number operands specified. -const unsigned M_VARIABLE_OPS = 1 << 12; +const unsigned M_VARIABLE_OPS = 1 << 11; // M_PREDICATED - Set if this instruction has a predicate that controls its // execution. -const unsigned M_PREDICATED = 1 << 13; +const unsigned M_PREDICATED = 1 << 12; // Machine operand flags @@ -184,9 +181,6 @@ return get(Opcode).Flags & M_RET_FLAG; } - bool isTwoAddrInstr(MachineOpCode Opcode) const { -return get(Opcode).Flags & M_2_ADDR_FLAG; - } bool isPredicated(MachineOpCode Opcode) const { return get(Opcode).Flags & M_PREDICATED; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/TableGen/InstrInfoEmitter.cpp
Changes in directory llvm/utils/TableGen: InstrInfoEmitter.cpp updated: 1.50 -> 1.51 --- Log message: Remove M_2_ADDR_FLAG. --- Diffs of the changes: (+0 -1) InstrInfoEmitter.cpp |1 - 1 files changed, 1 deletion(-) Index: llvm/utils/TableGen/InstrInfoEmitter.cpp diff -u llvm/utils/TableGen/InstrInfoEmitter.cpp:1.50 llvm/utils/TableGen/InstrInfoEmitter.cpp:1.51 --- llvm/utils/TableGen/InstrInfoEmitter.cpp:1.50 Mon Nov 6 17:53:31 2006 +++ llvm/utils/TableGen/InstrInfoEmitter.cppWed Nov 8 20:21:31 2006 @@ -232,7 +232,6 @@ if (Inst.isCall) OS << "|M_CALL_FLAG"; if (Inst.isLoad) OS << "|M_LOAD_FLAG"; if (Inst.isStore || isStore) OS << "|M_STORE_FLAG"; - if (Inst.isTwoAddress) OS << "|M_2_ADDR_FLAG"; if (Inst.isPredicated) OS << "|M_PREDICATED"; if (Inst.isConvertibleToThreeAddress) OS << "|M_CONVERTIBLE_TO_3_ADDR"; if (Inst.isCommutable) OS << "|M_COMMUTABLE"; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
Changes in directory llvm/lib/CodeGen: TwoAddressInstructionPass.cpp updated: 1.39 -> 1.40 --- Log message: Remove M_2_ADDR_FLAG. --- Diffs of the changes: (+0 -2) TwoAddressInstructionPass.cpp |2 -- 1 files changed, 2 deletions(-) Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.39 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.40 --- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.39 Wed Nov 1 17:06:55 2006 +++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Wed Nov 8 20:22:15 2006 @@ -191,8 +191,6 @@ mbbi->erase(mi); // Nuke the old inst. mi = New; ++NumConvertedTo3Addr; -assert(!TII.isTwoAddrInstr(New->getOpcode()) && - "convertToThreeAddress returned a 2-addr instruction??"); // Done with this instruction. break; } ___ 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/X86CodeEmitter.cpp X86RegisterInfo.cpp
Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.120 -> 1.121 X86RegisterInfo.cpp updated: 1.172 -> 1.173 --- Log message: Remove M_2_ADDR_FLAG. --- Diffs of the changes: (+9 -5) X86CodeEmitter.cpp |7 +-- X86RegisterInfo.cpp |7 --- 2 files changed, 9 insertions(+), 5 deletions(-) Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.120 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.121 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.120Wed Sep 13 14:07:28 2006 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Wed Nov 8 20:22:54 2006 @@ -470,7 +470,8 @@ REX |= 1 << 3; if (MI.getNumOperands()) { -bool isTwoAddr = (Desc.Flags & M_2_ADDR_FLAG) != 0; +bool isTwoAddr = II->getNumOperands(Opcode) > 1 && + II->getOperandConstraint(Opcode, 1, TargetInstrInfo::TIED_TO) != -1; // If it accesses SPL, BPL, SIL, or DIL, then it requires a 0x40 REX prefix. bool isTrunc8 = isX86_64TruncToByte(Opcode); @@ -607,7 +608,9 @@ // If this is a two-address instruction, skip one of the register operands. unsigned CurOp = 0; - CurOp += (Desc.Flags & M_2_ADDR_FLAG) != 0; + if (II->getNumOperands(Opcode) > 1 && + II->getOperandConstraint(Opcode, 1, TargetInstrInfo::TIED_TO) != -1) +CurOp++; unsigned char BaseOpcode = II->getBaseOpcodeFor(Opcode); switch (Desc.TSFlags & X86II::FormMask) { Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.172 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.173 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.172 Thu Nov 2 20:08:41 2006 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Wed Nov 8 20:22:54 2006 @@ -284,14 +284,15 @@ const TableEntry *OpcodeTablePtr = NULL; unsigned OpcodeTableSize = 0; bool isTwoAddrFold = false; + bool isTwoAddr = TII.getNumOperands(MI->getOpcode()) > 1 && +TII.getOperandConstraint(MI->getOpcode(), 1,TargetInstrInfo::TIED_TO) != -1; // Folding a memory location into the two-address part of a two-address // instruction is different than folding it other places. It requires // replacing the *two* registers with the memory location. - if (MI->getNumOperands() >= 2 && MI->getOperand(0).isReg() && + if (isTwoAddr && MI->getNumOperands() >= 2 && MI->getOperand(0).isReg() && MI->getOperand(1).isReg() && i < 2 && - MI->getOperand(0).getReg() == MI->getOperand(1).getReg() && - TII.isTwoAddrInstr(MI->getOpcode())) { + MI->getOperand(0).getReg() == MI->getOperand(1).getReg()) { static const TableEntry OpcodeTable[] = { { X86::ADC32ri, X86::ADC32mi }, { X86::ADC32ri8,X86::ADC32mi8 }, ___ 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.87 -> 1.88 --- Log message: getPostIndexedAddressParts change: passes in load/store instead of its loaded / stored VT. --- Diffs of the changes: (+1 -1) TargetLowering.h |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Target/TargetLowering.h diff -u llvm/include/llvm/Target/TargetLowering.h:1.87 llvm/include/llvm/Target/TargetLowering.h:1.88 --- llvm/include/llvm/Target/TargetLowering.h:1.87 Tue Nov 7 03:04:16 2006 +++ llvm/include/llvm/Target/TargetLowering.h Wed Nov 8 22:29:09 2006 @@ -385,7 +385,7 @@ /// getPostIndexedAddressParts - returns true by value, base pointer and /// offset pointer and addressing mode by reference if this node can be /// combined with a load / store to form a post-indexed load / store. - virtual bool getPostIndexedAddressParts(SDNode *N, MVT::ValueType VT, + virtual bool getPostIndexedAddressParts(SDNode *N, SDNode *Op, SDOperand &Base, SDOperand &Offset, ISD::MemOpAddrMode &AM, SelectionDAG &DAG) { ___ 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/DAGCombiner.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.244 -> 1.245 --- Log message: getPostIndexedAddressParts change: passes in load/store instead of its loaded / stored VT. --- Diffs of the changes: (+1 -3) DAGCombiner.cpp |4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.244 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.245 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.244 Wed Nov 8 14:27:27 2006 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Nov 8 22:29:46 2006 @@ -282,10 +282,8 @@ MVT::ValueType VT; if (LoadSDNode *LD = dyn_cast(N)) { Ptr = LD->getBasePtr(); -VT = LD->getLoadedVT(); } else if (StoreSDNode *ST = dyn_cast(N)) { Ptr = ST->getBasePtr(); -VT = ST->getStoredVT(); isLoad = false; } else return false; @@ -301,7 +299,7 @@ SDOperand BasePtr; SDOperand Offset; ISD::MemOpAddrMode AM = ISD::UNINDEXED; - if (TLI.getPostIndexedAddressParts(Op, VT, BasePtr, Offset, AM,DAG)) { + if (TLI.getPostIndexedAddressParts(N, Op, BasePtr, Offset, AM,DAG)) { if (Ptr == Offset) std::swap(BasePtr, Offset); if (Ptr != BasePtr) ___ 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/InstCombine/add.ll shift-sra.ll
Changes in directory llvm/test/Regression/Transforms/InstCombine: add.ll updated: 1.30 -> 1.31 shift-sra.ll updated: 1.2 -> 1.3 --- Log message: new testcases --- Diffs of the changes: (+24 -2) add.ll | 13 + shift-sra.ll | 13 +++-- 2 files changed, 24 insertions(+), 2 deletions(-) Index: llvm/test/Regression/Transforms/InstCombine/add.ll diff -u llvm/test/Regression/Transforms/InstCombine/add.ll:1.30 llvm/test/Regression/Transforms/InstCombine/add.ll:1.31 --- llvm/test/Regression/Transforms/InstCombine/add.ll:1.30 Sun Mar 5 17:53:04 2006 +++ llvm/test/Regression/Transforms/InstCombine/add.ll Wed Nov 8 23:11:23 2006 @@ -227,3 +227,16 @@ %D = sub int %C, 16 ret int %D } + +ubyte %test33(ubyte %A) { ;; OR A, 1 +%B = and ubyte %A, 254 +%C = add ubyte %B, 1 +ret ubyte %C +} + +ubyte %test34(ubyte %A) { +%B = add ubyte %A, 64 ;; dead +%C = and ubyte %B, 12 +ret ubyte %C +} + Index: llvm/test/Regression/Transforms/InstCombine/shift-sra.ll diff -u llvm/test/Regression/Transforms/InstCombine/shift-sra.ll:1.2 llvm/test/Regression/Transforms/InstCombine/shift-sra.ll:1.3 --- llvm/test/Regression/Transforms/InstCombine/shift-sra.ll:1.2Wed Nov 8 00:47:33 2006 +++ llvm/test/Regression/Transforms/InstCombine/shift-sra.llWed Nov 8 23:11:23 2006 @@ -1,8 +1,17 @@ ; RUN: llvm-as < %s | opt -instcombine -disable-output && -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'lshr int' +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'lshr int' | wc -l | grep 2 && +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep ashr -int %test0(int %X, ubyte %A) { +int %test1(int %X, ubyte %A) { %Y = shr int %X, ubyte %A ; can be logical shift. %Z = and int %Y, 1 ret int %Z } + +int %test2(ubyte %tmp) { +%tmp3 = cast ubyte %tmp to int +%tmp4 = add int %tmp3, 7 +%tmp5 = ashr int %tmp4, ubyte 3 ; lshr +ret int %tmp5 +} + ___ 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.540 -> 1.541 --- Log message: Teach ShrinkDemandedConstant how to handle X+C. This implements: add.ll:test33, add.ll:test34, shift-sra.ll:test2 --- Diffs of the changes: (+100 -1) InstructionCombining.cpp | 101 ++- 1 files changed, 100 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.540 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.541 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.540 Wed Nov 8 13:42:28 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Nov 8 23:12:27 2006 @@ -1117,6 +1117,97 @@ } break; } + case Instruction::Add: +// If there is a constant on the RHS, there are a variety of xformations +// we can do. +if (ConstantInt *RHS = dyn_cast(I->getOperand(1))) { + // If null, this should be simplified elsewhere. Some of the xforms here + // won't work if the RHS is zero. + if (RHS->isNullValue()) +break; + + // Figure out what the input bits are. If the top bits of the and result + // are not demanded, then the add doesn't demand them from its input + // either. + + // Shift the demanded mask up so that it's at the top of the uint64_t. + unsigned BitWidth = I->getType()->getPrimitiveSizeInBits(); + unsigned NLZ = CountLeadingZeros_64(DemandedMask << (64-BitWidth)); + + // If the top bit of the output is demanded, demand everything from the + // input. Otherwise, we demand all the input bits except NLZ top bits. + uint64_t InDemandedBits = ~0ULL >> 64-BitWidth+NLZ; + + // Find information about known zero/one bits in the input. + if (SimplifyDemandedBits(I->getOperand(0), InDemandedBits, + KnownZero2, KnownOne2, Depth+1)) +return true; + + // If the RHS of the add has bits set that can't affect the input, reduce + // the constant. + if (ShrinkDemandedConstant(I, 1, InDemandedBits)) +return UpdateValueUsesWith(I, I); + + // Avoid excess work. + if (KnownZero2 == 0 && KnownOne2 == 0) +break; + + // Turn it into OR if input bits are zero. + if ((KnownZero2 & RHS->getZExtValue()) == RHS->getZExtValue()) { +Instruction *Or = + BinaryOperator::createOr(I->getOperand(0), I->getOperand(1), + I->getName()); +InsertNewInstBefore(Or, *I); +return UpdateValueUsesWith(I, Or); + } + + // We can say something about the output known-zero and known-one bits, + // depending on potential carries from the input constant and the + // unknowns. For example if the LHS is known to have at most the 0x0F0F0 + // bits set and the RHS constant is 0x01001, then we know we have a known + // one mask of 0x1 and a known zero mask of 0xE0F0E. + + // To compute this, we first compute the potential carry bits. These are + // the bits which may be modified. I'm not aware of a better way to do + // this scan. + uint64_t RHSVal = RHS->getZExtValue(); + + bool CarryIn = false; + uint64_t CarryBits = 0; + uint64_t CurBit = 1; + for (unsigned i = 0; i != BitWidth; ++i, CurBit <<= 1) { +// Record the current carry in. +if (CarryIn) CarryBits |= CurBit; + +bool CarryOut; + +// This bit has a carry out unless it is "zero + zero" or +// "zero + anything" with no carry in. +if ((KnownZero2 & CurBit) && ((RHSVal & CurBit) == 0)) { + CarryOut = false; // 0 + 0 has no carry out, even with carry in. +} else if (!CarryIn && + ((KnownZero2 & CurBit) || ((RHSVal & CurBit) == 0))) { + CarryOut = false; // 0 + anything has no carry out if no carry in. +} else { + // Otherwise, we have to assume we have a carry out. + CarryOut = true; +} + +// This stage's carry out becomes the next stage's carry-in. +CarryIn = CarryOut; + } + + // Now that we know which bits have carries, compute the known-1/0 sets. + + // Bits are known one if they are known zero in one operand and one in the + // other, and there is no input carry. + KnownOne = ((KnownZero2 & RHSVal) | (KnownOne2 & ~RHSVal)) & ~CarryBits; + + // Bits are known zero if they are known zero in both operands and there + // is no input carry. + KnownZero = KnownZero2 & ~RHSVal & ~CarryBits; +} +break; case Instruction::Shl: if (ConstantInt *SA = dyn_cast(I->getOperand(1))) { uint64_t ShiftAmt = SA->getZExtValue(); @@ -1685,11 +1776,19 @@ return ReplaceInstUsesWith(I, LHS); } -//
[llvm-commits] CVS: llvm/lib/Linker/LinkModules.cpp
Changes in directory llvm/lib/Linker: LinkModules.cpp updated: 1.117 -> 1.118 --- Log message: silence warnings --- Diffs of the changes: (+2 -2) LinkModules.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Linker/LinkModules.cpp diff -u llvm/lib/Linker/LinkModules.cpp:1.117 llvm/lib/Linker/LinkModules.cpp:1.118 --- llvm/lib/Linker/LinkModules.cpp:1.117 Thu Sep 14 13:23:26 2006 +++ llvm/lib/Linker/LinkModules.cpp Wed Nov 8 23:18:12 2006 @@ -441,8 +441,8 @@ SGV->hasExternalLinkage() || SGV->hasDLLImportLinkage() && "Global must either be external or have an initializer!"); -GlobalValue::LinkageTypes NewLinkage; -bool LinkFromSrc; +GlobalValue::LinkageTypes NewLinkage = GlobalValue::InternalLinkage; +bool LinkFromSrc = false; if (GetLinkageResult(DGV, SGV, NewLinkage, LinkFromSrc, Err)) return true; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/bugpoint/ExecutionDriver.cpp
Changes in directory llvm/tools/bugpoint: ExecutionDriver.cpp updated: 1.66 -> 1.67 --- Log message: add a new bugpoint mode -llc-safe. This uses LLC for both halves of a miscompilation. This is useful for working around GCC+CBE bugs or for handling programs that CBE doesn't support (e.g. inline asm) when searching for optimizer bugs. --- Diffs of the changes: (+9 -3) ExecutionDriver.cpp | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) Index: llvm/tools/bugpoint/ExecutionDriver.cpp diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.66 llvm/tools/bugpoint/ExecutionDriver.cpp:1.67 --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.66Sun Nov 5 13:31:28 2006 +++ llvm/tools/bugpoint/ExecutionDriver.cpp Wed Nov 8 23:57:53 2006 @@ -28,7 +28,7 @@ // for miscompilation. // enum OutputType { -AutoPick, RunLLI, RunJIT, RunLLC, RunCBE, CBE_bug +AutoPick, RunLLI, RunJIT, RunLLC, RunCBE, CBE_bug, LLC_Safe }; cl::opt @@ -47,6 +47,7 @@ clEnumValN(RunLLC, "run-llc", "Compile with LLC"), clEnumValN(RunCBE, "run-cbe", "Compile with CBE"), clEnumValN(CBE_bug,"cbe-bug", "Find CBE bugs"), +clEnumValN(LLC_Safe, "llc-safe", "Use LLC for all"), clEnumValEnd), cl::init(AutoPick)); @@ -133,6 +134,10 @@ Interpreter = AbstractInterpreter::createJIT(getToolName(), Message, &ToolArgv); break; + case LLC_Safe: +Interpreter = AbstractInterpreter::createLLC(getToolName(), Message, + &ToolArgv); +break; case RunCBE: case CBE_bug: Interpreter = AbstractInterpreter::createCBE(getToolName(), Message, @@ -148,8 +153,9 @@ if (InterpreterSel == RunCBE) { // We already created a CBE, reuse it. cbe = Interpreter; - } else if (InterpreterSel == CBE_bug) { -// We want to debug the CBE itself. Use LLC as the 'known-good' compiler. + } else if (InterpreterSel == CBE_bug || InterpreterSel == LLC_Safe) { +// We want to debug the CBE itself or LLC is known-good. Use LLC as the +// 'known-good' compiler. std::vector ToolArgs; ToolArgs.push_back("--relocation-model=pic"); cbe = AbstractInterpreter::createLLC(getToolName(), Message, &ToolArgs); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/bugpoint/ExtractFunction.cpp
Changes in directory llvm/tools/bugpoint: ExtractFunction.cpp updated: 1.53 -> 1.54 --- Log message: completely revert patrick's enhancement to bugpoint. Though it makes bugpoint speed up, it sometimes makes it crash on complex bc files, which isn't very nice. With this, bugpoint can reduce the 176.gcc failure. --- Diffs of the changes: (+16 -124) ExtractFunction.cpp | 140 +--- 1 files changed, 16 insertions(+), 124 deletions(-) Index: llvm/tools/bugpoint/ExtractFunction.cpp diff -u llvm/tools/bugpoint/ExtractFunction.cpp:1.53 llvm/tools/bugpoint/ExtractFunction.cpp:1.54 --- llvm/tools/bugpoint/ExtractFunction.cpp:1.53Fri Oct 20 02:07:24 2006 +++ llvm/tools/bugpoint/ExtractFunction.cpp Thu Nov 9 00:24:56 2006 @@ -18,7 +18,6 @@ #include "llvm/Module.h" #include "llvm/PassManager.h" #include "llvm/Pass.h" -#include "llvm/SymbolTable.h" #include "llvm/Analysis/Verifier.h" #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/Scalar.h" @@ -248,63 +247,6 @@ } } -/// RewriteUsesInNewModule - Given a constant 'OrigVal' and a module 'OrigMod', -/// find all uses of the constant. If they are not in the specified module, -/// replace them with uses of another constant 'NewVal'. -static void RewriteUsesInNewModule(Constant *OrigVal, Constant *NewVal, - Module *OrigMod) { - assert(OrigVal->getType() == NewVal->getType() && - "Can't replace something with a different type"); - for (Value::use_iterator UI = OrigVal->use_begin(), E = OrigVal->use_end(); - UI != E; ) { -Value::use_iterator TmpUI = UI++; -User *U = *TmpUI; -if (Instruction *Inst = dyn_cast(U)) { - if (Inst->getParent()->getParent()->getParent() != OrigMod) -TmpUI.getUse() = NewVal; -} else if (GlobalVariable *GV = dyn_cast(U)) { - if (GV->getParent() != OrigMod) -TmpUI.getUse() = NewVal; -} else if (ConstantExpr *CE = dyn_cast(U)) { - // If nothing uses this, don't bother making a copy. - if (CE->use_empty()) continue; - Constant *NewCE = CE->getWithOperandReplaced(TmpUI.getOperandNo(), - NewVal); - RewriteUsesInNewModule(CE, NewCE, OrigMod); -} else if (ConstantStruct *CS = dyn_cast(U)) { - // If nothing uses this, don't bother making a copy. - if (CS->use_empty()) continue; - unsigned OpNo = TmpUI.getOperandNo(); - std::vector Ops; - for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i) -Ops.push_back(i == OpNo ? NewVal : CS->getOperand(i)); - Constant *NewStruct = ConstantStruct::get(Ops); - RewriteUsesInNewModule(CS, NewStruct, OrigMod); - } else if (ConstantPacked *CP = dyn_cast(U)) { - // If nothing uses this, don't bother making a copy. - if (CP->use_empty()) continue; - unsigned OpNo = TmpUI.getOperandNo(); - std::vector Ops; - for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) -Ops.push_back(i == OpNo ? NewVal : CP->getOperand(i)); - Constant *NewPacked = ConstantPacked::get(Ops); - RewriteUsesInNewModule(CP, NewPacked, OrigMod); -} else if (ConstantArray *CA = dyn_cast(U)) { - // If nothing uses this, don't bother making a copy. - if (CA->use_empty()) continue; - unsigned OpNo = TmpUI.getOperandNo(); - std::vector Ops; - for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i) { -Ops.push_back(i == OpNo ? NewVal : CA->getOperand(i)); - } - Constant *NewArray = ConstantArray::get(CA->getType(), Ops); - RewriteUsesInNewModule(CA, NewArray, OrigMod); -} else { - assert(0 && "Unexpected user"); -} - } -} - /// SplitFunctionsOutOfModule - Given a module and a list of functions in the /// module, split the functions OUT of the specified module, and place them in @@ -319,79 +261,29 @@ I != E; ++I) I->setLinkage(GlobalValue::ExternalLinkage); - // First off, we need to create the new module... - Module *New = new Module(M->getModuleIdentifier()); - New->setEndianness(M->getEndianness()); - New->setPointerSize(M->getPointerSize()); - New->setTargetTriple(M->getTargetTriple()); - New->setModuleInlineAsm(M->getModuleInlineAsm()); - - // Copy all of the dependent libraries over. - for (Module::lib_iterator I = M->lib_begin(), E = M->lib_end(); I != E; ++I) -New->addLibrary(*I); + Module *New = CloneModule(M); + + // Make sure global initializers exist only in the safe module (CBE->.so) + for (Module::global_iterator I = New->global_begin(), E = New->global_end(); + I != E; ++I) +I->setInitializer(0); // Delete the initializer to make it external - // build a set of the functions to search later... + // Remove the Test functions from the Safe module std::set > TestFunctions; for (unsigned i = 0, e = F.size(); i != e; ++i) { TestFunctions.insert(std::make_pair(F[i]->ge