From llvm at cs.uiuc.edu Mon Aug 21 00:34:23 2006 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 21 Aug 2006 00:34:23 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/LinkAllAnalyses.h Message-ID: <200608210534.k7L5YNUw017301@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: LinkAllAnalyses.h (r1.6) removed --- Log message: For PR885: http://llvm.org/PR885 : Consolidate the LinkAllAnalyses.h and LinkAllPasses.h headers into one so there is no dupliation. --- Diffs of the changes: (+0 -0) 0 files changed From llvm at cs.uiuc.edu Mon Aug 21 00:34:23 2006 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 21 Aug 2006 00:34:23 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/LinkAllPasses.h Message-ID: <200608210534.k7L5YN54017308@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: LinkAllPasses.h (r1.32) removed --- Log message: For PR885: http://llvm.org/PR885 : Consolidate the LinkAllAnalyses.h and LinkAllPasses.h headers into one so there is no dupliation. --- Diffs of the changes: (+0 -0) 0 files changed From reid at x10sys.com Mon Aug 21 00:34:20 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 21 Aug 2006 00:34:20 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/LinkAllPasses.h Message-ID: <200608210534.k7L5YKGf017293@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: LinkAllPasses.h added (r1.1) --- Log message: For PR885: http://llvm.org/PR885 : Consolidate the LinkAllAnalyses.h and LinkAllPasses.h headers into one so there is no dupliation. --- Diffs of the changes: (+142 -0) LinkAllPasses.h | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 142 insertions(+) Index: llvm/include/llvm/LinkAllPasses.h diff -c /dev/null llvm/include/llvm/LinkAllPasses.h:1.1 *** /dev/null Mon Aug 21 00:34:13 2006 --- llvm/include/llvm/LinkAllPasses.h Mon Aug 21 00:34:03 2006 *************** *** 0 **** --- 1,142 ---- + //===- llvm/Transforms/LinkAllPasses.h - Reference All Passes ---*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Jeff Cohen and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This header file pulls in all transformation passes for tools like opts and + // bugpoint that need this functionality. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_LINKALLPASSES_H + #define LLVM_LINKALLPASSES_H + + #include "llvm/Analysis/AliasSetTracker.h" + #include "llvm/Analysis/FindUsedTypes.h" + #include "llvm/Analysis/IntervalPartition.h" + #include "llvm/Analysis/LoadValueNumbering.h" + #include "llvm/Analysis/Passes.h" + #include "llvm/Analysis/PostDominators.h" + #include "llvm/Analysis/ScalarEvolution.h" + #include "llvm/Analysis/DataStructure/DataStructure.h" + #include "llvm/Analysis/DataStructure/CallTargets.h" + #include "llvm/CodeGen/Passes.h" + #include "llvm/Function.h" + #include "llvm/Transforms/Instrumentation.h" + #include "llvm/Transforms/IPO.h" + #include "llvm/Transforms/Scalar.h" + #include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h" + #include + + namespace { + struct ForcePassLinking { + ForcePassLinking() { + // We must reference the passes in such a way that compilers will not + // delete it all as dead code, even with whole program optimization, + // yet is effectively a NO-OP. As the compiler isn't smart enough + // to know that getenv() never returns -1, this will do the job. + if (std::getenv("bar") != (char*) -1) + return; + + (void) llvm::createAAEvalPass(); + (void) llvm::createAggressiveDCEPass(); + (void) llvm::createAliasAnalysisCounterPass(); + (void) llvm::createAndersensPass(); + (void) llvm::createArgumentPromotionPass(); + (void) llvm::createBasicAliasAnalysisPass(); + (void) llvm::createBasicVNPass(); + (void) llvm::createBlockPlacementPass(); + (void) llvm::createBlockProfilerPass(); + (void) llvm::createBreakCriticalEdgesPass(); + (void) llvm::createCFGSimplificationPass(); + (void) llvm::createConstantMergePass(); + (void) llvm::createConstantPropagationPass(); + (void) llvm::createCorrelatedExpressionEliminationPass(); + (void) llvm::createDSAAPass(); + (void) llvm::createDSOptPass(); + (void) llvm::createDeadArgEliminationPass(); + (void) llvm::createDeadCodeEliminationPass(); + (void) llvm::createDeadInstEliminationPass(); + (void) llvm::createDeadStoreEliminationPass(); + (void) llvm::createDeadTypeEliminationPass(); + (void) llvm::createEdgeProfilerPass(); + (void) llvm::createEmitFunctionTablePass(); + (void) llvm::createFunctionInliningPass(); + (void) llvm::createFunctionProfilerPass(); + (void) llvm::createFunctionResolvingPass(); + (void) llvm::createGCSEPass(); + (void) llvm::createGlobalDCEPass(); + (void) llvm::createGlobalOptimizerPass(); + (void) llvm::createGlobalsModRefPass(); + (void) llvm::createIPConstantPropagationPass(); + (void) llvm::createIPSCCPPass(); + (void) llvm::createIndVarSimplifyPass(); + (void) llvm::createInstructionCombiningPass(); + (void) llvm::createInternalizePass(false); + (void) llvm::createLCSSAPass(); + (void) llvm::createLICMPass(); + (void) llvm::createLoadValueNumberingPass(); + (void) llvm::createLoopExtractorPass(); + (void) llvm::createLoopSimplifyPass(); + (void) llvm::createLoopStrengthReducePass(); + (void) llvm::createLoopUnrollPass(); + (void) llvm::createLoopUnswitchPass(); + (void) llvm::createLowerAllocationsPass(); + (void) llvm::createLowerGCPass(); + (void) llvm::createLowerInvokePass(); + (void) llvm::createLowerPackedPass(); + (void) llvm::createLowerSelectPass(); + (void) llvm::createLowerSetJmpPass(); + (void) llvm::createLowerSwitchPass(); + (void) llvm::createNoAAPass(); + (void) llvm::createNoProfileInfoPass(); + (void) llvm::createProfileLoaderPass(); + (void) llvm::createPromoteMemoryToRegisterPass(); + (void) llvm::createDemoteRegisterToMemoryPass(); + (void) llvm::createPruneEHPass(); + (void) llvm::createRaiseAllocationsPass(); + (void) llvm::createRaisePointerReferencesPass(); + (void) llvm::createReassociatePass(); + (void) llvm::createSCCPPass(); + (void) llvm::createScalarReplAggregatesPass(); + (void) llvm::createSimplifyLibCallsPass(); + (void) llvm::createSingleLoopExtractorPass(); + (void) llvm::createSteensgaardPass(); + (void) llvm::createStripSymbolsPass(); + (void) llvm::createTailCallEliminationPass(); + (void) llvm::createTailDuplicationPass(); + (void) llvm::createTraceBasicBlockPass(); + (void) llvm::createTraceValuesPassForBasicBlocks(); + (void) llvm::createTraceValuesPassForFunction(); + (void) llvm::createUnifyFunctionExitNodesPass(); + (void) llvm::createCondPropagationPass(); + (void) llvm::createNullProfilerRSPass(); + (void) llvm::createRSProfilingPass(); + (void) llvm::createIndMemRemPass(); + (void) llvm::createDataStructureStatsPass(); + (void) llvm::createDataStructureGraphCheckerPass(); + (void) llvm::createInstCountPass(); + + (void)new llvm::LocalDataStructures(); + (void)new llvm::BUDataStructures(); + (void)new llvm::TDDataStructures(); + (void)new llvm::CompleteBUDataStructures(); + (void)new llvm::EquivClassGraphs(); + (void)new llvm::IntervalPartition(); + (void)new llvm::ImmediateDominators(); + (void)new llvm::PostDominatorSet(); + (void)new llvm::FindUsedTypes(); + (void)new llvm::ScalarEvolution(); + (void)new llvm::CallTargetFinder(); + ((llvm::Function*)0)->viewCFGOnly(); + llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)0); + X.add((llvm::Value*)0, 0); // for -print-alias-sets + } + } ForcePassLinking; // Force link by creating a global definition. + } + + #endif From reid at x10sys.com Mon Aug 21 00:34:23 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 21 Aug 2006 00:34:23 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp Message-ID: <200608210534.k7L5YNYh017306@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: opt.cpp updated: 1.114 -> 1.115 --- Log message: For PR885: http://llvm.org/PR885 : Consolidate the LinkAllAnalyses.h and LinkAllPasses.h headers into one so there is no dupliation. --- Diffs of the changes: (+1 -1) opt.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.114 llvm/tools/opt/opt.cpp:1.115 --- llvm/tools/opt/opt.cpp:1.114 Sun Aug 20 23:57:01 2006 +++ llvm/tools/opt/opt.cpp Mon Aug 21 00:34:03 2006 @@ -26,7 +26,7 @@ #include "llvm/Support/PluginLoader.h" #include "llvm/Support/SystemUtils.h" #include "llvm/Support/Timer.h" -#include "llvm/Transforms/LinkAllPasses.h" +#include "llvm/LinkAllPasses.h" #include "llvm/LinkAllVMCore.h" #include #include From reid at x10sys.com Mon Aug 21 00:34:20 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 21 Aug 2006 00:34:20 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/bugpoint.cpp Message-ID: <200608210534.k7L5YKuH017296@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: bugpoint.cpp updated: 1.32 -> 1.33 --- Log message: For PR885: http://llvm.org/PR885 : Consolidate the LinkAllAnalyses.h and LinkAllPasses.h headers into one so there is no dupliation. --- Diffs of the changes: (+1 -2) bugpoint.cpp | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/tools/bugpoint/bugpoint.cpp diff -u llvm/tools/bugpoint/bugpoint.cpp:1.32 llvm/tools/bugpoint/bugpoint.cpp:1.33 --- llvm/tools/bugpoint/bugpoint.cpp:1.32 Tue Aug 15 11:40:49 2006 +++ llvm/tools/bugpoint/bugpoint.cpp Mon Aug 21 00:34:03 2006 @@ -15,8 +15,7 @@ #include "BugDriver.h" #include "ToolRunner.h" -#include "llvm/Analysis/LinkAllAnalyses.h" -#include "llvm/Transforms/LinkAllPasses.h" +#include "llvm/LinkAllPasses.h" #include "llvm/Support/PassNameParser.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/PluginLoader.h" From reid at x10sys.com Mon Aug 21 00:37:17 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 21 Aug 2006 00:37:17 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/LinkAllPasses.h Message-ID: <200608210537.k7L5bH6A017370@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: LinkAllPasses.h updated: 1.1 -> 1.2 --- Log message: Fix the documentation for this file. --- Diffs of the changes: (+3 -3) LinkAllPasses.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/include/llvm/LinkAllPasses.h diff -u llvm/include/llvm/LinkAllPasses.h:1.1 llvm/include/llvm/LinkAllPasses.h:1.2 --- llvm/include/llvm/LinkAllPasses.h:1.1 Mon Aug 21 00:34:03 2006 +++ llvm/include/llvm/LinkAllPasses.h Mon Aug 21 00:37:03 2006 @@ -1,4 +1,4 @@ -//===- llvm/Transforms/LinkAllPasses.h - Reference All Passes ---*- C++ -*-===// +//===- llvm/LinkAllPasses.h ------------ Reference All Passes ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// // -// This header file pulls in all transformation passes for tools like opts and -// bugpoint that need this functionality. +// This header file pulls in all transformation and analysis passes for tools +// like opt and bugpoint that need this functionality. // //===----------------------------------------------------------------------===// From reid at x10sys.com Mon Aug 21 01:01:12 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 21 Aug 2006 01:01:12 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Program.h Message-ID: <200608210601.k7L61COL017732@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Program.h updated: 1.12 -> 1.13 --- Log message: For PR797: http://llvm.org/PR797 : Change interface for error recovery without exceptions. --- Diffs of the changes: (+10 -8) Program.h | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) Index: llvm/include/llvm/System/Program.h diff -u llvm/include/llvm/System/Program.h:1.12 llvm/include/llvm/System/Program.h:1.13 --- llvm/include/llvm/System/Program.h:1.12 Sun Aug 20 21:04:43 2006 +++ llvm/include/llvm/System/Program.h Mon Aug 21 01:00:58 2006 @@ -49,10 +49,7 @@ /// called then a std::string is thrown. /// @returns an integer result code indicating the status of the program. /// A zero or positive value indicates the result code of the program. A - /// negative value is the signal number on which it terminated. A value of - /// -9999 indicates the program could not be executed. - /// @throws std::string on a variety of error conditions or if the invoked - /// program aborted abnormally. + /// negative value is the signal number on which it terminated. /// @see FindProgrambyName /// @brief Executes the program with the given set of \p args. static int ExecuteAndWait( @@ -70,16 +67,21 @@ ///< should have a size of at least three. If the pointer in the array ///< are not null, then the inferior process's stdin(0), stdout(1), ///< and stderr(2) will be redirected to the corresponding Paths. - unsigned secondsToWait = 0 ///< If non-zero, this specifies the amount + unsigned secondsToWait = 0, ///< If non-zero, this specifies the amount ///< of time to wait for the child process to exit. If the time ///< expires, the child is killed and this call returns. If zero, ///< this function will wait until the child finishes or forever if ///< it doesn't. + std::string* ErrMsg = 0 ///< If non-zero, provides a pointer to a string + ///< instance in which error messages will be returned. If the string + ///< is non-empty upon return an error occurred while invoking the + ///< program. ); // These methods change the specified standard stream (stdin or stdout) to - // binary mode. - static void ChangeStdinToBinary(); - static void ChangeStdoutToBinary(); + // binary mode. They return true if an error occurred + static bool ChangeStdinToBinary(); + static bool ChangeStdoutToBinary(); + /// @} }; } } From reid at x10sys.com Mon Aug 21 01:03:00 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 21 Aug 2006 01:03:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Program.inc Win32.h Message-ID: <200608210603.k7L630dQ017784@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Program.inc updated: 1.16 -> 1.17 Win32.h updated: 1.6 -> 1.7 --- Log message: For PR797: http://llvm.org/PR797 : Remove all exception code from Program.inc and implement its new interface with an ErrMsg string argument. --- Diffs of the changes: (+59 -31) Program.inc | 74 +++++++++++++++++++++++++++++++++++------------------------- Win32.h | 16 ++++++++++++ 2 files changed, 59 insertions(+), 31 deletions(-) Index: llvm/lib/System/Win32/Program.inc diff -u llvm/lib/System/Win32/Program.inc:1.16 llvm/lib/System/Win32/Program.inc:1.17 --- llvm/lib/System/Win32/Program.inc:1.16 Wed Jun 7 18:18:34 2006 +++ llvm/lib/System/Win32/Program.inc Mon Aug 21 01:02:44 2006 @@ -69,7 +69,7 @@ } } -static HANDLE RedirectIO(const Path *path, int fd) { +static HANDLE RedirectIO(const Path *path, int fd, std::string* ErrMsg) { HANDLE h; if (path == 0) { DuplicateHandle(GetCurrentProcess(), (HANDLE)_get_osfhandle(fd), @@ -91,8 +91,9 @@ &sa, fd == 0 ? OPEN_EXISTING : CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (h == INVALID_HANDLE_VALUE) { - ThrowError(std::string(fname) + ": Can't open file for " + + MakeErrMsg(ErrMsg, std::string(fname) + ": Can't open file for " + (fd ? "input: " : "output: ")); + return h; } return h; } @@ -102,9 +103,13 @@ const char** args, const char** envp, const Path** redirects, - unsigned secondsToWait) { - if (!path.canExecute()) - throw path.toString() + " is not executable"; + unsigned secondsToWait, + std::string* ErrMsg) { + if (!path.canExecute()) { + if (ErrMsg) + *ErrMsg = "program not executable"; + return -1; + } // Windows wants a command line, not an array of args, to pass to the new // process. We have to concatenate them all, while quoting the args that @@ -148,21 +153,29 @@ if (redirects) { si.dwFlags = STARTF_USESTDHANDLES; - try { - si.hStdInput = RedirectIO(redirects[0], 0); - si.hStdOutput = RedirectIO(redirects[1], 1); - if (redirects[1] && redirects[2] && *(redirects[1]) != *(redirects[2])) { - si.hStdError = RedirectIO(redirects[2], 2); - } else { - DuplicateHandle(GetCurrentProcess(), si.hStdOutput, - GetCurrentProcess(), &si.hStdError, - 0, TRUE, DUPLICATE_SAME_ACCESS); - } - } catch (...) { + si.hStdInput = RedirectIO(redirects[0], 0, ErrMsg); + if (si.hStdInput == INVALID_HANDLE_VALUE) { + MakeErrMsg(ErrMsg, "can't redirect stdin"); + return -1; + } + si.hStdOutput = RedirectIO(redirects[1], 1); + if (si.hStdOutput == INVALID_HANDLE_VALUE) { CloseHandle(si.hStdInput); - CloseHandle(si.hStdOutput); - CloseHandle(si.hStdError); - throw; + MakeErrMsg(ErrMsg, "can't redirect stdout"); + return -1; + } + if (redirects[1] && redirects[2] && *(redirects[1]) != *(redirects[2])) { + si.hStdError = RedirectIO(redirects[2], 2); + if (si.hStdError == INVALID_HANDLE_VALUE) { + CloseHandle(si.hStdInput); + CloseHandle(si.hStdOutput); + MakeErrMsg(ErrMsg, "can't redirect stderr"); + return -1; + } + } else { + DuplicateHandle(GetCurrentProcess(), si.hStdOutput, + GetCurrentProcess(), &si.hStdError, + 0, TRUE, DUPLICATE_SAME_ACCESS); } } @@ -181,12 +194,13 @@ CloseHandle(si.hStdOutput); CloseHandle(si.hStdError); - // Now throw an error if the process didn't get created. + // Now return an error if the process didn't get created. if (!rc) { SetLastError(err); - ThrowError(std::string("Couldn't execute program '") + + MakeErrMsg(ErrMsg, std::string("Couldn't execute program '") + path.toString() + "'"); + return -1; } // Wait for it to terminate. @@ -196,8 +210,9 @@ if (WaitForSingleObject(pi.hProcess, millisecondsToWait) == WAIT_TIMEOUT) { if (!TerminateProcess(pi.hProcess, 1)) { - ThrowError(std::string("Failed to terminate timed-out program '") + - path.toString() + "'"); + MakeErrMsg(ErrMsg, std::string("Failed to terminate timed-out program '") + + path.toString() + "'"); + return -1; } WaitForSingleObject(pi.hProcess, INFINITE); } @@ -213,23 +228,22 @@ if (!rc) { SetLastError(err); - ThrowError(std::string("Failed getting status for program '") + + MakeErrMsg(ErrMsg, std::string("Failed getting status for program '") + path.toString() + "'"); + return -1; } return status; } -void Program::ChangeStdinToBinary(){ +bool Program::ChangeStdinToBinary(){ int result = _setmode( _fileno(stdin), _O_BINARY ); - if( result == -1 ) - throw std::string("Cannot set input mode on stdin to binary."); + return result == -1; } -void Program::ChangeStdoutToBinary(){ +bool Program::ChangeStdoutToBinary(){ int result = _setmode( _fileno(stdout), _O_BINARY ); - if( result == -1 ) - throw std::string("Cannot set output mode on stdout to binary."); + return result == -1; } } Index: llvm/lib/System/Win32/Win32.h diff -u llvm/lib/System/Win32/Win32.h:1.6 llvm/lib/System/Win32/Win32.h:1.7 --- llvm/lib/System/Win32/Win32.h:1.6 Fri Jul 7 12:26:47 2006 +++ llvm/lib/System/Win32/Win32.h Mon Aug 21 01:02:44 2006 @@ -44,6 +44,20 @@ throw s; } +inline void MakeErrMsg(std::string* ErrMsg, const std::string& prefix) { + if (!ErrMsg) + return; + char *buffer = NULL; + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, + NULL, GetLastError(), 0, (LPSTR)&buffer, 1, NULL); + ErrMsg = prefix + buffer; + LocalFree(buffer); +} + inline void ThrowErrno(const std::string& prefix) { - ThrowError(prefix + ": " + strerror(errno)); + ThrowError(prefix + ": " + strerror(errno)); +} + +inline void MakeErrnoMsg(std::string* ErrMsg, const std::string & prefix) { + MakeErrorMsg(prefix + ": " + strerror(errno)); } From reid at x10sys.com Mon Aug 21 01:03:01 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 21 Aug 2006 01:03:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Program.inc Unix.h Message-ID: <200608210603.k7L631PY017791@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Program.inc updated: 1.20 -> 1.21 Unix.h updated: 1.15 -> 1.16 --- Log message: For PR797: http://llvm.org/PR797 : Remove all exception code from Program.inc and implement its new interface with an ErrMsg string argument. --- Diffs of the changes: (+67 -23) Program.inc | 59 ++++++++++++++++++++++++++++++++++++----------------------- Unix.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 23 deletions(-) Index: llvm/lib/System/Unix/Program.inc diff -u llvm/lib/System/Unix/Program.inc:1.20 llvm/lib/System/Unix/Program.inc:1.21 --- llvm/lib/System/Unix/Program.inc:1.20 Sun Aug 20 21:04:43 2006 +++ llvm/lib/System/Unix/Program.inc Mon Aug 21 01:02:44 2006 @@ -81,18 +81,24 @@ return Path(); } -static void RedirectFD(const std::string &File, int FD) { - if (File.empty()) return; // Noop +static bool RedirectFD(const std::string &File, int FD, std::string* ErrMsg) { + if (File.empty()) return false; // Noop // Open the file int InFD = open(File.c_str(), FD == 0 ? O_RDONLY : O_WRONLY|O_CREAT, 0666); if (InFD == -1) { - ThrowErrno("Cannot open file '" + File + "' for " + MakeErrMsg(ErrMsg, "Cannot open file '" + File + "' for " + (FD == 0 ? "input" : "output") + "!\n"); + return true; } - dup2(InFD, FD); // Install it as the requested FD + // Install it as the requested FD + if (-1 == dup2(InFD, FD)) { + MakeErrMsg(ErrMsg, "Cannot dup2"); + return true; + } close(InFD); // Close the original FD + return false; } static bool Timeout = false; @@ -105,10 +111,14 @@ const char** args, const char** envp, const Path** redirects, - unsigned secondsToWait -) { - if (!path.canExecute()) - return -9999; + unsigned secondsToWait, + std::string* ErrMsg) +{ + if (!path.canExecute()) { + if (ErrMsg) + *ErrMsg = path.toString() + " is not executable"; + return -1; + } #ifdef HAVE_SYS_WAIT_H // Create a child process. @@ -116,9 +126,8 @@ switch (child) { // An error occured: Return to the caller. case -1: - ThrowErrno(std::string("Couldn't execute program '") + path.toString() + - "'"); - break; + MakeErrMsg(ErrMsg, "Couldn't fork"); + return -1; // Child process: Execute the program. case 0: { @@ -126,22 +135,23 @@ if (redirects) { if (redirects[0]) if (redirects[0]->isEmpty()) - RedirectFD("/dev/null",0); + if (RedirectFD("/dev/null",0,ErrMsg)) { return -1; } else - RedirectFD(redirects[0]->toString(), 0); + if (RedirectFD(redirects[0]->toString(), 0,ErrMsg)) { return -1; } if (redirects[1]) if (redirects[1]->isEmpty()) - RedirectFD("/dev/null",1); + if (RedirectFD("/dev/null",1,ErrMsg)) { return -1; } else - RedirectFD(redirects[1]->toString(), 1); + if (RedirectFD(redirects[1]->toString(),1,ErrMsg)) { return -1; } if (redirects[1] && redirects[2] && *(redirects[1]) != *(redirects[2])) { if (redirects[2]->isEmpty()) - RedirectFD("/dev/null",2); + if (RedirectFD("/dev/null",2,ErrMsg)) { return -1; } else - RedirectFD(redirects[2]->toString(), 2); - } else { - dup2(1, 2); + if (RedirectFD(redirects[2]->toString(), 2,ErrMsg)) { return -1; } + } else if (-1 == dup2(1,2)) { + MakeErrMsg(ErrMsg, "Can't redirect"); + return -1; } } @@ -192,11 +202,12 @@ // Wait for child to die if (wait(&status) != child) - ThrowErrno("Child timedout but wouldn't die"); + MakeErrMsg(ErrMsg, "Child timed out but wouldn't die"); return -1; // Timeout detected } else { - ThrowErrno("Error waiting for child process"); + MakeErrMsg(ErrMsg, "Error waiting for child process"); + return -1; } // We exited normally without timeout, so turn off the timer. @@ -223,12 +234,14 @@ } -void Program::ChangeStdinToBinary(){ +bool Program::ChangeStdinToBinary(){ // Do nothing, as Unix doesn't differentiate between text and binary. + return false; } -void Program::ChangeStdoutToBinary(){ +bool Program::ChangeStdoutToBinary(){ // Do nothing, as Unix doesn't differentiate between text and binary. + return false; } } Index: llvm/lib/System/Unix/Unix.h diff -u llvm/lib/System/Unix/Unix.h:1.15 llvm/lib/System/Unix/Unix.h:1.16 --- llvm/lib/System/Unix/Unix.h:1.15 Fri Jul 7 12:32:37 2006 +++ llvm/lib/System/Unix/Unix.h Mon Aug 21 01:02:44 2006 @@ -119,4 +119,35 @@ throw prefix + ": " + buffer; } +/// This function builds an error message into \p ErrMsg using the \p prefix +/// string and the Unix error number given by \p errnum. If errnum is -1, the +/// default then the value of errno is used. +/// @brief Make an error message +inline void MakeErrMsg( + std::string* ErrMsg, const std::string& prefix, int errnum = -1) { + if (!ErrMsg) + return; + char buffer[MAXPATHLEN]; + buffer[0] = 0; + if (errnum == -1) + errnum = errno; +#ifdef HAVE_STRERROR_R + // strerror_r is thread-safe. + if (errnum) + strerror_r(errnum,buffer,MAXPATHLEN-1); +#elif HAVE_STRERROR + // Copy the thread un-safe result of strerror into + // the buffer as fast as possible to minimize impact + // of collision of strerror in multiple threads. + if (errnum) + strncpy(buffer,strerror(errnum),MAXPATHLEN-1); + buffer[MAXPATHLEN-1] = 0; +#else + // Strange that this system doesn't even have strerror + // but, oh well, just use a generic message + sprintf(buffer, "Error #%d", errnum); +#endif + *ErrMsg = buffer; +} + #endif From reid at x10sys.com Mon Aug 21 01:05:02 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 21 Aug 2006 01:05:02 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/OptimizerDriver.cpp ToolRunner.cpp Message-ID: <200608210605.k7L652uv017857@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: OptimizerDriver.cpp updated: 1.41 -> 1.42 ToolRunner.cpp updated: 1.55 -> 1.56 --- Log message: For PR797: http://llvm.org/PR797 : Adjust usage of the ExecuteAndWait function to use the last argument which is the ErrMsg string. This is necessitated because this function no longer throws exceptions on error. --- Diffs of the changes: (+9 -6) OptimizerDriver.cpp | 13 ++++++++----- ToolRunner.cpp | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) Index: llvm/tools/bugpoint/OptimizerDriver.cpp diff -u llvm/tools/bugpoint/OptimizerDriver.cpp:1.41 llvm/tools/bugpoint/OptimizerDriver.cpp:1.42 --- llvm/tools/bugpoint/OptimizerDriver.cpp:1.41 Sun Aug 20 21:04:43 2006 +++ llvm/tools/bugpoint/OptimizerDriver.cpp Mon Aug 21 01:04:45 2006 @@ -179,7 +179,8 @@ args[n++] = 0; sys::Path prog(sys::Program::FindProgramByName(ToolName)); - int result = sys::Program::ExecuteAndWait(prog,args,0,0,Timeout); + std::string ErrMsg; + int result = sys::Program::ExecuteAndWait(prog,args,0,0,Timeout,&ErrMsg); // If we are supposed to delete the bytecode file or if the passes crashed, // remove it now. This may fail if the file was never created, but that's ok. @@ -194,10 +195,12 @@ std::cout << "Success!\n"; else if (result > 0) std::cout << "Exited with error code '" << result << "'\n"; - else if (result == -9999) - std::cout << "Program not executable\n"; - else if (result < 0) - std::cout << "Crashed with signal #" << abs(result) << "\n"; + else if (result < 0) { + if (result == -1) + std::cout << "Execute failed: " << ErrMsg << "\n"; + else + std::cout << "Crashed with signal #" << abs(result) << "\n"; + } if (result & 0x01000000) std::cout << "Dumped core\n"; } Index: llvm/tools/bugpoint/ToolRunner.cpp diff -u llvm/tools/bugpoint/ToolRunner.cpp:1.55 llvm/tools/bugpoint/ToolRunner.cpp:1.56 --- llvm/tools/bugpoint/ToolRunner.cpp:1.55 Sun Aug 20 21:04:43 2006 +++ llvm/tools/bugpoint/ToolRunner.cpp Mon Aug 21 01:04:45 2006 @@ -55,7 +55,7 @@ sys::Path ErrorFilename("error_messages"); ErrorFilename.makeUnique(); RunProgramWithTimeout(ProgPath, Args, sys::Path(""), ErrorFilename, - ErrorFilename); // FIXME: check return code + ErrorFilename); // FIXME: check return code ? // Print out the error messages generated by GCC if possible... std::ifstream ErrorFile(ErrorFilename.c_str()); From reid at x10sys.com Mon Aug 21 01:05:02 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 21 Aug 2006 01:05:02 -0500 Subject: [llvm-commits] CVS: llvm/tools/gccld/GenerateCode.cpp gccld.cpp gccld.h Message-ID: <200608210605.k7L652aO017866@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: GenerateCode.cpp updated: 1.59 -> 1.60 gccld.cpp updated: 1.108 -> 1.109 gccld.h updated: 1.18 -> 1.19 --- Log message: For PR797: http://llvm.org/PR797 : Adjust usage of the ExecuteAndWait function to use the last argument which is the ErrMsg string. This is necessitated because this function no longer throws exceptions on error. --- Diffs of the changes: (+32 -10) GenerateCode.cpp | 10 +++++++--- gccld.cpp | 29 ++++++++++++++++++++++------- gccld.h | 3 +++ 3 files changed, 32 insertions(+), 10 deletions(-) Index: llvm/tools/gccld/GenerateCode.cpp diff -u llvm/tools/gccld/GenerateCode.cpp:1.59 llvm/tools/gccld/GenerateCode.cpp:1.60 --- llvm/tools/gccld/GenerateCode.cpp:1.59 Tue Aug 1 13:04:01 2006 +++ llvm/tools/gccld/GenerateCode.cpp Mon Aug 21 01:04:45 2006 @@ -297,6 +297,7 @@ int llvm::GenerateAssembly(const std::string &OutputFilename, const std::string &InputFilename, const sys::Path &llc, + std::string& ErrMsg, bool Verbose) { // Run LLC to convert the bytecode file into assembly code. std::vector args; @@ -307,13 +308,14 @@ args.push_back(InputFilename.c_str()); args.push_back(0); if (Verbose) dumpArgs(&args[0]); - return sys::Program::ExecuteAndWait(llc, &args[0]); + return sys::Program::ExecuteAndWait(llc, &args[0],0,0,0,&ErrMsg); } /// GenerateCFile - generates a C source file from the specified bytecode file. int llvm::GenerateCFile(const std::string &OutputFile, const std::string &InputFile, const sys::Path &llc, + std::string& ErrMsg, bool Verbose) { // Run LLC to convert the bytecode file into C. std::vector args; @@ -325,7 +327,7 @@ args.push_back(InputFile.c_str()); args.push_back(0); if (Verbose) dumpArgs(&args[0]); - return sys::Program::ExecuteAndWait(llc, &args[0]); + return sys::Program::ExecuteAndWait(llc, &args[0],0,0,0,&ErrMsg); } /// GenerateNative - generates a native executable file from the specified @@ -352,6 +354,7 @@ bool ExportAllAsDynamic, const std::vector &RPaths, const std::string &SOName, + std::string& ErrMsg, bool Verbose) { // Remove these environment variables from the environment of the // programs that we will execute. It appears that GCC sets these @@ -436,7 +439,8 @@ // Run the compiler to assembly and link together the program. if (Verbose) dumpArgs(&args[0]); - int Res = sys::Program::ExecuteAndWait(gcc, &args[0],(const char**)clean_env); + int Res = sys::Program::ExecuteAndWait( + gcc, &args[0],(const char**)clean_env,0,0,&ErrMsg); delete [] clean_env; Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.108 llvm/tools/gccld/gccld.cpp:1.109 --- llvm/tools/gccld/gccld.cpp:1.108 Mon Jan 9 21:14:40 2006 +++ llvm/tools/gccld/gccld.cpp Mon Aug 21 01:04:45 2006 @@ -320,12 +320,19 @@ // Generate an assembly language file for the bytecode. if (Verbose) std::cout << "Generating Assembly Code\n"; - GenerateAssembly(AssemblyFile.toString(), RealBytecodeOutput, llc, - Verbose); + std::string ErrMsg; + if (0 != GenerateAssembly( + AssemblyFile.toString(), RealBytecodeOutput, llc, ErrMsg, Verbose)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 2; + } if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, AssemblyFile.toString(), + if (0 != GenerateNative(OutputFilename, AssemblyFile.toString(), LibPaths, Libraries, gcc, envp, LinkAsLibrary, - NoInternalize, RPath, SOName, Verbose); + NoInternalize, RPath, SOName, ErrMsg, Verbose) ) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 2; + } if (!SaveTemps) { // Remove the assembly language file. @@ -353,11 +360,19 @@ // Generate an assembly language file for the bytecode. if (Verbose) std::cout << "Generating C Source Code\n"; - GenerateCFile(CFile.toString(), RealBytecodeOutput, llc, Verbose); + std::string ErrMsg; + if (0 != GenerateCFile( + CFile.toString(), RealBytecodeOutput, llc, ErrMsg, Verbose)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 2; + } if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, CFile.toString(), + if (0 != GenerateNative(OutputFilename, CFile.toString(), LibPaths, Libraries, gcc, envp, LinkAsLibrary, - NoInternalize, RPath, SOName, Verbose); + NoInternalize, RPath, SOName, ErrMsg, Verbose)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 2; + } if (!SaveTemps) { // Remove the assembly language file. Index: llvm/tools/gccld/gccld.h diff -u llvm/tools/gccld/gccld.h:1.18 llvm/tools/gccld/gccld.h:1.19 --- llvm/tools/gccld/gccld.h:1.18 Wed Dec 21 19:50:56 2005 +++ llvm/tools/gccld/gccld.h Mon Aug 21 01:04:45 2006 @@ -30,12 +30,14 @@ GenerateAssembly (const std::string &OutputFilename, const std::string &InputFilename, const sys::Path &llc, + std::string& ErrMsg, bool Verbose=false); int GenerateCFile (const std::string &OutputFile, const std::string &InputFile, const sys::Path &llc, + std::string& ErrMsg, bool Verbose=false); int GenerateNative (const std::string &OutputFilename, @@ -48,6 +50,7 @@ bool ExportAllAsDynamic, const std::vector &RPath, const std::string &SOName, + std::string& ErrMsg, bool Verbose=false); } // End llvm namespace From reid at x10sys.com Mon Aug 21 01:05:05 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 21 Aug 2006 01:05:05 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvmc/CompilerDriver.cpp CompilerDriver.h llvmc.cpp Message-ID: <200608210605.k7L655fO017875@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: CompilerDriver.cpp updated: 1.38 -> 1.39 CompilerDriver.h updated: 1.20 -> 1.21 llvmc.cpp updated: 1.29 -> 1.30 --- Log message: For PR797: http://llvm.org/PR797 : Adjust usage of the ExecuteAndWait function to use the last argument which is the ErrMsg string. This is necessitated because this function no longer throws exceptions on error. --- Diffs of the changes: (+19 -13) CompilerDriver.cpp | 24 ++++++++++++++---------- CompilerDriver.h | 3 ++- llvmc.cpp | 5 +++-- 3 files changed, 19 insertions(+), 13 deletions(-) Index: llvm/tools/llvmc/CompilerDriver.cpp diff -u llvm/tools/llvmc/CompilerDriver.cpp:1.38 llvm/tools/llvmc/CompilerDriver.cpp:1.39 --- llvm/tools/llvmc/CompilerDriver.cpp:1.38 Wed Aug 16 15:31:44 2006 +++ llvm/tools/llvmc/CompilerDriver.cpp Mon Aug 21 01:04:45 2006 @@ -451,7 +451,7 @@ return action; } - bool DoAction(Action*action) { + int DoAction(Action*action, std::string& ErrMsg) { assert(action != 0 && "Invalid Action!"); if (isSet(VERBOSE_FLAG)) WriteAction(action); @@ -477,15 +477,17 @@ if (isSet(TIME_ACTIONS_FLAG)) { Timer timer(action->program.toString()); timer.startTimer(); - int resultCode = sys::Program::ExecuteAndWait(action->program, Args); + int resultCode = + sys::Program::ExecuteAndWait(action->program, Args,0,0,0,&ErrMsg); timer.stopTimer(); timer.print(timer,std::cerr); - return resultCode == 0; + return resultCode; } else - return 0 == sys::Program::ExecuteAndWait(action->program, Args); + return + sys::Program::ExecuteAndWait(action->program, Args, 0,0,0, &ErrMsg); } - return true; + return 0; } /// This method tries various variants of a linkage item's file @@ -594,7 +596,7 @@ /// @name Methods /// @{ public: - virtual int execute(const InputList& InpList, const sys::Path& Output ) { + virtual int execute(const InputList& InpList, const sys::Path& Output, std::string& ErrMsg ) { try { // Echo the configuration of options if we're running verbose if (isSet(DEBUG_FLAG)) { @@ -851,8 +853,9 @@ std::vector::iterator AI = actions.begin(); std::vector::iterator AE = actions.end(); while (AI != AE) { - if (!DoAction(*AI)) - throw std::string("Action failed"); + int ActionResult = DoAction(*AI, ErrMsg); + if (ActionResult != 0) + return ActionResult; AI++; } @@ -932,8 +935,9 @@ link->args.push_back(Output.toString()); // Execute the link - if (!DoAction(link)) - throw std::string("Action failed"); + int ActionResult = DoAction(link, ErrMsg); + if (ActionResult != 0) + return ActionResult; } } catch (std::string& msg) { cleanup(); Index: llvm/tools/llvmc/CompilerDriver.h diff -u llvm/tools/llvmc/CompilerDriver.h:1.20 llvm/tools/llvmc/CompilerDriver.h:1.21 --- llvm/tools/llvmc/CompilerDriver.h:1.20 Mon May 29 13:52:05 2006 +++ llvm/tools/llvmc/CompilerDriver.h Mon Aug 21 01:04:45 2006 @@ -150,7 +150,8 @@ /// @{ public: /// @brief Execute the actions requested for the given input list. - virtual int execute(const InputList& list, const sys::Path& output) = 0; + virtual int execute( + const InputList& list, const sys::Path& output, std::string& ErrMsg) =0; /// @brief Set the final phase at which compilation terminates virtual void setFinalPhase(Phases phase) = 0; Index: llvm/tools/llvmc/llvmc.cpp diff -u llvm/tools/llvmc/llvmc.cpp:1.29 llvm/tools/llvmc/llvmc.cpp:1.30 --- llvm/tools/llvmc/llvmc.cpp:1.29 Mon May 29 13:52:05 2006 +++ llvm/tools/llvmc/llvmc.cpp Mon Aug 21 01:04:45 2006 @@ -355,9 +355,10 @@ } // Tell the driver to do its thing - int result = CD->execute(InpList, sys::Path(OutputFilename)); + std::string ErrMsg; + int result = CD->execute(InpList, sys::Path(OutputFilename), ErrMsg); if (result != 0) { - throw std::string("Error executing actions. Terminated."); + std::cerr << argv[0] << ": " << ErrMsg << '\n'; return result; } From reid at x10sys.com Mon Aug 21 01:05:06 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 21 Aug 2006 01:05:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/GraphWriter.cpp Message-ID: <200608210605.k7L656v8017885@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: GraphWriter.cpp updated: 1.3 -> 1.4 --- Log message: For PR797: http://llvm.org/PR797 : Adjust usage of the ExecuteAndWait function to use the last argument which is the ErrMsg string. This is necessitated because this function no longer throws exceptions on error. --- Diffs of the changes: (+10 -8) GraphWriter.cpp | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) Index: llvm/lib/Support/GraphWriter.cpp diff -u llvm/lib/Support/GraphWriter.cpp:1.3 llvm/lib/Support/GraphWriter.cpp:1.4 --- llvm/lib/Support/GraphWriter.cpp:1.3 Sun Aug 20 21:04:43 2006 +++ llvm/lib/Support/GraphWriter.cpp Mon Aug 21 01:04:45 2006 @@ -19,6 +19,7 @@ using namespace llvm; void llvm::DisplayGraph(const sys::Path &Filename) { + std::string ErrMsg; #if HAVE_GRAPHVIZ sys::Path Graphviz(LLVM_PATH_GRAPHVIZ); @@ -28,8 +29,8 @@ args.push_back(0); std::cerr << "Running 'Graphviz' program... " << std::flush; - if (sys::Program::ExecuteAndWait(Graphviz, &args[0])) { - std::cerr << "Error viewing graph: 'Graphviz' not in path?\n"; + if (sys::Program::ExecuteAndWait(Graphviz, &args[0],0,0,0,&ErrMsg)) { + std::cerr << "Error viewing graph: " << ErrMsg << "\n"; } #elif (HAVE_GV && HAVE_DOT) sys::Path PSFilename = Filename; @@ -48,8 +49,8 @@ args.push_back(0); std::cerr << "Running 'dot' program... " << std::flush; - if (sys::Program::ExecuteAndWait(dot, &args[0])) { - std::cerr << "Error viewing graph: 'dot' not in path?\n"; + if (sys::Program::ExecuteAndWait(dot, &args[0],0,0,0,&ErrMsg)) { + std::cerr << "Error viewing graph: '" << ErrMsg << "\n"; } else { std::cerr << " done. \n"; @@ -59,8 +60,9 @@ args.push_back(PSFilename.c_str()); args.push_back(0); - if (sys::Program::ExecuteAndWait(gv, &args[0])) { - std::cerr << "Error viewing graph: 'gv' not in path?\n"; + ErrMsg.clear(); + if (sys::Program::ExecuteAndWait(gv, &args[0],0,0,0,&ErrMsg)) { + std::cerr << "Error viewing graph: " << ErrMsg << "\n"; } } PSFilename.eraseFromDisk(); @@ -72,8 +74,8 @@ args.push_back(0); std::cerr << "Running 'dotty' program... " << std::flush; - if (sys::Program::ExecuteAndWait(dotty, &args[0])) { - std::cerr << "Error viewing graph: 'dotty' not in path?\n"; + if (sys::Program::ExecuteAndWait(dotty, &args[0],0,0,0,&ErrMsg)) { + std::cerr << "Error viewing graph: " << ErrMsg << "\n"; } else { #ifdef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns. return; From reid at x10sys.com Mon Aug 21 01:05:06 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 21 Aug 2006 01:05:06 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200608210605.k7L656vC017880@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.33 -> 1.34 --- Log message: For PR797: http://llvm.org/PR797 : Adjust usage of the ExecuteAndWait function to use the last argument which is the ErrMsg string. This is necessitated because this function no longer throws exceptions on error. --- Diffs of the changes: (+39 -12) llvm-ld.cpp | 51 +++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 39 insertions(+), 12 deletions(-) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.33 llvm/tools/llvm-ld/llvm-ld.cpp:1.34 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.33 Tue Jun 27 13:07:29 2006 +++ llvm/tools/llvm-ld/llvm-ld.cpp Mon Aug 21 01:04:45 2006 @@ -227,7 +227,8 @@ /// static int GenerateAssembly(const std::string &OutputFilename, const std::string &InputFilename, - const sys::Path &llc) { + const sys::Path &llc, + std::string &ErrMsg ) { // Run LLC to convert the bytecode file into assembly code. std::vector args; args.push_back(llc.c_str()); @@ -237,13 +238,14 @@ args.push_back(InputFilename.c_str()); args.push_back(0); - return sys::Program::ExecuteAndWait(llc,&args[0]); + return sys::Program::ExecuteAndWait(llc,&args[0],0,0,0,&ErrMsg); } /// GenerateCFile - generates a C source file from the specified bytecode file. static int GenerateCFile(const std::string &OutputFile, const std::string &InputFile, - const sys::Path &llc) { + const sys::Path &llc, + std::string& ErrMsg) { // Run LLC to convert the bytecode file into C. std::vector args; args.push_back(llc.c_str()); @@ -253,7 +255,7 @@ args.push_back(OutputFile.c_str()); args.push_back(InputFile.c_str()); args.push_back(0); - return sys::Program::ExecuteAndWait(llc, &args[0]); + return sys::Program::ExecuteAndWait(llc, &args[0],0,0,0,&ErrMsg); } /// GenerateNative - generates a native object file from the @@ -275,7 +277,8 @@ static int GenerateNative(const std::string &OutputFilename, const std::string &InputFilename, const std::vector &Libraries, - const sys::Path &gcc, char ** const envp) { + const sys::Path &gcc, char ** const envp, + std::string& ErrMsg) { // Remove these environment variables from the environment of the // programs that we will execute. It appears that GCC sets these // environment variables so that the programs it uses can configure @@ -329,7 +332,8 @@ args.push_back(0); // Run the compiler to assembly and link together the program. - int R = sys::Program::ExecuteAndWait(gcc, &args[0], (const char**)clean_env); + int R = sys::Program::ExecuteAndWait( + gcc, &args[0], (const char**)clean_env,0,0,&ErrMsg); delete [] clean_env; return R; } @@ -497,7 +501,8 @@ args[1] = RealBytecodeOutput.c_str(); args[2] = tmp_output.c_str(); args[3] = 0; - if (0 == sys::Program::ExecuteAndWait(prog, args)) { + std::string ErrMsg; + if (0 == sys::Program::ExecuteAndWait(prog, args, 0,0,0, &ErrMsg)) { if (tmp_output.isBytecodeFile()) { sys::Path target(RealBytecodeOutput); target.eraseFromDisk(); @@ -505,6 +510,9 @@ } else return PrintAndReturn( "Post-link optimization output is not bytecode"); + } else { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 2; } } } @@ -533,10 +541,19 @@ // Generate an assembly language file for the bytecode. if (Verbose) std::cout << "Generating Assembly Code\n"; - GenerateAssembly(AssemblyFile.toString(), RealBytecodeOutput, llc); + std::string ErrMsg; + if (0 != GenerateAssembly(AssemblyFile.toString(), RealBytecodeOutput, + llc, ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 1; + } + if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, AssemblyFile.toString(), Libraries, - gcc, envp); + if (0 != GenerateNative(OutputFilename, AssemblyFile.toString(), + Libraries,gcc,envp,ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 1; + } // Remove the assembly language file. AssemblyFile.eraseFromDisk(); @@ -559,9 +576,19 @@ // Generate an assembly language file for the bytecode. if (Verbose) std::cout << "Generating Assembly Code\n"; - GenerateCFile(CFile.toString(), RealBytecodeOutput, llc); + std::string ErrMsg; + if (0 != GenerateCFile( + CFile.toString(), RealBytecodeOutput, llc, ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 1; + } + if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, CFile.toString(), Libraries, gcc, envp); + if (0 != GenerateNative(OutputFilename, CFile.toString(), Libraries, + gcc, envp, ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 1; + } // Remove the assembly language file. CFile.eraseFromDisk(); From rafael.espindola at gmail.com Mon Aug 21 08:59:19 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 21 Aug 2006 08:59:19 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.td Message-ID: <200608211359.k7LDxJba009822@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMInstrInfo.td updated: 1.16 -> 1.17 --- Log message: add the and instruction --- Diffs of the changes: (+4 -0) ARMInstrInfo.td | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/Target/ARM/ARMInstrInfo.td diff -u llvm/lib/Target/ARM/ARMInstrInfo.td:1.16 llvm/lib/Target/ARM/ARMInstrInfo.td:1.17 --- llvm/lib/Target/ARM/ARMInstrInfo.td:1.16 Thu Aug 17 12:09:40 2006 +++ llvm/lib/Target/ARM/ARMInstrInfo.td Mon Aug 21 08:58:59 2006 @@ -92,3 +92,7 @@ def subri : InstARM<(ops IntRegs:$dst, IntRegs:$a, i32imm:$b), "sub $dst, $a, $b", [(set IntRegs:$dst, (sub IntRegs:$a, imm:$b))]>; + +def andrr : InstARM<(ops IntRegs:$dst, IntRegs:$a, IntRegs:$b), + "and $dst, $a, $b", + [(set IntRegs:$dst, (and IntRegs:$a, IntRegs:$b))]>; From isanbard at gmail.com Mon Aug 21 02:33:50 2006 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 21 Aug 2006 02:33:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/VirtRegMap.cpp Message-ID: <200608210733.k7L7Xo1p027403@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: VirtRegMap.cpp updated: 1.69 -> 1.70 --- Log message: Added a check so that if we have two machine instructions in this form MOV R0, R1 MOV R1, R0 the second machine instruction is removed. Added a regression test. --- Diffs of the changes: (+30 -10) VirtRegMap.cpp | 40 ++++++++++++++++++++++++++++++---------- 1 files changed, 30 insertions(+), 10 deletions(-) Index: llvm/lib/CodeGen/VirtRegMap.cpp diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.69 llvm/lib/CodeGen/VirtRegMap.cpp:1.70 --- llvm/lib/CodeGen/VirtRegMap.cpp:1.69 Fri Jul 21 16:15:20 2006 +++ llvm/lib/CodeGen/VirtRegMap.cpp Mon Aug 21 02:33:33 2006 @@ -521,6 +521,7 @@ // Process all of the spilled uses and all non spilled reg references. for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) { MachineOperand &MO = MI.getOperand(i); + if (!MO.isRegister() || MO.getReg() == 0) continue; // Ignore non-register operands. @@ -790,16 +791,37 @@ } if (!OpTakenCareOf) { - // Check to see if this is a noop copy. If so, eliminate the - // instruction before considering the dest reg to be changed. unsigned Src, Dst; - if (TII->isMoveInstr(MI, Src, Dst) && Src == Dst) { - ++NumDCE; - DEBUG(std::cerr << "Removing now-noop copy: " << MI); - MBB.erase(&MI); - VRM.RemoveFromFoldedVirtMap(&MI); - goto ProcessNextInst; + if (TII->isMoveInstr(MI, Src, Dst)) { + if (Src == Dst) { + // Check to see if this is a noop copy. If so, eliminate + // the instruction before considering the dest reg to be + // changed. + ++NumDCE; + DEBUG(std::cerr << "Removing now-noop copy: " << MI); + MBB.erase(&MI); + VRM.RemoveFromFoldedVirtMap(&MI); + goto ProcessNextInst; + } else if (MII != MBB.begin()) { + // Check to see if this is a sequence of the form: + // mov R0, R1 + // mov R1, R0 + // Eliminate the second move if so. + MachineBasicBlock::iterator PrevMII = MII; --PrevMII; + MachineInstr& PrevMI = *PrevMII; + unsigned PrevSrc, PrevDst; + + if (TII->isMoveInstr(PrevMI, PrevSrc, PrevDst)) + if (PrevSrc == Dst && PrevDst == Src) { + ++NumDCE; + DEBUG(std::cerr << "Removing now-noop copy: " << MI); + MBB.erase(&MI); + VRM.RemoveFromFoldedVirtMap(&MI); + goto ProcessNextInst; + } + } } + Spills.ClobberPhysReg(VirtReg); continue; } @@ -861,8 +883,6 @@ } } - - llvm::Spiller* llvm::createSpiller() { switch (SpillerOpt) { default: assert(0 && "Unreachable!"); From isanbard at gmail.com Mon Aug 21 02:33:50 2006 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 21 Aug 2006 02:33:50 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-08-21-ExtraMovInst.ll Message-ID: <200608210733.k7L7XohQ027406@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: 2006-08-21-ExtraMovInst.ll added (r1.1) --- Log message: Added a check so that if we have two machine instructions in this form MOV R0, R1 MOV R1, R0 the second machine instruction is removed. Added a regression test. --- Diffs of the changes: (+15 -0) 2006-08-21-ExtraMovInst.ll | 15 +++++++++++++++ 1 files changed, 15 insertions(+) Index: llvm/test/Regression/CodeGen/X86/2006-08-21-ExtraMovInst.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/2006-08-21-ExtraMovInst.ll:1.1 *** /dev/null Mon Aug 21 02:33:43 2006 --- llvm/test/Regression/CodeGen/X86/2006-08-21-ExtraMovInst.ll Mon Aug 21 02:33:33 2006 *************** *** 0 **** --- 1,15 ---- + ; RUN: llvm-as < %s | llc -fast -march=x86 -mcpu=i386 | not grep 'movl %eax, %edx' + + int %foo(int %t, int %C) { + entry: + br label %cond_true + + cond_true: ; preds = %cond_true, %entry + %t_addr.0.0 = phi int [ %t, %entry ], [ %tmp7, %cond_true ] ; [#uses=2] + %tmp7 = add int %t_addr.0.0, 1 ; [#uses=1] + %tmp = setgt int %C, 39 ; [#uses=1] + br bool %tmp, label %bb12, label %cond_true + + bb12: ; preds = %cond_true + ret int %t_addr.0.0 + } From lattner at cs.uiuc.edu Mon Aug 21 12:20:16 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 21 Aug 2006 12:20:16 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ProfileInfoLoaderPass.cpp Message-ID: <200608211720.k7LHKG8f014685@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ProfileInfoLoaderPass.cpp updated: 1.12 -> 1.13 --- Log message: Fix PR885: http://llvm.org/PR885 --- Diffs of the changes: (+2 -3) ProfileInfoLoaderPass.cpp | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/lib/Analysis/ProfileInfoLoaderPass.cpp diff -u llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.12 llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.13 --- llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.12 Thu Apr 21 16:04:58 2005 +++ llvm/lib/Analysis/ProfileInfoLoaderPass.cpp Mon Aug 21 12:20:01 2006 @@ -49,9 +49,8 @@ virtual bool runOnModule(Module &M); }; - RegisterPass - X("profile-loader", "Load profile information from llvmprof.out", - PassInfo::Analysis|PassInfo::Optimization); + RegisterOpt + X("profile-loader", "Load profile information from llvmprof.out"); RegisterAnalysisGroup Y; } // End of anonymous namespace From lattner at cs.uiuc.edu Mon Aug 21 12:20:17 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 21 Aug 2006 12:20:17 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Message-ID: <200608211720.k7LHKHL2014690@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.201 -> 1.202 --- Log message: Fix PR885: http://llvm.org/PR885 --- Diffs of the changes: (+4 -4) AsmWriter.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.201 llvm/lib/VMCore/AsmWriter.cpp:1.202 --- llvm/lib/VMCore/AsmWriter.cpp:1.201 Fri May 19 16:58:52 2006 +++ llvm/lib/VMCore/AsmWriter.cpp Mon Aug 21 12:20:01 2006 @@ -162,10 +162,10 @@ } // end namespace llvm -static RegisterPass -X("printm", "Print module to stderr",PassInfo::Analysis|PassInfo::Optimization); -static RegisterPass -Y("print","Print function to stderr",PassInfo::Analysis|PassInfo::Optimization); +static RegisterOpt +X("printm", "Print module to stderr"); +static RegisterOpt +Y("print","Print function to stderr"); static void WriteAsOperandInternal(std::ostream &Out, const Value *V, bool PrintName, From pjenkins at apple.com Mon Aug 21 15:22:09 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Mon, 21 Aug 2006 15:22:09 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/NightlyTester.php ProgramResults.php fulltest.php test.php Message-ID: <200608212022.k7LKM9FD019491@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: NightlyTester.php updated: 1.17 -> 1.18 ProgramResults.php updated: 1.7 -> 1.8 fulltest.php updated: 1.14 -> 1.15 test.php updated: 1.16 -> 1.17 --- Log message: Added a new collapsable menu to the brief and full nightly tester pages. This new menu displays the failures for the test suite. The test suite changes section of the nightly reports has also been changed so that if a category (i.e. newly passing tests newly failing tests, etc, etc) is empty, it now reports "None" instead of being blank. This prevents the report from appearing incomplete. --- Diffs of the changes: (+94 -22) NightlyTester.php | 6 +++--- ProgramResults.php | 19 +++++++++++++++++++ fulltest.php | 49 ++++++++++++++++++++++++++++++++++++++----------- test.php | 42 ++++++++++++++++++++++++++++++++++-------- 4 files changed, 94 insertions(+), 22 deletions(-) Index: nightlytest-serverside/NightlyTester.php diff -u nightlytest-serverside/NightlyTester.php:1.17 nightlytest-serverside/NightlyTester.php:1.18 --- nightlytest-serverside/NightlyTester.php:1.17 Fri Aug 18 13:52:08 2006 +++ nightlytest-serverside/NightlyTester.php Mon Aug 21 15:21:55 2006 @@ -244,7 +244,8 @@ $result=array(); //setting up the night ids - $select = "select id from night WHERE id<$night_id and machine=$machine_id order by added desc"; + $select = "select id from night WHERE id<$night_id and machine=$machine_id ". + "and buildstatus=\"OK\" order by added desc"; $query = mysql_query($select) or die (mysql_error()); $row=mysql_fetch_array($query); @@ -254,7 +255,6 @@ $old_night=$row['id']; mysql_free_result($query); - if($cur_night>0) { $cur_data=getAllFileSizes($mysql_link, $cur_night); } if($prev_night>0) { $prev_data=getAllFileSizes($mysql_link, $prev_night); } if($old_night>0) { $old_data=getAllFileSizes($mysql_link, $old_night); } @@ -270,7 +270,7 @@ foreach (array_keys($cur_data) as $file){ $cur_sum+=$cur_data["$file"]; - if(isset($prev_data["$file"]) && isset($cur_data["$file"])) { + if(isset($prev_data[$file]) && isset($cur_data["$file"])) { $prev_delta= ( $cur_data["$file"] - $prev_data["$file"] ); $prev_diff = (($cur_data["$file"] - $prev_data["$file"]) / $prev_data["$file"] ) * 100; $prev_sum+=$prev_data["$file"]; Index: nightlytest-serverside/ProgramResults.php diff -u nightlytest-serverside/ProgramResults.php:1.7 nightlytest-serverside/ProgramResults.php:1.8 --- nightlytest-serverside/ProgramResults.php:1.7 Fri Aug 18 14:18:42 2006 +++ nightlytest-serverside/ProgramResults.php Mon Aug 21 15:21:55 2006 @@ -386,6 +386,25 @@ } /* + * Get failing tests + * + * This is somewhat of a hack because from night 684 forward we now store the test + * in their own table as oppoesd in the night table. + */ +function getFailures($night_id, $mysql_link){ + $result=""; + if($night_id>=684){ + $query = "SELECT * FROM tests WHERE night=$night_id AND result=\"FAIL\" AND measure!=\"dejagnu\""; + $program_query = mysql_query($query) or die (mysql_error()); + while($row = mysql_fetch_array($program_query)){ + $result.="{$row['measure']} - {$row['program']}
\n"; + } + mysql_free_result($program_query); + } + return $result; +} + +/* * Get Unexpected failing tests * * This is somewhat of a hack because from night 684 forward we now store the test Index: nightlytest-serverside/fulltest.php diff -u nightlytest-serverside/fulltest.php:1.14 nightlytest-serverside/fulltest.php:1.15 --- nightlytest-serverside/fulltest.php:1.14 Fri Aug 18 13:52:08 2006 +++ nightlytest-serverside/fulltest.php Mon Aug 21 15:21:55 2006 @@ -133,25 +133,34 @@ * ******************************************************/ $new_tests=getNewTests($night_id, $previous_succesful_id, $mysql_link); +if(strcmp($new_tests,"")===0){ + $new_tests="None"; +} $removed_tests=getRemovedTests($night_id, $previous_succesful_id, $mysql_link); +if(strcmp($removed_tests,"")===0){ + $removed_tests="None"; +} $newly_passing_tests=getFixedTests($night_id, $previous_succesful_id, $mysql_link); +if(strcmp($newly_passing_tests,"")===0){ + $newly_passing_tests="None"; +} $newly_failing_tests=getBrokenTests($night_id, $previous_succesful_id, $mysql_link); +if(strcmp($newly_failing_tests,"")===0){ + $newly_failing_tests="None"; +} -if((strpos($new_tests, "none")!==FALSE && - strpos($removed_tests, "none")!==FALSE && - strpos($newly_passing_tests, "none")!==FALSE && - strpos($newly_failing_tests, "none")!==FALSE ) || - (strcmp($new_tests, "")==0 && - strcmp($removed_tests, "")==0 && - strcmp($newly_passing_tests, "")==0 && - strcmp($newly_failing_tests, "")==0)){ - $disp="none"; - $sign="(-)"; +if(strpos($new_tests, "None")!==FALSE && + strpos($removed_tests, "None")!==FALSE && + strpos($newly_passing_tests, "None")!==FALSE && + strpos($newly_failing_tests, "None")!==FALSE ){ + $disp="none"; + $sign="(-)"; } else{ $disp=""; $sign="(+)"; } + print "$sign Test Suite Changes\n"; print "
\n"; print"

Test suite changes:

\n"; @@ -167,6 +176,24 @@ /***************************************************** * + * Printing failures in test suite + * + ******************************************************/ +$failing_tests=getFailures($night_id, $previous_succesful_id, $mysql_link); +if(strcmp($failing_tests,"")===0){ + $newly_failing_tests="None"; +} +$disp="none"; +$sign="(-)"; +print "$sign Test Suite Failures\n"; +print "
\n"; +print"

Test suite failures:

\n"; +print"Failing tests:
\n"; +print "$failing_tests

\n"; +print "


\n"; + +/***************************************************** + * * Dejagnu result go here * ******************************************************/ @@ -485,7 +512,7 @@ $formatted_num=number_format($all_data['Total Sum'][0],0,".",","); print "Total size: $formatted_num bytes
\n"; print "Percent difference from previous test: {$all_data['Total Sum'][1]}
\n"; -print "Percent difference from five tests ago: {$all_data['Total Sum'][2]}

\n"; +print "Percent difference from five tests ago: {$all_data['Total Sum'][3]}

\n"; print "\n"; print "\t\n"; Index: nightlytest-serverside/test.php diff -u nightlytest-serverside/test.php:1.16 nightlytest-serverside/test.php:1.17 --- nightlytest-serverside/test.php:1.16 Thu Aug 17 22:50:18 2006 +++ nightlytest-serverside/test.php Mon Aug 21 15:21:55 2006 @@ -149,18 +149,26 @@ * ******************************************************/ $new_tests=getNewTests($night_id, $previous_succesful_id, $mysql_link); +if(strcmp($new_tests,"")===0){ + $new_tests="None"; +} $removed_tests=getRemovedTests($night_id, $previous_succesful_id, $mysql_link); +if(strcmp($removed_tests,"")===0){ + $removed_tests="None"; +} $newly_passing_tests=getFixedTests($night_id, $previous_succesful_id, $mysql_link); +if(strcmp($newly_passing_tests,"")===0){ + $newly_passing_tests="None"; +} $newly_failing_tests=getBrokenTests($night_id, $previous_succesful_id, $mysql_link); +if(strcmp($newly_failing_tests,"")===0){ + $newly_failing_tests="None"; +} -if((strpos($new_tests, "none")!==FALSE && - strpos($removed_tests, "none")!==FALSE && - strpos($newly_passing_tests, "none")!==FALSE && - strpos($newly_failing_tests, "none")!==FALSE ) || - (strcmp($new_tests, "")==0 && - strcmp($removed_tests, "")==0 && - strcmp($newly_passing_tests, "")==0 && - strcmp($newly_failing_tests, "")==0)){ +if(strpos($new_tests, "None")!==FALSE && + strpos($removed_tests, "None")!==FALSE && + strpos($newly_passing_tests, "None")!==FALSE && + strpos($newly_failing_tests, "None")!==FALSE ){ $disp="none"; $sign="(-)"; } @@ -183,6 +191,24 @@ /***************************************************** * + * Printing failures in test suite + * + ******************************************************/ +$failing_tests=getFailures($night_id, $previous_succesful_id, $mysql_link); +if(strcmp($failing_tests,"")===0){ + $newly_failing_tests="None"; +} +$disp="none"; +$sign="(-)"; +print "$sign Test Suite Failures\n"; +print "
\n"; +print"

Test suite failures:

\n"; +print"Failing tests:
\n"; +print "$failing_tests

\n"; +print "


\n"; + +/***************************************************** + * * Dejagnu result go here * ******************************************************/ From lattner at cs.uiuc.edu Mon Aug 21 15:25:07 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 21 Aug 2006 15:25:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200608212025.k7LKP71Z019615@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.387 -> 1.388 --- Log message: Fix PR861: http://llvm.org/PR861 --- Diffs of the changes: (+1 -0) LegalizeDAG.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.387 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.388 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.387 Mon Aug 14 18:53:35 2006 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Aug 21 15:24:53 2006 @@ -1502,6 +1502,7 @@ SDOperand Lo, Hi; ExpandOp(Tmp2, Lo, Hi); Result = DAG.getNode(ISD::RET, MVT::Other, Tmp1, Lo, Tmp3, Hi, Tmp3); + Result = LegalizeOp(Result); } else { SDNode *InVal = Tmp2.Val; unsigned NumElems = From pjenkins at apple.com Mon Aug 21 15:46:11 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Mon, 21 Aug 2006 15:46:11 -0500 Subject: [llvm-commits] CVS: llvm/utils/NewNightlyTest.pl Message-ID: <200608212046.k7LKkBM2020191@zion.cs.uiuc.edu> Changes in directory llvm/utils: NewNightlyTest.pl updated: 1.55 -> 1.56 --- Log message: The new nightly tester should stop outputing a message stating the testresults directory is not present unless the script is run as verbose. --- Diffs of the changes: (+24 -22) NewNightlyTest.pl | 46 ++++++++++++++++++++++++---------------------- 1 files changed, 24 insertions(+), 22 deletions(-) Index: llvm/utils/NewNightlyTest.pl diff -u llvm/utils/NewNightlyTest.pl:1.55 llvm/utils/NewNightlyTest.pl:1.56 --- llvm/utils/NewNightlyTest.pl:1.55 Fri Aug 18 13:00:21 2006 +++ llvm/utils/NewNightlyTest.pl Mon Aug 21 15:45:57 2006 @@ -227,7 +227,9 @@ my $DejagnuTestsLog = "$Prefix-DejagnuTests-Log.txt"; if (! -d $WebDir) { mkdir $WebDir, 0777; - warn "$WebDir did not exist; creating it.\n"; + if($VERBOSE){ + warn "$WebDir did not exist; creating it.\n"; + } } if ($VERBOSE) { @@ -941,28 +943,28 @@ @BUILD_DATA = ReadFile "$BuildLog"; $build_data = join("\n", @BUILD_DATA); -my @DEJAGNU_LOG; -my @DEJAGNU_SUM; -my $dejagnutests_log; -my $dejagnutests_sum; - at DEJAGNU_LOG = ReadFile "$DejagnuLog"; - at DEJAGNU_SUM = ReadFile "$DejagnuSum"; -$dejagnutests_log = join("\n", @DEJAGNU_LOG); -$dejagnutests_sum = join("\n", @DEJAGNU_SUM); - -my @DEJAGNULOG_FULL; -my $dejagnulog_full; - at DEJAGNULOG_FULL = ReadFile "$DejagnuTestsLog"; -$dejagnulog_full = join("\n", @DEJAGNULOG_FULL); - -my $gcc_version_long=""; -if ($GCCPATH ne "") { - $gcc_version_long = `$GCCPATH/gcc --version`; -} else { - $gcc_version_long = `gcc --version`; +my (@DEJAGNU_LOG, @DEJAGNU_SUM, @DEJAGNULOG_FULL, @GCC_VERSION); +my ($dejagnutests_log ,$dejagnutests_sum, $dejagnulog_full) = ""; +my ($gcc_version, $gcc_version_long) = ""; + +if(!$BuildError){ + @DEJAGNU_LOG = ReadFile "$DejagnuLog"; + @DEJAGNU_SUM = ReadFile "$DejagnuSum"; + $dejagnutests_log = join("\n", @DEJAGNU_LOG); + $dejagnutests_sum = join("\n", @DEJAGNU_SUM); + + @DEJAGNULOG_FULL = ReadFile "$DejagnuTestsLog"; + $dejagnulog_full = join("\n", @DEJAGNULOG_FULL); + + $gcc_version_long=""; + if ($GCCPATH ne "") { + $gcc_version_long = `$GCCPATH/gcc --version`; + } else { + $gcc_version_long = `gcc --version`; + } + @GCC_VERSION = split '\n', $gcc_version_long; + $gcc_version = $GCC_VERSION[0]; } - at GCC_VERSION = split '\n', $gcc_version_long; -my $gcc_version = $GCC_VERSION[0]; ############################################################## # From brukman at cs.uiuc.edu Mon Aug 21 15:48:41 2006 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon, 21 Aug 2006 15:48:41 -0500 Subject: [llvm-commits] CVS: llvm-www/releases/download.html Message-ID: <200608212048.k7LKmf33020431@zion.cs.uiuc.edu> Changes in directory llvm-www/releases: download.html updated: 1.36 -> 1.37 --- Log message: Lined up all download links, combined long links and anchor text on the same line for readability. No user-visible changes. --- Diffs of the changes: (+46 -130) download.html | 176 +++++++++++++++------------------------------------------- 1 files changed, 46 insertions(+), 130 deletions(-) Index: llvm-www/releases/download.html diff -u llvm-www/releases/download.html:1.36 llvm-www/releases/download.html:1.37 --- llvm-www/releases/download.html:1.36 Wed Aug 9 12:00:24 2006 +++ llvm-www/releases/download.html Mon Aug 21 15:48:27 2006 @@ -39,19 +39,17 @@ downloading:

@@ -65,33 +63,17 @@ downloading:

- -
Download LLVM 1.6
@@ -103,24 +85,14 @@
-
Download LLVM 1.5
@@ -132,25 +104,14 @@ - -
Download LLVM 1.4
@@ -162,24 +123,14 @@ -
Download LLVM 1.3
@@ -191,25 +142,16 @@

Contributed by users:

@@ -225,18 +167,10 @@ @@ -252,21 +186,11 @@ @@ -282,18 +206,10 @@ From jlaskey at apple.com Mon Aug 21 16:18:27 2006 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 21 Aug 2006 16:18:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/Dwarf.cpp Message-ID: <200608212118.k7LLIRHn021068@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: Dwarf.cpp updated: 1.4 -> 1.5 --- Log message: Adding new Dwarf constants. --- Diffs of the changes: (+1 -0) Dwarf.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Support/Dwarf.cpp diff -u llvm/lib/Support/Dwarf.cpp:1.4 llvm/lib/Support/Dwarf.cpp:1.5 --- llvm/lib/Support/Dwarf.cpp:1.4 Wed Jul 26 11:18:00 2006 +++ llvm/lib/Support/Dwarf.cpp Mon Aug 21 16:18:10 2006 @@ -189,6 +189,7 @@ case DW_AT_elemental: return "AT_elemental"; case DW_AT_pure: return "AT_pure"; case DW_AT_recursive: return "AT_recursive"; + case DW_AT_MIPS_linkage_name: return "AT_MIPS_linkage_name"; case DW_AT_sf_names: return "AT_sf_names"; case DW_AT_src_info: return "AT_src_info"; case DW_AT_mac_info: return "AT_mac_info"; From jlaskey at apple.com Mon Aug 21 16:18:27 2006 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 21 Aug 2006 16:18:27 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Dwarf.h Message-ID: <200608212118.k7LLIRCj021071@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Dwarf.h updated: 1.9 -> 1.10 --- Log message: Adding new Dwarf constants. --- Diffs of the changes: (+3 -2) Dwarf.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Support/Dwarf.h diff -u llvm/include/llvm/Support/Dwarf.h:1.9 llvm/include/llvm/Support/Dwarf.h:1.10 --- llvm/include/llvm/Support/Dwarf.h:1.9 Wed Jul 26 11:18:00 2006 +++ llvm/include/llvm/Support/Dwarf.h Mon Aug 21 16:18:10 2006 @@ -202,7 +202,8 @@ DW_AT_elemental = 0x66, DW_AT_pure = 0x67, DW_AT_recursive = 0x68, - DW_AT_sf_names = 0x2101, + DW_AT_MIPS_linkage_name = 0x2007, + DW_AT_sf_names = 0x2101, DW_AT_src_info = 0x2102, DW_AT_mac_info = 0x2103, DW_AT_src_coords = 0x2104, @@ -211,7 +212,7 @@ DW_AT_GNU_vector = 0x2107, DW_AT_lo_user = 0x2000, DW_AT_hi_user = 0x3fff, - + // Attribute form encodings DW_FORM_addr = 0x01, DW_FORM_block2 = 0x03, From jlaskey at apple.com Mon Aug 21 16:20:32 2006 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 21 Aug 2006 16:20:32 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineDebugInfo.cpp DwarfWriter.cpp Message-ID: <200608212120.k7LLKWFN021128@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineDebugInfo.cpp updated: 1.46 -> 1.47 DwarfWriter.cpp updated: 1.69 -> 1.70 --- Log message: Adding C++ member support. --- Diffs of the changes: (+152 -62) DwarfWriter.cpp | 210 ++++++++++++++++++++++++++++++++++++--------------- MachineDebugInfo.cpp | 4 2 files changed, 152 insertions(+), 62 deletions(-) Index: llvm/lib/CodeGen/MachineDebugInfo.cpp diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.46 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.47 --- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.46 Thu Jul 13 10:27:42 2006 +++ llvm/lib/CodeGen/MachineDebugInfo.cpp Mon Aug 21 16:20:18 2006 @@ -497,7 +497,8 @@ case DW_TAG_const_type: case DW_TAG_volatile_type: case DW_TAG_restrict_type: - case DW_TAG_member: return new DerivedTypeDesc(Tag); + case DW_TAG_member: + case DW_TAG_inheritance: return new DerivedTypeDesc(Tag); case DW_TAG_array_type: case DW_TAG_structure_type: case DW_TAG_union_type: @@ -788,6 +789,7 @@ case DW_TAG_volatile_type: case DW_TAG_restrict_type: case DW_TAG_member: + case DW_TAG_inheritance: return true; default: break; } Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.69 llvm/lib/CodeGen/DwarfWriter.cpp:1.70 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.69 Thu Jul 13 10:27:42 2006 +++ llvm/lib/CodeGen/DwarfWriter.cpp Mon Aug 21 16:20:18 2006 @@ -1236,7 +1236,7 @@ DIE *&DwarfWriter::getDieMapSlotFor(DebugInfoDesc *DD) { return DescToDieMap[DD]; } - + /// NewType - Create a new type DIE. /// DIE *DwarfWriter::NewType(DIE *Context, TypeDesc *TyDesc, CompileUnit *Unit) { @@ -1249,8 +1249,6 @@ return Die; } - // FIXME - Should handle other contexts that compile units. - // Check for pre-existence. DIE *&Slot = Unit->getDieMapSlotFor(TyDesc); if (Slot) return Slot; @@ -1326,71 +1324,161 @@ } case DW_TAG_structure_type: case DW_TAG_union_type: { - // FIXME - this is just the basics. // Add elements to structure type. for(unsigned i = 0, N = Elements.size(); i < N; ++i) { - DerivedTypeDesc *MemberDesc = cast(Elements[i]); - - // Extract the basic information. - const std::string &Name = MemberDesc->getName(); - TypeDesc *MemTy = MemberDesc->getFromType(); - uint64_t Size = MemberDesc->getSize(); - uint64_t Align = MemberDesc->getAlign(); - uint64_t Offset = MemberDesc->getOffset(); - - // Construct member debug information entry. - DIE *Member = new DIE(DW_TAG_member); + DebugInfoDesc *Element = Elements[i]; - // Add name if not "". - if (!Name.empty()) Member->AddString(DW_AT_name, DW_FORM_string, Name); - // Add location if available. - AddSourceLine(Member, MemberDesc->getFile(), MemberDesc->getLine()); - - // Most of the time the field info is the same as the members. - uint64_t FieldSize = Size; - uint64_t FieldAlign = Align; - uint64_t FieldOffset = Offset; - - if (TypeDesc *FromTy = MemberDesc->getFromType()) { - Member->AddDIEntry(DW_AT_type, DW_FORM_ref4, - NewType(Context, FromTy, Unit)); - FieldSize = FromTy->getSize(); - FieldAlign = FromTy->getSize(); - } + if (DerivedTypeDesc *MemberDesc = dyn_cast(Element)) { + // Add field or base class. + + unsigned Tag = MemberDesc->getTag(); - // Unless we have a bit field. - if (FieldSize != Size) { - // Construct the alignment mask. - uint64_t AlignMask = ~(FieldAlign - 1); - // Determine the high bit + 1 of the declared size. - uint64_t HiMark = (Offset + FieldSize) & AlignMask; - // Work backwards to determine the base offset of the field. - FieldOffset = HiMark - FieldSize; - // Now normalize offset to the field. - Offset -= FieldOffset; + // Extract the basic information. + const std::string &Name = MemberDesc->getName(); + TypeDesc *MemTy = MemberDesc->getFromType(); + uint64_t Size = MemberDesc->getSize(); + uint64_t Align = MemberDesc->getAlign(); + uint64_t Offset = MemberDesc->getOffset(); + + // Construct member debug information entry. + DIE *Member = new DIE(Tag); - // Maybe we need to work from the other end. - if (TD->isLittleEndian()) Offset = FieldSize - (Offset + Size); + // Add name if not "". + if (!Name.empty())Member->AddString(DW_AT_name, DW_FORM_string, Name); + // Add location if available. + AddSourceLine(Member, MemberDesc->getFile(), MemberDesc->getLine()); - Member->AddUInt(DW_AT_byte_size, 0, FieldSize >> 3); - Member->AddUInt(DW_AT_bit_size, 0, Size); - Member->AddUInt(DW_AT_bit_offset, 0, Offset); - } - - // Add computation for offset. - DIEBlock *Block = new DIEBlock(); - Block->AddUInt(DW_FORM_data1, DW_OP_plus_uconst); - Block->AddUInt(DW_FORM_udata, FieldOffset >> 3); - Block->ComputeSize(*this); - Member->AddBlock(DW_AT_data_member_location, 0, Block); - - if (MemberDesc->isProtected()) { - Member->AddUInt(DW_AT_accessibility, 0, DW_ACCESS_protected); - } else if (MemberDesc->isPrivate()) { - Member->AddUInt(DW_AT_accessibility, 0, DW_ACCESS_private); + // Most of the time the field info is the same as the members. + uint64_t FieldSize = Size; + uint64_t FieldAlign = Align; + uint64_t FieldOffset = Offset; + + if (TypeDesc *FromTy = MemberDesc->getFromType()) { + Member->AddDIEntry(DW_AT_type, DW_FORM_ref4, + NewType(Context, FromTy, Unit)); + FieldSize = FromTy->getSize(); + FieldAlign = FromTy->getSize(); + } + + // Unless we have a bit field. + if (Tag == DW_TAG_member && FieldSize != Size) { + // Construct the alignment mask. + uint64_t AlignMask = ~(FieldAlign - 1); + // Determine the high bit + 1 of the declared size. + uint64_t HiMark = (Offset + FieldSize) & AlignMask; + // Work backwards to determine the base offset of the field. + FieldOffset = HiMark - FieldSize; + // Now normalize offset to the field. + Offset -= FieldOffset; + + // Maybe we need to work from the other end. + if (TD->isLittleEndian()) Offset = FieldSize - (Offset + Size); + + // Add size and offset. + Member->AddUInt(DW_AT_byte_size, 0, FieldSize >> 3); + Member->AddUInt(DW_AT_bit_size, 0, Size); + Member->AddUInt(DW_AT_bit_offset, 0, Offset); + } + + // Add computation for offset. + DIEBlock *Block = new DIEBlock(); + Block->AddUInt(DW_FORM_data1, DW_OP_plus_uconst); + Block->AddUInt(DW_FORM_udata, FieldOffset >> 3); + Block->ComputeSize(*this); + Member->AddBlock(DW_AT_data_member_location, 0, Block); + + // Add accessibility (public default unless is base class. + if (MemberDesc->isProtected()) { + Member->AddUInt(DW_AT_accessibility, 0, DW_ACCESS_protected); + } else if (MemberDesc->isPrivate()) { + Member->AddUInt(DW_AT_accessibility, 0, DW_ACCESS_private); + } else if (Tag == DW_TAG_inheritance) { + Member->AddUInt(DW_AT_accessibility, 0, DW_ACCESS_public); + } + + Ty->AddChild(Member); + } else if (GlobalVariableDesc *StaticDesc = + dyn_cast(Element)) { + // Add static member. + + // Construct member debug information entry. + DIE *Static = new DIE(DW_TAG_variable); + + // Add name and mangled name. + const std::string &Name = StaticDesc->getDisplayName(); + const std::string &MangledName = StaticDesc->getName(); + Static->AddString(DW_AT_name, DW_FORM_string, Name); + Static->AddString(DW_AT_MIPS_linkage_name, DW_FORM_string, + MangledName); + + // Add location. + AddSourceLine(Static, StaticDesc->getFile(), StaticDesc->getLine()); + + // Add type. + if (TypeDesc *StaticTy = StaticDesc->getType()) { + Static->AddDIEntry(DW_AT_type, DW_FORM_ref4, + NewType(Context, StaticTy, Unit)); + } + + // Add flags. + Static->AddUInt(DW_AT_external, DW_FORM_flag, 1); + Static->AddUInt(DW_AT_declaration, DW_FORM_flag, 1); + + Ty->AddChild(Static); + } else if (SubprogramDesc *MethodDesc = + dyn_cast(Element)) { + // Add member function. + + // Construct member debug information entry. + DIE *Method = new DIE(DW_TAG_subprogram); + + // Add name and mangled name. + const std::string &Name = MethodDesc->getDisplayName(); + const std::string &MangledName = MethodDesc->getName(); + bool IsCTor = false; + + if (Name.empty()) { + Method->AddString(DW_AT_name, DW_FORM_string, MangledName); + IsCTor = TyDesc->getName() == MangledName; + } else { + Method->AddString(DW_AT_name, DW_FORM_string, Name); + Method->AddString(DW_AT_MIPS_linkage_name, DW_FORM_string, + MangledName); + } + + // Add location. + AddSourceLine(Method, MethodDesc->getFile(), MethodDesc->getLine()); + + // Add type. + if (CompositeTypeDesc *MethodTy = + dyn_cast_or_null(MethodDesc->getType())) { + // Get argument information. + std::vector &Args = MethodTy->getElements(); + + // If not a ctor. + if (!IsCTor) { + // Add return type. + Method->AddDIEntry(DW_AT_type, DW_FORM_ref4, + NewType(Context, dyn_cast(Args[0]), + Unit)); + } + + // Add arguments. + for(unsigned i = 1, N = Args.size(); i < N; ++i) { + DIE *Arg = new DIE(DW_TAG_formal_parameter); + Arg->AddDIEntry(DW_AT_type, DW_FORM_ref4, + NewType(Context, cast(Args[i]), Unit)); + Arg->AddUInt(DW_AT_artificial, DW_FORM_flag, 1); + Method->AddChild(Arg); + } + } + + // Add flags. + Method->AddUInt(DW_AT_external, DW_FORM_flag, 1); + Method->AddUInt(DW_AT_declaration, DW_FORM_flag, 1); + + Ty->AddChild(Method); } - - Ty->AddChild(Member); } break; } From jlaskey at apple.com Mon Aug 21 16:21:21 2006 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 21 Aug 2006 16:21:21 -0500 Subject: [llvm-commits] CVS: llvm/docs/SourceLevelDebugging.html Message-ID: <200608212121.k7LLLLks021210@zion.cs.uiuc.edu> Changes in directory llvm/docs: SourceLevelDebugging.html updated: 1.23 -> 1.24 --- Log message: Update debugging documents. --- Diffs of the changes: (+13 -1) SourceLevelDebugging.html | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletion(-) Index: llvm/docs/SourceLevelDebugging.html diff -u llvm/docs/SourceLevelDebugging.html:1.23 llvm/docs/SourceLevelDebugging.html:1.24 --- llvm/docs/SourceLevelDebugging.html:1.23 Wed Jun 21 06:08:10 2006 +++ llvm/docs/SourceLevelDebugging.html Mon Aug 21 16:21:06 2006 @@ -591,6 +591,7 @@ DW_TAG_union_type = 23 DW_TAG_vector_type = 259 DW_TAG_subroutine_type = 46 + DW_TAG_inheritance = 26

The vector flag indicates that an array type is a native packed vector.

@@ -611,6 +612,17 @@ or composite type descriptors, each representing a field member of the structure or union.

+

For C++ classes (tag = DW_TAG_structure_type), member descriptors +provide information about base classes, static members and member functions. If +a member is a derived type descriptor and has +a tag of DW_TAG_inheritance, then the type represents a base class. If +the member of is a global variable +descriptor then it represents a static member. And, if the member is a subprogram descriptor then it represents a member +function. For static members and member functions, getName() returns +the members link or the C++ mangled name. getDisplayName() the +simplied version of the name.

+

The first member of subroutine (tag = DW_TAG_subroutine_type) type elements is the return type for the subroutine. The remaining elements are the formal arguments to the subroutine.

@@ -1755,7 +1767,7 @@ Chris Lattner
LLVM Compiler Infrastructure
- Last modified: $Date: 2006/06/21 11:08:10 $ + Last modified: $Date: 2006/08/21 21:21:06 $ From pjenkins at apple.com Mon Aug 21 16:57:13 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Mon, 21 Aug 2006 16:57:13 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/popup.js test.php Message-ID: <200608212157.k7LLvDxM021913@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: popup.js updated: 1.1 -> 1.2 test.php updated: 1.17 -> 1.18 --- Log message: A button entitled "Check All" now appears next to the buttons that allow the user to graph long term results. When this button is clicked it will select all the checkboxes in the corresponding table. Upon being clicked, the button will also rename itself to "Uncheck All" and when it is clicked a second time will deselect all boxes. --- Diffs of the changes: (+27 -8) popup.js | 22 +++++++++++++++++++++- test.php | 13 ++++++------- 2 files changed, 27 insertions(+), 8 deletions(-) Index: nightlytest-serverside/popup.js diff -u nightlytest-serverside/popup.js:1.1 nightlytest-serverside/popup.js:1.2 --- nightlytest-serverside/popup.js:1.1 Fri Jul 7 19:32:18 2006 +++ nightlytest-serverside/popup.js Mon Aug 21 16:56:57 2006 @@ -110,4 +110,24 @@ document.layers[whichLayer+"_"].innerHTML="(+)"+link.substring(3,link.length); } } -}//end function \ No newline at end of file +}//end function + +var checkflag="false"; +function check(field) { + if (checkflag == "false") { + for (i = 0; i < field.length; i++) { + field[i].checked = true; + } + checkflag = "true"; + return "Uncheck all"; + } + else { + for (i = 0; i < field.length; i++) { + if(field[i].type == 'checkbox'){ + field[i].checked = false; + } + } + checkflag = "false"; + return "Check all"; + } +} \ No newline at end of file Index: nightlytest-serverside/test.php diff -u nightlytest-serverside/test.php:1.17 nightlytest-serverside/test.php:1.18 --- nightlytest-serverside/test.php:1.17 Mon Aug 21 15:21:55 2006 +++ nightlytest-serverside/test.php Mon Aug 21 16:56:57 2006 @@ -27,11 +27,9 @@ die(); } - $mysql_link=mysql_connect("127.0.0.1","llvm","ll2002vm") or die("Error: could not connect to database!\n"); mysql_select_db("nightlytestresults"); - $row = getMachineInfo($machine_id,$mysql_link); $today_row = getNightInfo($night_id,$mysql_link); $cur_date=$today_row['added']; @@ -41,9 +39,7 @@ $yesterday_row = mysql_fetch_array($today_query); $oldday_row = mysql_fetch_array($today_query); mysql_free_result($today_query); - -$previous_succesful_id = getPreviousWorkingNight($night_id, $mysql_link); - +$previous_succesful_id = $yesterday_row['id']; ?> @@ -124,7 +120,7 @@ /***************************************************** * - * Printing the times table + * Printing the build status * ******************************************************/ if(strpos($today_row['buildstatus'], "OK")===FALSE){ @@ -176,6 +172,7 @@ $disp=""; $sign="(+)"; } + print "$sign Test Suite Changes\n"; print "
\n"; print"

Test suite changes:

\n"; @@ -582,7 +579,7 @@ print "\t\n"; if(strcmp($d, "Total Sum")!=0){ - print "\t\t\n"; + print "\t\t\n"; } else{ print "\t\t\n"; @@ -605,6 +602,7 @@ print "\n"; print "
\n"; #ending black border around table print " | "; +print " | \n"; print "\n"; print "\n"; print "


\n"; @@ -719,6 +717,7 @@ print "\n"; print "
\n"; #ending black border around table print " | "; + print " | \n"; print "\n"; print "\n"; print "

\n"; From rafael.espindola at gmail.com Mon Aug 21 17:00:49 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 21 Aug 2006 17:00:49 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/select.ll Message-ID: <200608212200.k7LM0nPR022004@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/ARM: select.ll added (r1.1) --- Log message: initial support for select --- Diffs of the changes: (+15 -0) select.ll | 15 +++++++++++++++ 1 files changed, 15 insertions(+) Index: llvm/test/Regression/CodeGen/ARM/select.ll diff -c /dev/null llvm/test/Regression/CodeGen/ARM/select.ll:1.1 *** /dev/null Mon Aug 21 17:00:42 2006 --- llvm/test/Regression/CodeGen/ARM/select.ll Mon Aug 21 17:00:32 2006 *************** *** 0 **** --- 1,15 ---- + int %f(int %a) { + entry: + %tmp = seteq int %a, 4 ; [#uses=1] + br bool %tmp, label %cond_false, label %cond_true + + cond_true: ; preds = %entry + br label %return + + cond_false: ; preds = %entry + br label %return + + return: ; preds = %cond_false, %cond_true + %retval.0 = phi int [ 2, %cond_true ], [ 3, %cond_false ] ; [#uses=1] + ret int %retval.0 + } From rafael.espindola at gmail.com Mon Aug 21 17:00:49 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 21 Aug 2006 17:00:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp ARMInstrInfo.td ARMTargetMachine.cpp Message-ID: <200608212200.k7LM0nDt022002@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelDAGToDAG.cpp updated: 1.32 -> 1.33 ARMInstrInfo.td updated: 1.17 -> 1.18 ARMTargetMachine.cpp updated: 1.5 -> 1.6 --- Log message: initial support for select --- Diffs of the changes: (+42 -1) ARMISelDAGToDAG.cpp | 26 +++++++++++++++++++++++++- ARMInstrInfo.td | 14 ++++++++++++++ ARMTargetMachine.cpp | 3 +++ 3 files changed, 42 insertions(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.32 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.33 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.32 Sat Aug 19 20:49:49 2006 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Mon Aug 21 17:00:32 2006 @@ -51,6 +51,9 @@ setOperationAction(ISD::GlobalAddress, MVT::i32, Custom); setOperationAction(ISD::ConstantPool, MVT::i32, Custom); + setOperationAction(ISD::SETCC, MVT::i32, Expand); + setOperationAction(ISD::SELECT_CC, MVT::i32, Custom); + setSchedulingPreference(SchedulingForRegPressure); computeRegisterProperties(); } @@ -64,7 +67,11 @@ CALL, /// Return with a flag operand. - RET_FLAG + RET_FLAG, + + CMP, + + SELECT }; } } @@ -74,6 +81,8 @@ default: return 0; case ARMISD::CALL: return "ARMISD::CALL"; case ARMISD::RET_FLAG: return "ARMISD::RET_FLAG"; + case ARMISD::SELECT: return "ARMISD::SELECT"; + case ARMISD::CMP: return "ARMISD::CMP"; } } @@ -290,6 +299,19 @@ return DAG.getNode(ISD::MERGE_VALUES, RetVT, &ArgValues[0], ArgValues.size()); } +static SDOperand LowerSELECT_CC(SDOperand Op, SelectionDAG &DAG) { + SDOperand LHS = Op.getOperand(0); + SDOperand RHS = Op.getOperand(1); + ISD::CondCode CC = cast(Op.getOperand(4))->get(); + SDOperand TrueVal = Op.getOperand(2); + SDOperand FalseVal = Op.getOperand(3); + + assert(CC == ISD::SETEQ); + + SDOperand Cmp = DAG.getNode(ARMISD::CMP, MVT::Flag, LHS, RHS); + return DAG.getNode(ARMISD::SELECT, MVT::i32, FalseVal, TrueVal, Cmp); +} + SDOperand ARMTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) { switch (Op.getOpcode()) { default: @@ -305,6 +327,8 @@ return LowerCALL(Op, DAG); case ISD::RET: return LowerRET(Op, DAG); + case ISD::SELECT_CC: + return LowerSELECT_CC(Op, DAG); } } Index: llvm/lib/Target/ARM/ARMInstrInfo.td diff -u llvm/lib/Target/ARM/ARMInstrInfo.td:1.17 llvm/lib/Target/ARM/ARMInstrInfo.td:1.18 --- llvm/lib/Target/ARM/ARMInstrInfo.td:1.17 Mon Aug 21 08:58:59 2006 +++ llvm/lib/Target/ARM/ARMInstrInfo.td Mon Aug 21 17:00:32 2006 @@ -48,6 +48,10 @@ [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>; def retflag : SDNode<"ARMISD::RET_FLAG", SDTRet, [SDNPHasChain, SDNPOptInFlag]>; +def armselect : SDNode<"ARMISD::SELECT", SDTIntBinOp, [SDNPInFlag, SDNPOutFlag]>; + +def SDTVoidBinOp : SDTypeProfile<0, 2, [SDTCisSameAs<0, 1>]>; +def armcmp : SDNode<"ARMISD::CMP", SDTVoidBinOp, [SDNPOutFlag]>; def ADJCALLSTACKUP : InstARM<(ops i32imm:$amt), "!ADJCALLSTACKUP $amt", @@ -96,3 +100,13 @@ def andrr : InstARM<(ops IntRegs:$dst, IntRegs:$a, IntRegs:$b), "and $dst, $a, $b", [(set IntRegs:$dst, (and IntRegs:$a, IntRegs:$b))]>; + +let isTwoAddress = 1 in { + def moveq : InstARM<(ops IntRegs:$dst, IntRegs:$false, IntRegs:$true), + "moveq $dst, $true", + [(set IntRegs:$dst, (armselect IntRegs:$true, IntRegs:$false))]>; +} + +def cmp : InstARM<(ops IntRegs:$a, IntRegs:$b), + "cmp $a, $b", + [(armcmp IntRegs:$a, IntRegs:$b)]>; Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.5 llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.6 --- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.5 Wed Aug 16 09:43:33 2006 +++ llvm/lib/Target/ARM/ARMTargetMachine.cpp Mon Aug 21 17:00:32 2006 @@ -61,6 +61,9 @@ if (!Fast) PM.add(createLoopStrengthReducePass()); + if (!Fast) + PM.add(createCFGSimplificationPass()); + // FIXME: Implement efficient support for garbage collection intrinsics. PM.add(createLowerGCPass()); From lattner at cs.uiuc.edu Mon Aug 21 17:56:44 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 21 Aug 2006 17:56:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Message-ID: <200608212256.k7LMuiqk023052@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveIntervalAnalysis.cpp updated: 1.163 -> 1.164 --- Log message: Print debug info as: *** Register mapping *** reg 1024 -> %reg1028 reg 1026 -> EAX reg 1027 -> %reg1028 instead of: *** Register mapping *** reg 1024 -> reg 1028 reg 1026 -> reg 15 reg 1027 -> reg 1028 --- Diffs of the changes: (+5 -2) LiveIntervalAnalysis.cpp | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.163 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.164 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.163 Fri Jul 21 16:15:20 2006 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Aug 21 17:56:29 2006 @@ -820,8 +820,11 @@ DEBUG(std::cerr << "*** Register mapping ***\n"); DEBUG(for (int i = 0, e = r2rMap_.size(); i != e; ++i) - if (r2rMap_[i]) - std::cerr << " reg " << i << " -> reg " << r2rMap_[i] << "\n"); + if (r2rMap_[i]) { + std::cerr << " reg " << i << " -> "; + printRegName(r2rMap_[i]); + std::cerr << "\n"; + }); } /// Return true if the two specified registers belong to different register From jlaskey at apple.com Mon Aug 21 17:57:45 2006 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 21 Aug 2006 17:57:45 -0500 Subject: [llvm-commits] CVS: llvm/docs/SourceLevelDebugging.html Message-ID: <200608212257.k7LMvjex023125@zion.cs.uiuc.edu> Changes in directory llvm/docs: SourceLevelDebugging.html updated: 1.24 -> 1.25 --- Log message: Update info on mangled names. --- Diffs of the changes: (+9 -3) SourceLevelDebugging.html | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) Index: llvm/docs/SourceLevelDebugging.html diff -u llvm/docs/SourceLevelDebugging.html:1.24 llvm/docs/SourceLevelDebugging.html:1.25 --- llvm/docs/SourceLevelDebugging.html:1.24 Mon Aug 21 16:21:06 2006 +++ llvm/docs/SourceLevelDebugging.html Mon Aug 21 17:57:31 2006 @@ -389,6 +389,7 @@ { }*, ;; Global variable anchor = cast (%llvm.dbg.anchor.type* %llvm.dbg.global_variables to { }*), { }*, ;; Reference to context descriptor sbyte*, ;; Name + sbyte*, ;; Display name (unmangled name if Name is the C++ mangled name) { }*, ;; Reference to compile unit where defined uint, ;; Line number where defined { }*, ;; Reference to type descriptor @@ -416,6 +417,7 @@ { }*, ;; Subprogram anchor = cast (%llvm.dbg.anchor.type* %llvm.dbg.subprograms to { }*), { }*, ;; Reference to context descriptor sbyte*, ;; Name + sbyte*, ;; Display name (unmangled name if Name is the C++ mangled name) { }*, ;; Reference to compile unit where defined uint, ;; Line number where defined { }*, ;; Reference to type descriptor @@ -1140,6 +1142,7 @@ { }* cast (%llvm.dbg.anchor.type* %llvm.dbg.global_variables to { }*), { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), sbyte* getelementptr ([9 x sbyte]* %str1, int 0, int 0), + sbyte* getelementptr ([1 x sbyte]* %str2, int 0, int 0), { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), uint 1, { }* cast (%llvm.dbg.basictype.type* %llvm.dbg.basictype to { }*), @@ -1154,7 +1157,7 @@ %llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { uint add(uint 36, uint 262144), { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), - sbyte* getelementptr ([4 x sbyte]* %str2, int 0, int 0), + sbyte* getelementptr ([4 x sbyte]* %str3, int 0, int 0), { }* null, int 0, uint 32, @@ -1166,7 +1169,8 @@ ;; Define the names of the global variable and basic type. ;; %str1 = internal constant [9 x sbyte] c"MyGlobal\00", section "llvm.metadata" -%str2 = internal constant [4 x sbyte] c"int\00", section "llvm.metadata" +%str2 = internal constant [1 x sbyte] c"\00", section "llvm.metadata" +%str3 = internal constant [4 x sbyte] c"int\00", section "llvm.metadata" @@ -1213,6 +1217,7 @@ { }* cast (%llvm.dbg.anchor.type* %llvm.dbg.subprograms to { }*), { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), sbyte* getelementptr ([5 x sbyte]* %str1, int 0, int 0), + sbyte* getelementptr ([1 x sbyte]* %str2, int 0, int 0), { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), uint 1, { }* null, @@ -1223,6 +1228,7 @@ ;; Define the name of the subprogram. ;; %str1 = internal constant [5 x sbyte] c"main\00", section "llvm.metadata" +%str2 = internal constant [1 x sbyte] c"\00", section "llvm.metadata" ;; ;; Define the subprogram itself. @@ -1767,7 +1773,7 @@ Chris Lattner
LLVM Compiler Infrastructure
- Last modified: $Date: 2006/08/21 21:21:06 $ + Last modified: $Date: 2006/08/21 22:57:31 $ From lattner at cs.uiuc.edu Mon Aug 21 18:04:08 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 21 Aug 2006 18:04:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Message-ID: <200608212304.k7LN48GL023278@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveIntervalAnalysis.cpp updated: 1.164 -> 1.165 --- Log message: Print physreg names symbolically in dumps --- Diffs of the changes: (+3 -2) LiveIntervalAnalysis.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.164 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.165 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.164 Mon Aug 21 17:56:29 2006 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Aug 21 18:03:54 2006 @@ -735,8 +735,9 @@ assert(SrcInt.reg == SrcReg && DestInt.reg == DestReg && "Register mapping is horribly broken!"); - DEBUG(std::cerr << "\t\tInspecting " << SrcInt << " and " << DestInt - << ": "); + DEBUG(std::cerr << "\t\tInspecting "; SrcInt.print(std::cerr, mri_); + std::cerr << " and "; DestInt.print(std::cerr, mri_); + std::cerr << ": "); // If two intervals contain a single value and are joined by a copy, it // does not matter if the intervals overlap, they can always be joined. From lattner at cs.uiuc.edu Mon Aug 21 18:15:26 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 21 Aug 2006 18:15:26 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveInterval.h Message-ID: <200608212315.k7LNFQld023571@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveInterval.h updated: 1.16 -> 1.17 --- Log message: move LiveInterval state all together --- Diffs of the changes: (+3 -1) LiveInterval.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/LiveInterval.h diff -u llvm/include/llvm/CodeGen/LiveInterval.h:1.16 llvm/include/llvm/CodeGen/LiveInterval.h:1.17 --- llvm/include/llvm/CodeGen/LiveInterval.h:1.16 Thu Jan 26 14:41:32 2006 +++ llvm/include/llvm/CodeGen/LiveInterval.h Mon Aug 21 18:15:12 2006 @@ -76,6 +76,9 @@ unsigned reg; // the register of this interval float weight; // weight of this interval Ranges ranges; // the ranges in which this register is live + private: + unsigned NumValues; // the number of distinct values in this interval. + public: LiveInterval(unsigned Reg, float Weight) : reg(Reg), weight(Weight), NumValues(0) { @@ -189,7 +192,6 @@ void dump() const; private: - unsigned NumValues; // the number of distinct values in this interval. Ranges::iterator addRangeFrom(LiveRange LR, Ranges::iterator From); void extendIntervalEndTo(Ranges::iterator I, unsigned NewEnd); Ranges::iterator extendIntervalStartTo(Ranges::iterator I, unsigned NewStr); From isanbard at gmail.com Mon Aug 21 23:36:18 2006 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 21 Aug 2006 21:36:18 -0700 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/select.ll Message-ID: <16e5fdf90608212136x4c66ee79hfcbe740b41ae1cda@mail.gmail.com> Hi, This testcase doesn't have a "RUN" line in it. It's failing the regression tests. -bw From isanbard at gmail.com Mon Aug 21 23:38:05 2006 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 21 Aug 2006 23:38:05 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Other/2002-01-31-CallGraph.ll 2002-01-31-PostDomSet-2.ll 2002-01-31-PostDomSet.ll 2002-08-02-DomSetProblem.ll 2003-02-19-LoopInfoNestingBug.ll Message-ID: <200608220438.k7M4c50i029926@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Other: 2002-01-31-CallGraph.ll updated: 1.1 -> 1.2 2002-01-31-PostDomSet-2.ll updated: 1.1 -> 1.2 2002-01-31-PostDomSet.ll updated: 1.2 -> 1.3 2002-08-02-DomSetProblem.ll updated: 1.1 -> 1.2 2003-02-19-LoopInfoNestingBug.ll updated: 1.2 -> 1.3 --- Log message: Modified the RUN line from "analyze ..." to "opt -analyze ..." because Reid removed the analyze tool and incorporated it into the opt tool. --- Diffs of the changes: (+5 -5) 2002-01-31-CallGraph.ll | 2 +- 2002-01-31-PostDomSet-2.ll | 2 +- 2002-01-31-PostDomSet.ll | 2 +- 2002-08-02-DomSetProblem.ll | 2 +- 2003-02-19-LoopInfoNestingBug.ll | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/test/Regression/Other/2002-01-31-CallGraph.ll diff -u llvm/test/Regression/Other/2002-01-31-CallGraph.ll:1.1 llvm/test/Regression/Other/2002-01-31-CallGraph.ll:1.2 --- llvm/test/Regression/Other/2002-01-31-CallGraph.ll:1.1 Thu Jan 31 23:04:58 2002 +++ llvm/test/Regression/Other/2002-01-31-CallGraph.ll Mon Aug 21 23:37:51 2006 @@ -1,6 +1,6 @@ ; Call graph construction crash: Not handling indirect calls right ; -; RUN: analyze -callgraph %s +; RUN: opt -analyze -callgraph %s ; %FunTy = type int(int) Index: llvm/test/Regression/Other/2002-01-31-PostDomSet-2.ll diff -u llvm/test/Regression/Other/2002-01-31-PostDomSet-2.ll:1.1 llvm/test/Regression/Other/2002-01-31-PostDomSet-2.ll:1.2 --- llvm/test/Regression/Other/2002-01-31-PostDomSet-2.ll:1.1 Tue Jul 23 13:28:03 2002 +++ llvm/test/Regression/Other/2002-01-31-PostDomSet-2.ll Mon Aug 21 23:37:51 2006 @@ -1,6 +1,6 @@ ; Crash in post dominator set construction. ; -; RUN: analyze -postdomset %s +; RUN: opt -analyze -postdomset %s ; implementation Index: llvm/test/Regression/Other/2002-01-31-PostDomSet.ll diff -u llvm/test/Regression/Other/2002-01-31-PostDomSet.ll:1.2 llvm/test/Regression/Other/2002-01-31-PostDomSet.ll:1.3 --- llvm/test/Regression/Other/2002-01-31-PostDomSet.ll:1.2 Thu Jan 31 22:44:38 2002 +++ llvm/test/Regression/Other/2002-01-31-PostDomSet.ll Mon Aug 21 23:37:51 2006 @@ -1,6 +1,6 @@ ; Crash in post dominator set construction. ; -; RUN: analyze -postdomset %s +; RUN: opt -analyze -postdomset %s ; implementation Index: llvm/test/Regression/Other/2002-08-02-DomSetProblem.ll diff -u llvm/test/Regression/Other/2002-08-02-DomSetProblem.ll:1.1 llvm/test/Regression/Other/2002-08-02-DomSetProblem.ll:1.2 --- llvm/test/Regression/Other/2002-08-02-DomSetProblem.ll:1.1 Fri Aug 2 11:41:21 2002 +++ llvm/test/Regression/Other/2002-08-02-DomSetProblem.ll Mon Aug 21 23:37:51 2006 @@ -2,7 +2,7 @@ ; blocks. These blocks should at least dominate themselves. This is ; fouling up the verify pass. ; -; RUN: analyze -domset %s | grep BB +; RUN: opt -analyze -domset %s | grep BB void %test() { ret void Index: llvm/test/Regression/Other/2003-02-19-LoopInfoNestingBug.ll diff -u llvm/test/Regression/Other/2003-02-19-LoopInfoNestingBug.ll:1.2 llvm/test/Regression/Other/2003-02-19-LoopInfoNestingBug.ll:1.3 --- llvm/test/Regression/Other/2003-02-19-LoopInfoNestingBug.ll:1.2 Tue Jul 1 16:03:30 2003 +++ llvm/test/Regression/Other/2003-02-19-LoopInfoNestingBug.ll Mon Aug 21 23:37:51 2006 @@ -2,7 +2,7 @@ ; figure out that loop "Inner" should be nested inside of leep "LoopHeader", ; and instead nests it just inside loop "Top" ; -; RUN: analyze -loops %s | grep ' Loop Containing:[ ]*%Inner' +; RUN: opt -analyze -loops %s | grep ' Loop Containing:[ ]*%Inner' ; implementation From reid at x10sys.com Tue Aug 22 00:28:52 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 00:28:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.inc Message-ID: <200608220528.k7M5Sqcu031543@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.inc updated: 1.51 -> 1.52 --- Log message: Make an error message a little more intelligible. --- Diffs of the changes: (+1 -1) Path.inc | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/System/Unix/Path.inc diff -u llvm/lib/System/Unix/Path.inc:1.51 llvm/lib/System/Unix/Path.inc:1.52 --- llvm/lib/System/Unix/Path.inc:1.51 Mon Aug 7 00:20:05 2006 +++ llvm/lib/System/Unix/Path.inc Tue Aug 22 00:28:38 2006 @@ -352,7 +352,7 @@ Path::getFileStatus(FileStatus &info, std::string *ErrStr) const { struct stat buf; if (0 != stat(path.c_str(), &buf)) - return GetErrno(path + ": can't determine type of path object: ", ErrStr); + return GetErrno(path + ": can't get status of file '" + path + "'", ErrStr); info.fileSize = buf.st_size; info.modTime.fromEpochTime(buf.st_mtime); info.mode = buf.st_mode; From reid at x10sys.com Tue Aug 22 00:37:58 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 00:37:58 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/select.ll Message-ID: <200608220537.k7M5bwUQ031819@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/ARM: select.ll updated: 1.1 -> 1.2 --- Log message: Add a simple RUN line so this doesn't always fail. XFAIL this until Rafael can get a chance to fix it. --- Diffs of the changes: (+2 -0) select.ll | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/test/Regression/CodeGen/ARM/select.ll diff -u llvm/test/Regression/CodeGen/ARM/select.ll:1.1 llvm/test/Regression/CodeGen/ARM/select.ll:1.2 --- llvm/test/Regression/CodeGen/ARM/select.ll:1.1 Mon Aug 21 17:00:32 2006 +++ llvm/test/Regression/CodeGen/ARM/select.ll Tue Aug 22 00:37:43 2006 @@ -1,3 +1,5 @@ +; RUN llvm-as %s -o /dev/null -f +; XFAIL: ALL int %f(int %a) { entry: %tmp = seteq int %a, 4 ; [#uses=1] From reid at x10sys.com Tue Aug 22 00:41:05 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 00:41:05 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/select.ll Message-ID: <200608220541.k7M5f58t031901@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/ARM: select.ll updated: 1.2 -> 1.3 --- Log message: Use the correct syntax. Note to self: test before committing things! --- Diffs of the changes: (+2 -2) select.ll | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/Regression/CodeGen/ARM/select.ll diff -u llvm/test/Regression/CodeGen/ARM/select.ll:1.2 llvm/test/Regression/CodeGen/ARM/select.ll:1.3 --- llvm/test/Regression/CodeGen/ARM/select.ll:1.2 Tue Aug 22 00:37:43 2006 +++ llvm/test/Regression/CodeGen/ARM/select.ll Tue Aug 22 00:40:51 2006 @@ -1,5 +1,5 @@ -; RUN llvm-as %s -o /dev/null -f -; XFAIL: ALL +; RUN: llvm-as %s -o /dev/null -f +; XFAIL: * int %f(int %a) { entry: %tmp = seteq int %a, 4 ; [#uses=1] From lattner at cs.uiuc.edu Tue Aug 22 01:27:31 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 22 Aug 2006 01:27:31 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/SmallVector.h Message-ID: <200608220627.k7M6RVDl000397@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: SmallVector.h updated: 1.14 -> 1.15 --- Log message: add a bunch more operations, including swap, insert, erase, front(), and bugfixes for operator=. --- Diffs of the changes: (+115 -13) SmallVector.h | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 115 insertions(+), 13 deletions(-) Index: llvm/include/llvm/ADT/SmallVector.h diff -u llvm/include/llvm/ADT/SmallVector.h:1.14 llvm/include/llvm/ADT/SmallVector.h:1.15 --- llvm/include/llvm/ADT/SmallVector.h:1.14 Wed Aug 16 17:09:24 2006 +++ llvm/include/llvm/ADT/SmallVector.h Tue Aug 22 01:27:16 2006 @@ -48,8 +48,7 @@ ~SmallVectorImpl() { // Destroy the constructed elements in the vector. - for (iterator I = Begin, E = End; I != E; ++I) - I->~T(); + destroy_range(Begin, End); // If this wasn't grown from the inline copy, deallocate the old space. if (!isSmall()) @@ -78,6 +77,13 @@ return Begin[idx]; } + reference front() { + return begin()[0]; + } + const_reference front() const { + return begin()[0]; + } + reference back() { return end()[-1]; } @@ -102,9 +108,44 @@ } void clear() { - while (End != Begin) { - End->~T(); - --End; + destroy_range(Begin, End); + End = Begin; + } + + void swap(SmallVectorImpl &RHS) { + if (this == &RHS) return; + + // We can only avoid copying elements if neither vector is small. + if (!isSmall() && !RHS.isSmall()) { + std::swap(Begin, RHS.Begin); + std::swap(End, RHS.End); + std::swap(Capacity, RHS.Capacity); + return; + } + if (Begin+RHS.size() > Capacity) + grow(RHS.size()); + if (RHS.begin()+size() > RHS.Capacity) + RHS.grow(size()); + + // Swap the shared elements. + unsigned NumShared = size(); + if (NumShared > RHS.size()) NumShared = RHS.size(); + for (unsigned i = 0; i != NumShared; ++i) + std::swap(Begin[i], RHS[i]); + + // Copy over the extra elts. + if (size() > RHS.size()) { + unsigned EltDiff = size() - RHS.size(); + std::uninitialized_copy(Begin+NumShared, End, RHS.End); + RHS.End += EltDiff; + destroy_range(Begin+NumShared, End); + End = Begin+NumShared; + } else if (RHS.size() > size()) { + unsigned EltDiff = RHS.size() - size(); + std::uninitialized_copy(RHS.Begin+NumShared, RHS.End, End); + End += EltDiff; + destroy_range(RHS.Begin+NumShared, RHS.End); + RHS.End = RHS.Begin+NumShared; } } @@ -131,6 +172,42 @@ new (Begin+NumElts-1) T(Elt); } + void erase(iterator I) { + // Shift all elts down one. + std::copy(I+1, End, I); + // Drop the last elt. + pop_back(); + } + + void erase(iterator S, iterator E) { + // Shift all elts down. + iterator I = std::copy(E, End, S); + // Drop the last elts. + destroy_range(I, End); + End = I; + } + + iterator insert(iterator I, const T &Elt) { + if (I == End) { // Important special case for empty vector. + push_back(Elt); + return end()-1; + } + + if (End < Capacity) { + Retry: + new (End) T(back()); + ++End; + // Push everything else over. + std::copy_backward(I, End-1, End); + *I = Elt; + return I; + } + unsigned EltNo = I-Begin; + grow(); + I = Begin+EltNo; + goto Retry; + } + const SmallVectorImpl &operator=(const SmallVectorImpl &RHS); private: @@ -143,6 +220,13 @@ /// grow - double the size of the allocated memory, guaranteeing space for at /// least one more element or MinSize if specified. void grow(unsigned MinSize = 0); + + void destroy_range(T *S, T *E) { + while (S != E) { + E->~T(); + --E; + } + } }; // Define this out-of-line to dissuade the C++ compiler from inlining it. @@ -159,8 +243,7 @@ std::uninitialized_copy(Begin, End, NewElts); // Destroy the original elements. - for (iterator I = Begin, E = End; I != E; ++I) - I->~T(); + destroy_range(Begin, End); // If this wasn't grown from the inline copy, deallocate the old space. if (!isSmall()) @@ -183,14 +266,13 @@ unsigned CurSize = size(); if (CurSize >= RHSSize) { // Assign common elements. - std::copy(RHS.Begin, RHS.Begin+RHSSize, Begin); + iterator NewEnd = std::copy(RHS.Begin, RHS.Begin+RHSSize, Begin); // Destroy excess elements. - for (unsigned i = RHSSize; i != CurSize; ++i) - Begin[i].~T(); + destroy_range(NewEnd, End); // Trim. - End = Begin + RHSSize; + End = NewEnd; return *this; } @@ -198,8 +280,7 @@ // This allows us to avoid copying them during the grow. if (unsigned(Capacity-Begin) < RHSSize) { // Destroy current elements. - for (iterator I = Begin, E = End; I != E; ++I) - I->~T(); + destroy_range(Begin, End); End = Begin; CurSize = 0; grow(RHSSize); @@ -255,8 +336,29 @@ SmallVector(const SmallVector &RHS) : SmallVectorImpl(NumTsAvailable) { operator=(RHS); } + + const SmallVector &operator=(const SmallVector &RHS) { + SmallVectorImpl::operator=(RHS); + return *this; + } }; } // End llvm namespace +namespace std { + /// Implement std::swap in terms of SmallVector swap. + template + inline void + swap(llvm::SmallVectorImpl &LHS, llvm::SmallVectorImpl &RHS) { + LHS.swap(RHS); + } + + /// Implement std::swap in terms of SmallVector swap. + template + inline void + swap(llvm::SmallVector &LHS, llvm::SmallVector &RHS) { + LHS.swap(RHS); + } +} + #endif From lattner at cs.uiuc.edu Tue Aug 22 01:33:10 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 22 Aug 2006 01:33:10 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveInterval.h Message-ID: <200608220633.k7M6XAk4000527@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveInterval.h updated: 1.17 -> 1.18 --- Log message: Switch to using smallvector for liveintervals. This speeds up live interval analysis 11% on kc++. --- Diffs of the changes: (+2 -1) LiveInterval.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/LiveInterval.h diff -u llvm/include/llvm/CodeGen/LiveInterval.h:1.17 llvm/include/llvm/CodeGen/LiveInterval.h:1.18 --- llvm/include/llvm/CodeGen/LiveInterval.h:1.17 Mon Aug 21 18:15:12 2006 +++ llvm/include/llvm/CodeGen/LiveInterval.h Tue Aug 22 01:32:56 2006 @@ -21,6 +21,7 @@ #ifndef LLVM_CODEGEN_LIVEINTERVAL_H #define LLVM_CODEGEN_LIVEINTERVAL_H +#include "llvm/ADT/SmallVector.h" #include #include #include @@ -72,7 +73,7 @@ /// register or value. This class also contains a bit of register allocator /// state. struct LiveInterval { - typedef std::vector Ranges; + typedef SmallVector Ranges; unsigned reg; // the register of this interval float weight; // weight of this interval Ranges ranges; // the ranges in which this register is live From lattner at cs.uiuc.edu Tue Aug 22 01:43:38 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 22 Aug 2006 01:43:38 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/select.ll Message-ID: <200608220643.k7M6hc7v000759@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/ARM: select.ll updated: 1.3 -> 1.4 --- Log message: This passes. --- Diffs of the changes: (+1 -1) select.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/ARM/select.ll diff -u llvm/test/Regression/CodeGen/ARM/select.ll:1.3 llvm/test/Regression/CodeGen/ARM/select.ll:1.4 --- llvm/test/Regression/CodeGen/ARM/select.ll:1.3 Tue Aug 22 00:40:51 2006 +++ llvm/test/Regression/CodeGen/ARM/select.ll Tue Aug 22 01:43:24 2006 @@ -1,5 +1,5 @@ ; RUN: llvm-as %s -o /dev/null -f -; XFAIL: * + int %f(int %a) { entry: %tmp = seteq int %a, 4 ; [#uses=1] From rafael.espindola at gmail.com Tue Aug 22 07:23:06 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Tue, 22 Aug 2006 07:23:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/README.txt Message-ID: <200608221223.k7MCN67O027178@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: README.txt added (r1.1) --- Log message: add a README.txt --- Diffs of the changes: (+9 -0) README.txt | 9 +++++++++ 1 files changed, 9 insertions(+) Index: llvm/lib/Target/ARM/README.txt diff -c /dev/null llvm/lib/Target/ARM/README.txt:1.1 *** /dev/null Tue Aug 22 07:22:56 2006 --- llvm/lib/Target/ARM/README.txt Tue Aug 22 07:22:46 2006 *************** *** 0 **** --- 1,9 ---- + //===---------------------------------------------------------------------===// + // Random ideas for the ARM backend. + //===---------------------------------------------------------------------===// + + Consider implementing a select with two conditional moves: + + cmp x, y + moveq dst, a + movne dst, b From reid at x10sys.com Tue Aug 22 10:57:06 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 10:57:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Program.inc Message-ID: <200608221557.k7MFv6sS032144@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Program.inc updated: 1.21 -> 1.22 --- Log message: For PR797: http://llvm.org/PR797 : Fix a bug in my last patch that botched file redirection by using explicit scoping of if statements. --- Diffs of the changes: (+13 -8) Program.inc | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-) Index: llvm/lib/System/Unix/Program.inc diff -u llvm/lib/System/Unix/Program.inc:1.21 llvm/lib/System/Unix/Program.inc:1.22 --- llvm/lib/System/Unix/Program.inc:1.21 Mon Aug 21 01:02:44 2006 +++ llvm/lib/System/Unix/Program.inc Tue Aug 22 10:56:52 2006 @@ -133,22 +133,27 @@ case 0: { // Redirect file descriptors... if (redirects) { - if (redirects[0]) - if (redirects[0]->isEmpty()) + if (redirects[0]) { + if (redirects[0]->isEmpty()) { if (RedirectFD("/dev/null",0,ErrMsg)) { return -1; } - else + } else { if (RedirectFD(redirects[0]->toString(), 0,ErrMsg)) { return -1; } - if (redirects[1]) - if (redirects[1]->isEmpty()) + } + } + if (redirects[1]) { + if (redirects[1]->isEmpty()) { if (RedirectFD("/dev/null",1,ErrMsg)) { return -1; } - else + } else { if (RedirectFD(redirects[1]->toString(),1,ErrMsg)) { return -1; } + } + } if (redirects[1] && redirects[2] && *(redirects[1]) != *(redirects[2])) { - if (redirects[2]->isEmpty()) + if (redirects[2]->isEmpty()) { if (RedirectFD("/dev/null",2,ErrMsg)) { return -1; } - else + } else { if (RedirectFD(redirects[2]->toString(), 2,ErrMsg)) { return -1; } + } } else if (-1 == dup2(1,2)) { MakeErrMsg(ErrMsg, "Can't redirect"); return -1; From reid at x10sys.com Tue Aug 22 11:04:37 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 11:04:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/MappedFile.inc Message-ID: <200608221604.k7MG4bpI032337@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: MappedFile.inc updated: 1.16 -> 1.17 --- Log message: For PR797: http://llvm.org/PR797 : Make MappedFile not throw any exceptions. --- Diffs of the changes: (+15 -10) MappedFile.inc | 25 +++++++++++++++---------- 1 files changed, 15 insertions(+), 10 deletions(-) Index: llvm/lib/System/Unix/MappedFile.inc diff -u llvm/lib/System/Unix/MappedFile.inc:1.16 llvm/lib/System/Unix/MappedFile.inc:1.17 --- llvm/lib/System/Unix/MappedFile.inc:1.16 Tue Jul 18 02:07:51 2006 +++ llvm/lib/System/Unix/MappedFile.inc Tue Aug 22 11:04:22 2006 @@ -39,7 +39,7 @@ off_t Size; }; -void MappedFile::initialize() { +bool MappedFile::initialize(std::string* ErrMsg) { int mode = 0; if (options_ & READ_ACCESS) if (options_ & WRITE_ACCESS) @@ -50,17 +50,20 @@ mode = O_WRONLY; int FD = ::open(path_.c_str(), mode); - if (FD < 0) - ThrowErrno(std::string("Can't open file: ") + path_.toString()); - + if (FD < 0) { + MakeErrMsg(ErrMsg, "can't open file '" + path_.toString() + "'"); + return true; + } struct stat sbuf; if(::fstat(FD, &sbuf) < 0) { + MakeErrMsg(ErrMsg, "can't stat file '"+ path_.toString() + "'"); ::close(FD); - ThrowErrno(std::string("Can't stat file: ") + path_.toString()); + return true; } info_ = new MappedFileInfo; info_->FD = FD; info_->Size = sbuf.st_size; + return false; } void MappedFile::terminate() { @@ -79,7 +82,7 @@ } } -void* MappedFile::map() { +void* MappedFile::map(std::string* ErrMsg) { assert(info_ && "MappedFile not initialized"); if (!isMapped()) { int prot = PROT_NONE; @@ -106,8 +109,10 @@ Process::GetPageSize(); base_ = ::mmap(0, map_size, prot, flags, info_->FD, 0); - if (base_ == MAP_FAILED) - ThrowErrno(std::string("Can't map file:") + path_.toString()); + if (base_ == MAP_FAILED) { + MakeErrMsg(ErrMsg, "Can't map file:" + path_.toString()); + return 0; + } } return base_; } @@ -139,8 +144,8 @@ ::write(info_->FD, "\0", 1); } - // Seek to current end of file. - this->map(); + // Put the mapping back into memory. + this->map(0); } } From reid at x10sys.com Tue Aug 22 11:04:37 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 11:04:37 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/MappedFile.h Message-ID: <200608221604.k7MG4bXu032332@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: MappedFile.h updated: 1.10 -> 1.11 --- Log message: For PR797: http://llvm.org/PR797 : Make MappedFile not throw any exceptions. --- Diffs of the changes: (+24 -7) MappedFile.h | 31 ++++++++++++++++++++++++------- 1 files changed, 24 insertions(+), 7 deletions(-) Index: llvm/include/llvm/System/MappedFile.h diff -u llvm/include/llvm/System/MappedFile.h:1.10 llvm/include/llvm/System/MappedFile.h:1.11 --- llvm/include/llvm/System/MappedFile.h:1.10 Wed Jul 26 11:55:39 2006 +++ llvm/include/llvm/System/MappedFile.h Tue Aug 22 11:04:22 2006 @@ -48,8 +48,7 @@ /// Construct a MappedFile to the \p path in the operating system's file /// system with the mapping \p options provided. /// @throws std::string if an error occurs - MappedFile(const Path& path, int options = READ_ACCESS) - : path_(path), options_(options), base_(0), info_(0) { initialize(); } + MappedFile() : path_(), options_(READ_ACCESS), base_(0), info_(0) {} /// Destruct a MappedFile and release all memory associated with it. /// @throws std::string if an error occurs @@ -101,6 +100,18 @@ /// @name Mutators /// @{ public: + /// Open a file to be mapped and get its size but don't map it yet. + /// @returns true if an error occurred + bool open( + const sys::Path& p, ///< Path to file to be mapped + int options = READ_ACCESS, ///< Access mode for the mapping + std::string* ErrMsg = 0 ///< Optional error string pointer + ) { + path_ = p; + options_ = options; + return initialize(ErrMsg); + } + /// The mapped file is removed from memory. If the file was mapped for /// write access, the memory contents will be automatically synchronized /// with the file's disk contents. @@ -108,9 +119,12 @@ void unmap(); /// The mapped file is put into memory. - /// @returns The base memory address of the mapped file. + /// @returns The base memory address of the mapped file or 0 if an error + /// occurred. /// @brief Map the file into memory. - void* map(); + void* map( + std::string* ErrMsg ///< Optional error string pointer + ); /// This method causes the size of the file, and consequently the size /// of the mapping to be set. This is logically the same as unmap(), @@ -122,14 +136,17 @@ /// @brief Set the size of the file and memory mapping. void size(size_t new_size); - void close() { terminate(); } + void close() { if (info_) terminate(); } /// @} /// @name Implementation /// @{ private: - void initialize(); ///< Initialize platform-specific portion - void terminate(); ///< Terminate platform-specific portion + /// @brief Initialize platform-specific portion + bool initialize(std::string* ErrMsg); + + /// @brief Terminate platform-specific portion + void terminate(); /// @} /// @name Data From reid at x10sys.com Tue Aug 22 11:06:44 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 11:06:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200608221606.k7MG6iYk032401@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.48 -> 1.49 --- Log message: For PR797: http://llvm.org/PR797 : Adjust users of MappedFile to its new non-throwing interface. Note that in most cases the lazy step of just throwing after a call to MappedFile was installed. This was done in the name of incremental changes. Getting rid of the new throw statements will take adjustment of interfaces and propagation of errors to higher levels. Those changes will come in subsequent patches. --- Diffs of the changes: (+14 -6) FileUtilities.cpp | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.48 llvm/lib/Support/FileUtilities.cpp:1.49 --- llvm/lib/Support/FileUtilities.cpp:1.48 Fri Jul 28 17:03:44 2006 +++ llvm/lib/Support/FileUtilities.cpp Tue Aug 22 11:06:27 2006 @@ -147,9 +147,11 @@ double AbsTol, double RelTol, std::string *Error) { sys::FileStatus FileAStat, FileBStat; - if (FileA.getFileStatus(FileAStat, Error) || - FileB.getFileStatus(FileBStat, Error)) + if (FileA.getFileStatus(FileAStat, Error)) return 2; + if (FileB.getFileStatus(FileBStat, Error)) + return 2; + // Check for zero length files because some systems croak when you try to // mmap an empty file. size_t A_size = FileAStat.getSize(); @@ -165,10 +167,16 @@ try { // Now its safe to mmap the files into memory becasue both files // have a non-zero size. - sys::MappedFile F1(FileA); - sys::MappedFile F2(FileB); - F1.map(); - F2.map(); + sys::MappedFile F1; + if (F1.open(FileA, sys::MappedFile::READ_ACCESS, Error)) + return 2; + sys::MappedFile F2; + if (F2.open(FileB, sys::MappedFile::READ_ACCESS, Error)) + return 2; + if (!F1.map(Error)) + return 2; + if (!F2.map(Error)) + return 2; // Okay, now that we opened the files, scan them for the first difference. char *File1Start = F1.charBase(); From reid at x10sys.com Tue Aug 22 11:06:44 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 11:06:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Debugger/SourceFile.cpp Message-ID: <200608221606.k7MG6iKj032406@zion.cs.uiuc.edu> Changes in directory llvm/lib/Debugger: SourceFile.cpp updated: 1.7 -> 1.8 --- Log message: For PR797: http://llvm.org/PR797 : Adjust users of MappedFile to its new non-throwing interface. Note that in most cases the lazy step of just throwing after a call to MappedFile was installed. This was done in the name of incremental changes. Getting rid of the new throw statements will take adjustment of interfaces and propagation of errors to higher levels. Those changes will come in subsequent patches. --- Diffs of the changes: (+3 -1) SourceFile.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/Debugger/SourceFile.cpp diff -u llvm/lib/Debugger/SourceFile.cpp:1.7 llvm/lib/Debugger/SourceFile.cpp:1.8 --- llvm/lib/Debugger/SourceFile.cpp:1.7 Thu Apr 21 17:36:21 2005 +++ llvm/lib/Debugger/SourceFile.cpp Tue Aug 22 11:06:27 2006 @@ -19,7 +19,9 @@ /// readFile - Load Filename /// void SourceFile::readFile() { - File.map(); + std::string ErrMsg; + if (File.map(&ErrMsg)) + throw ErrMsg; } /// calculateLineOffsets - Compute the LineOffset vector for the current file. From reid at x10sys.com Tue Aug 22 11:06:43 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 11:06:43 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Debugger/SourceFile.h Message-ID: <200608221606.k7MG6hXP032396@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Debugger: SourceFile.h updated: 1.3 -> 1.4 --- Log message: For PR797: http://llvm.org/PR797 : Adjust users of MappedFile to its new non-throwing interface. Note that in most cases the lazy step of just throwing after a call to MappedFile was installed. This was done in the name of incremental changes. Getting rid of the new throw statements will take adjustment of interfaces and propagation of errors to higher levels. Those changes will come in subsequent patches. --- Diffs of the changes: (+4 -1) SourceFile.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Debugger/SourceFile.h diff -u llvm/include/llvm/Debugger/SourceFile.h:1.3 llvm/include/llvm/Debugger/SourceFile.h:1.4 --- llvm/include/llvm/Debugger/SourceFile.h:1.3 Thu Apr 21 15:39:38 2005 +++ llvm/include/llvm/Debugger/SourceFile.h Tue Aug 22 11:06:27 2006 @@ -50,7 +50,10 @@ /// reading it, or if the user cancels the operation. Instead, it will just /// be an empty source file. SourceFile(const std::string &fn, const GlobalVariable *Desc) - : Filename(fn), Descriptor(Desc), File(Filename) { + : Filename(fn), Descriptor(Desc), File() { + std::string ErrMsg; + if (File.open(Filename, sys::MappedFile::READ_ACCESS, &ErrMsg)) + throw ErrMsg; readFile(); } ~SourceFile() { From reid at x10sys.com Tue Aug 22 11:07:58 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 11:07:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/Archive.cpp ArchiveWriter.cpp Message-ID: <200608221607.k7MG7wRf032447@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Archive: Archive.cpp updated: 1.12 -> 1.13 ArchiveWriter.cpp updated: 1.25 -> 1.26 --- Log message: For PR797: http://llvm.org/PR797 : Adjust to new interface for MappedFile. Note that the new "throw" statements will be removed later. --- Diffs of the changes: (+19 -6) Archive.cpp | 8 ++++++-- ArchiveWriter.cpp | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) Index: llvm/lib/Bytecode/Archive/Archive.cpp diff -u llvm/lib/Bytecode/Archive/Archive.cpp:1.12 llvm/lib/Bytecode/Archive/Archive.cpp:1.13 --- llvm/lib/Bytecode/Archive/Archive.cpp:1.12 Fri Jul 28 17:03:44 2006 +++ llvm/lib/Bytecode/Archive/Archive.cpp Tue Aug 22 11:07:44 2006 @@ -137,8 +137,12 @@ symTabSize(0), firstFileOffset(0), modules(), foreignST(0) { if (map) { - mapfile = new sys::MappedFile(filename); - base = (char*) mapfile->map(); + std::string ErrMsg; + mapfile = new sys::MappedFile(); + if (mapfile->open(filename, sys::MappedFile::READ_ACCESS, &ErrMsg)) + throw ErrMsg; + if (!(base = (char*) mapfile->map(&ErrMsg))) + throw ErrMsg; } } Index: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.25 llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.26 --- llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.25 Fri Jul 28 17:29:50 2006 +++ llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Tue Aug 22 11:07:44 2006 @@ -205,8 +205,12 @@ const char* data = (const char*)member.getData(); sys::MappedFile* mFile = 0; if (!data) { - mFile = new sys::MappedFile(member.getPath()); - data = (const char*) mFile->map(); + std::string ErrMsg; + mFile = new sys::MappedFile(); + if (mFile->open(member.getPath(), sys::MappedFile::READ_ACCESS, &ErrMsg)) + throw ErrMsg; + if (data = (const char*) mFile->map(&ErrMsg)) + throw ErrMsg; fSize = mFile->size(); } @@ -437,8 +441,13 @@ // we just wrote back in and copying it to the destination file. // Map in the archive we just wrote. - sys::MappedFile arch(TmpArchive); - const char* base = (const char*) arch.map(); + sys::MappedFile arch; + std::string ErrMsg; + if (arch.open(TmpArchive, sys::MappedFile::READ_ACCESS, &ErrMsg)) + throw ErrMsg; + const char* base; + if (!(base = (const char*) arch.map(&ErrMsg))) + throw ErrMsg; // Open another temporary file in order to avoid invalidating the // mmapped data From reid at x10sys.com Tue Aug 22 11:09:33 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 11:09:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.h Reader.cpp Message-ID: <200608221609.k7MG9XKv032493@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.h updated: 1.30 -> 1.31 Reader.cpp updated: 1.194 -> 1.195 --- Log message: For PR797: http://llvm.org/PR797 : Make the Bytecode Reader use setjmp/longjump instead of exceptions to handle errors. The alternative was even uglier than setjmp/longjump as it would impact the interface and workings of nearly every function in the reader. --- Diffs of the changes: (+119 -118) Reader.cpp | 226 +++++++++++++++++++++++++++++-------------------------------- Reader.h | 11 ++ 2 files changed, 119 insertions(+), 118 deletions(-) Index: llvm/lib/Bytecode/Reader/Reader.h diff -u llvm/lib/Bytecode/Reader/Reader.h:1.30 llvm/lib/Bytecode/Reader/Reader.h:1.31 --- llvm/lib/Bytecode/Reader/Reader.h:1.30 Fri Jul 7 01:06:06 2006 +++ llvm/lib/Bytecode/Reader/Reader.h Tue Aug 22 11:09:19 2006 @@ -24,6 +24,7 @@ #include "llvm/Bytecode/Analyzer.h" #include #include +#include namespace llvm { @@ -136,11 +137,13 @@ /// @name Methods /// @{ public: + /// @returns true if an error occurred /// @brief Main interface to parsing a bytecode buffer. - void ParseBytecode( + bool ParseBytecode( const unsigned char *Buf, ///< Beginning of the bytecode buffer unsigned Length, ///< Length of the bytecode buffer - const std::string &ModuleID ///< An identifier for the module constructed. + const std::string &ModuleID, ///< An identifier for the module constructed. + std::string* ErrMsg = 0 ///< Optional place for error message ); /// @brief Parse all function bodies @@ -260,6 +263,8 @@ /// @name Data /// @{ private: + std::string ErrorMsg; ///< A place to hold an error message through longjmp + jmp_buf context; ///< Where to return to if an error occurs. char* decompressedBlock; ///< Result of decompression BufPtr MemStart; ///< Start of the memory buffer BufPtr MemEnd; ///< End of the memory buffer @@ -487,7 +492,7 @@ } } - inline void error(std::string errmsg); + inline void error(const std::string& errmsg); BytecodeReader(const BytecodeReader &); // DO NOT IMPLEMENT void operator=(const BytecodeReader &); // DO NOT IMPLEMENT Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.194 llvm/lib/Bytecode/Reader/Reader.cpp:1.195 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.194 Fri May 26 13:42:34 2006 +++ llvm/lib/Bytecode/Reader/Reader.cpp Tue Aug 22 11:09:19 2006 @@ -51,13 +51,10 @@ } // Provide some details on error -inline void BytecodeReader::error(std::string err) { - err += " (Vers=" ; - err += itostr(RevisionNum) ; - err += ", Pos=" ; - err += itostr(At-MemStart); - err += ")"; - throw err; +inline void BytecodeReader::error(const std::string& err) { + ErrorMsg = err + " (Vers=" + itostr(RevisionNum) + ", Pos=" + + itostr(At-MemStart) + ")"; + longjmp(context,1); } //===----------------------------------------------------------------------===// @@ -470,7 +467,8 @@ ForwardReferences.insert(I, std::make_pair(KeyValue, Val)); return Val; } - throw "Can't create placeholder for value of type slot #" + utostr(type); + error("Can't create placeholder for value of type slot #" + utostr(type)); + return 0; // just silence warning, error calls longjmp } /// This is just like getValue, but when a compaction table is in use, it @@ -718,12 +716,12 @@ } case Instruction::ExtractElement: { if (Oprnds.size() != 2) - throw std::string("Invalid extractelement instruction!"); + error("Invalid extractelement instruction!"); Value *V1 = getValue(iType, Oprnds[0]); Value *V2 = getValue(Type::UIntTyID, Oprnds[1]); if (!ExtractElementInst::isValidOperands(V1, V2)) - throw std::string("Invalid extractelement instruction!"); + error("Invalid extractelement instruction!"); Result = new ExtractElementInst(V1, V2); break; @@ -731,28 +729,28 @@ case Instruction::InsertElement: { const PackedType *PackedTy = dyn_cast(InstTy); if (!PackedTy || Oprnds.size() != 3) - throw std::string("Invalid insertelement instruction!"); + error("Invalid insertelement instruction!"); Value *V1 = getValue(iType, Oprnds[0]); Value *V2 = getValue(getTypeSlot(PackedTy->getElementType()), Oprnds[1]); Value *V3 = getValue(Type::UIntTyID, Oprnds[2]); if (!InsertElementInst::isValidOperands(V1, V2, V3)) - throw std::string("Invalid insertelement instruction!"); + error("Invalid insertelement instruction!"); Result = new InsertElementInst(V1, V2, V3); break; } case Instruction::ShuffleVector: { const PackedType *PackedTy = dyn_cast(InstTy); if (!PackedTy || Oprnds.size() != 3) - throw std::string("Invalid shufflevector instruction!"); + error("Invalid shufflevector instruction!"); Value *V1 = getValue(iType, Oprnds[0]); Value *V2 = getValue(iType, Oprnds[1]); const PackedType *EltTy = PackedType::get(Type::UIntTy, PackedTy->getNumElements()); Value *V3 = getValue(getTypeSlot(EltTy), Oprnds[2]); if (!ShuffleVectorInst::isValidOperands(V1, V2, V3)) - throw std::string("Invalid shufflevector instruction!"); + error("Invalid shufflevector instruction!"); Result = new ShuffleVectorInst(V1, V2, V3); break; } @@ -2403,95 +2401,14 @@ /// This function completely parses a bytecode buffer given by the \p Buf /// and \p Length parameters. -void BytecodeReader::ParseBytecode(BufPtr Buf, unsigned Length, - const std::string &ModuleID) { - - try { - RevisionNum = 0; - At = MemStart = BlockStart = Buf; - MemEnd = BlockEnd = Buf + Length; - - // Create the module - TheModule = new Module(ModuleID); - - if (Handler) Handler->handleStart(TheModule, Length); - - // Read the four bytes of the signature. - unsigned Sig = read_uint(); - - // If this is a compressed file - if (Sig == ('l' | ('l' << 8) | ('v' << 16) | ('c' << 24))) { - - // Invoke the decompression of the bytecode. Note that we have to skip the - // file's magic number which is not part of the compressed block. Hence, - // the Buf+4 and Length-4. The result goes into decompressedBlock, a data - // member for retention until BytecodeReader is destructed. - unsigned decompressedLength = Compressor::decompressToNewBuffer( - (char*)Buf+4,Length-4,decompressedBlock); - - // We must adjust the buffer pointers used by the bytecode reader to point - // into the new decompressed block. After decompression, the - // decompressedBlock will point to a contiguous memory area that has - // the decompressed data. - At = MemStart = BlockStart = Buf = (BufPtr) decompressedBlock; - MemEnd = BlockEnd = Buf + decompressedLength; - - // else if this isn't a regular (uncompressed) bytecode file, then its - // and error, generate that now. - } else if (Sig != ('l' | ('l' << 8) | ('v' << 16) | ('m' << 24))) { - error("Invalid bytecode signature: " + utohexstr(Sig)); - } - - // Tell the handler we're starting a module - if (Handler) Handler->handleModuleBegin(ModuleID); - - // Get the module block and size and verify. This is handled specially - // because the module block/size is always written in long format. Other - // blocks are written in short format so the read_block method is used. - unsigned Type, Size; - Type = read_uint(); - Size = read_uint(); - if (Type != BytecodeFormat::ModuleBlockID) { - error("Expected Module Block! Type:" + utostr(Type) + ", Size:" - + utostr(Size)); - } - - // It looks like the darwin ranlib program is broken, and adds trailing - // garbage to the end of some bytecode files. This hack allows the bc - // reader to ignore trailing garbage on bytecode files. - if (At + Size < MemEnd) - MemEnd = BlockEnd = At+Size; - - if (At + Size != MemEnd) - error("Invalid Top Level Block Length! Type:" + utostr(Type) - + ", Size:" + utostr(Size)); - - // Parse the module contents - this->ParseModule(); - - // Check for missing functions - if (hasFunctions()) - error("Function expected, but bytecode stream ended!"); - - // Look for intrinsic functions to upgrade, upgrade them, and save the - // mapping from old function to new for use later when instructions are - // converted. - for (Module::iterator FI = TheModule->begin(), FE = TheModule->end(); - FI != FE; ++FI) - if (Function* newF = UpgradeIntrinsicFunction(FI)) { - upgradedFunctions.insert(std::make_pair(FI, newF)); - FI->setName(""); - } - - // Tell the handler we're done with the module - if (Handler) - Handler->handleModuleEnd(ModuleID); - - // Tell the handler we're finished the parse - if (Handler) Handler->handleFinish(); - - } catch (std::string& errstr) { - if (Handler) Handler->handleError(errstr); +bool BytecodeReader::ParseBytecode(BufPtr Buf, unsigned Length, + const std::string &ModuleID, + std::string* ErrMsg) { + + /// We handle errors by + if (setjmp(context)) { + // Cleanup after error + if (Handler) Handler->handleError(ErrorMsg); freeState(); delete TheModule; TheModule = 0; @@ -2499,19 +2416,98 @@ ::free(decompressedBlock); decompressedBlock = 0; } - throw; - } catch (...) { - std::string msg("Unknown Exception Occurred"); - if (Handler) Handler->handleError(msg); - freeState(); - delete TheModule; - TheModule = 0; - if (decompressedBlock != 0) { - ::free(decompressedBlock); - decompressedBlock = 0; + // Set caller's error message, if requested + if (ErrMsg) + *ErrMsg = ErrorMsg; + // Indicate an error occurred + return true; + } + + RevisionNum = 0; + At = MemStart = BlockStart = Buf; + MemEnd = BlockEnd = Buf + Length; + + // Create the module + TheModule = new Module(ModuleID); + + if (Handler) Handler->handleStart(TheModule, Length); + + // Read the four bytes of the signature. + unsigned Sig = read_uint(); + + // If this is a compressed file + if (Sig == ('l' | ('l' << 8) | ('v' << 16) | ('c' << 24))) { + + // Invoke the decompression of the bytecode. Note that we have to skip the + // file's magic number which is not part of the compressed block. Hence, + // the Buf+4 and Length-4. The result goes into decompressedBlock, a data + // member for retention until BytecodeReader is destructed. + unsigned decompressedLength = Compressor::decompressToNewBuffer( + (char*)Buf+4,Length-4,decompressedBlock); + + // We must adjust the buffer pointers used by the bytecode reader to point + // into the new decompressed block. After decompression, the + // decompressedBlock will point to a contiguous memory area that has + // the decompressed data. + At = MemStart = BlockStart = Buf = (BufPtr) decompressedBlock; + MemEnd = BlockEnd = Buf + decompressedLength; + + // else if this isn't a regular (uncompressed) bytecode file, then its + // and error, generate that now. + } else if (Sig != ('l' | ('l' << 8) | ('v' << 16) | ('m' << 24))) { + error("Invalid bytecode signature: " + utohexstr(Sig)); + } + + // Tell the handler we're starting a module + if (Handler) Handler->handleModuleBegin(ModuleID); + + // Get the module block and size and verify. This is handled specially + // because the module block/size is always written in long format. Other + // blocks are written in short format so the read_block method is used. + unsigned Type, Size; + Type = read_uint(); + Size = read_uint(); + if (Type != BytecodeFormat::ModuleBlockID) { + error("Expected Module Block! Type:" + utostr(Type) + ", Size:" + + utostr(Size)); + } + + // It looks like the darwin ranlib program is broken, and adds trailing + // garbage to the end of some bytecode files. This hack allows the bc + // reader to ignore trailing garbage on bytecode files. + if (At + Size < MemEnd) + MemEnd = BlockEnd = At+Size; + + if (At + Size != MemEnd) + error("Invalid Top Level Block Length! Type:" + utostr(Type) + + ", Size:" + utostr(Size)); + + // Parse the module contents + this->ParseModule(); + + // Check for missing functions + if (hasFunctions()) + error("Function expected, but bytecode stream ended!"); + + // Look for intrinsic functions to upgrade, upgrade them, and save the + // mapping from old function to new for use later when instructions are + // converted. + for (Module::iterator FI = TheModule->begin(), FE = TheModule->end(); + FI != FE; ++FI) + if (Function* newF = UpgradeIntrinsicFunction(FI)) { + upgradedFunctions.insert(std::make_pair(FI, newF)); + FI->setName(""); } - throw msg; - } + + // Tell the handler we're done with the module + if (Handler) + Handler->handleModuleEnd(ModuleID); + + // Tell the handler we're finished the parse + if (Handler) Handler->handleFinish(); + + return false; + } //===----------------------------------------------------------------------===// From reid at x10sys.com Tue Aug 22 11:10:26 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 11:10:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Message-ID: <200608221610.k7MGAQ9k032527@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ReaderWrappers.cpp updated: 1.55 -> 1.56 --- Log message: For PR797: http://llvm.org/PR797 : Adjust the use of MappedFile to its new non-throwing interface. We just propagate the exceptions if an error occurs. This will get cleaned up later, incrementally. --- Diffs of the changes: (+16 -8) ReaderWrappers.cpp | 24 ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-) Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.55 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.56 --- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.55 Thu Jul 6 16:35:01 2006 +++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Tue Aug 22 11:10:12 2006 @@ -48,11 +48,17 @@ BytecodeFileReader::BytecodeFileReader(const std::string &Filename, llvm::BytecodeHandler* H ) : BytecodeReader(H) - , mapFile( sys::Path(Filename)) + , mapFile() { - mapFile.map(); + std::string ErrMsg; + if (mapFile.open(sys::Path(Filename), sys::MappedFile::READ_ACCESS, &ErrMsg)) + throw ErrMsg; + if (!mapFile.map(&ErrMsg)) + throw ErrMsg; unsigned char* buffer = reinterpret_cast(mapFile.base()); - ParseBytecode(buffer, mapFile.size(), Filename); + if (ParseBytecode(buffer, mapFile.size(), Filename, &ErrMsg)) { + throw ErrMsg; + } } //===----------------------------------------------------------------------===// @@ -98,11 +104,10 @@ ParseBegin = Buffer = Buf; MustDelete = false; } - try { - ParseBytecode(ParseBegin, Length, ModuleID); - } catch (...) { + std::string ErrMsg; + if (ParseBytecode(ParseBegin, Length, ModuleID, &ErrMsg)) { if (MustDelete) delete [] Buffer; - throw; + throw ErrMsg; } } @@ -149,7 +154,10 @@ throw std::string("Standard Input empty!"); FileBuf = &FileData[0]; - ParseBytecode(FileBuf, FileData.size(), ""); + std::string ErrMsg; + if (ParseBytecode(FileBuf, FileData.size(), "", &ErrMsg)) { + throw ErrMsg; + } } //===----------------------------------------------------------------------===// From rafael.espindola at gmail.com Tue Aug 22 11:20:08 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Tue, 22 Aug 2006 11:20:08 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/select.ll Message-ID: <200608221620.k7MGK89X032766@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/ARM: select.ll updated: 1.4 -> 1.5 --- Log message: run llc with -march=arm in select.ll --- Diffs of the changes: (+1 -1) select.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/ARM/select.ll diff -u llvm/test/Regression/CodeGen/ARM/select.ll:1.4 llvm/test/Regression/CodeGen/ARM/select.ll:1.5 --- llvm/test/Regression/CodeGen/ARM/select.ll:1.4 Tue Aug 22 01:43:24 2006 +++ llvm/test/Regression/CodeGen/ARM/select.ll Tue Aug 22 11:19:54 2006 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s -o /dev/null -f +; RUN: llvm-as < %s | llc -march=arm int %f(int %a) { entry: From pjenkins at apple.com Tue Aug 22 12:26:26 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Tue, 22 Aug 2006 12:26:26 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php Message-ID: <200608221726.k7MHQQ6B002415@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: ProgramResults.php updated: 1.8 -> 1.9 --- Log message: Fixed an issue where instead of appending to list of new/removed/fixed/ broken tests, we were instead assigning the list. Therefore, only the last discovered test change was being reported. --- Diffs of the changes: (+12 -12) ProgramResults.php | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) Index: nightlytest-serverside/ProgramResults.php diff -u nightlytest-serverside/ProgramResults.php:1.8 nightlytest-serverside/ProgramResults.php:1.9 --- nightlytest-serverside/ProgramResults.php:1.8 Mon Aug 21 15:21:55 2006 +++ nightlytest-serverside/ProgramResults.php Tue Aug 22 12:26:12 2006 @@ -453,18 +453,18 @@ } else{ $test_hash=array(); - $query = "SELECT * FROM tests WHERE night=$prev_id and measure!=\"dejagnu\""; + $query = "SELECT * FROM tests WHERE night=$prev_id"; $program_query = mysql_query($query) or die (mysql_error()); while($row = mysql_fetch_array($program_query)){ $test_hash["{$row['measure']} - {$row['program']}"]=1; } mysql_free_result($program_query); - $query = "SELECT * FROM tests WHERE night=$cur_id and measure!=\"dejagnu\""; + $query = "SELECT * FROM tests WHERE night=$cur_id"; $program_query = mysql_query($query) or die (mysql_error()); while($row = mysql_fetch_array($program_query)){ if( !isset($test_hash["{$row['measure']} - {$row['program']}"])){ - $result = "{$row['measure']} - {$row['program']}
\n"; + $result .= "{$row['measure']} - {$row['program']}
\n"; } } mysql_free_result($program_query); @@ -494,18 +494,18 @@ } else{ $test_hash=array(); - $query = "SELECT * FROM tests WHERE night=$cur_id and measure!=\"dejagnu\""; + $query = "SELECT * FROM tests WHERE night=$cur_id"; $program_query = mysql_query($query) or die (mysql_error()); while($row = mysql_fetch_array($program_query)){ $test_hash["{$row['measure']} - {$row['program']}"]=1; } mysql_free_result($program_query); - $query = "SELECT * FROM tests WHERE night=$prev_id and measure!=\"dejagnu\""; + $query = "SELECT * FROM tests WHERE night=$prev_id"; $program_query = mysql_query($query) or die (mysql_error()); while($row = mysql_fetch_array($program_query)){ if( !isset($test_hash["{$row['measure']} - {$row['program']}"])){ - $result = "{$row['measure']} - {$row['program']}
\n"; + $result .= "{$row['measure']} - {$row['program']}
\n"; } } mysql_free_result($program_query); @@ -535,7 +535,7 @@ } else{ $test_hash=array(); - $query = "SELECT * FROM tests WHERE night=$cur_id and measure!=\"dejagnu\""; + $query = "SELECT * FROM tests WHERE night=$cur_id"; $program_query = mysql_query($query) or die (mysql_error()); while($row = mysql_fetch_array($program_query)){ if(strcmp("{$row['result']}", "PASS")===0){ @@ -544,12 +544,12 @@ } mysql_free_result($program_query); - $query = "SELECT * FROM tests WHERE night=$prev_id and measure!=\"dejagnu\""; + $query = "SELECT * FROM tests WHERE night=$prev_id"; $program_query = mysql_query($query) or die (mysql_error()); while($row = mysql_fetch_array($program_query)){ if( isset($test_hash["{$row['measure']} - {$row['program']}"]) && strcmp($test_hash["{$row['measure']} - {$row['program']}"], $row['result'])!==0){ - $result = "{$row['measure']} - {$row['program']}
\n"; + $result .= "{$row['measure']} - {$row['program']}
\n"; } } mysql_free_result($program_query); @@ -579,7 +579,7 @@ } else{ $test_hash=array(); - $query = "SELECT * FROM tests WHERE night=$prev_id and measure!=\"dejagnu\""; + $query = "SELECT * FROM tests WHERE night=$prev_id"; $program_query = mysql_query($query) or die (mysql_error()); while($row = mysql_fetch_array($program_query)){ if(strcmp("{$row['result']}", "PASS")===0){ @@ -588,12 +588,12 @@ } mysql_free_result($program_query); - $query = "SELECT * FROM tests WHERE night=$cur_id and measure!=\"dejagnu\""; + $query = "SELECT * FROM tests WHERE night=$cur_id"; $program_query = mysql_query($query) or die (mysql_error()); while($row = mysql_fetch_array($program_query)){ if( isset($test_hash["{$row['measure']} - {$row['program']}"]) && strcmp($test_hash["{$row['measure']} - {$row['program']}"], $row['result'])!==0){ - $result = "{$row['measure']} - {$row['program']}
\n"; + $result .= "{$row['measure']} - {$row['program']}
\n"; } } mysql_free_result($program_query); From lattner at cs.uiuc.edu Tue Aug 22 12:29:11 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 22 Aug 2006 12:29:11 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/SmallVector.h Message-ID: <200608221729.k7MHTBfc002543@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: SmallVector.h updated: 1.15 -> 1.16 --- Log message: add resize, move swap out of line --- Diffs of the changes: (+56 -36) SmallVector.h | 92 +++++++++++++++++++++++++++++++++++----------------------- 1 files changed, 56 insertions(+), 36 deletions(-) Index: llvm/include/llvm/ADT/SmallVector.h diff -u llvm/include/llvm/ADT/SmallVector.h:1.15 llvm/include/llvm/ADT/SmallVector.h:1.16 --- llvm/include/llvm/ADT/SmallVector.h:1.15 Tue Aug 22 01:27:16 2006 +++ llvm/include/llvm/ADT/SmallVector.h Tue Aug 22 12:28:57 2006 @@ -112,43 +112,20 @@ End = Begin; } - void swap(SmallVectorImpl &RHS) { - if (this == &RHS) return; - - // We can only avoid copying elements if neither vector is small. - if (!isSmall() && !RHS.isSmall()) { - std::swap(Begin, RHS.Begin); - std::swap(End, RHS.End); - std::swap(Capacity, RHS.Capacity); - return; - } - if (Begin+RHS.size() > Capacity) - grow(RHS.size()); - if (RHS.begin()+size() > RHS.Capacity) - RHS.grow(size()); - - // Swap the shared elements. - unsigned NumShared = size(); - if (NumShared > RHS.size()) NumShared = RHS.size(); - for (unsigned i = 0; i != NumShared; ++i) - std::swap(Begin[i], RHS[i]); - - // Copy over the extra elts. - if (size() > RHS.size()) { - unsigned EltDiff = size() - RHS.size(); - std::uninitialized_copy(Begin+NumShared, End, RHS.End); - RHS.End += EltDiff; - destroy_range(Begin+NumShared, End); - End = Begin+NumShared; - } else if (RHS.size() > size()) { - unsigned EltDiff = RHS.size() - size(); - std::uninitialized_copy(RHS.Begin+NumShared, RHS.End, End); - End += EltDiff; - destroy_range(RHS.Begin+NumShared, RHS.End); - RHS.End = RHS.Begin+NumShared; + void resize(unsigned N) { + if (N < size()) { + destroy_range(Begin+N, End); + End = Begin+N; + } else if (N > size()) { + if (Begin+N > Capacity) + grow(N); + construct_range(End, Begin+N, T()); + End = Begin+N; } } + void swap(SmallVectorImpl &RHS); + /// append - Add the specified range to the end of the SmallVector. /// template @@ -168,8 +145,7 @@ if (Begin+NumElts > Capacity) grow(NumElts); End = Begin+NumElts; - for (; NumElts; --NumElts) - new (Begin+NumElts-1) T(Elt); + construct_range(Begin, End, Elt); } void erase(iterator I) { @@ -220,6 +196,12 @@ /// grow - double the size of the allocated memory, guaranteeing space for at /// least one more element or MinSize if specified. void grow(unsigned MinSize = 0); + + void construct_range(T *S, T *E, const T &Elt) { + for (; S != E; ++S) + new (S) T(Elt); + } + void destroy_range(T *S, T *E) { while (S != E) { @@ -253,6 +235,44 @@ End = NewElts+CurSize; Capacity = Begin+NewCapacity; } + +template +void SmallVectorImpl::swap(SmallVectorImpl &RHS) { + if (this == &RHS) return; + + // We can only avoid copying elements if neither vector is small. + if (!isSmall() && !RHS.isSmall()) { + std::swap(Begin, RHS.Begin); + std::swap(End, RHS.End); + std::swap(Capacity, RHS.Capacity); + return; + } + if (Begin+RHS.size() > Capacity) + grow(RHS.size()); + if (RHS.begin()+size() > RHS.Capacity) + RHS.grow(size()); + + // Swap the shared elements. + unsigned NumShared = size(); + if (NumShared > RHS.size()) NumShared = RHS.size(); + for (unsigned i = 0; i != NumShared; ++i) + std::swap(Begin[i], RHS[i]); + + // Copy over the extra elts. + if (size() > RHS.size()) { + unsigned EltDiff = size() - RHS.size(); + std::uninitialized_copy(Begin+NumShared, End, RHS.End); + RHS.End += EltDiff; + destroy_range(Begin+NumShared, End); + End = Begin+NumShared; + } else if (RHS.size() > size()) { + unsigned EltDiff = RHS.size() - size(); + std::uninitialized_copy(RHS.Begin+NumShared, RHS.End, End); + End += EltDiff; + destroy_range(RHS.Begin+NumShared, RHS.End); + RHS.End = RHS.Begin+NumShared; + } +} template const SmallVectorImpl & From pjenkins at apple.com Tue Aug 22 12:31:40 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Tue, 22 Aug 2006 12:31:40 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/NightlyTestAccept.cgi Message-ID: <200608221731.k7MHVel2002715@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: NightlyTestAccept.cgi updated: 1.52 -> 1.53 --- Log message: Changed the nightly test accept script to send out emails with new/removed/ fixed/broken tests listed. --- Diffs of the changes: (+35 -27) NightlyTestAccept.cgi | 62 ++++++++++++++++++++++++++++---------------------- 1 files changed, 35 insertions(+), 27 deletions(-) Index: nightlytest-serverside/NightlyTestAccept.cgi diff -u nightlytest-serverside/NightlyTestAccept.cgi:1.52 nightlytest-serverside/NightlyTestAccept.cgi:1.53 --- nightlytest-serverside/NightlyTestAccept.cgi:1.52 Fri Aug 18 16:40:04 2006 +++ nightlytest-serverside/NightlyTestAccept.cgi Tue Aug 22 12:31:26 2006 @@ -655,8 +655,9 @@ ################################################################################ @ALL_TESTS= split "\n", $all_tests; foreach my $x (@ALL_TESTS){ - if($x =~ m/(TEST-)?(PASS|XFAIL|FAIL):\s(.+?)\s(.+)/){ - $query="INSERT INTO tests ( program, result, measure, night) VALUES(\"$4\", \'$2\', \"$3\", $night_id)"; + if($x =~ m/(TEST-)?(XPASS|PASS|XFAIL|FAIL):\s(.+?)\s(.+)/){ + $query="INSERT INTO tests ( program, result, measure, night) ". + "VALUES(\"$4\", \'$2\', \"$3\", $night_id)"; my $d = $dbh->prepare($query); $d->execute; } @@ -666,8 +667,9 @@ } foreach my $x (@DEJAGNUTESTS_RESULTS){ - if($x =~ m/^(PASS|XFAIL|FAIL):\s(.+)/){ - $query="INSERT INTO tests ( program, result, measure, night) VALUES(\"$2\", \'$1\', \"dejagnu\", $night_id)"; + if($x =~ m/^(XPASS|PASS|XFAIL|FAIL):\s(.+):?/){ + $query="INSERT INTO tests ( program, result, measure, night) ". + "VALUES(\"$2\", \'$1\', \"dejagnu\", $night_id)"; my $d = $dbh->prepare($query); $d->execute; } @@ -685,7 +687,8 @@ @nights = GetMachineNights $machine_id; $length = @nights; print "DB date : $db_date\n"; -print "Machine $machine_id now has ids [@nights]{$length} associated with it in the database\n"; +print "Machine $machine_id now has ids [@nights]{$length} ". + "associated with it in the database\n"; ################################################################################ # @@ -694,7 +697,8 @@ # adds very useful information to the nightly test email. # ################################################################################ -$query = "select id from night where id<$night_id and machine=$machine_id and buildstatus=\"OK\" order by id desc"; +$query = "select id from night where id<$night_id and machine=$machine_id and ". + "buildstatus=\"OK\" order by id desc"; my $g = $dbh->prepare($query); $g->execute; $row = $g->fetchrow_hashref; @@ -751,11 +755,13 @@ if($perc > 5 || $perc < -5){ if( ! exists $output_big_changes{"$x"} ){ my $rounded_perc = sprintf("%1.2f", $perc); - $output_big_changes{"$x"}[0]="$prog: $rounded_perc\% ($value_old => $value_new)\n"; + $output_big_changes{"$x"}[0]= + "$prog: $rounded_perc\% ($value_old => $value_new)\n"; } else{ my $rounded_perc = sprintf("%1.2f", $perc); - push(@{ $output_big_changes{"$x"} },"$prog ($x) changed \%$rounded_perc ($value_old => $value_new)\n"); + push(@{ $output_big_changes{"$x"} }, + "$prog ($x) changed \%$rounded_perc ($value_old => $value_new)\n"); } #end else }# end if $perc is acceptable }# end foreach measure taken @@ -766,14 +772,16 @@ # Determining changes in new tests and old tests # ################################################################################ -my $d = $dbh->prepare("SELECT id FROM night WHERE machine=38 and buildstatus=\"OK\" order by added desc"); +my $d = $dbh->prepare("SELECT id FROM night WHERE machine=38 and ". + "buildstatus=\"OK\" order by added desc"); $d->execute; my @row=$d->fetchrow_array; $cur_night=$row[0]; @row=$d->fetchrow_array; $prev_night=$row[0]; -my $c = $dbh->prepare("SELECT program, measure, result FROM tests WHERE night=$cur_night"); +my $c = $dbh->prepare("SELECT program, measure, result FROM tests WHERE ". + "night=$cur_night"); $c->execute; %result_hash=(); @@ -786,15 +794,18 @@ my ($num_removed, $num_added, $num_new_passing, $num_new_failing)=0; my ($removed, $added, $passing, $failing) = ""; -my $j = $dbh->prepare("SELECT program, measure, result FROM tests WHERE night=$prev_night"); +my $j = $dbh->prepare("SELECT program, measure, result FROM tests WHERE ". + "night=$prev_night"); $j->execute; while(my @row=$j->fetchrow_array){ my $key = $row[1]." - ".$row[0]; - if($result_hash{$key} and $result_hash{$key} ne $row[2] and $row[2] eq "PASS"){ + if($result_hash{$key} and $result_hash{$key} ne $row[2] and + $row[2] eq "PASS"){ $failing .= "changed: from $row[2] to $result_hash{$key} - $key\n"; $num_new_failing++; } - if($result_hash{$key} and $result_hash{$key} ne $row[2] and $result_hash{$key} eq "PASS" ){ + if($result_hash{$key} and $result_hash{$key} ne $row[2] and + $result_hash{$key} eq "PASS" ){ $passing .= "changed: from $row[2] to $result_hash{$key} - $key\n"; $num_new_passing++; } @@ -819,29 +830,26 @@ # Sending email to nightly test email archive # ################################################################################ -$link_to_page="http://llvm.org/nightlytest/test.php?machine=$machine_id&night=$night_id"; +$link_to_page="http://llvm.org/nightlytest/test.php?machine=$machine_id&". + "night=$night_id"; $email = "$link_to_page\n"; $email .= "Name: $name\n"; $email .= "Nickname: $nickname\n"; $email .= "Buildstatus: $buildstatus\n"; if($buildstatus eq "OK") { - if ($TestsFixed ne "") { - $TestsFixed= "\n$newly_passing_tests\n"; - } else { - $TestsFixed = "None"; - } - $email .= "\nNew Test Passes: $TestsFixed"; - if ($TestsBroken ne "") { - $TestsBroken = "\n$newly_failing_tests\n"; - } else { - $TestsBroken = "None"; - } - $email .= "\nNew Test Failures: $TestsBroken"; + if ($passing eq "") { + $pasing = "None"; + } + $email .= "\nNew Test Passes: $passing\n"; + if ($failing eq "") { + $failing = "None"; + } + $email .= "\nNew Test Failures: $failing\n"; if ($added eq "") { $added = "None"; } - $email .= "\nAdded Tests: $added"; + $email .= "\nAdded Tests: $added\n"; if ($removed eq "") { $removed= "None"; } From reid at x10sys.com Tue Aug 22 12:38:20 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 12:38:20 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/TimeValue.h Message-ID: <200608221738.k7MHcK4G022113@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: TimeValue.h updated: 1.15 -> 1.16 --- Log message: Fix some indentation. --- Diffs of the changes: (+4 -5) TimeValue.h | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) Index: llvm/include/llvm/System/TimeValue.h diff -u llvm/include/llvm/System/TimeValue.h:1.15 llvm/include/llvm/System/TimeValue.h:1.16 --- llvm/include/llvm/System/TimeValue.h:1.15 Wed Jul 26 11:55:39 2006 +++ llvm/include/llvm/System/TimeValue.h Tue Aug 22 12:38:05 2006 @@ -354,14 +354,13 @@ /// @brief Normalize to canonical form. void normalize(); -/// @} + /// @} /// @name Data /// @{ private: - /// Store the values as a . - SecondsType seconds_;///< Stores the seconds part of the TimeVal - NanoSecondsType nanos_; ///< Stores the nanoseconds part of the TimeVal - + /// Store the values as a . + SecondsType seconds_;///< Stores the seconds part of the TimeVal + NanoSecondsType nanos_; ///< Stores the nanoseconds part of the TimeVal /// @} }; From reid at x10sys.com Tue Aug 22 12:39:00 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 12:39:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/TimeValue.inc Message-ID: <200608221739.k7MHd0Qo022239@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: TimeValue.inc updated: 1.9 -> 1.10 --- Log message: Don't throw needlessly. Failure of gettimeofday is *very* unlinkely so just return MinTime if that should ever happen. --- Diffs of the changes: (+7 -2) TimeValue.inc | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) Index: llvm/lib/System/Unix/TimeValue.inc diff -u llvm/lib/System/Unix/TimeValue.inc:1.9 llvm/lib/System/Unix/TimeValue.inc:1.10 --- llvm/lib/System/Unix/TimeValue.inc:1.9 Mon May 16 01:59:53 2005 +++ llvm/lib/System/Unix/TimeValue.inc Tue Aug 22 12:38:44 2006 @@ -39,8 +39,13 @@ TimeValue TimeValue::now() { struct timeval the_time; timerclear(&the_time); - if (0 != ::gettimeofday(&the_time,0)) - ThrowErrno("Couldn't obtain time of day"); + if (0 != ::gettimeofday(&the_time,0)) { + // This is *really* unlikely to occur because the only gettimeofday + // errors concern the timezone parameter which we're passing in as 0. + // In the unlikely case it does happen, just return MinTime, no error + // message needed. + return MinTime; + } return TimeValue( static_cast( the_time.tv_sec ), From reid at x10sys.com Tue Aug 22 12:59:04 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 12:59:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Message-ID: <200608221759.k7MHx49J000860@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Archive: ArchiveWriter.cpp updated: 1.26 -> 1.27 --- Log message: Inverse the error check logic for the MappedFile::map() call. It returns a null pointer when there is an error. --- Diffs of the changes: (+1 -1) ArchiveWriter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.26 llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.27 --- llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.26 Tue Aug 22 11:07:44 2006 +++ llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Tue Aug 22 12:58:50 2006 @@ -209,7 +209,7 @@ mFile = new sys::MappedFile(); if (mFile->open(member.getPath(), sys::MappedFile::READ_ACCESS, &ErrMsg)) throw ErrMsg; - if (data = (const char*) mFile->map(&ErrMsg)) + if (!(data = (const char*) mFile->map(&ErrMsg))) throw ErrMsg; fSize = mFile->size(); } From reid at x10sys.com Tue Aug 22 13:03:16 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 13:03:16 -0500 Subject: [llvm-commits] CVS: llvm/lib/Debugger/SourceFile.cpp Message-ID: <200608221803.k7MI3G2B001053@zion.cs.uiuc.edu> Changes in directory llvm/lib/Debugger: SourceFile.cpp updated: 1.8 -> 1.9 --- Log message: Fix another occurrence of inverted logic on the result of MappedFile::map --- Diffs of the changes: (+1 -1) SourceFile.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Debugger/SourceFile.cpp diff -u llvm/lib/Debugger/SourceFile.cpp:1.8 llvm/lib/Debugger/SourceFile.cpp:1.9 --- llvm/lib/Debugger/SourceFile.cpp:1.8 Tue Aug 22 11:06:27 2006 +++ llvm/lib/Debugger/SourceFile.cpp Tue Aug 22 13:03:02 2006 @@ -20,7 +20,7 @@ /// void SourceFile::readFile() { std::string ErrMsg; - if (File.map(&ErrMsg)) + if (!File.map(&ErrMsg)) throw ErrMsg; } From pjenkins at apple.com Tue Aug 22 13:11:33 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Tue, 22 Aug 2006 13:11:33 -0500 Subject: [llvm-commits] CVS: llvm/utils/NewNightlyTest.pl Message-ID: <200608221811.k7MIBXef001280@zion.cs.uiuc.edu> Changes in directory llvm/utils: NewNightlyTest.pl updated: 1.56 -> 1.57 --- Log message: Corrected an error that was introduced yesterday that caused the GCC version to be left blank if the build failed. Also corrected a problem where if the build failed the nightly tester would still try to read the results of the Dejagnutests log even though it didnt exist. --- Diffs of the changes: (+35 -37) NewNightlyTest.pl | 72 ++++++++++++++++++++++++++---------------------------- 1 files changed, 35 insertions(+), 37 deletions(-) Index: llvm/utils/NewNightlyTest.pl diff -u llvm/utils/NewNightlyTest.pl:1.56 llvm/utils/NewNightlyTest.pl:1.57 --- llvm/utils/NewNightlyTest.pl:1.56 Mon Aug 21 15:45:57 2006 +++ llvm/utils/NewNightlyTest.pl Tue Aug 22 13:11:19 2006 @@ -768,8 +768,7 @@ # ############################################################## sub TestDirectory { - my $SubDir = shift; - + my $SubDir = shift; ChangeDir( "$BuildDir/llvm/projects/llvm-test/$SubDir", "Programs Test Subdirectory" ) || return ("", ""); @@ -850,35 +849,34 @@ "$Prefix-MultiSource-Performance.txt ". " | sort > $Prefix-Performance.txt"; } -} - -############################################################## -# -# -# gathering tests added removed broken information here -# -# -############################################################## -my $dejagnu_test_list = ReadFile "$Prefix-Tests.txt"; -my @DEJAGNU = split "\n", $dejagnu_test_list; - -my $passes="", -my $fails=""; -my $xfails=""; -if(!$NODEJAGNU) { - for ($x=0; $x<@DEJAGNU; $x++) { - if ($DEJAGNU[$x] =~ m/^PASS:/) { - $passes.="$DEJAGNU[$x]\n"; - } - elsif ($DEJAGNU[$x] =~ m/^FAIL:/) { - $fails.="$DEJAGNU[$x]\n"; - } - elsif ($DEJAGNU[$x] =~ m/^XFAIL:/) { - $xfails.="$DEJAGNU[$x]\n"; + ############################################################## + # + # + # gathering tests added removed broken information here + # + # + ############################################################## + my $dejagnu_test_list = ReadFile "$Prefix-Tests.txt"; + my @DEJAGNU = split "\n", $dejagnu_test_list; + my ($passes, $fails, $xfails) = ""; + + if(!$NODEJAGNU) { + for ($x=0; $x<@DEJAGNU; $x++) { + if ($DEJAGNU[$x] =~ m/^PASS:/) { + $passes.="$DEJAGNU[$x]\n"; + } + elsif ($DEJAGNU[$x] =~ m/^FAIL:/) { + $fails.="$DEJAGNU[$x]\n"; + } + elsif ($DEJAGNU[$x] =~ m/^XFAIL:/) { + $xfails.="$DEJAGNU[$x]\n"; + } } } -} + +} #end if !$BuildError + ############################################################## # @@ -947,6 +945,15 @@ my ($dejagnutests_log ,$dejagnutests_sum, $dejagnulog_full) = ""; my ($gcc_version, $gcc_version_long) = ""; +$gcc_version_long=""; +if ($GCCPATH ne "") { + $gcc_version_long = `$GCCPATH/gcc --version`; +} else { + $gcc_version_long = `gcc --version`; +} + at GCC_VERSION = split '\n', $gcc_version_long; +$gcc_version = $GCC_VERSION[0]; + if(!$BuildError){ @DEJAGNU_LOG = ReadFile "$DejagnuLog"; @DEJAGNU_SUM = ReadFile "$DejagnuSum"; @@ -955,15 +962,6 @@ @DEJAGNULOG_FULL = ReadFile "$DejagnuTestsLog"; $dejagnulog_full = join("\n", @DEJAGNULOG_FULL); - - $gcc_version_long=""; - if ($GCCPATH ne "") { - $gcc_version_long = `$GCCPATH/gcc --version`; - } else { - $gcc_version_long = `gcc --version`; - } - @GCC_VERSION = split '\n', $gcc_version_long; - $gcc_version = $GCC_VERSION[0]; } ############################################################## From lattner at cs.uiuc.edu Tue Aug 22 13:20:04 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 22 Aug 2006 13:20:04 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveInterval.h Message-ID: <200608221820.k7MIK4kp020582@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveInterval.h updated: 1.18 -> 1.19 --- Log message: Improve the LiveInterval class to keep track of which machine instruction defines each value# tracked by the interval. This will be used to improve coallescing. --- Diffs of the changes: (+23 -2) LiveInterval.h | 25 +++++++++++++++++++++++-- 1 files changed, 23 insertions(+), 2 deletions(-) Index: llvm/include/llvm/CodeGen/LiveInterval.h diff -u llvm/include/llvm/CodeGen/LiveInterval.h:1.18 llvm/include/llvm/CodeGen/LiveInterval.h:1.19 --- llvm/include/llvm/CodeGen/LiveInterval.h:1.18 Tue Aug 22 01:32:56 2006 +++ llvm/include/llvm/CodeGen/LiveInterval.h Tue Aug 22 13:19:46 2006 @@ -79,6 +79,11 @@ Ranges ranges; // the ranges in which this register is live private: unsigned NumValues; // the number of distinct values in this interval. + + /// InstDefiningValue - This tracks the def index of the instruction that + /// defines a particular value number in the interval. This may be ~0, + /// which is treated as unknown. + SmallVector InstDefiningValue; public: LiveInterval(unsigned Reg, float Weight) @@ -109,15 +114,31 @@ void swap(LiveInterval& other) { std::swap(reg, other.reg); std::swap(weight, other.weight); - ranges.swap(other.ranges); + std::swap(ranges, other.ranges); std::swap(NumValues, other.NumValues); } bool containsOneValue() const { return NumValues == 1; } - unsigned getNextValue() { + /// getNextValue - Create a new value number and return it. MIIdx specifies + /// the instruction that defines the value number. + unsigned getNextValue(unsigned MIIdx) { + InstDefiningValue.push_back(MIIdx); return NumValues++; } + + /// getInstForValNum - Return the machine instruction index that defines the + /// specified value number. + unsigned getInstForValNum(unsigned ValNo) const { + return InstDefiningValue[ValNo]; + } + + /// setInstDefiningValNum - Change the instruction defining the specified + /// value number to the specified instruction. + void setInstDefiningValNum(unsigned ValNo, unsigned MIIdx) { + InstDefiningValue[ValNo] = MIIdx; + } + bool empty() const { return ranges.empty(); } From lattner at cs.uiuc.edu Tue Aug 22 13:20:05 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 22 Aug 2006 13:20:05 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp LiveIntervalAnalysis.cpp Message-ID: <200608221820.k7MIK5vT020589@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveInterval.cpp updated: 1.27 -> 1.28 LiveIntervalAnalysis.cpp updated: 1.165 -> 1.166 --- Log message: Improve the LiveInterval class to keep track of which machine instruction defines each value# tracked by the interval. This will be used to improve coallescing. --- Diffs of the changes: (+40 -17) LiveInterval.cpp | 16 +++++++++++++++- LiveIntervalAnalysis.cpp | 41 +++++++++++++++++++++++++---------------- 2 files changed, 40 insertions(+), 17 deletions(-) Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.27 llvm/lib/CodeGen/LiveInterval.cpp:1.28 --- llvm/lib/CodeGen/LiveInterval.cpp:1.27 Fri Oct 21 01:41:30 2005 +++ llvm/lib/CodeGen/LiveInterval.cpp Tue Aug 22 13:19:46 2006 @@ -388,7 +388,7 @@ I->ValId = MergedDstValIdx; else { unsigned &NV = Dst2SrcIdxMap[I->ValId]; - if (NV == 0) NV = getNextValue(); + if (NV == 0) NV = getNextValue(Other.getInstForValNum(I->ValId)); I->ValId = NV; } @@ -422,6 +422,20 @@ E = ranges.end(); I != E; ++I) OS << *I; } + + // Print value number info. + if (NumValues) { + OS << " "; + for (unsigned i = 0; i != NumValues; ++i) { + if (i) OS << " "; + OS << i << "@"; + if (InstDefiningValue[i] == ~0U) { + OS << "?"; + } else { + OS << InstDefiningValue[i]; + } + } + } } void LiveInterval::dump() const { Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.165 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.166 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.165 Mon Aug 21 18:03:54 2006 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Aug 22 13:19:46 2006 @@ -328,7 +328,7 @@ // the spill weight is now infinity as it // cannot be spilled again nI.weight = float(HUGE_VAL); - LiveRange LR(start, end, nI.getNextValue()); + LiveRange LR(start, end, nI.getNextValue(~0U)); DEBUG(std::cerr << " +" << LR); nI.addRange(LR); added.push_back(&nI); @@ -351,18 +351,16 @@ return added; } -void LiveIntervals::printRegName(unsigned reg) const -{ +void LiveIntervals::printRegName(unsigned reg) const { if (MRegisterInfo::isPhysicalRegister(reg)) std::cerr << mri_->getName(reg); else std::cerr << "%reg" << reg; } -void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock* mbb, +void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, MachineBasicBlock::iterator mi, - LiveInterval& interval) -{ + LiveInterval &interval) { DEBUG(std::cerr << "\t\tregister: "; printRegName(interval.reg)); LiveVariables::VarInfo& vi = lv_->getVarInfo(interval.reg); @@ -374,7 +372,7 @@ // Get the Idx of the defining instructions. unsigned defIndex = getDefIndex(getInstructionIndex(mi)); - unsigned ValNum = interval.getNextValue(); + unsigned ValNum = interval.getNextValue(defIndex); assert(ValNum == 0 && "First value in interval is not 0?"); ValNum = 0; // Clue in the optimizer. @@ -456,10 +454,22 @@ unsigned RedefIndex = getDefIndex(getInstructionIndex(mi)); // Delete the initial value, which should be short and continuous, - // becuase the 2-addr copy must be in the same MBB as the redef. + // because the 2-addr copy must be in the same MBB as the redef. interval.removeRange(DefIndex, RedefIndex); - LiveRange LR(DefIndex, RedefIndex, interval.getNextValue()); + // Two-address vregs should always only be redefined once. This means + // that at this point, there should be exactly one value number in it. + assert(interval.containsOneValue() && "Unexpected 2-addr liveint!"); + + // The new value number is defined by the instruction we claimed defined + // value #0. + unsigned ValNo = interval.getNextValue(DefIndex); + + // Value#1 is now defined by the 2-addr instruction. + interval.setInstDefiningValNum(0, RedefIndex); + + // Add the new live interval which replaces the range for the input copy. + LiveRange LR(DefIndex, RedefIndex, ValNo); DEBUG(std::cerr << " replace range with " << LR); interval.addRange(LR); @@ -487,8 +497,9 @@ interval.removeRange(Start, End); DEBUG(std::cerr << "RESULT: " << interval); - // Replace the interval with one of a NEW value number. - LiveRange LR(Start, End, interval.getNextValue()); + // Replace the interval with one of a NEW value number. Note that this + // value number isn't actually defined by an instruction, weird huh? :) + LiveRange LR(Start, End, interval.getNextValue(~0U)); DEBUG(std::cerr << " replace range with " << LR); interval.addRange(LR); DEBUG(std::cerr << "RESULT: " << interval); @@ -500,7 +511,7 @@ unsigned defIndex = getDefIndex(getInstructionIndex(mi)); LiveRange LR(defIndex, getInstructionIndex(&mbb->back()) + InstrSlots::NUM, - interval.getNextValue()); + interval.getNextValue(defIndex)); interval.addRange(LR); DEBUG(std::cerr << " +" << LR); } @@ -513,8 +524,7 @@ MachineBasicBlock::iterator mi, LiveInterval& interval, unsigned SrcReg, unsigned DestReg, - bool isLiveIn) -{ + bool isLiveIn) { // A physical register cannot be live across basic block, so its // lifetime must end somewhere in its defining basic block. DEBUG(std::cerr << "\t\tregister: "; printRegName(interval.reg)); @@ -591,8 +601,7 @@ } } - - LiveRange LR(start, end, interval.getNextValue()); + LiveRange LR(start, end, interval.getNextValue(start)); interval.addRange(LR); DEBUG(std::cerr << " +" << LR << '\n'); } From reid at x10sys.com Tue Aug 22 14:01:47 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 14:01:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.inc Message-ID: <200608221901.k7MJ1lcN002792@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.inc updated: 1.52 -> 1.53 --- Log message: Make the sys::Path::GetTemporaryDirectory method not throw exceptions and adjust users of it to compensate. --- Diffs of the changes: (+30 -23) Path.inc | 53 ++++++++++++++++++++++++++++++----------------------- 1 files changed, 30 insertions(+), 23 deletions(-) Index: llvm/lib/System/Unix/Path.inc diff -u llvm/lib/System/Unix/Path.inc:1.52 llvm/lib/System/Unix/Path.inc:1.53 --- llvm/lib/System/Unix/Path.inc:1.52 Tue Aug 22 00:28:38 2006 +++ llvm/lib/System/Unix/Path.inc Tue Aug 22 14:01:30 2006 @@ -63,16 +63,6 @@ namespace llvm { using namespace sys; -Path::Path(const std::string& unverified_path) : path(unverified_path) { - if (unverified_path.empty()) - return; - if (this->isValid()) - return; - // oops, not valid. - path.clear(); - ThrowErrno(unverified_path + ": path is not valid"); -} - bool Path::isValid() const { // Check some obvious things @@ -97,14 +87,17 @@ } Path -Path::GetTemporaryDirectory() { +Path::GetTemporaryDirectory(std::string* ErrMsg ) { #if defined(HAVE_MKDTEMP) // The best way is with mkdtemp but that's not available on many systems, // Linux and FreeBSD have it. Others probably won't. char pathname[MAXPATHLEN]; strcpy(pathname,"/tmp/llvm_XXXXXX"); - if (0 == mkdtemp(pathname)) - ThrowErrno(std::string(pathname) + ": can't create temporary directory"); + if (0 == mkdtemp(pathname)) { + MakeErrMsg(ErrMsg, + std::string(pathname) + ": can't create temporary directory"); + return Path(); + } Path result; result.set(pathname); assert(result.isValid() && "mkdtemp didn't create a valid pathname!"); @@ -118,12 +111,18 @@ char pathname[MAXPATHLEN]; strcpy(pathname, "/tmp/llvm_XXXXXX"); int fd = 0; - if (-1 == (fd = mkstemp(pathname))) - ThrowErrno(std::string(pathname) + ": can't create temporary directory"); + if (-1 == (fd = mkstemp(pathname))) { + MakeErrMsg(ErrMsg, + std::string(pathname) + ": can't create temporary directory"); + return Path(); + } ::close(fd); ::unlink(pathname); // start race condition, ignore errors - if (-1 == ::mkdir(pathname, S_IRWXU)) // end race condition - ThrowErrno(std::string(pathname) + ": can't create temporary directory"); + if (-1 == ::mkdir(pathname, S_IRWXU)) { // end race condition + MakeErrMsg(ErrMsg, + std::string(pathname) + ": can't create temporary directory"); + return Path(); + } Path result; result.set(pathname); assert(result.isValid() && "mkstemp didn't create a valid pathname!"); @@ -137,10 +136,16 @@ char pathname[MAXPATHLEN]; strcpy(pathname, "/tmp/llvm_XXXXXX"); char *TmpName = ::mktemp(pathname); - if (TmpName == 0) - ThrowErrno(std::string(TmpName) + ": can't create unique directory name"); - if (-1 == ::mkdir(TmpName, S_IRWXU)) - ThrowErrno(std::string(TmpName) + ": can't create temporary directory"); + if (TmpName == 0) { + MakeErrMsg(ErrMsg, + std::string(TmpName) + ": can't create unique directory name"); + return Path(); + } + if (-1 == ::mkdir(TmpName, S_IRWXU)) { + MakeErrMsg(ErrMsg, + std::string(TmpName) + ": can't create temporary directory"); + return Path(); + } Path result; result.set(TmpName); assert(result.isValid() && "mktemp didn't create a valid pathname!"); @@ -160,8 +165,10 @@ num++; sprintf(pathname, "/tmp/llvm_%010u", unsigned(num)); } while ( 0 == access(pathname, F_OK ) ); - if (-1 == ::mkdir(pathname, S_IRWXU)) - ThrowErrno(std::string(pathname) + ": can't create temporary directory"); + if (-1 == ::mkdir(pathname, S_IRWXU)) { + MakeErrMsg(ErrMsg, + std::string(pathname) + ": can't create temporary directory"); + return Path(); Path result; result.set(pathname); assert(result.isValid() && "mkstemp didn't create a valid pathname!"); From reid at x10sys.com Tue Aug 22 14:01:49 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 14:01:49 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvmc/CompilerDriver.cpp Message-ID: <200608221901.k7MJ1npw002819@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: CompilerDriver.cpp updated: 1.39 -> 1.40 --- Log message: Make the sys::Path::GetTemporaryDirectory method not throw exceptions and adjust users of it to compensate. --- Diffs of the changes: (+30 -10) CompilerDriver.cpp | 40 ++++++++++++++++++++++++++++++---------- 1 files changed, 30 insertions(+), 10 deletions(-) Index: llvm/tools/llvmc/CompilerDriver.cpp diff -u llvm/tools/llvmc/CompilerDriver.cpp:1.39 llvm/tools/llvmc/CompilerDriver.cpp:1.40 --- llvm/tools/llvmc/CompilerDriver.cpp:1.39 Mon Aug 21 01:04:45 2006 +++ llvm/tools/llvmc/CompilerDriver.cpp Tue Aug 22 14:01:30 2006 @@ -83,8 +83,6 @@ , TempDir() , AdditionalArgs() { - TempDir = sys::Path::GetTemporaryDirectory(); - sys::RemoveDirectoryOnSignal(TempDir); AdditionalArgs.reserve(NUM_PHASES); StringVector emptyVec; for (unsigned i = 0; i < NUM_PHASES; ++i) @@ -196,12 +194,25 @@ } sys::Path MakeTempFile(const std::string& basename, - const std::string& suffix) { + const std::string& suffix, + std::string* ErrMsg) { + if (TempDir.isEmpty()) { + TempDir = sys::Path::GetTemporaryDirectory(ErrMsg); + if (TempDir.isEmpty()) + return sys::Path(); + sys::RemoveDirectoryOnSignal(TempDir); + } sys::Path result(TempDir); - if (!result.appendComponent(basename)) - throw basename + ": can't use this file name"; - if (!result.appendSuffix(suffix)) - throw suffix + ": can't use this file suffix"; + if (!result.appendComponent(basename)) { + if (ErrMsg) + *ErrMsg = basename + ": can't use this file name"; + return sys::Path(); + } + if (!result.appendSuffix(suffix)) { + if (ErrMsg) + *ErrMsg = suffix + ": can't use this file suffix"; + return sys::Path(); + } return result; } @@ -700,7 +711,10 @@ actions.push_back(GetAction(cd,InFile,Output,PREPROCESSING)); } } else { - sys::Path TempFile(MakeTempFile(I->first.getBasename(),"E")); + sys::Path TempFile( + MakeTempFile(I->first.getBasename(),"E",&ErrMsg)); + if (TempFile.isEmpty()) + return 1; actions.push_back(GetAction(cd,InFile,TempFile, PREPROCESSING)); InFile = TempFile; @@ -731,7 +745,10 @@ actions.push_back(GetAction(cd,InFile,Output,TRANSLATION)); } } else { - sys::Path TempFile(MakeTempFile(I->first.getBasename(),"trans")); + sys::Path TempFile( + MakeTempFile(I->first.getBasename(),"trans", &ErrMsg)); + if (TempFile.isEmpty()) + return 1; actions.push_back(GetAction(cd,InFile,TempFile,TRANSLATION)); InFile = TempFile; } @@ -774,7 +791,10 @@ actions.push_back(GetAction(cd,InFile,Output,OPTIMIZATION)); } } else { - sys::Path TempFile(MakeTempFile(I->first.getBasename(),"opt")); + sys::Path TempFile( + MakeTempFile(I->first.getBasename(),"opt", &ErrMsg)); + if (TempFile.isEmpty()) + return 1; actions.push_back(GetAction(cd,InFile,TempFile,OPTIMIZATION)); InFile = TempFile; } From reid at x10sys.com Tue Aug 22 14:01:49 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 14:01:49 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200608221901.k7MJ1n98002807@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.35 -> 1.36 --- Log message: Make the sys::Path::GetTemporaryDirectory method not throw exceptions and adjust users of it to compensate. --- Diffs of the changes: (+4 -3) Path.h | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.35 llvm/include/llvm/System/Path.h:1.36 --- llvm/include/llvm/System/Path.h:1.35 Tue Aug 1 13:16:02 2006 +++ llvm/include/llvm/System/Path.h Tue Aug 22 14:01:30 2006 @@ -97,10 +97,11 @@ /// a "standard" place for the operating system. The directory is /// guaranteed to be created on exit from this function. If the directory /// cannot be created, the function will throw an exception. - /// @throws std::string indicating why the directory could not be created. + /// @returns an invalid path (empty) on error + /// @param ErrMsg Optional place for an error message if an error occurs /// @brief Constrct a path to an new, unique, existing temporary /// directory. - static Path GetTemporaryDirectory(); + static Path GetTemporaryDirectory(std::string* ErrMsg); /// Construct a vector of sys::Path that contains the "standard" system /// library paths suitable for linking into programs. This function *must* @@ -171,7 +172,7 @@ /// @throws std::string if \p unverified_path is not legal. /// @param unverified_path The path to verify and assign. /// @brief Construct a Path from a string. - explicit Path(const std::string& unverified_path); + explicit Path(const std::string& p) : path(p) {} /// @} /// @name Operators From reid at x10sys.com Tue Aug 22 14:01:50 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 14:01:50 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/GraphWriter.h Message-ID: <200608221901.k7MJ1osD002824@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: GraphWriter.h updated: 1.27 -> 1.28 --- Log message: Make the sys::Path::GetTemporaryDirectory method not throw exceptions and adjust users of it to compensate. --- Diffs of the changes: (+6 -1) GraphWriter.h | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Support/GraphWriter.h diff -u llvm/include/llvm/Support/GraphWriter.h:1.27 llvm/include/llvm/Support/GraphWriter.h:1.28 --- llvm/include/llvm/Support/GraphWriter.h:1.27 Tue Jun 27 11:49:46 2006 +++ llvm/include/llvm/Support/GraphWriter.h Tue Aug 22 14:01:30 2006 @@ -244,7 +244,12 @@ sys::Path WriteGraph(const GraphType &G, const std::string& Name, const std::string& Title = "") { - sys::Path Filename = sys::Path::GetTemporaryDirectory();; + std::string ErrMsg; + sys::Path Filename = sys::Path::GetTemporaryDirectory(&ErrMsg); + if (Filename.isEmpty()) { + std::cerr << "Error: " << ErrMsg << "\n"; + return Filename; + } Filename.appendComponent(Name + ".dot"); Filename.makeUnique(); std::cerr << "Writing '" << Filename << "'... "; From brukman at cs.uiuc.edu Tue Aug 22 16:57:10 2006 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue, 22 Aug 2006 16:57:10 -0500 Subject: [llvm-commits] CVS: llvm/docs/CompilerWriterInfo.html Message-ID: <200608222157.k7MLvACM013514@zion.cs.uiuc.edu> Changes in directory llvm/docs: CompilerWriterInfo.html updated: 1.9 -> 1.10 --- Log message: Added link to ABI documentation, sent by Rafael Espindola. --- Diffs of the changes: (+2 -1) CompilerWriterInfo.html | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/docs/CompilerWriterInfo.html diff -u llvm/docs/CompilerWriterInfo.html:1.9 llvm/docs/CompilerWriterInfo.html:1.10 --- llvm/docs/CompilerWriterInfo.html:1.9 Mon Mar 13 23:39:39 2006 +++ llvm/docs/CompilerWriterInfo.html Tue Aug 22 16:56:43 2006 @@ -63,6 +63,7 @@
  • ARM documentation (Processor Cores)
  • +
  • ABI
  • @@ -253,7 +254,7 @@ Misha Brukman
    LLVM Compiler Infrastructure
    - Last modified: $Date: 2006/03/14 05:39:39 $ + Last modified: $Date: 2006/08/22 21:56:43 $ From reid at x10sys.com Tue Aug 22 17:21:55 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 17:21:55 -0500 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200608222221.k7MMLtVP006381@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.247 -> 1.248 --- Log message: Add irix as a (potential) new platform so that Timothy Baldridge can (hopefully) provide support for it. --- Diffs of the changes: (+30 -68) configure | 98 ++++++++++++++++++-------------------------------------------- 1 files changed, 30 insertions(+), 68 deletions(-) Index: llvm/configure diff -u llvm/configure:1.247 llvm/configure:1.248 --- llvm/configure:1.247 Tue Aug 15 19:45:38 2006 +++ llvm/configure Tue Aug 22 17:21:37 2006 @@ -872,7 +872,6 @@ INSTALL_DATA BZIP2 DOXYGEN -ETAGS GROFF GZIP POD2HTML @@ -2220,6 +2219,11 @@ llvm_cv_no_link_all_option="-Wl,--no-whole-archive" llvm_cv_os_type="AIX" llvm_cv_platform_type="Unix" ;; + *-*-irix*) + llvm_cv_link_all_option="-Wl,--whole-archive" + llvm_cv_no_link_all_option="-Wl,--no-whole-archive" + llvm_cv_os_type="IRIX" + llvm_cv_platform_type="Unix" ;; *-*-cygwin*) llvm_cv_link_all_option="-Wl,--whole-archive" llvm_cv_no_link_all_option="-Wl,--no-whole-archive" @@ -7466,47 +7470,6 @@ fi -# Extract the first word of "etags", so it can be a program name with args. -set dummy etags; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_ETAGS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $ETAGS in - [\\/]* | ?:[\\/]*) - ac_cv_path_ETAGS="$ETAGS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ETAGS="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_ETAGS" && ac_cv_path_ETAGS="echo "Skipped: etags not found"" - ;; -esac -fi -ETAGS=$ac_cv_path_ETAGS -if test -n "$ETAGS"; then - { echo "$as_me:$LINENO: result: $ETAGS" >&5 -echo "${ECHO_T}$ETAGS" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - # Extract the first word of "groff", so it can be a program name with args. set dummy groff; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -10305,7 +10268,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext + echo '#line 12415 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -14167,11 +14130,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14170: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14133: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14174: \$? = $ac_status" >&5 + echo "$as_me:14137: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14435,11 +14398,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14438: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14401: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14442: \$? = $ac_status" >&5 + echo "$as_me:14405: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14539,11 +14502,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14542: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14505: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14546: \$? = $ac_status" >&5 + echo "$as_me:14509: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16991,7 +16954,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:19425: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:19466: \$? = $ac_status" >&5 + echo "$as_me:19429: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -19563,11 +19526,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:19566: $lt_compile\"" >&5) + (eval echo "\"\$as_me:19529: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:19570: \$? = $ac_status" >&5 + echo "$as_me:19533: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -21133,11 +21096,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21136: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21099: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:21140: \$? = $ac_status" >&5 + echo "$as_me:21103: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -21237,11 +21200,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21240: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21203: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:21244: \$? = $ac_status" >&5 + echo "$as_me:21207: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -23472,11 +23435,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:23475: $lt_compile\"" >&5) + (eval echo "\"\$as_me:23438: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:23479: \$? = $ac_status" >&5 + echo "$as_me:23442: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -23740,11 +23703,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:23743: $lt_compile\"" >&5) + (eval echo "\"\$as_me:23706: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:23747: \$? = $ac_status" >&5 + echo "$as_me:23710: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -23844,11 +23807,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:23847: $lt_compile\"" >&5) + (eval echo "\"\$as_me:23810: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:23851: \$? = $ac_status" >&5 + echo "$as_me:23814: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -34180,7 +34143,6 @@ INSTALL_DATA!$INSTALL_DATA$ac_delim BZIP2!$BZIP2$ac_delim DOXYGEN!$DOXYGEN$ac_delim -ETAGS!$ETAGS$ac_delim GROFF!$GROFF$ac_delim GZIP!$GZIP$ac_delim POD2HTML!$POD2HTML$ac_delim @@ -34226,7 +34188,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 63; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 62; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 From reid at x10sys.com Tue Aug 22 17:21:55 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 17:21:55 -0500 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200608222221.k7MMLt5i006382@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.244 -> 1.245 --- Log message: Add irix as a (potential) new platform so that Timothy Baldridge can (hopefully) provide support for it. --- Diffs of the changes: (+5 -0) configure.ac | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.244 llvm/autoconf/configure.ac:1.245 --- llvm/autoconf/configure.ac:1.244 Tue Aug 15 19:45:38 2006 +++ llvm/autoconf/configure.ac Tue Aug 22 17:21:38 2006 @@ -106,6 +106,11 @@ llvm_cv_no_link_all_option="-Wl,--no-whole-archive" llvm_cv_os_type="AIX" llvm_cv_platform_type="Unix" ;; + *-*-irix*) + llvm_cv_link_all_option="-Wl,--whole-archive" + llvm_cv_no_link_all_option="-Wl,--no-whole-archive" + llvm_cv_os_type="IRIX" + llvm_cv_platform_type="Unix" ;; *-*-cygwin*) llvm_cv_link_all_option="-Wl,--whole-archive" llvm_cv_no_link_all_option="-Wl,--no-whole-archive" From reid at x10sys.com Tue Aug 22 17:46:55 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 17:46:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.inc Message-ID: <200608222246.k7MMktCA014991@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.inc updated: 1.51 -> 1.52 --- Log message: Update for changes in Path class interface for exception removal. --- Diffs of the changes: (+6 -16) Path.inc | 22 ++++++---------------- 1 files changed, 6 insertions(+), 16 deletions(-) Index: llvm/lib/System/Win32/Path.inc diff -u llvm/lib/System/Win32/Path.inc:1.51 llvm/lib/System/Win32/Path.inc:1.52 --- llvm/lib/System/Win32/Path.inc:1.51 Tue Aug 1 13:16:02 2006 +++ llvm/lib/System/Win32/Path.inc Tue Aug 22 17:46:39 2006 @@ -108,13 +108,16 @@ static Path *TempDirectory = NULL; Path -Path::GetTemporaryDirectory() { +Path::GetTemporaryDirectory(std::string* ErrMsg) { if (TempDirectory) return *TempDirectory; char pathname[MAX_PATH]; - if (!GetTempPath(MAX_PATH, pathname)) - throw std::string("Can't determine temporary directory"); + if (!GetTempPath(MAX_PATH, pathname)) { + if (ErrMsg) + *ErrMsg = "Can't determine temporary directory"; + return Path(); + } Path result; result.set(pathname); @@ -134,19 +137,6 @@ return *TempDirectory; } -Path::Path(const std::string& unverified_path) - : path(unverified_path) -{ - FlipBackSlashes(path); - if (unverified_path.empty()) - return; - if (this->isValid()) - return; - // oops, not valid. - path.clear(); - throw std::string(unverified_path + ": path is not valid"); -} - // FIXME: the following set of functions don't map to Windows very well. Path Path::GetRootDirectory() { From reid at x10sys.com Tue Aug 22 18:27:39 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 18:27:39 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200608222327.k7MNRdSi026173@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.36 -> 1.37 --- Log message: For PR797: http://llvm.org/PR797 : Change the Path::make*OnDisk methods exception free and adjust their usage. --- Diffs of the changes: (+4 -4) Path.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.36 llvm/include/llvm/System/Path.h:1.37 --- llvm/include/llvm/System/Path.h:1.36 Tue Aug 22 14:01:30 2006 +++ llvm/include/llvm/System/Path.h Tue Aug 22 18:27:22 2006 @@ -101,7 +101,7 @@ /// @param ErrMsg Optional place for an error message if an error occurs /// @brief Constrct a path to an new, unique, existing temporary /// directory. - static Path GetTemporaryDirectory(std::string* ErrMsg); + static Path GetTemporaryDirectory(std::string* ErrMsg = 0); /// Construct a vector of sys::Path that contains the "standard" system /// library paths suitable for linking into programs. This function *must* @@ -424,18 +424,18 @@ /// This method attempts to make the file referenced by the Path object /// available for reading so that the canRead() method will return true. /// @brief Make the file readable; - void makeReadableOnDisk(); + bool makeReadableOnDisk(std::string* ErrMsg); /// This method attempts to make the file referenced by the Path object /// available for writing so that the canWrite() method will return true. /// @brief Make the file writable; - void makeWriteableOnDisk(); + bool makeWriteableOnDisk(std::string* ErrMsg); /// This method attempts to make the file referenced by the Path object /// available for execution so that the canExecute() method will return /// true. /// @brief Make the file readable; - void makeExecutableOnDisk(); + bool makeExecutableOnDisk(std::string* ErrMsg); /// This method allows the last modified time stamp and permission bits /// to be set on the disk object referenced by the Path. From reid at x10sys.com Tue Aug 22 18:21:37 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 18:21:37 -0500 Subject: [llvm-commits] CVS: llvm/tools/Makefile Message-ID: <200608222321.k7MNLbxD023939@zion.cs.uiuc.edu> Changes in directory llvm/tools: Makefile updated: 1.51 -> 1.52 --- Log message: Rearrange the build order to better accommodate parallel build by reducing memory pressure. This order spaces out large executables with small ones in between so that in a -j2 or -j3 build, it only attempts to build only one large executable at time. If you're doing -j4, you probably have enuogh memory anyway. --- Diffs of the changes: (+4 -3) Makefile | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/tools/Makefile diff -u llvm/tools/Makefile:1.51 llvm/tools/Makefile:1.52 --- llvm/tools/Makefile:1.51 Fri Aug 18 01:34:30 2006 +++ llvm/tools/Makefile Tue Aug 22 18:21:21 2006 @@ -8,8 +8,9 @@ ##===----------------------------------------------------------------------===## LEVEL := .. -PARALLEL_DIRS := llvm-config llvm-as llvm-dis opt gccas llc llvm-link lli gccld\ - llvm-stub llvm-extract llvm-nm llvm-prof llvm-ar llvm-ranlib \ - llvm-bcanalyzer llvmc llvm-ld llvm-db bugpoint llvm2cpp +PARALLEL_DIRS := llvm-config opt llvm-as -llvm-dis llc llvm-bcanalyzer \ + llvm-extract lli llvm-db llvm-ar llvm-ld llvm-prof llvm-nm \ + gccas llvm-ranlib llvm-stub gccld llvm2cpp \ + bugpoint llvmc llvm-link include $(LEVEL)/Makefile.common From reid at x10sys.com Tue Aug 22 18:27:42 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 18:27:42 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200608222327.k7MNRgu2026249@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.34 -> 1.35 --- Log message: For PR797: http://llvm.org/PR797 : Change the Path::make*OnDisk methods exception free and adjust their usage. --- Diffs of the changes: (+13 -3) llvm-ld.cpp | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.34 llvm/tools/llvm-ld/llvm-ld.cpp:1.35 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.34 Mon Aug 21 01:04:45 2006 +++ llvm/tools/llvm-ld/llvm-ld.cpp Tue Aug 22 18:27:23 2006 @@ -598,11 +598,21 @@ } // Make the script executable... - sys::Path(OutputFilename).makeExecutableOnDisk(); + std::string ErrMsg; + if (sys::Path(OutputFilename).makeExecutableOnDisk(&ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 1; + } // Make the bytecode file readable and directly executable in LLEE as well - sys::Path(RealBytecodeOutput).makeExecutableOnDisk(); - sys::Path(RealBytecodeOutput).makeReadableOnDisk(); + if (sys::Path(RealBytecodeOutput).makeExecutableOnDisk(&ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 1; + } + if (sys::Path(RealBytecodeOutput).makeReadableOnDisk(&ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 1; + } } return 0; From reid at x10sys.com Tue Aug 22 19:06:29 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 19:06:29 -0500 Subject: [llvm-commits] CVS: llvm/tools/Makefile Message-ID: <200608230006.k7N06Tma009145@zion.cs.uiuc.edu> Changes in directory llvm/tools: Makefile updated: 1.52 -> 1.53 --- Log message: Fix a typo. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/Makefile diff -u llvm/tools/Makefile:1.52 llvm/tools/Makefile:1.53 --- llvm/tools/Makefile:1.52 Tue Aug 22 18:21:21 2006 +++ llvm/tools/Makefile Tue Aug 22 19:06:14 2006 @@ -8,7 +8,7 @@ ##===----------------------------------------------------------------------===## LEVEL := .. -PARALLEL_DIRS := llvm-config opt llvm-as -llvm-dis llc llvm-bcanalyzer \ +PARALLEL_DIRS := llvm-config opt llvm-as llvm-dis llc llvm-bcanalyzer \ llvm-extract lli llvm-db llvm-ar llvm-ld llvm-prof llvm-nm \ gccas llvm-ranlib llvm-stub gccld llvm2cpp \ bugpoint llvmc llvm-link From reid at x10sys.com Tue Aug 22 19:12:26 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 19:12:26 -0500 Subject: [llvm-commits] CVS: llvm/tools/Makefile Message-ID: <200608230012.k7N0CQ21010219@zion.cs.uiuc.edu> Changes in directory llvm/tools: Makefile updated: 1.53 -> 1.54 --- Log message: Rearrange order to build more frequently used tools first and make the triplet ordering (large, small, small) explicit with one triplet per line. --- Diffs of the changes: (+11 -4) Makefile | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) Index: llvm/tools/Makefile diff -u llvm/tools/Makefile:1.53 llvm/tools/Makefile:1.54 --- llvm/tools/Makefile:1.53 Tue Aug 22 19:06:14 2006 +++ llvm/tools/Makefile Tue Aug 22 19:12:11 2006 @@ -8,9 +8,16 @@ ##===----------------------------------------------------------------------===## LEVEL := .. -PARALLEL_DIRS := llvm-config opt llvm-as llvm-dis llc llvm-bcanalyzer \ - llvm-extract lli llvm-db llvm-ar llvm-ld llvm-prof llvm-nm \ - gccas llvm-ranlib llvm-stub gccld llvm2cpp \ - bugpoint llvmc llvm-link +# Note .. the tools are organized in triples consisting of one large and two +# small executables. This is done to minimize memory load in parallel builds. +# Please retain this ordering. +PARALLEL_DIRS := llvm-config \ + opt llvm-as llvm-dis \ + llc llvm-ranlib llvm-ar \ + lli llvm-link llvm-nm \ + bugpoint llvm-db llvm-extract \ + gccas llvm-bcanalyzer llvm-stub \ + gccld llvm2cpp \ + llvm-ld llvmc llvm-prof include $(LEVEL)/Makefile.common From reid at x10sys.com Tue Aug 22 19:39:56 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 19:39:56 -0500 Subject: [llvm-commits] CVS: llvm/tools/lto/lto.cpp Message-ID: <200608230039.k7N0duFm018734@zion.cs.uiuc.edu> Changes in directory llvm/tools/lto: lto.cpp updated: 1.6 -> 1.7 --- Log message: For PR797: http://llvm.org/PR797 : Remove exceptions from the Path::create*OnDisk methods. Update their users to handle error messages via arguments and result codes. --- Diffs of the changes: (+5 -1) lto.cpp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/tools/lto/lto.cpp diff -u llvm/tools/lto/lto.cpp:1.6 llvm/tools/lto/lto.cpp:1.7 --- llvm/tools/lto/lto.cpp:1.6 Sun Aug 20 21:04:43 2006 +++ llvm/tools/lto/lto.cpp Tue Aug 22 19:39:35 2006 @@ -295,7 +295,11 @@ } sys::Path tmpAsmFilePath("/tmp/"); - tmpAsmFilePath.createTemporaryFileOnDisk(); + std::string ErrMsg; + if (tmpAsmFilePath.createTemporaryFileOnDisk(&ErrMsg)) { + std::cerr << "lto: " << ErrMsg << "\n"; + return; + } sys::RemoveFileOnSignal(tmpAsmFilePath); std::ofstream asmFile(tmpAsmFilePath.c_str(), io_mode); From reid at x10sys.com Tue Aug 22 19:39:55 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 19:39:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Message-ID: <200608230039.k7N0dtTh018706@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Archive: ArchiveWriter.cpp updated: 1.27 -> 1.28 --- Log message: For PR797: http://llvm.org/PR797 : Remove exceptions from the Path::create*OnDisk methods. Update their users to handle error messages via arguments and result codes. --- Diffs of the changes: (+4 -2) ArchiveWriter.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.27 llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.28 --- llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.27 Tue Aug 22 12:58:50 2006 +++ llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Tue Aug 22 19:39:34 2006 @@ -389,7 +389,8 @@ // Create a temporary file to store the archive in sys::Path TmpArchive = archPath; - TmpArchive.createTemporaryFileOnDisk(); + if (TmpArchive.createTemporaryFileOnDisk(error)) + return false; // Make sure the temporary gets removed if we crash sys::RemoveFileOnSignal(TmpArchive); @@ -452,7 +453,8 @@ // Open another temporary file in order to avoid invalidating the // mmapped data sys::Path FinalFilePath = archPath; - FinalFilePath.createTemporaryFileOnDisk(); + if (FinalFilePath.createTemporaryFileOnDisk(error)) + return false; sys::RemoveFileOnSignal(FinalFilePath); std::ofstream FinalFile(FinalFilePath.c_str(), io_mode); From reid at x10sys.com Tue Aug 22 19:39:56 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 19:39:56 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ar/llvm-ar.cpp Message-ID: <200608230039.k7N0duZJ018721@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ar: llvm-ar.cpp updated: 1.34 -> 1.35 --- Log message: For PR797: http://llvm.org/PR797 : Remove exceptions from the Path::create*OnDisk methods. Update their users to handle error messages via arguments and result codes. --- Diffs of the changes: (+12 -4) llvm-ar.cpp | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) Index: llvm/tools/llvm-ar/llvm-ar.cpp diff -u llvm/tools/llvm-ar/llvm-ar.cpp:1.34 llvm/tools/llvm-ar/llvm-ar.cpp:1.35 --- llvm/tools/llvm-ar/llvm-ar.cpp:1.34 Tue Aug 1 13:09:46 2006 +++ llvm/tools/llvm-ar/llvm-ar.cpp Tue Aug 22 19:39:35 2006 @@ -425,8 +425,8 @@ } // doExtract - Implement the 'x' operation. This function extracts files back to -// the file system, making sure to uncompress any that were compressed. -void doExtract() { +// the file system, making sure to uncompress any that were compressed +bool doExtract(std::string* ErrMsg) { buildPaths(false); unsigned countDown = Count; for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end(); @@ -438,7 +438,8 @@ if (I->hasPath()) { sys::Path dirs(I->getPath()); dirs.eraseComponent(); - dirs.createDirectoryOnDisk(/*create_parents=*/true); + if (dirs.createDirectoryOnDisk(/*create_parents=*/true, ErrMsg)) + return true; } // Open up a file stream for writing @@ -464,6 +465,7 @@ I->getPath().setStatusInfoOnDisk(I->getFileStatus()); } } + return false; } // doDelete - Implement the delete operation. This function deletes zero or more @@ -711,6 +713,7 @@ std::auto_ptr AutoArchive(TheArchive); // Perform the operation + std::string ErrMsg; switch (Operation) { case Print: doPrint(); break; case Delete: doDelete(); break; @@ -718,7 +721,12 @@ case QuickAppend: /* FALL THROUGH */ case ReplaceOrInsert: doReplaceOrInsert(); break; case DisplayTable: doDisplayTable(); break; - case Extract: doExtract(); break; + case Extract: + if (doExtract(&ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 1; + } + break; case NoOperation: std::cerr << argv[0] << ": No operation was selected.\n"; break; From reid at x10sys.com Tue Aug 22 19:39:56 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 19:39:56 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200608230039.k7N0dudX018728@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.37 -> 1.38 --- Log message: For PR797: http://llvm.org/PR797 : Remove exceptions from the Path::create*OnDisk methods. Update their users to handle error messages via arguments and result codes. --- Diffs of the changes: (+21 -19) Path.h | 40 +++++++++++++++++++++------------------- 1 files changed, 21 insertions(+), 19 deletions(-) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.37 llvm/include/llvm/System/Path.h:1.38 --- llvm/include/llvm/System/Path.h:1.37 Tue Aug 22 18:27:22 2006 +++ llvm/include/llvm/System/Path.h Tue Aug 22 19:39:34 2006 @@ -424,18 +424,18 @@ /// This method attempts to make the file referenced by the Path object /// available for reading so that the canRead() method will return true. /// @brief Make the file readable; - bool makeReadableOnDisk(std::string* ErrMsg); + bool makeReadableOnDisk(std::string* ErrMsg = 0); /// This method attempts to make the file referenced by the Path object /// available for writing so that the canWrite() method will return true. /// @brief Make the file writable; - bool makeWriteableOnDisk(std::string* ErrMsg); + bool makeWriteableOnDisk(std::string* ErrMsg = 0); /// This method attempts to make the file referenced by the Path object /// available for execution so that the canExecute() method will return /// true. /// @brief Make the file readable; - bool makeExecutableOnDisk(std::string* ErrMsg); + bool makeExecutableOnDisk(std::string* ErrMsg = 0); /// This method allows the last modified time stamp and permission bits /// to be set on the disk object referenced by the Path. @@ -452,23 +452,25 @@ /// intermediate directories, as needed. If \p create_parents is false, /// then only the final directory component of the Path name will be /// created. The created directory will have no entries. - /// @returns false if the Path does not reference a directory, true - /// otherwise. - /// @param create_parents Determines whether non-existent directory - /// components other than the last one (the "parents") are created or not. - /// @throws std::string if an error occurs. + /// @returns true if the directory could not be created, false otherwise /// @brief Create the directory this Path refers to. - bool createDirectoryOnDisk( bool create_parents = false ); + bool createDirectoryOnDisk( + bool create_parents = false, ///< Determines whether non-existent + ///< directory components other than the last one (the "parents") + ///< are created or not. + std::string* ErrMsg = 0 ///< Optional place to put error messages. + ); /// This method attempts to create a file in the file system with the same /// name as the Path object. The intermediate directories must all exist /// at the time this method is called. Use createDirectoriesOnDisk to /// accomplish that. The created file will be empty upon return from this /// function. - /// @returns false if the Path does not reference a file, true otherwise. - /// @throws std::string if an error occurs. + /// @returns true if the file could not be created, false otherwise. /// @brief Create the file this Path refers to. - bool createFileOnDisk(); + bool createFileOnDisk( + std::string* ErrMsg = 0 ///< Optional place to put error messages. + ); /// This is like createFile except that it creates a temporary file. A /// unique temporary file name is generated based on the contents of @@ -476,14 +478,14 @@ /// file is created. Note that this will both change the Path object /// *and* create the corresponding file. This function will ensure that /// the newly generated temporary file name is unique in the file system. - /// @param reuse_current When set to true, this parameter indicates that - /// if the current file name does not exist then it will be used without - /// modification. - /// @returns true if successful, false if the file couldn't be created. - /// @throws std::string if there is a hard error creating the temp file - /// name. + /// @returns true if the file couldn't be created, false otherwise. /// @brief Create a unique temporary file - bool createTemporaryFileOnDisk(bool reuse_current = false); + bool createTemporaryFileOnDisk( + bool reuse_current = false, ///< When set to true, this parameter + ///< indicates that if the current file name does not exist then + ///< it will be used without modification. + std::string* ErrMsg = 0 ///< Optional place to put error messages + ); /// This method renames the file referenced by \p this as \p newName. The /// file referenced by \p this must exist. The file referenced by From reid at x10sys.com Tue Aug 22 19:39:58 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 19:39:58 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200608230039.k7N0dwhE018742@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.35 -> 1.36 --- Log message: For PR797: http://llvm.org/PR797 : Remove exceptions from the Path::create*OnDisk methods. Update their users to handle error messages via arguments and result codes. --- Diffs of the changes: (+3 -4) llvm-ld.cpp | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.35 llvm/tools/llvm-ld/llvm-ld.cpp:1.36 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.35 Tue Aug 22 18:27:23 2006 +++ llvm/tools/llvm-ld/llvm-ld.cpp Tue Aug 22 19:39:35 2006 @@ -492,16 +492,15 @@ } // Get the program arguments sys::Path tmp_output("opt_result"); - if (!tmp_output.createTemporaryFileOnDisk()) { - return PrintAndReturn( - "Can't create temporary file for post-link optimization"); + std::string ErrMsg; + if (tmp_output.createTemporaryFileOnDisk(&ErrMsg)) { + return PrintAndReturn(ErrMsg); } const char* args[4]; args[0] = I->c_str(); args[1] = RealBytecodeOutput.c_str(); args[2] = tmp_output.c_str(); args[3] = 0; - std::string ErrMsg; if (0 == sys::Program::ExecuteAndWait(prog, args, 0,0,0, &ErrMsg)) { if (tmp_output.isBytecodeFile()) { sys::Path target(RealBytecodeOutput); From reid at x10sys.com Tue Aug 22 19:39:59 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 19:39:59 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.inc Message-ID: <200608230039.k7N0dxr4018783@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.inc updated: 1.54 -> 1.55 --- Log message: For PR797: http://llvm.org/PR797 : Remove exceptions from the Path::create*OnDisk methods. Update their users to handle error messages via arguments and result codes. --- Diffs of the changes: (+22 -15) Path.inc | 37 ++++++++++++++++++++++--------------- 1 files changed, 22 insertions(+), 15 deletions(-) Index: llvm/lib/System/Unix/Path.inc diff -u llvm/lib/System/Unix/Path.inc:1.54 llvm/lib/System/Unix/Path.inc:1.55 --- llvm/lib/System/Unix/Path.inc:1.54 Tue Aug 22 18:27:22 2006 +++ llvm/lib/System/Unix/Path.inc Tue Aug 22 19:39:35 2006 @@ -517,7 +517,7 @@ } bool -Path::createDirectoryOnDisk( bool create_parents) { +Path::createDirectoryOnDisk( bool create_parents, std::string* ErrMsg ) { // Get a writeable copy of the path name char pathname[MAXPATHLEN]; path.copy(pathname,MAXPATHLEN); @@ -540,8 +540,11 @@ while ( next != 0 ) { *next = 0; if (0 != access(pathname, F_OK | R_OK | W_OK)) - if (0 != mkdir(pathname, S_IRWXU | S_IRWXG)) - ThrowErrno(std::string(pathname) + ": can't create directory"); + if (0 != mkdir(pathname, S_IRWXU | S_IRWXG)) { + MakeErrMsg(ErrMsg, + std::string(pathname) + ": can't create directory"); + return true; + } char* save = next; next = strchr(next+1,'/'); *save = '/'; @@ -549,33 +552,37 @@ } if (0 != access(pathname, F_OK | R_OK)) - if (0 != mkdir(pathname, S_IRWXU | S_IRWXG)) - ThrowErrno(std::string(pathname) + ": can't create directory"); - return true; + if (0 != mkdir(pathname, S_IRWXU | S_IRWXG)) { + MakeErrMsg(ErrMsg, std::string(pathname) + ": can't create directory"); + return true; + } + return false; } bool -Path::createFileOnDisk() { +Path::createFileOnDisk(std::string* ErrMsg) { // Create the file int fd = ::creat(path.c_str(), S_IRUSR | S_IWUSR); - if (fd < 0) - ThrowErrno(path + ": can't create file"); + if (fd < 0) { + MakeErrMsg(ErrMsg, path + ": can't create file"); + return true; + } ::close(fd); - - return true; + return false; } bool -Path::createTemporaryFileOnDisk(bool reuse_current) { +Path::createTemporaryFileOnDisk(bool reuse_current, std::string* ErrMsg) { // Make this into a unique file name makeUnique( reuse_current ); // create the file - int outFile = ::open(path.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0666); - if (outFile != -1) { - ::close(outFile); + int fd = ::open(path.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0666); + if (fd < 0) { + MakeErrMsg(ErrMsg, path + ": can't create temporary file"); return true; } + ::close(fd); return false; } From reid at x10sys.com Tue Aug 22 18:54:51 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 18:54:51 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.inc Message-ID: <200608222354.k7MNspFr007512@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.inc updated: 1.52 -> 1.53 --- Log message: For PR797: http://llvm.org/PR797 : Adjust code to compensate for Path class interface change. --- Diffs of the changes: (+10 -5) Path.inc | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) Index: llvm/lib/System/Win32/Path.inc diff -u llvm/lib/System/Win32/Path.inc:1.52 llvm/lib/System/Win32/Path.inc:1.53 --- llvm/lib/System/Win32/Path.inc:1.52 Tue Aug 22 17:46:39 2006 +++ llvm/lib/System/Win32/Path.inc Tue Aug 22 18:54:35 2006 @@ -326,11 +326,12 @@ return true; } -void Path::makeReadableOnDisk() { +bool Path::makeReadableOnDisk(std::string* ErrMsg) { // All files are readable on Windows (ignoring security attributes). + return false; } -void Path::makeWriteableOnDisk() { +void Path::makeWriteableOnDisk(std::string* ErrMsg) { DWORD attr = GetFileAttributes(path.c_str()); // If it doesn't exist, we're done. @@ -338,13 +339,17 @@ return; if (attr & FILE_ATTRIBUTE_READONLY) { - if (!SetFileAttributes(path.c_str(), attr & ~FILE_ATTRIBUTE_READONLY)) - ThrowError(std::string(path) + ": Can't make file writable: "); + if (!SetFileAttributes(path.c_str(), attr & ~FILE_ATTRIBUTE_READONLY)) { + MakeErrMsg(ErrMsg, std::string(path) + ": Can't make file writable: "); + return true; + } } + return false; } -void Path::makeExecutableOnDisk() { +bool Path::makeExecutableOnDisk(std::string* ErrMsg) { // All files are executable on Windows (ignoring security attributes). + return false; } bool From reid at x10sys.com Tue Aug 22 18:27:39 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 18:27:39 -0500 Subject: [llvm-commits] CVS: llvm/tools/gccld/gccld.cpp Message-ID: <200608222327.k7MNRdJ3026181@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: gccld.cpp updated: 1.109 -> 1.110 --- Log message: For PR797: http://llvm.org/PR797 : Change the Path::make*OnDisk methods exception free and adjust their usage. --- Diffs of the changes: (+14 -4) gccld.cpp | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.109 llvm/tools/gccld/gccld.cpp:1.110 --- llvm/tools/gccld/gccld.cpp:1.109 Mon Aug 21 01:04:45 2006 +++ llvm/tools/gccld/gccld.cpp Tue Aug 22 18:27:22 2006 @@ -385,13 +385,23 @@ EmitShellScript(argv); // Make the bytecode file readable and directly executable in LLEE - sys::Path(RealBytecodeOutput).makeExecutableOnDisk(); - sys::Path(RealBytecodeOutput).makeReadableOnDisk(); + std::string ErrMsg; + if (sys::Path(RealBytecodeOutput).makeExecutableOnDisk(&ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 1; + } + if (sys::Path(RealBytecodeOutput).makeReadableOnDisk(&ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 1; + } } // Make the output, whether native or script, executable as well... - sys::Path(OutputFilename).makeExecutableOnDisk(); - + std::string ErrMsg; + if (sys::Path(OutputFilename).makeExecutableOnDisk(&ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 1; + } } catch (const char*msg) { std::cerr << argv[0] << ": " << msg << "\n"; exitCode = 1; From reid at x10sys.com Tue Aug 22 18:27:40 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 22 Aug 2006 18:27:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.inc Message-ID: <200608222327.k7MNRexL026195@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.inc updated: 1.53 -> 1.54 --- Log message: For PR797: http://llvm.org/PR797 : Change the Path::make*OnDisk methods exception free and adjust their usage. --- Diffs of the changes: (+18 -9) Path.inc | 27 ++++++++++++++++++--------- 1 files changed, 18 insertions(+), 9 deletions(-) Index: llvm/lib/System/Unix/Path.inc diff -u llvm/lib/System/Unix/Path.inc:1.53 llvm/lib/System/Unix/Path.inc:1.54 --- llvm/lib/System/Unix/Path.inc:1.53 Tue Aug 22 14:01:30 2006 +++ llvm/lib/System/Unix/Path.inc Tue Aug 22 18:27:22 2006 @@ -390,19 +390,28 @@ return true; } -void Path::makeReadableOnDisk() { - if (!AddPermissionBits(*this, 0444)) - ThrowErrno(path + ": can't make file readable"); +bool Path::makeReadableOnDisk(std::string* ErrMsg) { + if (!AddPermissionBits(*this, 0444)) { + MakeErrMsg(ErrMsg, path + ": can't make file readable"); + return true; + } + return false; } -void Path::makeWriteableOnDisk() { - if (!AddPermissionBits(*this, 0222)) - ThrowErrno(path + ": can't make file writable"); +bool Path::makeWriteableOnDisk(std::string* ErrMsg) { + if (!AddPermissionBits(*this, 0222)) { + MakeErrMsg(ErrMsg, path + ": can't make file writable"); + return true; + } + return false; } -void Path::makeExecutableOnDisk() { - if (!AddPermissionBits(*this, 0111)) - ThrowErrno(path + ": can't make file executable"); +bool Path::makeExecutableOnDisk(std::string* ErrMsg) { + if (!AddPermissionBits(*this, 0111)) { + MakeErrMsg(ErrMsg, path + ": can't make file executable"); + return true; + } + return false; } bool From reid at x10sys.com Wed Aug 23 01:56:45 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 01:56:45 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.inc Message-ID: <200608230656.k7N6uj5o031572@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.inc updated: 1.55 -> 1.56 --- Log message: For PR797: http://llvm.org/PR797 : Remove exception throwing from Path::getDirectoryContents and its users. --- Diffs of the changes: (+8 -5) Path.inc | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) Index: llvm/lib/System/Unix/Path.inc diff -u llvm/lib/System/Unix/Path.inc:1.55 llvm/lib/System/Unix/Path.inc:1.56 --- llvm/lib/System/Unix/Path.inc:1.55 Tue Aug 22 19:39:35 2006 +++ llvm/lib/System/Unix/Path.inc Wed Aug 23 01:56:27 2006 @@ -415,10 +415,12 @@ } bool -Path::getDirectoryContents(std::set& result) const { +Path::getDirectoryContents(std::set& result, std::string* ErrMsg) const { DIR* direntries = ::opendir(path.c_str()); - if (direntries == 0) - ThrowErrno(path + ": can't open directory"); + if (direntries == 0) { + MakeErrMsg(ErrMsg, path + ": can't open directory"); + return true; + } std::string dirPath = path; if (!lastIsSlash(dirPath)) @@ -433,14 +435,15 @@ if (0 != lstat(aPath.path.c_str(), &st)) { if (S_ISLNK(st.st_mode)) continue; // dangling symlink -- ignore - ThrowErrno(aPath.path + ": can't determine file object type"); + MakeErrMsg(ErrMsg, aPath.path + ": can't determine file object type"); + return true; } result.insert(aPath); } } closedir(direntries); - return true; + return false; } bool From reid at x10sys.com Wed Aug 23 01:56:47 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 01:56:47 -0500 Subject: [llvm-commits] CVS: llvm/tools/gccld/GenerateCode.cpp Message-ID: <200608230656.k7N6ulQ8031577@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: GenerateCode.cpp updated: 1.60 -> 1.61 --- Log message: For PR797: http://llvm.org/PR797 : Remove exception throwing from Path::getDirectoryContents and its users. --- Diffs of the changes: (+2 -1) GenerateCode.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/tools/gccld/GenerateCode.cpp diff -u llvm/tools/gccld/GenerateCode.cpp:1.60 llvm/tools/gccld/GenerateCode.cpp:1.61 --- llvm/tools/gccld/GenerateCode.cpp:1.60 Mon Aug 21 01:04:45 2006 +++ llvm/tools/gccld/GenerateCode.cpp Wed Aug 23 01:56:27 2006 @@ -157,7 +157,8 @@ // Grab the contents of the -L path std::set Files; - LPath.getDirectoryContents(Files); + if (LPath.getDirectoryContents(Files, 0)) + return false; // Iterate over the contents one by one to determine // if this -L path has any bytecode shared libraries From reid at x10sys.com Wed Aug 23 01:56:48 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 01:56:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.inc Message-ID: <200608230656.k7N6umY0031587@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.inc updated: 1.53 -> 1.54 --- Log message: For PR797: http://llvm.org/PR797 : Remove exception throwing from Path::getDirectoryContents and its users. --- Diffs of the changes: (+10 -6) Path.inc | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) Index: llvm/lib/System/Win32/Path.inc diff -u llvm/lib/System/Win32/Path.inc:1.53 llvm/lib/System/Win32/Path.inc:1.54 --- llvm/lib/System/Win32/Path.inc:1.53 Tue Aug 22 18:54:35 2006 +++ llvm/lib/System/Win32/Path.inc Wed Aug 23 01:56:27 2006 @@ -353,9 +353,11 @@ } bool -Path::getDirectoryContents(std::set& result) const { - if (!isDirectory()) - return false; +Path::getDirectoryContents(std::set& result, std::string* ErrMsg) const { + if (!isDirectory()) { + MakeErrMsg(ErrMsg, path + ": not a directory"); + return true; + } result.clear(); WIN32_FIND_DATA fd; @@ -369,7 +371,8 @@ if (h == INVALID_HANDLE_VALUE) { if (GetLastError() == ERROR_FILE_NOT_FOUND) return true; // not really an error, now is it? - ThrowError(path + ": Can't read directory: "); + MakeErrMsg(ErrMsg, path + ": Can't read directory: "); + return true; } do { @@ -384,9 +387,10 @@ FindClose(h); if (err != ERROR_NO_MORE_FILES) { SetLastError(err); - ThrowError(path + ": Can't read directory: "); + MakeErrMsg(ErrMsg, path + ": Can't read directory: "); + return true; } - return true; + return false; } bool From reid at x10sys.com Wed Aug 23 01:56:48 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 01:56:48 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ar/llvm-ar.cpp Message-ID: <200608230656.k7N6umDx031582@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ar: llvm-ar.cpp updated: 1.35 -> 1.36 --- Log message: For PR797: http://llvm.org/PR797 : Remove exception throwing from Path::getDirectoryContents and its users. --- Diffs of the changes: (+86 -59) llvm-ar.cpp | 145 +++++++++++++++++++++++++++++++++++------------------------- 1 files changed, 86 insertions(+), 59 deletions(-) Index: llvm/tools/llvm-ar/llvm-ar.cpp diff -u llvm/tools/llvm-ar/llvm-ar.cpp:1.35 llvm/tools/llvm-ar/llvm-ar.cpp:1.36 --- llvm/tools/llvm-ar/llvm-ar.cpp:1.35 Tue Aug 22 19:39:35 2006 +++ llvm/tools/llvm-ar/llvm-ar.cpp Wed Aug 23 01:56:27 2006 @@ -269,32 +269,38 @@ // the Paths vector (built by buildPaths, below) and replaces any directories it // finds with all the files in that directory (recursively). It uses the // sys::Path::getDirectoryContent method to perform the actual directory scans. -std::set recurseDirectories(const sys::Path& path) { - std::set result; +bool +recurseDirectories(const sys::Path& path, + std::set& result, std::string* ErrMsg) { + result.clear(); if (RecurseDirectories) { std::set content; - path.getDirectoryContents(content); + if (path.getDirectoryContents(content, ErrMsg)) + return true; + for (std::set::iterator I = content.begin(), E = content.end(); I != E; ++I) { - // Make sure it exists and is a directory - sys::FileStatus Status; - if (!I->getFileStatus(Status)) { - if (Status.isDir) { - std::set moreResults = recurseDirectories(*I); - result.insert(moreResults.begin(), moreResults.end()); - } else { - result.insert(*I); - } - } + // Make sure it exists and is a directory + sys::FileStatus Status; + if (I->getFileStatus(Status)) { + if (Status.isDir) { + std::set moreResults; + if (recurseDirectories(*I, moreResults, ErrMsg)) + return true; + result.insert(moreResults.begin(), moreResults.end()); + } else { + result.insert(*I); + } + } } } - return result; + return false; } // buildPaths - Convert the strings in the Members vector to sys::Path objects // and make sure they are valid and exist exist. This check is only needed for // the operations that add/replace files to the archive ('q' and 'r') -void buildPaths(bool checkExistence = true) { +bool buildPaths(bool checkExistence, std::string* ErrMsg) { for (unsigned i = 0; i < Members.size(); i++) { sys::Path aPath; if (!aPath.set(Members[i])) @@ -307,7 +313,9 @@ if (aPath.getFileStatus(si, &Err)) throw Err; if (si.isDir) { - std::set dirpaths = recurseDirectories(aPath); + std::set dirpaths; + if (recurseDirectories(aPath, dirpaths, ErrMsg)) + return true; Paths.insert(dirpaths.begin(),dirpaths.end()); } else { Paths.insert(aPath); @@ -316,6 +324,7 @@ Paths.insert(aPath); } } + return false; } // printSymbolTable - print out the archive's symbol table. @@ -333,8 +342,9 @@ // looking for members that match the path list. It is careful to uncompress // things that should be and to skip bytecode files unless the 'k' modifier was // given. -void doPrint() { - buildPaths(false); +bool doPrint(std::string* ErrMsg) { + if (buildPaths(false, ErrMsg)) + return true; unsigned countDown = Count; for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end(); I != E; ++I ) { @@ -365,11 +375,13 @@ } } } + return false; } // putMode - utility function for printing out the file mode when the 't' // operation is in verbose mode. -void printMode(unsigned mode) { +void +printMode(unsigned mode) { if (mode & 004) std::cout << "r"; else @@ -388,8 +400,10 @@ // the file names of each of the members. However, if verbose mode is requested // ('v' modifier) then the file type, permission mode, user, group, size, and // modification time are also printed. -void doDisplayTable() { - buildPaths(false); +bool +doDisplayTable(std::string* ErrMsg) { + if (buildPaths(false, ErrMsg)) + return true; for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end(); I != E; ++I ) { if (Paths.empty() || @@ -422,12 +436,15 @@ } if (ReallyVerbose) printSymbolTable(); + return false; } // doExtract - Implement the 'x' operation. This function extracts files back to // the file system, making sure to uncompress any that were compressed -bool doExtract(std::string* ErrMsg) { - buildPaths(false); +bool +doExtract(std::string* ErrMsg) { + if (buildPaths(false, ErrMsg)) + return true; unsigned countDown = Count; for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end(); I != E; ++I ) { @@ -472,9 +489,12 @@ // members from the archive. Note that if the count is specified, there should // be no more than one path in the Paths list or else this algorithm breaks. // That check is enforced in parseCommandLine (above). -void doDelete() { - buildPaths(false); - if (Paths.empty()) return; +bool +doDelete(std::string* ErrMsg) { + if (buildPaths(false, ErrMsg)) + return true; + if (Paths.empty()) + return false; unsigned countDown = Count; for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end(); I != E; ) { @@ -491,20 +511,21 @@ } // We're done editting, reconstruct the archive. - std::string errmsg; - if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,&errmsg)) - throw errmsg; + if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) + return true; if (ReallyVerbose) printSymbolTable(); + return false; } // doMore - Implement the move operation. This function re-arranges just the // order of the archive members so that when the archive is written the move // of the members is accomplished. Note the use of the RelPos variable to // determine where the items should be moved to. -void doMove() { - - buildPaths(false); +bool +doMove(std::string* ErrMsg) { + if (buildPaths(false, ErrMsg)) + return true; // By default and convention the place to move members to is the end of the // archive. @@ -545,19 +566,22 @@ } // We're done editting, reconstruct the archive. - std::string errmsg; - if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,&errmsg)) - throw errmsg; + if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) + return true; if (ReallyVerbose) printSymbolTable(); + return false; } // doQuickAppend - Implements the 'q' operation. This function just // indiscriminantly adds the members to the archive and rebuilds it. -void doQuickAppend() { +bool +doQuickAppend(std::string* ErrMsg) { // Get the list of paths to append. - buildPaths(true); - if (Paths.empty()) return; + if (buildPaths(true, ErrMsg)) + return true; + if (Paths.empty()) + return false; // Append them quickly. for (std::set::iterator PI = Paths.begin(), PE = Paths.end(); @@ -566,20 +590,23 @@ } // We're done editting, reconstruct the archive. - std::string errmsg; - if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,&errmsg)) - throw errmsg; + if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) + return true; if (ReallyVerbose) printSymbolTable(); + return false; } // doReplaceOrInsert - Implements the 'r' operation. This function will replace // any existing files or insert new ones into the archive. -void doReplaceOrInsert() { +bool +doReplaceOrInsert(std::string* ErrMsg) { // Build the list of files to be added/replaced. - buildPaths(true); - if (Paths.empty()) return; + if (buildPaths(true, ErrMsg)) + return true; + if (Paths.empty()) + return false; // Keep track of the paths that remain to be inserted. std::set remaining(Paths); @@ -657,11 +684,11 @@ } // We're done editting, reconstruct the archive. - std::string errmsg; - if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,&errmsg)) - throw errmsg; + if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) + return true; if (ReallyVerbose) printSymbolTable(); + return false; } // main - main program for llvm-ar .. see comments in the code @@ -714,23 +741,23 @@ // Perform the operation std::string ErrMsg; + bool haveError = false; switch (Operation) { - case Print: doPrint(); break; - case Delete: doDelete(); break; - case Move: doMove(); break; - case QuickAppend: /* FALL THROUGH */ - case ReplaceOrInsert: doReplaceOrInsert(); break; - case DisplayTable: doDisplayTable(); break; - case Extract: - if (doExtract(&ErrMsg)) { - std::cerr << argv[0] << ": " << ErrMsg << "\n"; - return 1; - } - break; + case Print: haveError = doPrint(&ErrMsg); break; + case Delete: haveError = doDelete(&ErrMsg); break; + case Move: haveError = doMove(&ErrMsg); break; + case QuickAppend: haveError = doQuickAppend(&ErrMsg); break; + case ReplaceOrInsert: haveError = doReplaceOrInsert(&ErrMsg); break; + case DisplayTable: haveError = doDisplayTable(&ErrMsg); break; + case Extract: haveError = doExtract(&ErrMsg); break; case NoOperation: std::cerr << argv[0] << ": No operation was selected.\n"; break; } + if (haveError) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 1; + } } catch (const char*msg) { // These errors are usage errors, thrown only by the various checks in the // code above. From reid at x10sys.com Wed Aug 23 01:56:48 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 01:56:48 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200608230656.k7N6umlA031592@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.38 -> 1.39 --- Log message: For PR797: http://llvm.org/PR797 : Remove exception throwing from Path::getDirectoryContents and its users. --- Diffs of the changes: (+5 -3) Path.h | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.38 llvm/include/llvm/System/Path.h:1.39 --- llvm/include/llvm/System/Path.h:1.38 Tue Aug 22 19:39:34 2006 +++ llvm/include/llvm/System/Path.h Wed Aug 23 01:56:27 2006 @@ -343,10 +343,12 @@ /// This function builds a list of paths that are the names of the /// files and directories in a directory. - /// @returns false if \p this is not a directory, true otherwise - /// @throws std::string if the directory cannot be searched + /// @returns true if an error occurs, true otherwise /// @brief Build a list of directory's contents. - bool getDirectoryContents(std::set &paths) const; + bool getDirectoryContents( + std::set &paths, ///< The resulting list of file & directory names + std::string* ErrMsg ///< Optional place to return an error message. + ) const; /// This function returns status information about the file. The type of /// path (file or directory) is updated to reflect the actual contents From reid at x10sys.com Wed Aug 23 02:10:21 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 02:10:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/CommandLine.cpp Message-ID: <200608230710.k7N7ALGQ001922@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: CommandLine.cpp updated: 1.72 -> 1.73 --- Log message: Make the ProgramName variable a std::string so we can eliminate the path portion fo the program name via sys::Path().getLast(). This makes error messages more readable since this is invariably used only in error messages. Instead of: /path/to/llvm/bin/directory/toolname: error message we will now get: toolname: error message Also, since we always have a program name (even if its defaulted), don't check to see if it is set or not when generating error messages. This eliminates a bunch of constant strings, saving a little under 1K of data. --- Diffs of the changes: (+14 -26) CommandLine.cpp | 40 ++++++++++++++-------------------------- 1 files changed, 14 insertions(+), 26 deletions(-) Index: llvm/lib/Support/CommandLine.cpp diff -u llvm/lib/Support/CommandLine.cpp:1.72 llvm/lib/Support/CommandLine.cpp:1.73 --- llvm/lib/Support/CommandLine.cpp:1.72 Sun Aug 20 21:04:43 2006 +++ llvm/lib/Support/CommandLine.cpp Wed Aug 23 02:10:06 2006 @@ -18,6 +18,7 @@ #include "llvm/Config/config.h" #include "llvm/Support/CommandLine.h" +#include "llvm/System/Path.h" #include #include #include @@ -31,7 +32,7 @@ using namespace cl; // Globals for name and overview of program -static const char *ProgramName = ""; +static std::string ProgramName ( "" ); static const char *ProgramOverview = 0; // This collects additional help to be printed. @@ -289,7 +290,8 @@ assert((!getOpts().empty() || !getPositionalOpts().empty()) && "No options specified, or ParseCommandLineOptions called more" " than once!"); - ProgramName = argv[0]; // Save this away safe and snug + sys::Path progname(argv[0]); + ProgramName = sys::Path(argv[0]).getLast(); ProgramOverview = Overview; bool ErrorParsing = false; @@ -448,11 +450,8 @@ } if (Handler == 0) { - if (ProgramName) - std::cerr << ProgramName << ": Unknown command line argument '" + std::cerr << ProgramName << ": Unknown command line argument '" << argv[i] << "'. Try: '" << argv[0] << " --help'\n"; - else - std::cerr << "Unknown command line argument '" << argv[i] << "'.\n"; ErrorParsing = true; continue; } @@ -488,28 +487,18 @@ // Check and handle positional arguments now... if (NumPositionalRequired > PositionalVals.size()) { - if (ProgramName) - std::cerr << ProgramName - << ": Not enough positional command line arguments specified!\n" - << "Must specify at least " << NumPositionalRequired - << " positional arguments: See: " << argv[0] << " --help\n"; - else - std::cerr << "Not enough positional command line arguments specified!\n" - << "Must specify at least " << NumPositionalRequired - << " positional arguments."; + std::cerr << ProgramName + << ": Not enough positional command line arguments specified!\n" + << "Must specify at least " << NumPositionalRequired + << " positional arguments: See: " << argv[0] << " --help\n"; ErrorParsing = true; } else if (!HasUnlimitedPositionals && PositionalVals.size() > PositionalOpts.size()) { - if (ProgramName) - std::cerr << ProgramName - << ": Too many positional arguments specified!\n" - << "Can specify at most " << PositionalOpts.size() - << " positional arguments: See: " << argv[0] << " --help\n"; - else - std::cerr << "Too many positional arguments specified!\n" - << "Can specify at most " << PositionalOpts.size() - << " positional arguments.\n"; + std::cerr << ProgramName + << ": Too many positional arguments specified!\n" + << "Can specify at most " << PositionalOpts.size() + << " positional arguments: See: " << argv[0] << " --help\n"; ErrorParsing = true; } else if (ConsumeAfterOpt == 0) { @@ -616,8 +605,7 @@ if (ArgName[0] == 0) std::cerr << HelpStr; // Be nice for positional arguments else - std::cerr << (ProgramName ? ProgramName : "***") - << ": for the -" << ArgName; + std::cerr << ProgramName << ": for the -" << ArgName; std::cerr << " option: " << Message << "\n"; return true; From reid at x10sys.com Wed Aug 23 02:31:05 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 02:31:05 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200608230731.k7N7V5R2008006@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.36 -> 1.37 --- Log message: For PR797: http://llvm.org/PR797 : Eliminate exception throwing from Path::renamePathOnDisk and adjust its users correspondingly. --- Diffs of the changes: (+4 -1) llvm-ld.cpp | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.36 llvm/tools/llvm-ld/llvm-ld.cpp:1.37 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.36 Tue Aug 22 19:39:35 2006 +++ llvm/tools/llvm-ld/llvm-ld.cpp Wed Aug 23 02:30:48 2006 @@ -505,7 +505,10 @@ if (tmp_output.isBytecodeFile()) { sys::Path target(RealBytecodeOutput); target.eraseFromDisk(); - tmp_output.renamePathOnDisk(target); + if (tmp_output.renamePathOnDisk(target, &ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 2; + } } else return PrintAndReturn( "Post-link optimization output is not bytecode"); From reid at x10sys.com Wed Aug 23 02:31:05 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 02:31:05 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.inc Unix.h Message-ID: <200608230731.k7N7V5tE008013@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.inc updated: 1.56 -> 1.57 Unix.h updated: 1.16 -> 1.17 --- Log message: For PR797: http://llvm.org/PR797 : Eliminate exception throwing from Path::renamePathOnDisk and adjust its users correspondingly. --- Diffs of the changes: (+24 -36) Path.inc | 55 +++++++++++++++++++++---------------------------------- Unix.h | 5 +++-- 2 files changed, 24 insertions(+), 36 deletions(-) Index: llvm/lib/System/Unix/Path.inc diff -u llvm/lib/System/Unix/Path.inc:1.56 llvm/lib/System/Unix/Path.inc:1.57 --- llvm/lib/System/Unix/Path.inc:1.56 Wed Aug 23 01:56:27 2006 +++ llvm/lib/System/Unix/Path.inc Wed Aug 23 02:30:48 2006 @@ -391,36 +391,28 @@ } bool Path::makeReadableOnDisk(std::string* ErrMsg) { - if (!AddPermissionBits(*this, 0444)) { - MakeErrMsg(ErrMsg, path + ": can't make file readable"); - return true; - } + if (!AddPermissionBits(*this, 0444)) + return MakeErrMsg(ErrMsg, path + ": can't make file readable"); return false; } bool Path::makeWriteableOnDisk(std::string* ErrMsg) { - if (!AddPermissionBits(*this, 0222)) { - MakeErrMsg(ErrMsg, path + ": can't make file writable"); - return true; - } + if (!AddPermissionBits(*this, 0222)) + return MakeErrMsg(ErrMsg, path + ": can't make file writable"); return false; } bool Path::makeExecutableOnDisk(std::string* ErrMsg) { - if (!AddPermissionBits(*this, 0111)) { - MakeErrMsg(ErrMsg, path + ": can't make file executable"); - return true; - } + if (!AddPermissionBits(*this, 0111)) + return MakeErrMsg(ErrMsg, path + ": can't make file executable"); return false; } bool Path::getDirectoryContents(std::set& result, std::string* ErrMsg) const { DIR* direntries = ::opendir(path.c_str()); - if (direntries == 0) { - MakeErrMsg(ErrMsg, path + ": can't open directory"); - return true; - } + if (direntries == 0) + return MakeErrMsg(ErrMsg, path + ": can't open directory"); std::string dirPath = path; if (!lastIsSlash(dirPath)) @@ -435,8 +427,8 @@ if (0 != lstat(aPath.path.c_str(), &st)) { if (S_ISLNK(st.st_mode)) continue; // dangling symlink -- ignore - MakeErrMsg(ErrMsg, aPath.path + ": can't determine file object type"); - return true; + return MakeErrMsg(ErrMsg, + aPath.path + ": can't determine file object type"); } result.insert(aPath); } @@ -544,9 +536,8 @@ *next = 0; if (0 != access(pathname, F_OK | R_OK | W_OK)) if (0 != mkdir(pathname, S_IRWXU | S_IRWXG)) { - MakeErrMsg(ErrMsg, - std::string(pathname) + ": can't create directory"); - return true; + return MakeErrMsg(ErrMsg, + std::string(pathname) + ": can't create directory"); } char* save = next; next = strchr(next+1,'/'); @@ -556,8 +547,8 @@ if (0 != access(pathname, F_OK | R_OK)) if (0 != mkdir(pathname, S_IRWXU | S_IRWXG)) { - MakeErrMsg(ErrMsg, std::string(pathname) + ": can't create directory"); - return true; + return MakeErrMsg(ErrMsg, + std::string(pathname) + ": can't create directory"); } return false; } @@ -566,10 +557,8 @@ Path::createFileOnDisk(std::string* ErrMsg) { // Create the file int fd = ::creat(path.c_str(), S_IRUSR | S_IWUSR); - if (fd < 0) { - MakeErrMsg(ErrMsg, path + ": can't create file"); - return true; - } + if (fd < 0) + return MakeErrMsg(ErrMsg, path + ": can't create file"); ::close(fd); return false; } @@ -581,10 +570,8 @@ // create the file int fd = ::open(path.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0666); - if (fd < 0) { - MakeErrMsg(ErrMsg, path + ": can't create temporary file"); - return true; - } + if (fd < 0) + return MakeErrMsg(ErrMsg, path + ": can't create temporary file"); ::close(fd); return false; } @@ -633,11 +620,11 @@ } bool -Path::renamePathOnDisk(const Path& newName) { +Path::renamePathOnDisk(const Path& newName, std::string* ErrMsg) { if (0 != ::rename(path.c_str(), newName.c_str())) - ThrowErrno(std::string("can't rename '") + path + "' as '" + + return MakeErrMsg(ErrMsg, std::string("can't rename '") + path + "' as '" + newName.toString() + "' "); - return true; + return false; } bool Index: llvm/lib/System/Unix/Unix.h diff -u llvm/lib/System/Unix/Unix.h:1.16 llvm/lib/System/Unix/Unix.h:1.17 --- llvm/lib/System/Unix/Unix.h:1.16 Mon Aug 21 01:02:44 2006 +++ llvm/lib/System/Unix/Unix.h Wed Aug 23 02:30:48 2006 @@ -123,10 +123,10 @@ /// string and the Unix error number given by \p errnum. If errnum is -1, the /// default then the value of errno is used. /// @brief Make an error message -inline void MakeErrMsg( +inline bool MakeErrMsg( std::string* ErrMsg, const std::string& prefix, int errnum = -1) { if (!ErrMsg) - return; + return true; char buffer[MAXPATHLEN]; buffer[0] = 0; if (errnum == -1) @@ -148,6 +148,7 @@ sprintf(buffer, "Error #%d", errnum); #endif *ErrMsg = buffer; + return true; } #endif From reid at x10sys.com Wed Aug 23 02:31:08 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 02:31:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.inc Win32.h Message-ID: <200608230731.k7N7V8aP008020@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.inc updated: 1.54 -> 1.55 Win32.h updated: 1.7 -> 1.8 --- Log message: For PR797: http://llvm.org/PR797 : Eliminate exception throwing from Path::renamePathOnDisk and adjust its users correspondingly. --- Diffs of the changes: (+6 -5) Path.inc | 6 +++--- Win32.h | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) Index: llvm/lib/System/Win32/Path.inc diff -u llvm/lib/System/Win32/Path.inc:1.54 llvm/lib/System/Win32/Path.inc:1.55 --- llvm/lib/System/Win32/Path.inc:1.54 Wed Aug 23 01:56:27 2006 +++ llvm/lib/System/Win32/Path.inc Wed Aug 23 02:30:48 2006 @@ -651,10 +651,10 @@ } bool -Path::renamePathOnDisk(const Path& newName) { +Path::renamePathOnDisk(const Path& newName, std::string* ErrMsg) { if (!MoveFileEx(path.c_str(), newName.c_str(), MOVEFILE_REPLACE_EXISTING)) - ThrowError("Can't move '" + path + - "' to '" + newName.path + "': "); + return MakeErrMsg(ErrMsg, "Can't move '" + path + "' to '" + newName.path + + "': "); return true; } Index: llvm/lib/System/Win32/Win32.h diff -u llvm/lib/System/Win32/Win32.h:1.7 llvm/lib/System/Win32/Win32.h:1.8 --- llvm/lib/System/Win32/Win32.h:1.7 Mon Aug 21 01:02:44 2006 +++ llvm/lib/System/Win32/Win32.h Wed Aug 23 02:30:48 2006 @@ -44,14 +44,15 @@ throw s; } -inline void MakeErrMsg(std::string* ErrMsg, const std::string& prefix) { +inline bool MakeErrMsg(std::string* ErrMsg, const std::string& prefix) { if (!ErrMsg) - return; + return true; char *buffer = NULL; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, (LPSTR)&buffer, 1, NULL); ErrMsg = prefix + buffer; LocalFree(buffer); + return true; } inline void ThrowErrno(const std::string& prefix) { From reid at x10sys.com Wed Aug 23 02:31:09 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 02:31:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Message-ID: <200608230731.k7N7V926008028@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Archive: ArchiveWriter.cpp updated: 1.28 -> 1.29 --- Log message: For PR797: http://llvm.org/PR797 : Eliminate exception throwing from Path::renamePathOnDisk and adjust its users correspondingly. --- Diffs of the changes: (+4 -2) ArchiveWriter.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.28 llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.29 --- llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.28 Tue Aug 22 19:39:34 2006 +++ llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Wed Aug 23 02:30:48 2006 @@ -496,7 +496,8 @@ arch.close(); // Move the final file over top of TmpArchive - FinalFilePath.renamePathOnDisk(TmpArchive); + if (FinalFilePath.renamePathOnDisk(TmpArchive, error)) + return false; } // Before we replace the actual archive, we need to forget all the @@ -504,7 +505,8 @@ // this because we cannot replace an open file on Windows. cleanUpMemory(); - TmpArchive.renamePathOnDisk(archPath); + if (TmpArchive.renamePathOnDisk(archPath, error)) + return false; return true; } From reid at x10sys.com Wed Aug 23 02:31:09 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 02:31:09 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200608230731.k7N7V9av008025@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.39 -> 1.40 --- Log message: For PR797: http://llvm.org/PR797 : Eliminate exception throwing from Path::renamePathOnDisk and adjust its users correspondingly. --- Diffs of the changes: (+2 -3) Path.h | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.39 llvm/include/llvm/System/Path.h:1.40 --- llvm/include/llvm/System/Path.h:1.39 Wed Aug 23 01:56:27 2006 +++ llvm/include/llvm/System/Path.h Wed Aug 23 02:30:48 2006 @@ -492,10 +492,9 @@ /// This method renames the file referenced by \p this as \p newName. The /// file referenced by \p this must exist. The file referenced by /// \p newName does not need to exist. - /// @returns true - /// @throws std::string if there is an file system error. + /// @returns true on error, false otherwise /// @brief Rename one file as another. - bool renamePathOnDisk(const Path& newName); + bool renamePathOnDisk(const Path& newName, std::string* ErrMsg); /// This method attempts to destroy the file or directory named by the /// last component of the Path. If the Path refers to a directory and the From dpatel at apple.com Wed Aug 23 11:59:45 2006 From: dpatel at apple.com (Devang Patel) Date: Wed, 23 Aug 2006 11:59:45 -0500 Subject: [llvm-commits] CVS: llvm/tools/lto/lto.cpp Message-ID: <200608231659.k7NGxjUZ027713@zion.cs.uiuc.edu> Changes in directory llvm/tools/lto: lto.cpp updated: 1.7 -> 1.8 --- Log message: If unable to create tmp. file on disk then return LTO_WRITE_FAILURE status. --- Diffs of the changes: (+1 -1) lto.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/lto/lto.cpp diff -u llvm/tools/lto/lto.cpp:1.7 llvm/tools/lto/lto.cpp:1.8 --- llvm/tools/lto/lto.cpp:1.7 Tue Aug 22 19:39:35 2006 +++ llvm/tools/lto/lto.cpp Wed Aug 23 11:59:25 2006 @@ -298,7 +298,7 @@ std::string ErrMsg; if (tmpAsmFilePath.createTemporaryFileOnDisk(&ErrMsg)) { std::cerr << "lto: " << ErrMsg << "\n"; - return; + return LTO_WRITE_FAILURE; } sys::RemoveFileOnSignal(tmpAsmFilePath); From reid at x10sys.com Wed Aug 23 12:43:34 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 12:43:34 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200608231743.k7NHhYvL028534@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.40 -> 1.41 --- Log message: --- Diffs of the changes: (+4 -7) Path.h | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.40 llvm/include/llvm/System/Path.h:1.41 --- llvm/include/llvm/System/Path.h:1.40 Wed Aug 23 02:30:48 2006 +++ llvm/include/llvm/System/Path.h Wed Aug 23 12:43:20 2006 @@ -164,13 +164,10 @@ /// @brief Construct an empty (and invalid) path. Path() : path() {} - /// This constructor will accept a std::string as a path but it verifies - /// that the path string has a legal syntax for the operating system on - /// which it is running. This allows a path to be taken in from outside - /// the program. However, if the path is not valid, the Path object will - /// be set to an empty string and an exception will be thrown. - /// @throws std::string if \p unverified_path is not legal. - /// @param unverified_path The path to verify and assign. + /// This constructor will accept a std::string as a path. No checking is + /// done on this path to determine if it is valid. To determine validity + /// of the path, use the isValid method. + /// @param p The path to assign. /// @brief Construct a Path from a string. explicit Path(const std::string& p) : path(p) {} From reid at x10sys.com Wed Aug 23 15:35:14 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 15:35:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Memory.inc Path.inc Unix.h Message-ID: <200608232035.k7NKZE14032056@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Memory.inc updated: 1.5 -> 1.6 Path.inc updated: 1.57 -> 1.58 Unix.h updated: 1.17 -> 1.18 --- Log message: For PR797: http://llvm.org/PR797 : Final removal of exceptions from lib/System and adjustment of users to accommodate. --- Diffs of the changes: (+63 -109) Memory.inc | 6 +-- Path.inc | 113 ++++++++++++++++++++++++++++++++----------------------------- Unix.h | 53 ---------------------------- 3 files changed, 63 insertions(+), 109 deletions(-) Index: llvm/lib/System/Unix/Memory.inc diff -u llvm/lib/System/Unix/Memory.inc:1.5 llvm/lib/System/Unix/Memory.inc:1.6 --- llvm/lib/System/Unix/Memory.inc:1.5 Fri Jul 7 12:32:37 2006 +++ llvm/lib/System/Unix/Memory.inc Wed Aug 23 15:34:57 2006 @@ -35,7 +35,7 @@ #ifdef NEED_DEV_ZERO_FOR_MMAP static int zero_fd = open("/dev/zero", O_RDWR); if (zero_fd == -1) { - GetErrno("Can't open /dev/zero device", ErrMsg); + MakeErrMsg(ErrMsg, "Can't open /dev/zero device"); return MemoryBlock(); } fd = zero_fd; @@ -58,7 +58,7 @@ if (NearBlock) //Try again without a near hint return AllocateRWX(NumBytes, 0); - GetErrno("Can't allocate RWX Memory", ErrMsg); + MakeErrMsg(ErrMsg, "Can't allocate RWX Memory"); return MemoryBlock(); } MemoryBlock result; @@ -70,7 +70,7 @@ bool llvm::sys::Memory::ReleaseRWX(MemoryBlock &M, std::string *ErrMsg) { if (M.Address == 0 || M.Size == 0) return false; if (0 != ::munmap(M.Address, M.Size)) - return GetErrno("Can't release RWX Memory", ErrMsg); + return MakeErrMsg(ErrMsg, "Can't release RWX Memory"); return false; } Index: llvm/lib/System/Unix/Path.inc diff -u llvm/lib/System/Unix/Path.inc:1.57 llvm/lib/System/Unix/Path.inc:1.58 --- llvm/lib/System/Unix/Path.inc:1.57 Wed Aug 23 02:30:48 2006 +++ llvm/lib/System/Unix/Path.inc Wed Aug 23 15:34:57 2006 @@ -169,6 +169,7 @@ MakeErrMsg(ErrMsg, std::string(pathname) + ": can't create temporary directory"); return Path(); + } Path result; result.set(pathname); assert(result.isValid() && "mkstemp didn't create a valid pathname!"); @@ -359,7 +360,8 @@ Path::getFileStatus(FileStatus &info, std::string *ErrStr) const { struct stat buf; if (0 != stat(path.c_str(), &buf)) - return GetErrno(path + ": can't get status of file '" + path + "'", ErrStr); + return MakeErrMsg(ErrStr, + path + ": can't get status of file '" + path + "'"); info.fileSize = buf.st_size; info.modTime.fromEpochTime(buf.st_mtime); info.mode = buf.st_mode; @@ -566,7 +568,8 @@ bool Path::createTemporaryFileOnDisk(bool reuse_current, std::string* ErrMsg) { // Make this into a unique file name - makeUnique( reuse_current ); + if (makeUnique( reuse_current, ErrMsg )) + return true; // create the file int fd = ::open(path.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0666); @@ -589,7 +592,7 @@ // or other things that aren't "regular" files. if (Status.isFile) { if (unlink(path.c_str()) != 0) - return GetErrno(path + ": can't destroy file", ErrStr); + return MakeErrMsg(ErrStr, path + ": can't destroy file"); return false; } @@ -614,8 +617,8 @@ pathname[lastchar+1] = 0; if (rmdir(pathname) != 0) - return GetErrno(std::string(pathname) + ": can't destroy directory", - ErrStr); + return MakeErrMsg(ErrStr, + std::string(pathname) + ": can't destroy directory"); return false; } @@ -633,59 +636,63 @@ utb.actime = si.modTime.toPosixTime(); utb.modtime = utb.actime; if (0 != ::utime(path.c_str(),&utb)) - return GetErrno(path + ": can't set file modification time", ErrStr); + return MakeErrMsg(ErrStr, path + ": can't set file modification time"); if (0 != ::chmod(path.c_str(),si.mode)) - return GetErrno(path + ": can't set mode", ErrStr); + return MakeErrMsg(ErrStr, path + ": can't set mode"); return false; } -void -sys::CopyFile(const sys::Path &Dest, const sys::Path &Src) { +bool +sys::CopyFile(const sys::Path &Dest, const sys::Path &Src, std::string* ErrMsg){ int inFile = -1; int outFile = -1; - try { - inFile = ::open(Src.c_str(), O_RDONLY); - if (inFile == -1) - ThrowErrno(Src.toString() + ": can't open source file to copy: "); - - outFile = ::open(Dest.c_str(), O_WRONLY|O_CREAT, 0666); - if (outFile == -1) - ThrowErrno(Dest.toString() +": can't create destination file for copy: "); - - char Buffer[16*1024]; - while (ssize_t Amt = ::read(inFile, Buffer, 16*1024)) { - if (Amt == -1) { - if (errno != EINTR && errno != EAGAIN) - ThrowErrno(Src.toString()+": can't read source file: "); - } else { - char *BufPtr = Buffer; - while (Amt) { - ssize_t AmtWritten = ::write(outFile, BufPtr, Amt); - if (AmtWritten == -1) { - if (errno != EINTR && errno != EAGAIN) - ThrowErrno(Dest.toString() + ": can't write destination file: "); - } else { - Amt -= AmtWritten; - BufPtr += AmtWritten; + inFile = ::open(Src.c_str(), O_RDONLY); + if (inFile == -1) + return MakeErrMsg(ErrMsg, Src.toString() + + ": can't open source file to copy"); + + outFile = ::open(Dest.c_str(), O_WRONLY|O_CREAT, 0666); + if (outFile == -1) { + ::close(inFile); + return MakeErrMsg(ErrMsg, Dest.toString() + + ": can't create destination file for copy"); + } + + char Buffer[16*1024]; + while (ssize_t Amt = ::read(inFile, Buffer, 16*1024)) { + if (Amt == -1) { + if (errno != EINTR && errno != EAGAIN) { + ::close(inFile); + ::close(outFile); + return MakeErrMsg(ErrMsg, Src.toString()+": can't read source file: "); + } + } else { + char *BufPtr = Buffer; + while (Amt) { + ssize_t AmtWritten = ::write(outFile, BufPtr, Amt); + if (AmtWritten == -1) { + if (errno != EINTR && errno != EAGAIN) { + ::close(inFile); + ::close(outFile); + return MakeErrMsg(ErrMsg, Dest.toString() + + ": can't write destination file: "); } + } else { + Amt -= AmtWritten; + BufPtr += AmtWritten; } } } - ::close(inFile); - ::close(outFile); - } catch (...) { - if (inFile != -1) - ::close(inFile); - if (outFile != -1) - ::close(outFile); - throw; } + ::close(inFile); + ::close(outFile); + return false; } -void -Path::makeUnique(bool reuse_current) { +bool +Path::makeUnique(bool reuse_current, std::string* ErrMsg) { if (reuse_current && !exists()) - return; // File doesn't exist already, just use it! + return false; // File doesn't exist already, just use it! // Append an XXXXXX pattern to the end of the file for use with mkstemp, // mktemp or our own implementation. @@ -695,9 +702,8 @@ #if defined(HAVE_MKSTEMP) int TempFD; - if ((TempFD = mkstemp(FNBuffer)) == -1) { - ThrowErrno(path + ": can't make unique filename"); - } + if ((TempFD = mkstemp(FNBuffer)) == -1) + return MakeErrMsg(ErrMsg, path + ": can't make unique filename"); // We don't need to hold the temp file descriptor... we will trust that no one // will overwrite/delete the file before we can open it again. @@ -707,9 +713,8 @@ path = FNBuffer; #elif defined(HAVE_MKTEMP) // If we don't have mkstemp, use the old and obsolete mktemp function. - if (mktemp(FNBuffer) == 0) { - ThrowErrno(path + ": can't make unique filename"); - } + if (mktemp(FNBuffer) == 0) + return MakeErrMsg(ErrMsg, path + ": can't make unique filename"); // Save the name path = FNBuffer; @@ -722,9 +727,11 @@ path = FNBuffer; } if (FCounter > 999999) - throw std::string(path + ": can't make unique filename: too many files"); + return MakeErrMsg(ErrMsg, + path + ": can't make unique filename: too many files"); #endif - -} + return false; } +} // end llvm namespace + Index: llvm/lib/System/Unix/Unix.h diff -u llvm/lib/System/Unix/Unix.h:1.17 llvm/lib/System/Unix/Unix.h:1.18 --- llvm/lib/System/Unix/Unix.h:1.17 Wed Aug 23 02:30:48 2006 +++ llvm/lib/System/Unix/Unix.h Wed Aug 23 15:34:57 2006 @@ -66,59 +66,6 @@ # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif -inline bool GetErrno(const std::string &prefix, std::string *ErrDest, - int errnum = -1) { - char buffer[MAXPATHLEN]; - - if (ErrDest == 0) return true; - - buffer[0] = 0; - if (errnum == -1) - errnum = errno; -#ifdef HAVE_STRERROR_R - // strerror_r is thread-safe. - if (errnum) - strerror_r(errnum, buffer, MAXPATHLEN-1); -#elif HAVE_STRERROR - // Copy the thread un-safe result of strerror into - // the buffer as fast as possible to minimize impact - // of collision of strerror in multiple threads. - if (errnum) - strncpy(buffer, strerror(errnum), MAXPATHLEN-1); - buffer[MAXPATHLEN-1] = 0; -#else - // Strange that this system doesn't even have strerror - // but, oh well, just use a generic message - sprintf(buffer, "Error #%d", errnum); -#endif - *ErrDest = prefix + ": " + buffer; - return true; -} - -inline void ThrowErrno(const std::string& prefix, int errnum = -1) { - char buffer[MAXPATHLEN]; - buffer[0] = 0; - if (errnum == -1) - errnum = errno; -#ifdef HAVE_STRERROR_R - // strerror_r is thread-safe. - if (errnum) - strerror_r(errnum,buffer,MAXPATHLEN-1); -#elif HAVE_STRERROR - // Copy the thread un-safe result of strerror into - // the buffer as fast as possible to minimize impact - // of collision of strerror in multiple threads. - if (errnum) - strncpy(buffer,strerror(errnum),MAXPATHLEN-1); - buffer[MAXPATHLEN-1] = 0; -#else - // Strange that this system doesn't even have strerror - // but, oh well, just use a generic message - sprintf(buffer, "Error #%d", errnum); -#endif - throw prefix + ": " + buffer; -} - /// This function builds an error message into \p ErrMsg using the \p prefix /// string and the Unix error number given by \p errnum. If errnum is -1, the /// default then the value of errno is used. From reid at x10sys.com Wed Aug 23 15:35:14 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 15:35:14 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/GraphWriter.h Message-ID: <200608232035.k7NKZEiU032047@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: GraphWriter.h updated: 1.28 -> 1.29 --- Log message: For PR797: http://llvm.org/PR797 : Final removal of exceptions from lib/System and adjustment of users to accommodate. --- Diffs of the changes: (+5 -1) GraphWriter.h | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Support/GraphWriter.h diff -u llvm/include/llvm/Support/GraphWriter.h:1.28 llvm/include/llvm/Support/GraphWriter.h:1.29 --- llvm/include/llvm/Support/GraphWriter.h:1.28 Tue Aug 22 14:01:30 2006 +++ llvm/include/llvm/Support/GraphWriter.h Wed Aug 23 15:34:57 2006 @@ -251,7 +251,11 @@ return Filename; } Filename.appendComponent(Name + ".dot"); - Filename.makeUnique(); + if (Filename.makeUnique(true,&ErrMsg)) { + std::cerr << "Error: " << ErrMsg << "\n"; + return sys::Path(); + } + std::cerr << "Writing '" << Filename << "'... "; std::ofstream O(Filename.c_str()); From reid at x10sys.com Wed Aug 23 15:35:17 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 15:35:17 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/ExecutionDriver.cpp Miscompilation.cpp OptimizerDriver.cpp ToolRunner.cpp Message-ID: <200608232035.k7NKZHfc032070@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: ExecutionDriver.cpp updated: 1.63 -> 1.64 Miscompilation.cpp updated: 1.75 -> 1.76 OptimizerDriver.cpp updated: 1.42 -> 1.43 ToolRunner.cpp updated: 1.56 -> 1.57 --- Log message: For PR797: http://llvm.org/PR797 : Final removal of exceptions from lib/System and adjustment of users to accommodate. --- Diffs of the changes: (+75 -15) ExecutionDriver.cpp | 20 +++++++++++++++++--- Miscompilation.cpp | 26 ++++++++++++++++++++++---- OptimizerDriver.cpp | 14 +++++++++++--- ToolRunner.cpp | 30 +++++++++++++++++++++++++----- 4 files changed, 75 insertions(+), 15 deletions(-) Index: llvm/tools/bugpoint/ExecutionDriver.cpp diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.63 llvm/tools/bugpoint/ExecutionDriver.cpp:1.64 --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.63 Tue Aug 15 11:40:49 2006 +++ llvm/tools/bugpoint/ExecutionDriver.cpp Wed Aug 23 15:34:57 2006 @@ -161,7 +161,12 @@ void BugDriver::compileProgram(Module *M) { // Emit the program to a bytecode file... sys::Path BytecodeFile ("bugpoint-test-program.bc"); - BytecodeFile.makeUnique(); + std::string ErrMsg; + if (BytecodeFile.makeUnique(true,&ErrMsg)) { + std::cerr << ToolName << ": Error making unique filename: " << ErrMsg + << "\n"; + exit(1); + } if (writeProgramToFile(BytecodeFile.toString(), M)) { std::cerr << ToolName << ": Error emitting bytecode to file '" << BytecodeFile << "'!\n"; @@ -188,10 +193,15 @@ if (AI == 0) AI = Interpreter; assert(AI && "Interpreter should have been created already!"); bool CreatedBytecode = false; + std::string ErrMsg; if (BytecodeFile.empty()) { // Emit the program to a bytecode file... sys::Path uniqueFilename("bugpoint-test-program.bc"); - uniqueFilename.makeUnique(); + if (uniqueFilename.makeUnique(true, &ErrMsg)) { + std::cerr << ToolName << ": Error making unique filename: " + << ErrMsg << "!\n"; + exit(1); + } BytecodeFile = uniqueFilename.toString(); if (writeProgramToFile(BytecodeFile, Program)) { @@ -210,7 +220,11 @@ // Check to see if this is a valid output filename... sys::Path uniqueFile(OutputFile); - uniqueFile.makeUnique(); + if (uniqueFile.makeUnique(true, &ErrMsg)) { + std::cerr << ToolName << ": Error making unique filename: " + << ErrMsg << "\n"; + exit(1); + } OutputFile = uniqueFile.toString(); // Figure out which shared objects to run, if any. Index: llvm/tools/bugpoint/Miscompilation.cpp diff -u llvm/tools/bugpoint/Miscompilation.cpp:1.75 llvm/tools/bugpoint/Miscompilation.cpp:1.76 --- llvm/tools/bugpoint/Miscompilation.cpp:1.75 Thu May 4 18:35:31 2006 +++ llvm/tools/bugpoint/Miscompilation.cpp Wed Aug 23 15:34:57 2006 @@ -776,7 +776,12 @@ CleanupAndPrepareModules(BD, Test, Safe); sys::Path TestModuleBC("bugpoint.test.bc"); - TestModuleBC.makeUnique(); + std::string ErrMsg; + if (TestModuleBC.makeUnique(true, &ErrMsg)) { + std::cerr << BD.getToolName() << "Error making unique filename: " + << ErrMsg << "\n"; + exit(1); + } if (BD.writeProgramToFile(TestModuleBC.toString(), Test)) { std::cerr << "Error writing bytecode to `" << TestModuleBC << "'\nExiting."; exit(1); @@ -785,7 +790,11 @@ // Make the shared library sys::Path SafeModuleBC("bugpoint.safe.bc"); - SafeModuleBC.makeUnique(); + if (SafeModuleBC.makeUnique(true, &ErrMsg)) { + std::cerr << BD.getToolName() << "Error making unique filename: " + << ErrMsg << "\n"; + exit(1); + } if (BD.writeProgramToFile(SafeModuleBC.toString(), Safe)) { std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting."; @@ -836,7 +845,12 @@ CleanupAndPrepareModules(*this, ToCodeGen, ToNotCodeGen); sys::Path TestModuleBC("bugpoint.test.bc"); - TestModuleBC.makeUnique(); + std::string ErrMsg; + if (TestModuleBC.makeUnique(true, &ErrMsg)) { + std::cerr << getToolName() << "Error making unique filename: " + << ErrMsg << "\n"; + exit(1); + } if (writeProgramToFile(TestModuleBC.toString(), ToCodeGen)) { std::cerr << "Error writing bytecode to `" << TestModuleBC << "'\nExiting."; @@ -846,7 +860,11 @@ // Make the shared library sys::Path SafeModuleBC("bugpoint.safe.bc"); - SafeModuleBC.makeUnique(); + if (SafeModuleBC.makeUnique(true, &ErrMsg)) { + std::cerr << getToolName() << "Error making unique filename: " + << ErrMsg << "\n"; + exit(1); + } if (writeProgramToFile(SafeModuleBC.toString(), ToNotCodeGen)) { std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting."; Index: llvm/tools/bugpoint/OptimizerDriver.cpp diff -u llvm/tools/bugpoint/OptimizerDriver.cpp:1.42 llvm/tools/bugpoint/OptimizerDriver.cpp:1.43 --- llvm/tools/bugpoint/OptimizerDriver.cpp:1.42 Mon Aug 21 01:04:45 2006 +++ llvm/tools/bugpoint/OptimizerDriver.cpp Wed Aug 23 15:34:57 2006 @@ -139,12 +139,21 @@ // setup the output file name std::cout << std::flush; sys::Path uniqueFilename("bugpoint-output.bc"); - uniqueFilename.makeUnique(); + std::string ErrMsg; + if (uniqueFilename.makeUnique(true, &ErrMsg)) { + std::cerr << getToolName() << ": Error making unique filename: " + << ErrMsg << "\n"; + return(1); + } OutputFilename = uniqueFilename.toString(); // set up the input file name sys::Path inputFilename("bugpoint-input.bc"); - inputFilename.makeUnique(); + if (inputFilename.makeUnique(true, &ErrMsg)) { + std::cerr << getToolName() << ": Error making unique filename: " + << ErrMsg << "\n"; + return(1); + } std::ios::openmode io_mode = std::ios::out | std::ios::trunc | std::ios::binary; std::ofstream InFile(inputFilename.c_str(), io_mode); @@ -179,7 +188,6 @@ args[n++] = 0; sys::Path prog(sys::Program::FindProgramByName(ToolName)); - std::string ErrMsg; int result = sys::Program::ExecuteAndWait(prog,args,0,0,Timeout,&ErrMsg); // If we are supposed to delete the bytecode file or if the passes crashed, Index: llvm/tools/bugpoint/ToolRunner.cpp diff -u llvm/tools/bugpoint/ToolRunner.cpp:1.56 llvm/tools/bugpoint/ToolRunner.cpp:1.57 --- llvm/tools/bugpoint/ToolRunner.cpp:1.56 Mon Aug 21 01:04:45 2006 +++ llvm/tools/bugpoint/ToolRunner.cpp Wed Aug 23 15:34:57 2006 @@ -53,7 +53,11 @@ // Rerun the compiler, capturing any error messages to print them. sys::Path ErrorFilename("error_messages"); - ErrorFilename.makeUnique(); + std::string ErrMsg; + if (ErrorFilename.makeUnique(true, &ErrMsg)) { + std::cerr << "Error making unique filename: " << ErrMsg << "\n"; + exit(1); + } RunProgramWithTimeout(ProgPath, Args, sys::Path(""), ErrorFilename, ErrorFilename); // FIXME: check return code ? @@ -153,7 +157,11 @@ // void LLC::OutputAsm(const std::string &Bytecode, sys::Path &OutputAsmFile) { sys::Path uniqueFile(Bytecode+".llc.s"); - uniqueFile.makeUnique(); + std::string ErrMsg; + if (uniqueFile.makeUnique(true, &ErrMsg)) { + std::cerr << "Error making unique filename: " << ErrMsg << "\n"; + exit(1); + } OutputAsmFile = uniqueFile; std::vector LLCArgs; LLCArgs.push_back (LLCPath.c_str()); @@ -307,7 +315,11 @@ void CBE::OutputC(const std::string &Bytecode, sys::Path& OutputCFile) { sys::Path uniqueFile(Bytecode+".cbe.c"); - uniqueFile.makeUnique(); + std::string ErrMsg; + if (uniqueFile.makeUnique(true, &ErrMsg)) { + std::cerr << "Error making unique filename: " << ErrMsg << "\n"; + exit(1); + } OutputCFile = uniqueFile; std::vector LLCArgs; LLCArgs.push_back (LLCPath.c_str()); @@ -409,7 +421,11 @@ GCCArgs.push_back("none"); GCCArgs.push_back("-o"); sys::Path OutputBinary (ProgramFile+".gcc.exe"); - OutputBinary.makeUnique(); + std::string ErrMsg; + if (OutputBinary.makeUnique(true, &ErrMsg)) { + std::cerr << "Error making unique filename: " << ErrMsg << "\n"; + exit(1); + } GCCArgs.push_back(OutputBinary.c_str()); // Output to the right file... // Add any arguments intended for GCC. We locate them here because this is @@ -462,7 +478,11 @@ std::string &OutputFile, const std::vector &ArgsForGCC) { sys::Path uniqueFilename(InputFile+LTDL_SHLIB_EXT); - uniqueFilename.makeUnique(); + std::string ErrMsg; + if (uniqueFilename.makeUnique(true, &ErrMsg)) { + std::cerr << "Error making unique filename: " << ErrMsg << "\n"; + exit(1); + } OutputFile = uniqueFilename.toString(); std::vector GCCArgs; From reid at x10sys.com Wed Aug 23 15:35:17 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 15:35:17 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200608232035.k7NKZHLI032063@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.41 -> 1.42 --- Log message: For PR797: http://llvm.org/PR797 : Final removal of exceptions from lib/System and adjustment of users to accommodate. --- Diffs of the changes: (+3 -3) Path.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.41 llvm/include/llvm/System/Path.h:1.42 --- llvm/include/llvm/System/Path.h:1.41 Wed Aug 23 12:43:20 2006 +++ llvm/include/llvm/System/Path.h Wed Aug 23 15:34:57 2006 @@ -414,7 +414,7 @@ /// already unique. /// @throws std::string if an unrecoverable error occurs. /// @brief Make the current path name unique in the file system. - void makeUnique( bool reuse_current = true ); + bool makeUnique( bool reuse_current /*= true*/, std::string* ErrMsg ); /// @} /// @name Disk Mutators @@ -529,9 +529,9 @@ /// This function can be used to copy the file specified by Src to the /// file specified by Dest. If an error occurs, Dest is removed. - /// @throws std::string if an error opening or writing the files occurs. + /// @returns true if an error occurs, false otherwise /// @brief Copy one file to another. - void CopyFile(const Path& Dest, const Path& Src); + bool CopyFile(const Path& Dest, const Path& Src, std::string* ErrMsg); } std::ostream& operator<<(std::ostream& strm, const sys::Path& aPath); From reid at x10sys.com Wed Aug 23 15:36:05 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 15:36:05 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Makefile Message-ID: <200608232036.k7NKa56f032097@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Makefile updated: 1.12 -> 1.13 --- Log message: Turn off exception handling for this library. It no longer throws nor handles exceptions. --- Diffs of the changes: (+0 -1) Makefile | 1 - 1 files changed, 1 deletion(-) Index: llvm/lib/System/Makefile diff -u llvm/lib/System/Makefile:1.12 llvm/lib/System/Makefile:1.13 --- llvm/lib/System/Makefile:1.12 Thu Jul 6 19:47:29 2006 +++ llvm/lib/System/Makefile Wed Aug 23 15:35:51 2006 @@ -10,7 +10,6 @@ LEVEL = ../.. LIBRARYNAME = LLVMSystem BUILD_ARCHIVE = 1 -REQUIRES_EH := 1 EXTRA_DIST = Unix Win32 README.txt From reid at x10sys.com Wed Aug 23 15:38:13 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 15:38:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200608232038.k7NKcDZc032143@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.49 -> 1.50 --- Log message: For PR797: http://llvm.org/PR797 : Final remove of exception handling from this file. lib/System can no longer throw exceptions so there's no need for try/catch blocks here. --- Diffs of the changes: (+78 -86) FileUtilities.cpp | 164 +++++++++++++++++++++++++----------------------------- 1 files changed, 78 insertions(+), 86 deletions(-) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.49 llvm/lib/Support/FileUtilities.cpp:1.50 --- llvm/lib/Support/FileUtilities.cpp:1.49 Tue Aug 22 11:06:27 2006 +++ llvm/lib/Support/FileUtilities.cpp Wed Aug 23 15:37:59 2006 @@ -164,97 +164,89 @@ if ((A_size == 0 || B_size == 0)) return 1; - try { - // Now its safe to mmap the files into memory becasue both files - // have a non-zero size. - sys::MappedFile F1; - if (F1.open(FileA, sys::MappedFile::READ_ACCESS, Error)) - return 2; - sys::MappedFile F2; - if (F2.open(FileB, sys::MappedFile::READ_ACCESS, Error)) - return 2; - if (!F1.map(Error)) - return 2; - if (!F2.map(Error)) - return 2; - - // Okay, now that we opened the files, scan them for the first difference. - char *File1Start = F1.charBase(); - char *File2Start = F2.charBase(); - char *File1End = File1Start+A_size; - char *File2End = File2Start+B_size; - char *F1P = File1Start; - char *F2P = File2Start; - - if (A_size == B_size) { - // Are the buffers identical? - if (std::memcmp(File1Start, File2Start, A_size) == 0) - return 0; + // Now its safe to mmap the files into memory becasue both files + // have a non-zero size. + sys::MappedFile F1; + if (F1.open(FileA, sys::MappedFile::READ_ACCESS, Error)) + return 2; + sys::MappedFile F2; + if (F2.open(FileB, sys::MappedFile::READ_ACCESS, Error)) + return 2; + if (!F1.map(Error)) + return 2; + if (!F2.map(Error)) + return 2; - if (AbsTol == 0 && RelTol == 0) - return 1; // Files different! - } + // Okay, now that we opened the files, scan them for the first difference. + char *File1Start = F1.charBase(); + char *File2Start = F2.charBase(); + char *File1End = File1Start+A_size; + char *File2End = File2Start+B_size; + char *F1P = File1Start; + char *F2P = File2Start; + + if (A_size == B_size) { + // Are the buffers identical? + if (std::memcmp(File1Start, File2Start, A_size) == 0) + return 0; - char *OrigFile1Start = File1Start; - char *OrigFile2Start = File2Start; + if (AbsTol == 0 && RelTol == 0) + return 1; // Files different! + } - // If the files need padding, do so now. - PadFileIfNeeded(File1Start, File1End, F1P); - PadFileIfNeeded(File2Start, File2End, F2P); - - bool CompareFailed = false; - while (1) { - // Scan for the end of file or next difference. - while (F1P < File1End && F2P < File2End && *F1P == *F2P) - ++F1P, ++F2P; - - if (F1P >= File1End || F2P >= File2End) break; - - // Okay, we must have found a difference. Backup to the start of the - // current number each stream is at so that we can compare from the - // beginning. - F1P = BackupNumber(F1P, File1Start); - F2P = BackupNumber(F2P, File2Start); - - // Now that we are at the start of the numbers, compare them, exiting if - // they don't match. - if (CompareNumbers(F1P, F2P, File1End, File2End, AbsTol, RelTol, Error)) { - CompareFailed = true; - break; - } - } + char *OrigFile1Start = File1Start; + char *OrigFile2Start = File2Start; - // Okay, we reached the end of file. If both files are at the end, we - // succeeded. - bool F1AtEnd = F1P >= File1End; - bool F2AtEnd = F2P >= File2End; - if (!CompareFailed && (!F1AtEnd || !F2AtEnd)) { - // Else, we might have run off the end due to a number: backup and retry. - if (F1AtEnd && isNumberChar(F1P[-1])) --F1P; - if (F2AtEnd && isNumberChar(F2P[-1])) --F2P; - F1P = BackupNumber(F1P, File1Start); - F2P = BackupNumber(F2P, File2Start); - - // Now that we are at the start of the numbers, compare them, exiting if - // they don't match. - if (CompareNumbers(F1P, F2P, File1End, File2End, AbsTol, RelTol, Error)) - CompareFailed = true; - - // If we found the end, we succeeded. - if (F1P < File1End || F2P < File2End) - CompareFailed = true; + // If the files need padding, do so now. + PadFileIfNeeded(File1Start, File1End, F1P); + PadFileIfNeeded(File2Start, File2End, F2P); + + bool CompareFailed = false; + while (1) { + // Scan for the end of file or next difference. + while (F1P < File1End && F2P < File2End && *F1P == *F2P) + ++F1P, ++F2P; + + if (F1P >= File1End || F2P >= File2End) break; + + // Okay, we must have found a difference. Backup to the start of the + // current number each stream is at so that we can compare from the + // beginning. + F1P = BackupNumber(F1P, File1Start); + F2P = BackupNumber(F2P, File2Start); + + // Now that we are at the start of the numbers, compare them, exiting if + // they don't match. + if (CompareNumbers(F1P, F2P, File1End, File2End, AbsTol, RelTol, Error)) { + CompareFailed = true; + break; } + } - if (OrigFile1Start != File1Start) - delete[] (File1Start-1); // Back up past null byte - if (OrigFile2Start != File2Start) - delete[] (File2Start-1); // Back up past null byte - return CompareFailed; - } catch (const std::string &Msg) { - if (Error) *Error = Msg; - return 2; - } catch (...) { - *Error = "Unknown Exception Occurred"; - return 2; + // Okay, we reached the end of file. If both files are at the end, we + // succeeded. + bool F1AtEnd = F1P >= File1End; + bool F2AtEnd = F2P >= File2End; + if (!CompareFailed && (!F1AtEnd || !F2AtEnd)) { + // Else, we might have run off the end due to a number: backup and retry. + if (F1AtEnd && isNumberChar(F1P[-1])) --F1P; + if (F2AtEnd && isNumberChar(F2P[-1])) --F2P; + F1P = BackupNumber(F1P, File1Start); + F2P = BackupNumber(F2P, File2Start); + + // Now that we are at the start of the numbers, compare them, exiting if + // they don't match. + if (CompareNumbers(F1P, F2P, File1End, File2End, AbsTol, RelTol, Error)) + CompareFailed = true; + + // If we found the end, we succeeded. + if (F1P < File1End || F2P < File2End) + CompareFailed = true; } + + if (OrigFile1Start != File1Start) + delete[] (File1Start-1); // Back up past null byte + if (OrigFile2Start != File2Start) + delete[] (File2Start-1); // Back up past null byte + return CompareFailed; } From reid at x10sys.com Wed Aug 23 15:39:39 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 23 Aug 2006 15:39:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/Makefile Message-ID: <200608232039.k7NKdd7w032188@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: Makefile updated: 1.11 -> 1.12 --- Log message: For PR797: http://llvm.org/PR797 : This library no longer throws nor handles exceptions, so turn off the REQUIRES_EH flag. --- Diffs of the changes: (+0 -1) Makefile | 1 - 1 files changed, 1 deletion(-) Index: llvm/lib/Support/Makefile diff -u llvm/lib/Support/Makefile:1.11 llvm/lib/Support/Makefile:1.12 --- llvm/lib/Support/Makefile:1.11 Fri Jul 28 17:01:01 2006 +++ llvm/lib/Support/Makefile Wed Aug 23 15:39:25 2006 @@ -11,6 +11,5 @@ PARALLEL_DIRS=bzip2 LIBRARYNAME = LLVMSupport BUILD_ARCHIVE = 1 -REQUIRES_EH := 1 include $(LEVEL)/Makefile.common From natebegeman at mac.com Wed Aug 23 16:09:10 2006 From: natebegeman at mac.com (Nate Begeman) Date: Wed, 23 Aug 2006 16:09:10 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachOWriter.cpp Message-ID: <200608232109.k7NL9ADO000403@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachOWriter.cpp added (r1.1) --- Log message: Initial checkin of the Mach-O emitter. There's plenty of fixmes, but it does emit linkable .o files in very simple cases. --- Diffs of the changes: (+428 -0) MachOWriter.cpp | 428 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 428 insertions(+) Index: llvm/lib/CodeGen/MachOWriter.cpp diff -c /dev/null llvm/lib/CodeGen/MachOWriter.cpp:1.1 *** /dev/null Wed Aug 23 16:09:02 2006 --- llvm/lib/CodeGen/MachOWriter.cpp Wed Aug 23 16:08:52 2006 *************** *** 0 **** --- 1,428 ---- + //===-- MachOWriter.cpp - Target-independent Mach-O Writer code -----------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Nate Begeman and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the target-independent Mach-O writer. This file writes + // out the Mach-O file in the following order: + // + // #1 FatHeader (universal-only) + // #2 FatArch (universal-only, 1 per universal arch) + // Per arch: + // #3 Header + // #4 Load Commands + // #5 Sections + // #6 Relocations + // #7 Symbols + // #8 Strings + // + //===----------------------------------------------------------------------===// + + #include "llvm/Module.h" + #include "llvm/CodeGen/MachineCodeEmitter.h" + #include "llvm/CodeGen/MachineConstantPool.h" + #include "llvm/CodeGen/MachineRelocation.h" + #include "llvm/CodeGen/MachOWriter.h" + #include "llvm/Target/TargetData.h" + #include "llvm/Target/TargetJITInfo.h" + #include "llvm/Target/TargetMachine.h" + #include "llvm/Support/Mangler.h" + #include + using namespace llvm; + + //===----------------------------------------------------------------------===// + // MachOCodeEmitter Implementation + //===----------------------------------------------------------------------===// + + namespace llvm { + /// MachOCodeEmitter - This class is used by the MachOWriter to emit the code + /// for functions to the Mach-O file. + class MachOCodeEmitter : public MachineCodeEmitter { + MachOWriter &MOW; + + /// MOS - The current section we're writing to + MachOWriter::MachOSection *MOS; + + /// Relocations - These are the relocations that the function needs, as + /// emitted. + std::vector Relocations; + + /// MBBLocations - This vector is a mapping from MBB ID's to their address. + /// It is filled in by the StartMachineBasicBlock callback and queried by + /// the getMachineBasicBlockAddress callback. + std::vector MBBLocations; + + public: + MachOCodeEmitter(MachOWriter &mow) : MOW(mow) {} + + void startFunction(MachineFunction &F); + bool finishFunction(MachineFunction &F); + + void addRelocation(const MachineRelocation &MR) { + Relocations.push_back(MR); + } + + virtual void StartMachineBasicBlock(MachineBasicBlock *MBB) { + if (MBBLocations.size() <= (unsigned)MBB->getNumber()) + MBBLocations.resize((MBB->getNumber()+1)*2); + MBBLocations[MBB->getNumber()] = getCurrentPCValue(); + } + + virtual intptr_t getConstantPoolEntryAddress(unsigned Index) const { + assert(0 && "CP not implementated yet!"); + return 0; + } + virtual intptr_t getJumpTableEntryAddress(unsigned Index) const { + assert(0 && "JT not implementated yet!"); + return 0; + } + + virtual intptr_t getMachineBasicBlockAddress(MachineBasicBlock *MBB) const { + assert(MBBLocations.size() > (unsigned)MBB->getNumber() && + MBBLocations[MBB->getNumber()] && "MBB not emitted!"); + return MBBLocations[MBB->getNumber()]; + } + + /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE! + void startFunctionStub(unsigned StubSize) { + assert(0 && "JIT specific function called!"); + abort(); + } + void *finishFunctionStub(const Function *F) { + assert(0 && "JIT specific function called!"); + abort(); + return 0; + } + }; + } + + /// startFunction - This callback is invoked when a new machine function is + /// about to be emitted. + void MachOCodeEmitter::startFunction(MachineFunction &F) { + // Align the output buffer to the appropriate alignment, power of 2. + // FIXME: GENERICIZE!! + unsigned Align = 4; + + // Get the Mach-O Section that this function belongs in. + MOS = &MOW.getTextSection(); + + // FIXME: better memory management + MOS->SectionData.reserve(4096); + BufferBegin = &(MOS->SectionData[0]); + BufferEnd = BufferBegin + MOS->SectionData.capacity(); + CurBufferPtr = BufferBegin + MOS->size; + + // Upgrade the section alignment if required. + if (MOS->align < Align) MOS->align = Align; + + // Make sure we only relocate to this function's MBBs. + MBBLocations.clear(); + } + + /// finishFunction - This callback is invoked after the function is completely + /// finished. + bool MachOCodeEmitter::finishFunction(MachineFunction &F) { + MOS->size += CurBufferPtr - BufferBegin; + + // Get a symbol for the function to add to the symbol table + MachOWriter::MachOSym FnSym(F.getFunction(), MOS->Index); + + // Figure out the binding (linkage) of the symbol. + switch (F.getFunction()->getLinkage()) { + default: + // appending linkage is illegal for functions. + assert(0 && "Unknown linkage type!"); + case GlobalValue::ExternalLinkage: + FnSym.n_type = MachOWriter::MachOSym::N_SECT | MachOWriter::MachOSym::N_EXT; + break; + case GlobalValue::InternalLinkage: + FnSym.n_type = MachOWriter::MachOSym::N_SECT; + break; + } + + // Resolve the function's relocations either to concrete pointers in the case + // of branches from one block to another, or to target relocation entries. + for (unsigned i = 0, e = Relocations.size(); i != e; ++i) { + MachineRelocation &MR = Relocations[i]; + if (MR.isBasicBlock()) { + void *MBBAddr = (void *)getMachineBasicBlockAddress(MR.getBasicBlock()); + MR.setResultPointer(MBBAddr); + MOW.TM.getJITInfo()->relocate(BufferBegin, &MR, 1, 0); + // FIXME: we basically want the JITInfo relocate() function to rewrite + // this guy right now, so we just write the correct displacement + // to the file. + } else { + // isString | isGV | isCPI | isJTI + // FIXME: do something smart here. We won't be able to relocate these + // until the sections are all layed out, but we still need to + // record them. Maybe emit TargetRelocations and then resolve + // those at file writing time? + std::cerr << "whee!\n"; + } + } + Relocations.clear(); + + // Finally, add it to the symtab. + MOW.SymbolTable.push_back(FnSym); + return false; + } + + //===----------------------------------------------------------------------===// + // MachOWriter Implementation + //===----------------------------------------------------------------------===// + + MachOWriter::MachOWriter(std::ostream &o, TargetMachine &tm) : O(o), TM(tm) { + // FIXME: set cpu type and cpu subtype somehow from TM + is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64; + isLittleEndian = TM.getTargetData()->isLittleEndian(); + + // Create the machine code emitter object for this target. + MCE = new MachOCodeEmitter(*this); + } + + MachOWriter::~MachOWriter() { + delete MCE; + } + + void MachOWriter::EmitGlobal(GlobalVariable *GV) { + // FIXME: do something smart here. + } + + + bool MachOWriter::runOnMachineFunction(MachineFunction &MF) { + // Nothing to do here, this is all done through the MCE object. + return false; + } + + bool MachOWriter::doInitialization(Module &M) { + // Set the magic value, now that we know the pointer size and endianness + Header.setMagic(isLittleEndian, is64Bit); + + // Set the file type + // FIXME: this only works for object files, we do not support the creation + // of dynamic libraries or executables at this time. + Header.filetype = MachOHeader::MH_OBJECT; + + Mang = new Mangler(M); + return false; + } + + /// doFinalization - Now that the module has been completely processed, emit + /// the Mach-O file to 'O'. + bool MachOWriter::doFinalization(Module &M) { + // Okay, the.text section has been completed, build the .data, .bss, and + // "common" sections next. + for (Module::global_iterator I = M.global_begin(), E = M.global_end(); + I != E; ++I) + EmitGlobal(I); + + // Emit the header and load commands. + EmitHeaderAndLoadCommands(); + + // Emit the text and data sections. + EmitSections(); + + // Emit the relocation entry data for each section. + // FIXME: presumably this should be a virtual method, since different targets + // have different relocation types. + EmitRelocations(); + + // Emit the symbol table. + // FIXME: we don't handle debug info yet, we should probably do that. + EmitSymbolTable(); + + // Emit the string table for the sections we have. + EmitStringTable(); + + // We are done with the abstract symbols. + SectionList.clear(); + SymbolTable.clear(); + DynamicSymbolTable.clear(); + + // Release the name mangler object. + delete Mang; Mang = 0; + return false; + } + + void MachOWriter::EmitHeaderAndLoadCommands() { + // Step #0: Fill in the segment load command size, since we need it to figure + // out the rest of the header fields + MachOSegment SEG("", is64Bit); + SEG.nsects = SectionList.size(); + SEG.cmdsize = SEG.cmdSize(is64Bit) + + SEG.nsects * SectionList.begin()->cmdSize(is64Bit); + + // Step #1: calculate the number of load commands. We always have at least + // one, for the LC_SEGMENT load command, plus two for the normal + // and dynamic symbol tables, if there are any symbols. + Header.ncmds = SymbolTable.empty() ? 1 : 3; + + // Step #2: calculate the size of the load commands + Header.sizeofcmds = SEG.cmdsize; + if (!SymbolTable.empty()) + Header.sizeofcmds += SymTab.cmdsize + DySymTab.cmdsize; + + // Step #3: write the header to the file + // Local alias to shortenify coming code. + DataBuffer &FH = Header.HeaderData; + outword(FH, Header.magic); + outword(FH, Header.cputype); + outword(FH, Header.cpusubtype); + outword(FH, Header.filetype); + outword(FH, Header.ncmds); + outword(FH, Header.sizeofcmds); + outword(FH, Header.flags); + if (is64Bit) + outword(FH, Header.reserved); + + // Step #4: Finish filling in the segment load command and write it out + for (std::list::iterator I = SectionList.begin(), + E = SectionList.end(); I != E; ++I) + SEG.filesize += I->size; + SEG.vmsize = SEG.filesize; + SEG.fileoff = Header.cmdSize(is64Bit) + Header.sizeofcmds; + + outword(FH, SEG.cmd); + outword(FH, SEG.cmdsize); + outstring(FH, SEG.segname, 16); + outaddr(FH, SEG.vmaddr); + outaddr(FH, SEG.vmsize); + outaddr(FH, SEG.fileoff); + outaddr(FH, SEG.filesize); + outword(FH, SEG.maxprot); + outword(FH, SEG.initprot); + outword(FH, SEG.nsects); + outword(FH, SEG.flags); + + // Step #5: Write out the section commands for each section + for (std::list::iterator I = SectionList.begin(), + E = SectionList.end(); I != E; ++I) { + I->offset = SEG.fileoff; // FIXME: separate offset + outstring(FH, I->sectname, 16); + outstring(FH, I->segname, 16); + outaddr(FH, I->addr); + outaddr(FH, I->size); + outword(FH, I->offset); + outword(FH, I->align); + outword(FH, I->reloff); + outword(FH, I->nreloc); + outword(FH, I->flags); + outword(FH, I->reserved1); + outword(FH, I->reserved2); + if (is64Bit) + outword(FH, I->reserved3); + } + + // Step #6: Emit LC_SYMTAB/LC_DYSYMTAB load commands + // FIXME: We'll need to scan over the symbol table and possibly do the sort + // here so that we can set the proper indices in the dysymtab load command for + // the index and number of external symbols defined in this module. + // FIXME: We'll also need to scan over all the symbols so that we can + // calculate the size of the string table. + // FIXME: add size of relocs + SymTab.symoff = SEG.fileoff + SEG.filesize; + SymTab.nsyms = SymbolTable.size(); + SymTab.stroff = SymTab.symoff + SymTab.nsyms * MachOSym::entrySize(); + SymTab.strsize = 10; + outword(FH, SymTab.cmd); + outword(FH, SymTab.cmdsize); + outword(FH, SymTab.symoff); + outword(FH, SymTab.nsyms); + outword(FH, SymTab.stroff); + outword(FH, SymTab.strsize); + + // FIXME: set DySymTab fields appropriately + outword(FH, DySymTab.cmd); + outword(FH, DySymTab.cmdsize); + outword(FH, DySymTab.ilocalsym); + outword(FH, DySymTab.nlocalsym); + outword(FH, DySymTab.iextdefsym); + outword(FH, DySymTab.nextdefsym); + outword(FH, DySymTab.iundefsym); + outword(FH, DySymTab.nundefsym); + outword(FH, DySymTab.tocoff); + outword(FH, DySymTab.ntoc); + outword(FH, DySymTab.modtaboff); + outword(FH, DySymTab.nmodtab); + outword(FH, DySymTab.extrefsymoff); + outword(FH, DySymTab.nextrefsyms); + outword(FH, DySymTab.indirectsymoff); + outword(FH, DySymTab.nindirectsyms); + outword(FH, DySymTab.extreloff); + outword(FH, DySymTab.nextrel); + outword(FH, DySymTab.locreloff); + outword(FH, DySymTab.nlocrel); + + O.write((char*)&FH[0], FH.size()); + } + + /// EmitSections - Now that we have constructed the file header and load + /// commands, emit the data for each section to the file. + void MachOWriter::EmitSections() { + for (std::list::iterator I = SectionList.begin(), + E = SectionList.end(); I != E; ++I) { + O.write((char*)&I->SectionData[0], I->size); + } + } + + void MachOWriter::EmitRelocations() { + // FIXME: this should probably be a pure virtual function, since the + // relocation types and layout of the relocations themselves are target + // specific. + } + + /// EmitSymbolTable - Sort the symbols we encountered and assign them each a + /// string table index so that they appear in the correct order in the output + /// file. + void MachOWriter::EmitSymbolTable() { + // The order of the symbol table is: + // local symbols + // defined external symbols (sorted by name) + // undefined external symbols (sorted by name) + DataBuffer ST; + + // FIXME: enforce the above ordering, presumably by sorting by name, + // then partitioning twice. + unsigned stringIndex; + for (std::vector::iterator I = SymbolTable.begin(), + E = SymbolTable.end(); I != E; ++I) { + // FIXME: remove when we actually calculate these correctly + I->n_strx = 1; + StringTable.push_back(Mang->getValueName(I->GV)); + // Emit nlist to buffer + outword(ST, I->n_strx); + outbyte(ST, I->n_type); + outbyte(ST, I->n_sect); + outhalf(ST, I->n_desc); + outaddr(ST, I->n_value); + } + + O.write((char*)&ST[0], ST.size()); + } + + /// EmitStringTable - This method adds and emits a section for the Mach-O + /// string table. + void MachOWriter::EmitStringTable() { + // The order of the string table is: + // strings for external symbols + // strings for local symbols + // This is the symbol table, but backwards. This allows us to avoid a sorting + // the symbol table again; all we have to do is use a reverse iterator. + DataBuffer ST; + + // Write out a leading zero byte when emitting string table, for n_strx == 0 + // which means an empty string. + outbyte(ST, 0); + + for (std::vector::iterator I = StringTable.begin(), + E = StringTable.end(); I != E; ++I) { + // FIXME: do not arbitrarily cap symbols to 16 characters + // FIXME: do something more efficient than outstring + outstring(ST, *I, 16); + } + O.write((char*)&ST[0], ST.size()); + } From natebegeman at mac.com Wed Aug 23 16:09:09 2006 From: natebegeman at mac.com (Nate Begeman) Date: Wed, 23 Aug 2006 16:09:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCMachOWriter.cpp PPC.h PPCCodeEmitter.cpp PPCTargetMachine.cpp Message-ID: <200608232109.k7NL99Hx000398@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCMachOWriter.cpp added (r1.1) PPC.h updated: 1.30 -> 1.31 PPCCodeEmitter.cpp updated: 1.65 -> 1.66 PPCTargetMachine.cpp updated: 1.99 -> 1.100 --- Log message: Initial checkin of the Mach-O emitter. There's plenty of fixmes, but it does emit linkable .o files in very simple cases. --- Diffs of the changes: (+89 -43) PPC.h | 9 +++++++- PPCCodeEmitter.cpp | 56 ++++++++++++++++----------------------------------- PPCMachOWriter.cpp | 41 +++++++++++++++++++++++++++++++++++++ PPCTargetMachine.cpp | 26 ++++++++++++++++++++--- 4 files changed, 89 insertions(+), 43 deletions(-) Index: llvm/lib/Target/PowerPC/PPCMachOWriter.cpp diff -c /dev/null llvm/lib/Target/PowerPC/PPCMachOWriter.cpp:1.1 *** /dev/null Wed Aug 23 16:09:02 2006 --- llvm/lib/Target/PowerPC/PPCMachOWriter.cpp Wed Aug 23 16:08:52 2006 *************** *** 0 **** --- 1,41 ---- + //===-- PPCMachOWriter.cpp - Emit a Mach-O file for the PowerPC backend ---===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Nate Begeman and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements a Mach-O writer for the PowerPC backend. The public + // interface to this file is the createPPCMachOObjectWriterPass function. + // + //===----------------------------------------------------------------------===// + + #include "PPCTargetMachine.h" + #include "llvm/PassManager.h" + #include "llvm/CodeGen/MachOWriter.h" + #include "llvm/Support/Visibility.h" + using namespace llvm; + + namespace { + class VISIBILITY_HIDDEN PPCMachOWriter : public MachOWriter { + public: + PPCMachOWriter(std::ostream &O, PPCTargetMachine &TM) : MachOWriter(O, TM) { + // FIMXE: choose ppc64 when appropriate + Header.cputype = MachOHeader::CPU_TYPE_POWERPC; + Header.cpusubtype = MachOHeader::CPU_SUBTYPE_POWERPC_ALL; + } + + }; + } + + /// addPPCMachOObjectWriterPass - Returns a pass that outputs the generated code + /// as a Mach-O object file. + /// + void llvm::addPPCMachOObjectWriterPass(PassManager &FPM, + std::ostream &O, PPCTargetMachine &TM) { + PPCMachOWriter *EW = new PPCMachOWriter(O, TM); + FPM.add(EW); + FPM.add(createPPCCodeEmitterPass(TM, EW->getMachineCodeEmitter())); + } Index: llvm/lib/Target/PowerPC/PPC.h diff -u llvm/lib/Target/PowerPC/PPC.h:1.30 llvm/lib/Target/PowerPC/PPC.h:1.31 --- llvm/lib/Target/PowerPC/PPC.h:1.30 Fri Jul 14 20:24:23 2006 +++ llvm/lib/Target/PowerPC/PPC.h Wed Aug 23 16:08:52 2006 @@ -19,11 +19,18 @@ namespace llvm { -class FunctionPass; class PPCTargetMachine; +class PassManager; +class FunctionPass; +class MachineCodeEmitter; + FunctionPass *createPPCBranchSelectionPass(); FunctionPass *createPPCISelDag(PPCTargetMachine &TM); FunctionPass *createDarwinAsmPrinter(std::ostream &OS, PPCTargetMachine &TM); +FunctionPass *createPPCCodeEmitterPass(PPCTargetMachine &TM, + MachineCodeEmitter &MCE); +void addPPCMachOObjectWriterPass(PassManager &FPM, std::ostream &o, + PPCTargetMachine &tm); } // end namespace llvm; // GCC #defines PPC on Linux but we use it as our namespace name Index: llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.65 llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.66 --- llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.65 Thu Jul 27 13:20:32 2006 +++ llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp Wed Aug 23 16:08:52 2006 @@ -21,7 +21,7 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/Passes.h" -#include "llvm/Support/Debug.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/Visibility.h" #include "llvm/Target/TargetOptions.h" #include @@ -62,19 +62,11 @@ }; } -/// addPassesToEmitMachineCode - Add passes to the specified pass manager to get -/// machine code emitted. This uses a MachineCodeEmitter object to handle -/// actually outputting the machine code and resolving things like the address -/// of functions. This method should returns true if machine code emission is -/// not supported. -/// -bool PPCTargetMachine::addPassesToEmitMachineCode(FunctionPassManager &PM, - MachineCodeEmitter &MCE) { - // Machine code emitter pass for PowerPC - PM.add(new PPCCodeEmitter(*this, MCE)); - // Delete machine code for this function after emitting it - PM.add(createMachineCodeDeleter()); - return false; +/// createPPCCodeEmitterPass - Return a pass that emits the collected PPC code +/// to the specified MCE object. +FunctionPass *llvm::createPPCCodeEmitterPass(PPCTargetMachine &TM, + MachineCodeEmitter &MCE) { + return new PPCCodeEmitter(TM, MCE); } #ifdef __APPLE__ @@ -132,7 +124,8 @@ } } else if (MO.isImmediate()) { rv = MO.getImmedValue(); - } else if (MO.isGlobalAddress() || MO.isExternalSymbol()) { + } else if (MO.isGlobalAddress() || MO.isExternalSymbol() || + MO.isConstantPoolIndex() || MO.isJumpTableIndex()) { unsigned Reloc = 0; if (MI.getOpcode() == PPC::BL) Reloc = PPC::reloc_pcrel_bx; @@ -141,6 +134,7 @@ default: DEBUG(MI.dump()); assert(0 && "Unknown instruction for relocation!"); case PPC::LIS: case PPC::LIS8: + case PPC::ADDIS: case PPC::ADDIS8: Reloc = PPC::reloc_absolute_high; // Pointer to symbol break; @@ -176,9 +170,17 @@ if (MO.isGlobalAddress()) MCE.addRelocation(MachineRelocation::getGV(MCE.getCurrentPCOffset(), Reloc, MO.getGlobal(), 0)); - else + else if (MO.isExternalSymbol()) MCE.addRelocation(MachineRelocation::getExtSym(MCE.getCurrentPCOffset(), Reloc, MO.getSymbolName(), 0)); + else if (MO.isConstantPoolIndex()) + MCE.addRelocation(MachineRelocation::getConstPool( + MCE.getCurrentPCOffset(), + Reloc, MO.getConstantPoolIndex(), 0)); + else // isJumpTableIndex + MCE.addRelocation(MachineRelocation::getJumpTable( + MCE.getCurrentPCOffset(), + Reloc, MO.getJumpTableIndex(), 0)); } else if (MO.isMachineBasicBlock()) { unsigned Reloc = 0; unsigned Opcode = MI.getOpcode(); @@ -190,28 +192,6 @@ MCE.addRelocation(MachineRelocation::getBB(MCE.getCurrentPCOffset(), Reloc, MO.getMachineBasicBlock())); - } else if (MO.isConstantPoolIndex() || MO.isJumpTableIndex()) { - if (MO.isConstantPoolIndex()) - rv = MCE.getConstantPoolEntryAddress(MO.getConstantPoolIndex()); - else - rv = MCE.getJumpTableEntryAddress(MO.getJumpTableIndex()); - - unsigned Opcode = MI.getOpcode(); - if (Opcode == PPC::LIS || Opcode == PPC::LIS8 || - Opcode == PPC::ADDIS || Opcode == PPC::ADDIS8) { - // lis wants hi16(addr) - if ((short)rv < 0) rv += 1 << 16; - rv >>= 16; - } else if (Opcode == PPC::LWZ || Opcode == PPC::LWZ8 || - Opcode == PPC::LA || - Opcode == PPC::LI || Opcode == PPC::LI8 || - Opcode == PPC::LFS || Opcode == PPC::LFD) { - // These load opcodes want lo16(addr) - rv &= 0xffff; - } else { - MI.dump(); - assert(0 && "Unknown constant pool or jump table using instruction!"); - } } else { std::cerr << "ERROR: Unknown type of MachineOperand: " << MO << "\n"; abort(); Index: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.99 llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.100 --- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.99 Wed Jul 26 16:12:04 2006 +++ llvm/lib/Target/PowerPC/PPCTargetMachine.cpp Wed Aug 23 16:08:52 2006 @@ -109,11 +109,11 @@ /// addPassesToEmitFile - Add passes to the specified pass manager to implement /// a static compiler for this target. /// -bool PPCTargetMachine::addPassesToEmitFile(PassManager &PM, - std::ostream &Out, +bool PPCTargetMachine::addPassesToEmitFile(PassManager &PM, std::ostream &Out, CodeGenFileType FileType, bool Fast) { - if (FileType != TargetMachine::AssemblyFile) return true; + if (FileType != TargetMachine::AssemblyFile && + FileType != TargetMachine::ObjectFile) return true; // Run loop strength reduction before anything else. if (!Fast) PM.add(createLoopStrengthReducePass(&TLInfo)); @@ -146,7 +146,11 @@ // Must run branch selection immediately preceding the asm printer PM.add(createPPCBranchSelectionPass()); - PM.add(createDarwinAsmPrinter(Out, *this)); + if (FileType == TargetMachine::AssemblyFile) + PM.add(createDarwinAsmPrinter(Out, *this)); + else + // FIXME: support PPC ELF files at some point + addPPCMachOObjectWriterPass(PM, Out, *this); PM.add(createMachineCodeDeleter()); return false; @@ -184,3 +188,17 @@ PM.add(createMachineFunctionPrinterPass(&std::cerr)); } +/// addPassesToEmitMachineCode - Add passes to the specified pass manager to get +/// machine code emitted. This uses a MachineCodeEmitter object to handle +/// actually outputting the machine code and resolving things like the address +/// of functions. This method should returns true if machine code emission is +/// not supported. +/// +bool PPCTargetMachine::addPassesToEmitMachineCode(FunctionPassManager &PM, + MachineCodeEmitter &MCE) { + // Machine code emitter pass for PowerPC + PM.add(createPPCCodeEmitterPass(*this, MCE)); + // Delete machine code for this function after emitting it + PM.add(createMachineCodeDeleter()); + return false; +} From natebegeman at mac.com Wed Aug 23 16:09:12 2006 From: natebegeman at mac.com (Nate Begeman) Date: Wed, 23 Aug 2006 16:09:12 -0500 Subject: [llvm-commits] CVS: llvm/tools/llc/llc.cpp Message-ID: <200608232109.k7NL9CpY000409@zion.cs.uiuc.edu> Changes in directory llvm/tools/llc: llc.cpp updated: 1.136 -> 1.137 --- Log message: Initial checkin of the Mach-O emitter. There's plenty of fixmes, but it does emit linkable .o files in very simple cases. --- Diffs of the changes: (+0 -3) llc.cpp | 3 --- 1 files changed, 3 deletions(-) Index: llvm/tools/llc/llc.cpp diff -u llvm/tools/llc/llc.cpp:1.136 llvm/tools/llc/llc.cpp:1.137 --- llvm/tools/llc/llc.cpp:1.136 Tue Aug 1 17:34:35 2006 +++ llvm/tools/llc/llc.cpp Wed Aug 23 16:08:52 2006 @@ -219,9 +219,6 @@ } } - if (FileType != TargetMachine::AssemblyFile) - std::cerr << "WARNING: only -filetype=asm is currently supported.\n"; - // Ask the target to add backend passes as necessary. if (Target.addPassesToEmitFile(Passes, *Out, FileType, Fast)) { std::cerr << argv[0] << ": target '" << Target.getName() From natebegeman at mac.com Wed Aug 23 16:09:13 2006 From: natebegeman at mac.com (Nate Begeman) Date: Wed, 23 Aug 2006 16:09:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp Message-ID: <200608232109.k7NL9D2H000417@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.120 -> 1.121 --- Log message: Initial checkin of the Mach-O emitter. There's plenty of fixmes, but it does emit linkable .o files in very simple cases. --- Diffs of the changes: (+1 -1) X86TargetMachine.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.120 llvm/lib/Target/X86/X86TargetMachine.cpp:1.121 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.120 Wed Aug 2 00:29:40 2006 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Wed Aug 23 16:08:52 2006 @@ -136,7 +136,7 @@ case TargetMachine::ObjectFile: // FIXME: We only support emission of ELF files for now, this should check // the target triple and decide on the format to write (e.g. COFF on - // win32). + // win32 or Mach-O on darwin). addX86ELFObjectWriterPass(PM, Out, *this); break; } From natebegeman at mac.com Wed Aug 23 16:09:13 2006 From: natebegeman at mac.com (Nate Begeman) Date: Wed, 23 Aug 2006 16:09:13 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachOWriter.h Message-ID: <200608232109.k7NL9DNG000414@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachOWriter.h added (r1.1) --- Log message: Initial checkin of the Mach-O emitter. There's plenty of fixmes, but it does emit linkable .o files in very simple cases. --- Diffs of the changes: (+600 -0) MachOWriter.h | 600 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 600 insertions(+) Index: llvm/include/llvm/CodeGen/MachOWriter.h diff -c /dev/null llvm/include/llvm/CodeGen/MachOWriter.h:1.1 *** /dev/null Wed Aug 23 16:09:02 2006 --- llvm/include/llvm/CodeGen/MachOWriter.h Wed Aug 23 16:08:52 2006 *************** *** 0 **** --- 1,600 ---- + //=== MachOWriter.h - Target-independent Mach-O writer support --*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Chris Lattner and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the MachOWriter class. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_CODEGEN_MACHOWRITER_H + #define LLVM_CODEGEN_MACHOWRITER_H + + #include "llvm/CodeGen/MachineRelocation.h" + #include "llvm/CodeGen/MachineFunctionPass.h" + #include + + namespace llvm { + class GlobalVariable; + class Mangler; + class MachineCodeEmitter; + class MachOCodeEmitter; + + /// MachOWriter - This class implements the common target-independent code for + /// writing Mach-O files. Targets should derive a class from this to + /// parameterize the output format. + /// + class MachOWriter : public MachineFunctionPass { + friend class MachOCodeEmitter; + public: + MachineCodeEmitter &getMachineCodeEmitter() const { + return *(MachineCodeEmitter*)MCE; + } + + ~MachOWriter(); + + typedef std::vector DataBuffer; + + protected: + MachOWriter(std::ostream &O, TargetMachine &TM); + + /// Output stream to send the resultant object file to. + /// + std::ostream &O; + + /// Target machine description. + /// + TargetMachine &TM; + + /// Mang - The object used to perform name mangling for this module. + /// + Mangler *Mang; + + /// MCE - The MachineCodeEmitter object that we are exposing to emit machine + /// code for functions to the .o file. + MachOCodeEmitter *MCE; + + /// is64Bit/isLittleEndian - This information is inferred from the target + /// machine directly, indicating what header values and flags to set. + bool is64Bit, isLittleEndian; + + /// doInitialization - Emit the file header and all of the global variables + /// for the module to the Mach-O file. + bool doInitialization(Module &M); + + bool runOnMachineFunction(MachineFunction &MF); + + /// doFinalization - Now that the module has been completely processed, emit + /// the Mach-O file to 'O'. + bool doFinalization(Module &M); + + /// MachOHeader - This struct contains the header information about a + /// specific architecture type/subtype pair that is emitted to the file. + struct MachOHeader { + uint32_t magic; // mach magic number identifier + uint32_t cputype; // cpu specifier + uint32_t cpusubtype; // machine specifier + uint32_t filetype; // type of file + uint32_t ncmds; // number of load commands + uint32_t sizeofcmds; // the size of all the load commands + uint32_t flags; // flags + uint32_t reserved; // 64-bit only + + /// HeaderData - The actual data for the header which we are building + /// up for emission to the file. + DataBuffer HeaderData; + + // Constants for the cputype field + // see + enum { CPU_TYPE_I386 = 7, + CPU_TYPE_X86_64 = 7 | 0x1000000, + CPU_TYPE_ARM = 12, + CPU_TYPE_SPARC = 14, + CPU_TYPE_POWERPC = 18, + CPU_TYPE_POWERPC64 = 18 | 0x1000000 + }; + + // Constants for the cpusubtype field + // see + enum { CPU_SUBTYPE_I386_ALL = 3, + CPU_SUBTYPE_X86_64_ALL = 3, + CPU_SUBTYPE_ARM_ALL = 0, + CPU_SUBTYPE_SPARC_ALL = 0, + CPU_SUBTYPE_POWERPC_ALL = 0 + }; + + // Constants for the filetype field + // see for additional info on the various types + enum { MH_OBJECT = 1, // relocatable object file + MH_EXECUTE = 2, // demand paged executable file + MH_FVMLIB = 3, // fixed VM shared library file + MH_CORE = 4, // core file + MH_PRELOAD = 5, // preloaded executable file + MH_DYLIB = 6, // dynamically bound shared library + MH_DYLINKER = 7, // dynamic link editor + MH_BUNDLE = 8, // dynamically bound bundle file + MH_DYLIB_STUB = 9, // shared library stub for static linking only + MH_DSYM = 10 // companion file wiht only debug sections + }; + + // Constants for the flags field + enum { MH_NOUNDEFS = 1 << 0, + // the object file has no undefined references + MH_INCRLINK = 1 << 1, + // the object file is the output of an incremental link against + // a base file and cannot be link edited again + MH_DYLDLINK = 1 << 2, + // the object file is input for the dynamic linker and cannot be + // statically link edited again. + MH_BINDATLOAD = 1 << 3, + // the object file's undefined references are bound by the + // dynamic linker when loaded. + MH_PREBOUND = 1 << 4, + // the file has its dynamic undefined references prebound + MH_SPLIT_SEGS = 1 << 5, + // the file has its read-only and read-write segments split + // see + MH_LAZY_INIT = 1 << 6, + // the shared library init routine is to be run lazily via + // catching memory faults to its writable segments (obsolete) + MH_TWOLEVEL = 1 << 7, + // the image is using two-level namespace bindings + MH_FORCE_FLAT = 1 << 8, + // the executable is forcing all images to use flat namespace + // bindings. + MH_NOMULTIDEFS = 1 << 8, + // this umbrella guarantees no multiple definitions of symbols + // in its sub-images so the two-level namespace hints can + // always be used. + MH_NOFIXPREBINDING = 1 << 10, + // do not have dyld notify the prebidning agent about this + // executable. + MH_PREBINDABLE = 1 << 11, + // the binary is not prebound but can have its prebinding + // redone. only used when MH_PREBOUND is not set. + MH_ALLMODSBOUND = 1 << 12, + // indicates that this binary binds to all two-level namespace + // modules of its dependent libraries. Only used when + // MH_PREBINDABLE and MH_TWOLEVEL are both set. + MH_SUBSECTIONS_VIA_SYMBOLS = 1 << 13, + // safe to divide up the sections into sub-sections via symbols + // for dead code stripping. + MH_CANONICAL = 1 << 14, + // the binary has been canonicalized via the unprebind operation + MH_WEAK_DEFINES = 1 << 15, + // the final linked image contains external weak symbols + MH_BINDS_TO_WEAK = 1 << 16, + // the final linked image uses weak symbols + MH_ALLOW_STACK_EXECUTION = 1 << 17 + // When this bit is set, all stacks in the task will be given + // stack execution privilege. Only used in MH_EXECUTE filetype + }; + + MachOHeader() : magic(0), cputype(0), cpusubtype(0), filetype(0), + ncmds(0), sizeofcmds(0), flags(0), reserved(0) { } + + /// cmdSize - This routine returns the size of the MachOSection as written + /// to disk, depending on whether the destination is a 64 bit Mach-O file. + unsigned cmdSize(bool is64Bit) const { + if (is64Bit) + return 8 * sizeof(uint32_t); + else + return 7 * sizeof(uint32_t); + } + + /// setMagic - This routine sets the appropriate value for the 'magic' + /// field based on pointer size and endianness. + void setMagic(bool isLittleEndian, bool is64Bit) { + if (isLittleEndian) + if (is64Bit) magic = 0xcffaedfe; + else magic = 0xcefaedfe; + else + if (is64Bit) magic = 0xfeedfacf; + else magic = 0xfeedface; + } + }; + + /// Header - An instance of MachOHeader that we will update while we build + /// the file, and then emit during finalization. + MachOHeader Header; + + private: + + /// MachOSegment - This struct contains the necessary information to + /// emit the load commands for each section in the file. + struct MachOSegment { + uint32_t cmd; // LC_SEGMENT or LC_SEGMENT_64 + uint32_t cmdsize; // Total size of this struct and section commands + std::string segname; // segment name + uint64_t vmaddr; // address of this segment + uint64_t vmsize; // size of this segment, may be larger than filesize + uint64_t fileoff; // offset in file + uint64_t filesize; // amount to read from file + uint32_t maxprot; // maximum VM protection + uint32_t initprot; // initial VM protection + uint32_t nsects; // number of sections in this segment + uint32_t flags; // flags + + // Constants for the vm protection fields + // see + enum { VM_PROT_NONE = 0x00, + VM_PROT_READ = 0x01, // read permission + VM_PROT_WRITE = 0x02, // write permission + VM_PROT_EXECUTE = 0x04, // execute permission, + VM_PROT_ALL = 0x07 + }; + + // Constants for the cmd field + // see + enum { LC_SEGMENT = 0x01, // segment of this file to be mapped + LC_SEGMENT_64 = 0x19 // 64-bit segment of this file to be mapped + }; + + /// cmdSize - This routine returns the size of the MachOSection as written + /// to disk, depending on whether the destination is a 64 bit Mach-O file. + unsigned cmdSize(bool is64Bit) const { + if (is64Bit) + return 6 * sizeof(uint32_t) + 4 * sizeof(uint64_t) + 16; + else + return 10 * sizeof(uint32_t) + 16; // addresses only 32 bits + } + + MachOSegment(const std::string &seg, bool is64Bit) + : cmd(is64Bit ? LC_SEGMENT_64 : LC_SEGMENT), cmdsize(0), segname(seg), + vmaddr(0), vmsize(0), fileoff(0), filesize(0), maxprot(VM_PROT_ALL), + initprot(VM_PROT_ALL), nsects(0), flags(0) { } + }; + + /// MachOSection - This struct contains information about each section in a + /// particular segment that is emitted to the file. This is eventually + /// turned into the SectionCommand in the load command for a particlar + /// segment. + struct MachOSection { + std::string sectname; // name of this section, + std::string segname; // segment this section goes in + uint64_t addr; // memory address of this section + uint64_t size; // size in bytes of this section + uint32_t offset; // file offset of this section + uint32_t align; // section alignment (power of 2) + uint32_t reloff; // file offset of relocation entries + uint32_t nreloc; // number of relocation entries + uint32_t flags; // flags (section type and attributes) + uint32_t reserved1; // reserved (for offset or index) + uint32_t reserved2; // reserved (for count or sizeof) + uint32_t reserved3; // reserved (64 bit only) + + /// A unique number for this section, which will be used to match symbols + /// to the correct section. + uint32_t Index; + + /// SectionData - The actual data for this section which we are building + /// up for emission to the file. + DataBuffer SectionData; + + // Constants for the section types (low 8 bits of flags field) + // see + enum { S_REGULAR = 0, + // regular section + S_ZEROFILL = 1, + // zero fill on demand section + S_CSTRING_LITERALS = 2, + // section with only literal C strings + S_4BYTE_LITERALS = 3, + // section with only 4 byte literals + S_8BYTE_LITERALS = 4, + // section with only 8 byte literals + S_LITERAL_POINTERS = 5, + // section with only pointers to literals + S_NON_LAZY_SYMBOL_POINTERS = 6, + // section with only non-lazy symbol pointers + S_LAZY_SYMBOL_POINTERS = 7, + // section with only lazy symbol pointers + S_SYMBOL_STUBS = 8, + // section with only symbol stubs + // byte size of stub in the reserved2 field + S_MOD_INIT_FUNC_POINTERS = 9, + // section with only function pointers for initialization + S_MOD_TERM_FUNC_POINTERS = 10, + // section with only function pointers for termination + S_COALESCED = 11, + // section contains symbols that are coalesced + S_GB_ZEROFILL = 12, + // zero fill on demand section (that can be larger than 4GB) + S_INTERPOSING = 13, + // section with only pairs of function pointers for interposing + S_16BYTE_LITERALS = 14 + // section with only 16 byte literals + }; + + // Constants for the section flags (high 24 bits of flags field) + // see + enum { S_ATTR_PURE_INSTRUCTIONS = 1 << 31, + // section contains only true machine instructions + S_ATTR_NO_TOC = 1 << 30, + // section contains coalesced symbols that are not to be in a + // ranlib table of contents + S_ATTR_STRIP_STATIC_SYMS = 1 << 29, + // ok to strip static symbols in this section in files with the + // MY_DYLDLINK flag + S_ATTR_NO_DEAD_STRIP = 1 << 28, + // no dead stripping + S_ATTR_LIVE_SUPPORT = 1 << 27, + // blocks are live if they reference live blocks + S_ATTR_SELF_MODIFYING_CODE = 1 << 26, + // used with i386 code stubs written on by dyld + S_ATTR_DEBUG = 1 << 25, + // a debug section + S_ATTR_SOME_INSTRUCTIONS = 1 << 10, + // section contains some machine instructions + S_ATTR_EXT_RELOC = 1 << 9, + // section has external relocation entries + S_ATTR_LOC_RELOC = 1 << 8 + // section has local relocation entries + }; + + /// cmdSize - This routine returns the size of the MachOSection as written + /// to disk, depending on whether the destination is a 64 bit Mach-O file. + unsigned cmdSize(bool is64Bit) const { + if (is64Bit) + return 7 * sizeof(uint32_t) + 2 * sizeof(uint64_t) + 32; + else + return 9 * sizeof(uint32_t) + 32; // addresses only 32 bits + } + + MachOSection(const std::string &seg, const std::string §) + : sectname(sect), segname(seg), addr(0), size(0), offset(0), align(0), + reloff(0), nreloc(0), flags(0), reserved1(0), reserved2(0), + reserved3(0) { } + }; + + /// SectionList - This is the list of sections that we have emitted to the + /// file. Once the file has been completely built, the segment load command + /// SectionCommands are constructed from this info. + std::list SectionList; + + /// SectionLookup - This is a mapping from section name to SectionList entry + std::map SectionLookup; + + /// getSection - Return the section with the specified name, creating a new + /// section if one does not already exist. + MachOSection &getSection(const std::string &seg, const std::string §, + unsigned Flags = 0) { + MachOSection *&SN = SectionLookup[seg+sect]; + if (SN) return *SN; + + SectionList.push_back(MachOSection(seg, sect)); + SN = &SectionList.back(); + SN->Index = SectionList.size(); + SN->flags = MachOSection::S_REGULAR | Flags; + return *SN; + } + MachOSection &getTextSection() { + return getSection("__TEXT", "__text", + MachOSection::S_ATTR_PURE_INSTRUCTIONS | + MachOSection::S_ATTR_SOME_INSTRUCTIONS); + } + + /// MachOSymTab - This struct contains information about the offsets and + /// size of symbol table information. + /// segment. + struct MachOSymTab { + uint32_t cmd; // LC_SYMTAB + uint32_t cmdsize; // sizeof( MachOSymTab ) + uint32_t symoff; // symbol table offset + uint32_t nsyms; // number of symbol table entries + uint32_t stroff; // string table offset + uint32_t strsize; // string table size in bytes + + // Constants for the cmd field + // see + enum { LC_SYMTAB = 0x02 // link-edit stab symbol table info + }; + + MachOSymTab() : cmd(LC_SYMTAB), cmdsize(6 * sizeof(uint32_t)), symoff(0), + nsyms(0), stroff(0), strsize(0) { } + }; + + /// MachOSymTab - This struct contains information about the offsets and + /// size of symbol table information. + /// segment. + struct MachODySymTab { + uint32_t cmd; // LC_DYSYMTAB + uint32_t cmdsize; // sizeof( MachODySymTab ) + uint32_t ilocalsym; // index to local symbols + uint32_t nlocalsym; // number of local symbols + uint32_t iextdefsym; // index to externally defined symbols + uint32_t nextdefsym; // number of externally defined symbols + uint32_t iundefsym; // index to undefined symbols + uint32_t nundefsym; // number of undefined symbols + uint32_t tocoff; // file offset to table of contents + uint32_t ntoc; // number of entries in table of contents + uint32_t modtaboff; // file offset to module table + uint32_t nmodtab; // number of module table entries + uint32_t extrefsymoff; // offset to referenced symbol table + uint32_t nextrefsyms; // number of referenced symbol table entries + uint32_t indirectsymoff; // file offset to the indirect symbol table + uint32_t nindirectsyms; // number of indirect symbol table entries + uint32_t extreloff; // offset to external relocation entries + uint32_t nextrel; // number of external relocation entries + uint32_t locreloff; // offset to local relocation entries + uint32_t nlocrel; // number of local relocation entries + + // Constants for the cmd field + // see + enum { LC_DYSYMTAB = 0x0B // dynamic link-edit symbol table info + }; + + MachODySymTab() : cmd(LC_DYSYMTAB), cmdsize(20 * sizeof(uint32_t)), + ilocalsym(0), nlocalsym(0), iextdefsym(0), nextdefsym(0), + iundefsym(0), nundefsym(0), tocoff(0), ntoc(0), modtaboff(0), + nmodtab(0), extrefsymoff(0), nextrefsyms(0), indirectsymoff(0), + nindirectsyms(0), extreloff(0), nextrel(0), locreloff(0), nlocrel(0) { } + }; + + /// SymTab - The "stab" style symbol table information + MachOSymTab SymTab; + /// DySymTab - symbol table info for the dynamic link editor + MachODySymTab DySymTab; + + /// MachOSym - This struct contains information about each symbol that is + /// added to logical symbol table for the module. This is eventually + /// turned into a real symbol table in the file. + struct MachOSym { + const GlobalValue *GV; // The global value this corresponds to. + uint32_t n_strx; // index into the string table + uint8_t n_type; // type flag + uint8_t n_sect; // section number or NO_SECT + int16_t n_desc; // see + uint64_t n_value; // value for this symbol (or stab offset) + + // Constants for the n_sect field + // see + enum { NO_SECT = 0 }; // symbol is not in any section + + // Constants for the n_type field + // see + enum { N_UNDF = 0x0, // undefined, n_sect == NO_SECT + N_ABS = 0x2, // absolute, n_sect == NO_SECT + N_SECT = 0xe, // defined in section number n_sect + N_PBUD = 0xc, // prebound undefined (defined in a dylib) + N_INDR = 0xa // indirect + }; + // The following bits are OR'd into the types above. For example, a type + // of 0x0f would be an external N_SECT symbol (0x0e | 0x01). + enum { N_EXT = 0x01, // external symbol bit + N_PEXT = 0x10 // private external symbol bit + }; + + // Constants for the n_desc field + // see + enum { REFERENCE_FLAG_UNDEFINED_NON_LAZY = 0, + REFERENCE_FLAG_UNDEFINED_LAZY = 1, + REFERENCE_FLAG_DEFINED = 2, + REFERENCE_FLAG_PRIVATE_DEFINED = 3, + REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY = 4, + REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY = 5 + }; + enum { N_NO_DEAD_STRIP = 0x0020, // symbol is not to be dead stripped + N_WEAK_REF = 0x0040, // symbol is weak referenced + N_WEAK_DEF = 0x0080 // coalesced symbol is a weak definition + }; + + /// entrySize - This routine returns the size of a symbol table entry as + /// written to disk. + static unsigned entrySize() { return 12; } + + MachOSym(const GlobalValue *gv, uint8_t sect) : GV(gv), n_strx(0), + n_type(N_UNDF), n_sect(sect), n_desc(0), n_value(0) {} + }; + + /// SymbolTable - This is the list of symbols we have emitted to the file. + /// This actually gets rearranged before emission to the file (to put the + /// local symbols first in the list). + std::vector SymbolTable; + + /// DynamicSymbolTable - This is just a vector of indices into + /// SymbolTable to aid in emitting the DYSYMTAB load command. + std::vector DynamicSymbolTable; + + /// StringTable - The table of strings referenced by SymbolTable entries + std::vector StringTable; + + // align - Emit padding into the file until the current output position is + // aligned to the specified power of two boundary. + static void align(DataBuffer &Output, unsigned Boundary) { + assert(Boundary && (Boundary & (Boundary-1)) == 0 && + "Must align to 2^k boundary"); + size_t Size = Output.size(); + if (Size & (Boundary-1)) { + // Add padding to get alignment to the correct place. + size_t Pad = Boundary-(Size & (Boundary-1)); + Output.resize(Size+Pad); + } + } + + void outbyte(DataBuffer &Output, unsigned char X) { + Output.push_back(X); + } + void outhalf(DataBuffer &Output, unsigned short X) { + if (isLittleEndian) { + Output.push_back(X&255); + Output.push_back(X >> 8); + } else { + Output.push_back(X >> 8); + Output.push_back(X&255); + } + } + void outword(DataBuffer &Output, unsigned X) { + if (isLittleEndian) { + Output.push_back((X >> 0) & 255); + Output.push_back((X >> 8) & 255); + Output.push_back((X >> 16) & 255); + Output.push_back((X >> 24) & 255); + } else { + Output.push_back((X >> 24) & 255); + Output.push_back((X >> 16) & 255); + Output.push_back((X >> 8) & 255); + Output.push_back((X >> 0) & 255); + } + } + void outxword(DataBuffer &Output, uint64_t X) { + if (isLittleEndian) { + Output.push_back(unsigned(X >> 0) & 255); + Output.push_back(unsigned(X >> 8) & 255); + Output.push_back(unsigned(X >> 16) & 255); + Output.push_back(unsigned(X >> 24) & 255); + Output.push_back(unsigned(X >> 32) & 255); + Output.push_back(unsigned(X >> 40) & 255); + Output.push_back(unsigned(X >> 48) & 255); + Output.push_back(unsigned(X >> 56) & 255); + } else { + Output.push_back(unsigned(X >> 56) & 255); + Output.push_back(unsigned(X >> 48) & 255); + Output.push_back(unsigned(X >> 40) & 255); + Output.push_back(unsigned(X >> 32) & 255); + Output.push_back(unsigned(X >> 24) & 255); + Output.push_back(unsigned(X >> 16) & 255); + Output.push_back(unsigned(X >> 8) & 255); + Output.push_back(unsigned(X >> 0) & 255); + } + } + void outaddr32(DataBuffer &Output, unsigned X) { + outword(Output, X); + } + void outaddr64(DataBuffer &Output, uint64_t X) { + outxword(Output, X); + } + void outaddr(DataBuffer &Output, uint64_t X) { + if (!is64Bit) + outword(Output, (unsigned)X); + else + outxword(Output, X); + } + void outstring(DataBuffer &Output, std::string &S, unsigned Length) { + char *buffer = (char *)calloc(1, Length); + unsigned i; + // FIXME: it is unclear if mach-o requires null terminated strings, or + // if a string of 16 bytes with no null terminator is ok. If so, + // we should switch to strncpy. + strlcpy(buffer, S.c_str(), Length); + + for (i = 0; i < Length; ++i) + outbyte(Output, buffer[i]); + + free(buffer); + } + private: + void EmitGlobal(GlobalVariable *GV); + void EmitHeaderAndLoadCommands(); + void EmitSections(); + void EmitRelocations(); + void EmitSymbolTable(); + void EmitStringTable(); + }; + } + + #endif From natebegeman at mac.com Wed Aug 23 16:30:06 2006 From: natebegeman at mac.com (Nate Begeman) Date: Wed, 23 Aug 2006 16:30:06 -0500 Subject: [llvm-commits] CVS: llvm/tools/llc/llc.cpp Message-ID: <200608232130.k7NLU6Lp000954@zion.cs.uiuc.edu> Changes in directory llvm/tools/llc: llc.cpp updated: 1.137 -> 1.138 --- Log message: Make sure that both non-asm file types are marked as experimental --- Diffs of the changes: (+2 -1) llc.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/tools/llc/llc.cpp diff -u llvm/tools/llc/llc.cpp:1.137 llvm/tools/llc/llc.cpp:1.138 --- llvm/tools/llc/llc.cpp:1.137 Wed Aug 23 16:08:52 2006 +++ llvm/tools/llc/llc.cpp Wed Aug 23 16:29:52 2006 @@ -78,7 +78,8 @@ clEnumValN(TargetMachine::ObjectFile, "obj", " Emit a native object ('.o') file [experimental]"), clEnumValN(TargetMachine::DynamicLibrary, "dynlib", - " Emit a native dynamic library ('.so') file"), + " Emit a native dynamic library ('.so') file" + " [experimental]"), clEnumValEnd)); cl::opt NoVerify("disable-verify", cl::Hidden, From natebegeman at mac.com Wed Aug 23 16:33:41 2006 From: natebegeman at mac.com (Nate Begeman) Date: Wed, 23 Aug 2006 16:33:41 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachOWriter.h Message-ID: <200608232133.k7NLXfWB001014@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachOWriter.h updated: 1.1 -> 1.2 --- Log message: Correctly attribute file author & remote tabs --- Diffs of the changes: (+20 -20) MachOWriter.h | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-) Index: llvm/include/llvm/CodeGen/MachOWriter.h diff -u llvm/include/llvm/CodeGen/MachOWriter.h:1.1 llvm/include/llvm/CodeGen/MachOWriter.h:1.2 --- llvm/include/llvm/CodeGen/MachOWriter.h:1.1 Wed Aug 23 16:08:52 2006 +++ llvm/include/llvm/CodeGen/MachOWriter.h Wed Aug 23 16:33:27 2006 @@ -2,7 +2,7 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by Chris Lattner and is distributed under the +// This file was developed by Nate Begeman and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// @@ -75,13 +75,13 @@ /// MachOHeader - This struct contains the header information about a /// specific architecture type/subtype pair that is emitted to the file. struct MachOHeader { - uint32_t magic; // mach magic number identifier - uint32_t cputype; // cpu specifier - uint32_t cpusubtype; // machine specifier - uint32_t filetype; // type of file - uint32_t ncmds; // number of load commands - uint32_t sizeofcmds; // the size of all the load commands - uint32_t flags; // flags + uint32_t magic; // mach magic number identifier + uint32_t cputype; // cpu specifier + uint32_t cpusubtype; // machine specifier + uint32_t filetype; // type of file + uint32_t ncmds; // number of load commands + uint32_t sizeofcmds; // the size of all the load commands + uint32_t flags; // flags uint32_t reserved; // 64-bit only /// HeaderData - The actual data for the header which we are building @@ -254,18 +254,18 @@ /// turned into the SectionCommand in the load command for a particlar /// segment. struct MachOSection { - std::string sectname; // name of this section, - std::string segname; // segment this section goes in - uint64_t addr; // memory address of this section - uint64_t size; // size in bytes of this section - uint32_t offset; // file offset of this section - uint32_t align; // section alignment (power of 2) - uint32_t reloff; // file offset of relocation entries - uint32_t nreloc; // number of relocation entries - uint32_t flags; // flags (section type and attributes) - uint32_t reserved1; // reserved (for offset or index) - uint32_t reserved2; // reserved (for count or sizeof) - uint32_t reserved3; // reserved (64 bit only) + std::string sectname; // name of this section, + std::string segname; // segment this section goes in + uint64_t addr; // memory address of this section + uint64_t size; // size in bytes of this section + uint32_t offset; // file offset of this section + uint32_t align; // section alignment (power of 2) + uint32_t reloff; // file offset of relocation entries + uint32_t nreloc; // number of relocation entries + uint32_t flags; // flags (section type and attributes) + uint32_t reserved1; // reserved (for offset or index) + uint32_t reserved2; // reserved (for count or sizeof) + uint32_t reserved3; // reserved (64 bit only) /// A unique number for this section, which will be used to match symbols /// to the correct section. From lattner at cs.uiuc.edu Wed Aug 23 19:21:46 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 23 Aug 2006 19:21:46 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h Message-ID: <200608240021.k7O0LkrH003885@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: MRegisterInfo.h updated: 1.82 -> 1.83 --- Log message: update some comments --- Diffs of the changes: (+1 -2) MRegisterInfo.h | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/include/llvm/Target/MRegisterInfo.h diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.82 llvm/include/llvm/Target/MRegisterInfo.h:1.83 --- llvm/include/llvm/Target/MRegisterInfo.h:1.82 Thu Aug 17 17:00:07 2006 +++ llvm/include/llvm/Target/MRegisterInfo.h Wed Aug 23 19:21:32 2006 @@ -314,8 +314,7 @@ //===--------------------------------------------------------------------===// // Interfaces used by the register allocator and stack frame // manipulation passes to move data around between registers, - // immediates and memory. The return value is the number of - // instructions added to (negative if removed from) the basic block. + // immediates and memory. FIXME: Move these to TargetInstrInfo.h. // virtual void storeRegToStackSlot(MachineBasicBlock &MBB, From rafael.espindola at gmail.com Thu Aug 24 08:46:10 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Thu, 24 Aug 2006 08:46:10 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp ARMISelDAGToDAG.cpp ARMInstrInfo.td Message-ID: <200608241346.k7ODkAQG015612@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.11 -> 1.12 ARMISelDAGToDAG.cpp updated: 1.33 -> 1.34 ARMInstrInfo.td updated: 1.18 -> 1.19 --- Log message: initial support for branches --- Diffs of the changes: (+30 -3) ARMAsmPrinter.cpp | 3 +-- ARMISelDAGToDAG.cpp | 21 ++++++++++++++++++++- ARMInstrInfo.td | 9 +++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.11 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.12 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.11 Thu Aug 17 12:09:40 2006 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Thu Aug 24 08:45:54 2006 @@ -174,8 +174,7 @@ O << "#" << (int)MO.getImmedValue(); break; case MachineOperand::MO_MachineBasicBlock: - assert(0 && "not implemented"); - abort(); + printBasicBlockLabel(MO.getMachineBasicBlock()); return; case MachineOperand::MO_GlobalAddress: { GlobalValue *GV = MO.getGlobal(); Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.33 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.34 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.33 Mon Aug 21 17:00:32 2006 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Thu Aug 24 08:45:54 2006 @@ -53,6 +53,7 @@ setOperationAction(ISD::SETCC, MVT::i32, Expand); setOperationAction(ISD::SELECT_CC, MVT::i32, Custom); + setOperationAction(ISD::BR_CC, MVT::i32, Custom); setSchedulingPreference(SchedulingForRegPressure); computeRegisterProperties(); @@ -71,7 +72,9 @@ CMP, - SELECT + SELECT, + + BR }; } } @@ -83,6 +86,7 @@ case ARMISD::RET_FLAG: return "ARMISD::RET_FLAG"; case ARMISD::SELECT: return "ARMISD::SELECT"; case ARMISD::CMP: return "ARMISD::CMP"; + case ARMISD::BR: return "ARMISD::BR"; } } @@ -312,6 +316,19 @@ return DAG.getNode(ARMISD::SELECT, MVT::i32, FalseVal, TrueVal, Cmp); } +static SDOperand LowerBR_CC(SDOperand Op, SelectionDAG &DAG) { + SDOperand Chain = Op.getOperand(0); + ISD::CondCode CC = cast(Op.getOperand(1))->get(); + SDOperand LHS = Op.getOperand(2); + SDOperand RHS = Op.getOperand(3); + SDOperand Dest = Op.getOperand(4); + + assert(CC == ISD::SETNE); + + SDOperand Cmp = DAG.getNode(ARMISD::CMP, MVT::Flag, LHS, RHS); + return DAG.getNode(ARMISD::BR, MVT::Other, Chain, Dest, Cmp); +} + SDOperand ARMTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) { switch (Op.getOpcode()) { default: @@ -329,6 +346,8 @@ return LowerRET(Op, DAG); case ISD::SELECT_CC: return LowerSELECT_CC(Op, DAG); + case ISD::BR_CC: + return LowerBR_CC(Op, DAG); } } Index: llvm/lib/Target/ARM/ARMInstrInfo.td diff -u llvm/lib/Target/ARM/ARMInstrInfo.td:1.18 llvm/lib/Target/ARM/ARMInstrInfo.td:1.19 --- llvm/lib/Target/ARM/ARMInstrInfo.td:1.18 Mon Aug 21 17:00:32 2006 +++ llvm/lib/Target/ARM/ARMInstrInfo.td Thu Aug 24 08:45:55 2006 @@ -37,6 +37,8 @@ let Pattern = pattern; } +def brtarget : Operand; + def SDT_ARMCallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>; def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARMCallSeq, [SDNPHasChain, SDNPOutFlag]>; @@ -50,6 +52,9 @@ [SDNPHasChain, SDNPOptInFlag]>; def armselect : SDNode<"ARMISD::SELECT", SDTIntBinOp, [SDNPInFlag, SDNPOutFlag]>; +def SDTarmbr : SDTypeProfile<0, 1, [SDTCisVT<0, OtherVT>]>; +def armbr : SDNode<"ARMISD::BR", SDTarmbr, [SDNPHasChain, SDNPInFlag]>; + def SDTVoidBinOp : SDTypeProfile<0, 2, [SDTCisSameAs<0, 1>]>; def armcmp : SDNode<"ARMISD::CMP", SDTVoidBinOp, [SDNPOutFlag]>; @@ -107,6 +112,10 @@ [(set IntRegs:$dst, (armselect IntRegs:$true, IntRegs:$false))]>; } +def bne : InstARM<(ops brtarget:$dst), + "bne $dst", + [(armbr bb:$dst)]>; + def cmp : InstARM<(ops IntRegs:$a, IntRegs:$b), "cmp $a, $b", [(armcmp IntRegs:$a, IntRegs:$b)]>; From rafael.espindola at gmail.com Thu Aug 24 08:46:11 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Thu, 24 Aug 2006 08:46:11 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/branch.ll Message-ID: <200608241346.k7ODkBeX015617@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/ARM: branch.ll added (r1.1) --- Log message: initial support for branches --- Diffs of the changes: (+13 -0) branch.ll | 13 +++++++++++++ 1 files changed, 13 insertions(+) Index: llvm/test/Regression/CodeGen/ARM/branch.ll diff -c /dev/null llvm/test/Regression/CodeGen/ARM/branch.ll:1.1 *** /dev/null Thu Aug 24 08:46:05 2006 --- llvm/test/Regression/CodeGen/ARM/branch.ll Thu Aug 24 08:45:55 2006 *************** *** 0 **** --- 1,13 ---- + ; RUN: llvm-as < %s | llc -march=arm + void %f(int %a, int* %v) { + entry: + %tmp = seteq int %a, 0 ; [#uses=1] + br bool %tmp, label %cond_true, label %return + + cond_true: ; preds = %entry + store int 0, int* %v + ret void + + return: ; preds = %entry + ret void + } From reid at x10sys.com Thu Aug 24 09:25:53 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 24 Aug 2006 09:25:53 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachOWriter.h Message-ID: <200608241425.k7OEPrqo016262@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachOWriter.h updated: 1.2 -> 1.3 --- Log message: Remove a FIXME. Don't use strlcpy that isn't available on non-BSD platforms and ensure that a memory overrun won't occur while still writing Length bytes in the outstring function. --- Diffs of the changes: (+7 -9) MachOWriter.h | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) Index: llvm/include/llvm/CodeGen/MachOWriter.h diff -u llvm/include/llvm/CodeGen/MachOWriter.h:1.2 llvm/include/llvm/CodeGen/MachOWriter.h:1.3 --- llvm/include/llvm/CodeGen/MachOWriter.h:1.2 Wed Aug 23 16:33:27 2006 +++ llvm/include/llvm/CodeGen/MachOWriter.h Thu Aug 24 09:25:39 2006 @@ -575,17 +575,15 @@ outxword(Output, X); } void outstring(DataBuffer &Output, std::string &S, unsigned Length) { - char *buffer = (char *)calloc(1, Length); - unsigned i; - // FIXME: it is unclear if mach-o requires null terminated strings, or - // if a string of 16 bytes with no null terminator is ok. If so, - // we should switch to strncpy. - strlcpy(buffer, S.c_str(), Length); + unsigned len_to_copy = S.length() < Length ? S.length() : Length; + unsigned len_to_fill = S.length() < Length ? Length-S.length() : 0; - for (i = 0; i < Length; ++i) - outbyte(Output, buffer[i]); + for (unsigned i = 0; i < len_to_copy; ++i) + outbyte(Output, S[i]); + + for (unsigned i = 0; i < len_to_fill; ++i) + outbyte(Output, 0); - free(buffer); } private: void EmitGlobal(GlobalVariable *GV); From rafael.espindola at gmail.com Thu Aug 24 11:13:29 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Thu, 24 Aug 2006 11:13:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARM.h ARMAsmPrinter.cpp ARMISelDAGToDAG.cpp ARMInstrInfo.td Message-ID: <200608241613.k7OGDTKw018860@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARM.h updated: 1.1 -> 1.2 ARMAsmPrinter.cpp updated: 1.12 -> 1.13 ARMISelDAGToDAG.cpp updated: 1.34 -> 1.35 ARMInstrInfo.td updated: 1.19 -> 1.20 --- Log message: create a generic bcond instruction that has a conditional code argument --- Diffs of the changes: (+34 -8) ARM.h | 14 ++++++++++++++ ARMAsmPrinter.cpp | 3 ++- ARMISelDAGToDAG.cpp | 13 ++++++++++--- ARMInstrInfo.td | 12 ++++++++---- 4 files changed, 34 insertions(+), 8 deletions(-) Index: llvm/lib/Target/ARM/ARM.h diff -u llvm/lib/Target/ARM/ARM.h:1.1 llvm/lib/Target/ARM/ARM.h:1.2 --- llvm/lib/Target/ARM/ARM.h:1.1 Sun May 14 17:18:28 2006 +++ llvm/lib/Target/ARM/ARM.h Thu Aug 24 11:13:15 2006 @@ -20,6 +20,20 @@ #include namespace llvm { + // Enums corresponding to ARM condition codes + namespace ARMCC { + enum CondCodes { + NE + }; + } + + static const char *ARMCondCodeToString(ARMCC::CondCodes CC) { + switch (CC) { + default: assert(0 && "Unknown condition code"); + case ARMCC::NE: return "ne"; + } + } + class FunctionPass; class TargetMachine; Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.12 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.13 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.12 Thu Aug 24 08:45:54 2006 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Thu Aug 24 11:13:15 2006 @@ -201,7 +201,8 @@ } void ARMAsmPrinter::printCCOperand(const MachineInstr *MI, int opNum) { - assert(0 && "not implemented"); + int CC = (int)MI->getOperand(opNum).getImmedValue(); + O << ARMCondCodeToString((ARMCC::CondCodes)CC); } bool ARMAsmPrinter::doInitialization(Module &M) { Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.34 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.35 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.34 Thu Aug 24 08:45:54 2006 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Thu Aug 24 11:13:15 2006 @@ -79,6 +79,14 @@ } } +/// DAGCCToARMCC - Convert a DAG integer condition code to an ARM CC +static ARMCC::CondCodes DAGCCToARMCC(ISD::CondCode CC) { + switch (CC) { + default: assert(0 && "Unknown condition code!"); + case ISD::SETNE: return ARMCC::NE; + } +} + const char *ARMTargetLowering::getTargetNodeName(unsigned Opcode) const { switch (Opcode) { default: return 0; @@ -322,11 +330,10 @@ SDOperand LHS = Op.getOperand(2); SDOperand RHS = Op.getOperand(3); SDOperand Dest = Op.getOperand(4); - - assert(CC == ISD::SETNE); + SDOperand ARMCC = DAG.getConstant(DAGCCToARMCC(CC), MVT::i32); SDOperand Cmp = DAG.getNode(ARMISD::CMP, MVT::Flag, LHS, RHS); - return DAG.getNode(ARMISD::BR, MVT::Other, Chain, Dest, Cmp); + return DAG.getNode(ARMISD::BR, MVT::Other, Chain, Dest, ARMCC, Cmp); } SDOperand ARMTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) { Index: llvm/lib/Target/ARM/ARMInstrInfo.td diff -u llvm/lib/Target/ARM/ARMInstrInfo.td:1.19 llvm/lib/Target/ARM/ARMInstrInfo.td:1.20 --- llvm/lib/Target/ARM/ARMInstrInfo.td:1.19 Thu Aug 24 08:45:55 2006 +++ llvm/lib/Target/ARM/ARMInstrInfo.td Thu Aug 24 11:13:15 2006 @@ -39,6 +39,10 @@ def brtarget : Operand; +// Operand for printing out a condition code. +let PrintMethod = "printCCOperand" in + def CCOp : Operand; + def SDT_ARMCallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i32> ]>; def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_ARMCallSeq, [SDNPHasChain, SDNPOutFlag]>; @@ -52,7 +56,7 @@ [SDNPHasChain, SDNPOptInFlag]>; def armselect : SDNode<"ARMISD::SELECT", SDTIntBinOp, [SDNPInFlag, SDNPOutFlag]>; -def SDTarmbr : SDTypeProfile<0, 1, [SDTCisVT<0, OtherVT>]>; +def SDTarmbr : SDTypeProfile<0, 2, [SDTCisVT<0, OtherVT>, SDTCisVT<1, i32>]>; def armbr : SDNode<"ARMISD::BR", SDTarmbr, [SDNPHasChain, SDNPInFlag]>; def SDTVoidBinOp : SDTypeProfile<0, 2, [SDTCisSameAs<0, 1>]>; @@ -112,9 +116,9 @@ [(set IntRegs:$dst, (armselect IntRegs:$true, IntRegs:$false))]>; } -def bne : InstARM<(ops brtarget:$dst), - "bne $dst", - [(armbr bb:$dst)]>; +def bcond : InstARM<(ops brtarget:$dst, CCOp:$cc), + "b$cc $dst", + [(armbr bb:$dst, imm:$cc)]>; def cmp : InstARM<(ops IntRegs:$a, IntRegs:$b), "cmp $a, $b", From rafael.espindola at gmail.com Thu Aug 24 12:19:22 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Thu, 24 Aug 2006 12:19:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARM.h ARMISelDAGToDAG.cpp ARMInstrInfo.td Message-ID: <200608241719.k7OHJM4X020029@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARM.h updated: 1.2 -> 1.3 ARMISelDAGToDAG.cpp updated: 1.35 -> 1.36 ARMInstrInfo.td updated: 1.20 -> 1.21 --- Log message: add the "eq" condition code implement a movcond instruction --- Diffs of the changes: (+13 -8) ARM.h | 4 +++- ARMISelDAGToDAG.cpp | 6 +++--- ARMInstrInfo.td | 11 +++++++---- 3 files changed, 13 insertions(+), 8 deletions(-) Index: llvm/lib/Target/ARM/ARM.h diff -u llvm/lib/Target/ARM/ARM.h:1.2 llvm/lib/Target/ARM/ARM.h:1.3 --- llvm/lib/Target/ARM/ARM.h:1.2 Thu Aug 24 11:13:15 2006 +++ llvm/lib/Target/ARM/ARM.h Thu Aug 24 12:19:08 2006 @@ -23,7 +23,8 @@ // Enums corresponding to ARM condition codes namespace ARMCC { enum CondCodes { - NE + NE, + EQ }; } @@ -31,6 +32,7 @@ switch (CC) { default: assert(0 && "Unknown condition code"); case ARMCC::NE: return "ne"; + case ARMCC::EQ: return "eq"; } } Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.35 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.36 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.35 Thu Aug 24 11:13:15 2006 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Thu Aug 24 12:19:08 2006 @@ -84,6 +84,7 @@ switch (CC) { default: assert(0 && "Unknown condition code!"); case ISD::SETNE: return ARMCC::NE; + case ISD::SETEQ: return ARMCC::EQ; } } @@ -317,11 +318,10 @@ ISD::CondCode CC = cast(Op.getOperand(4))->get(); SDOperand TrueVal = Op.getOperand(2); SDOperand FalseVal = Op.getOperand(3); - - assert(CC == ISD::SETEQ); + SDOperand ARMCC = DAG.getConstant(DAGCCToARMCC(CC), MVT::i32); SDOperand Cmp = DAG.getNode(ARMISD::CMP, MVT::Flag, LHS, RHS); - return DAG.getNode(ARMISD::SELECT, MVT::i32, FalseVal, TrueVal, Cmp); + return DAG.getNode(ARMISD::SELECT, MVT::i32, FalseVal, TrueVal, ARMCC, Cmp); } static SDOperand LowerBR_CC(SDOperand Op, SelectionDAG &DAG) { Index: llvm/lib/Target/ARM/ARMInstrInfo.td diff -u llvm/lib/Target/ARM/ARMInstrInfo.td:1.20 llvm/lib/Target/ARM/ARMInstrInfo.td:1.21 --- llvm/lib/Target/ARM/ARMInstrInfo.td:1.20 Thu Aug 24 11:13:15 2006 +++ llvm/lib/Target/ARM/ARMInstrInfo.td Thu Aug 24 12:19:08 2006 @@ -54,7 +54,10 @@ [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>; def retflag : SDNode<"ARMISD::RET_FLAG", SDTRet, [SDNPHasChain, SDNPOptInFlag]>; -def armselect : SDNode<"ARMISD::SELECT", SDTIntBinOp, [SDNPInFlag, SDNPOutFlag]>; + +def SDTarmselect : SDTypeProfile<1, 3, [SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisInt<0>, SDTCisVT<2, i32>]>; + +def armselect : SDNode<"ARMISD::SELECT", SDTarmselect, [SDNPInFlag, SDNPOutFlag]>; def SDTarmbr : SDTypeProfile<0, 2, [SDTCisVT<0, OtherVT>, SDTCisVT<1, i32>]>; def armbr : SDNode<"ARMISD::BR", SDTarmbr, [SDNPHasChain, SDNPInFlag]>; @@ -111,9 +114,9 @@ [(set IntRegs:$dst, (and IntRegs:$a, IntRegs:$b))]>; let isTwoAddress = 1 in { - def moveq : InstARM<(ops IntRegs:$dst, IntRegs:$false, IntRegs:$true), - "moveq $dst, $true", - [(set IntRegs:$dst, (armselect IntRegs:$true, IntRegs:$false))]>; + def movcond : InstARM<(ops IntRegs:$dst, IntRegs:$false, IntRegs:$true, CCOp:$cc), + "mov$cc $dst, $true", + [(set IntRegs:$dst, (armselect IntRegs:$true, IntRegs:$false, imm:$cc))]>; } def bcond : InstARM<(ops brtarget:$dst, CCOp:$cc), From reid at x10sys.com Thu Aug 24 13:58:51 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 24 Aug 2006 13:58:51 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.inc Message-ID: <200608241858.k7OIwpGK021813@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.inc updated: 1.55 -> 1.56 --- Log message: For PR797: http://llvm.org/PR797 : Adjust implementation to match the new interface after exception handling was removed in the Unix verison. NOTE: this hasn't been compiled yet! --- Diffs of the changes: (+37 -42) Path.inc | 79 +++++++++++++++++++++++++++++---------------------------------- 1 files changed, 37 insertions(+), 42 deletions(-) Index: llvm/lib/System/Win32/Path.inc diff -u llvm/lib/System/Win32/Path.inc:1.55 llvm/lib/System/Win32/Path.inc:1.56 --- llvm/lib/System/Win32/Path.inc:1.55 Wed Aug 23 02:30:48 2006 +++ llvm/lib/System/Win32/Path.inc Thu Aug 24 13:58:37 2006 @@ -310,22 +310,6 @@ return false; } -static bool AddPermissionBits(const std::string& Filename, int bits) { - DWORD attr = GetFileAttributes(Filename.c_str()); - - // If it doesn't exist, we're done. - if (attr == INVALID_FILE_ATTRIBUTES) - return false; - - // The best we can do to interpret Unix permission bits is to use - // the owner writable bit. - if ((attr & FILE_ATTRIBUTE_READONLY) && (bits & 0200)) { - if (!SetFileAttributes(Filename.c_str(), attr & ~FILE_ATTRIBUTE_READONLY)) - ThrowError(Filename + ": SetFileAttributes: "); - } - return true; -} - bool Path::makeReadableOnDisk(std::string* ErrMsg) { // All files are readable on Windows (ignoring security attributes). return false; @@ -469,8 +453,14 @@ return false; } +inline bool PathMsg(std::string* ErrMsg, const char* pathname, const char*msg) { + if (ErrMsg) + *ErrMsg = std::string(pathname) + ": " + std::string(msg); + return true; +} + bool -Path::createDirectoryOnDisk(bool create_parents) { +Path::createDirectoryOnDisk(bool create_parents, std::string* ErrMsg) { // Get a writeable copy of the path name size_t len = path.length(); char *pathname = reinterpret_cast(_alloca(len+2)); @@ -489,14 +479,17 @@ // Skip host name. next = strchr(pathname+2, '/'); if (next == NULL) - throw std::string(pathname) + ": badly formed remote directory"; + return PathMsg(ErrMsg, pathname, "badly formed remote directory"); + // Skip share name. next = strchr(next+1, '/'); if (next == NULL) - throw std::string(pathname) + ": badly formed remote directory"; + return PathMsg(ErrMsg, pathname,"badly formed remote directory"); + next++; if (*next == 0) - throw std::string(pathname) + ": badly formed remote directory"; + return PathMsg(ErrMsg, pathname, "badly formed remote directory"); + } else { if (pathname[1] == ':') next += 2; // skip drive letter @@ -511,43 +504,44 @@ next = strchr(next, '/'); *next = 0; if (!CreateDirectory(pathname, NULL)) - ThrowError(std::string(pathname) + ": Can't create directory: "); + return MakeErrMsg(ErrMsg, + std::string(pathname) + ": Can't create directory: "); *next++ = '/'; } } else { // Drop trailing slash. pathname[len-1] = 0; if (!CreateDirectory(pathname, NULL)) { - ThrowError(std::string(pathname) + ": Can't create directory: "); + return MakeErrMsg(, std::string(pathname) + ": Can't create directory: "); } } - return true; + return false; } bool -Path::createFileOnDisk() { +Path::createFileOnDisk(std::string* ErrMsg) { // Create the file HANDLE h = CreateFile(path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); if (h == INVALID_HANDLE_VALUE) - ThrowError(path + ": Can't create file: "); + return MakeErrMsg(ErrMsg, path + ": Can't create file: "); CloseHandle(h); - return true; + return false; } bool Path::eraseFromDisk(bool remove_contents, std::string *ErrStr) const { FileStatus Status; if (getFileStatus(Status, ErrStr)) - return true; + return false; if (Status.isFile) { DWORD attr = GetFileAttributes(path.c_str()); // If it doesn't exist, we're done. if (attr == INVALID_FILE_ATTRIBUTES) - return true; + return false; // Read-only files cannot be deleted on Windows. Must remove the read-only // attribute first. @@ -557,7 +551,7 @@ } if (!DeleteFile(path.c_str())) - ThrowError(path + ": Can't destroy file: "); + return MakeErrMsg(ErrStr, path + ": Can't destroy file: "); return false; } else if (Status.isDir) { // If it doesn't exist, we're done. @@ -618,10 +612,9 @@ return GetError(std::string(pathname) + ": Can't destroy directory: ", ErrStr); return false; - } else { - // It appears the path doesn't exist. - return true; - } + } + // It appears the path doesn't exist. + return true; } bool Path::getMagicNumber(std::string& Magic, unsigned len) const { @@ -710,19 +703,20 @@ return false; } -void -CopyFile(const sys::Path &Dest, const sys::Path &Src) { +bool +CopyFile(const sys::Path &Dest, const sys::Path &Src, std::string* ErrMsg) { // Can't use CopyFile macro defined in Windows.h because it would mess up the // above line. We use the expansion it would have in a non-UNICODE build. if (!::CopyFileA(Src.c_str(), Dest.c_str(), false)) - ThrowError("Can't copy '" + Src.toString() + + return MakeErrMsg(ErrMsg, "Can't copy '" + Src.toString() + "' to '" + Dest.toString() + "': "); + return false; } -void -Path::makeUnique(bool reuse_current) { +bool +Path::makeUnique(bool reuse_current, std::string* ErrMsg) { if (reuse_current && !exists()) - return; // File doesn't exist already, just use it! + return false; // File doesn't exist already, just use it! // Reserve space for -XXXXXX at the end. char *FNBuffer = (char*) alloca(path.size()+8); @@ -739,10 +733,11 @@ FCounter = 0; path = FNBuffer; } while (exists()); + return false; } bool -Path::createTemporaryFileOnDisk(bool reuse_current) { +Path::createTemporaryFileOnDisk(bool reuse_current, std::string* ErrMsg) { // Make this into a unique file name makeUnique(reuse_current); @@ -750,10 +745,10 @@ HANDLE h = CreateFile(path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); if (h == INVALID_HANDLE_VALUE) - return false; + return MakeErrMsg(ErrMsg, path.toString() + ": can't create file"); CloseHandle(h); - return true; + return false; } } From resistor at mac.com Thu Aug 24 16:28:34 2006 From: resistor at mac.com (Owen Anderson) Date: Thu, 24 Aug 2006 16:28:34 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnroll.cpp Message-ID: <200608242128.k7OLSYL0024436@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopUnroll.cpp updated: 1.23 -> 1.24 --- Log message: Implement unrolling of multiblock loops. This significantly improves the utility of the LoopUnroll pass. Also, add a testcase for multiblock-loop unrolling. --- Diffs of the changes: (+124 -126) LoopUnroll.cpp | 250 ++++++++++++++++++++++++++++----------------------------- 1 files changed, 124 insertions(+), 126 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.23 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.24 --- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.23 Thu Jul 20 14:06:16 2006 +++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp Thu Aug 24 16:28:19 2006 @@ -11,8 +11,9 @@ // been canonicalized by the -indvars pass, allowing it to determine the trip // counts of loops easily. // -// This pass is currently extremely limited. It only currently only unrolls -// single basic block loops that execute a constant number of times. +// This pass will multi-block loops only if they contain no non-unrolled +// subloops. The process of unrolling can produce extraneous basic blocks +// linked with unconditional branches. This will be corrected in the future. // //===----------------------------------------------------------------------===// @@ -53,7 +54,9 @@ /// virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredID(LoopSimplifyID); + AU.addRequiredID(LCSSAID); AU.addRequired(); + AU.addPreservedID(LCSSAID); AU.addPreserved(); } }; @@ -125,12 +128,10 @@ for (unsigned i = 0, e = SubLoops.size(); i != e; ++i) Changed |= visitLoop(SubLoops[i]); - // We only handle single basic block loops right now. - if (L->getBlocks().size() != 1) - return Changed; + BasicBlock* Header = L->getHeader(); + BasicBlock* LatchBlock = L->getLoopLatch(); - BasicBlock *BB = L->getHeader(); - BranchInst *BI = dyn_cast(BB->getTerminator()); + BranchInst *BI = dyn_cast(LatchBlock->getTerminator()); if (BI == 0) return Changed; // Must end in a conditional branch ConstantInt *TripCountC = dyn_cast_or_null(L->getTripCount()); @@ -141,9 +142,9 @@ return Changed; // More than 2^32 iterations??? unsigned LoopSize = ApproximateLoopSize(L); - DEBUG(std::cerr << "Loop Unroll: F[" << BB->getParent()->getName() - << "] Loop %" << BB->getName() << " Loop Size = " << LoopSize - << " Trip Count = " << TripCountFull << " - "); + DEBUG(std::cerr << "Loop Unroll: F[" << Header->getParent()->getName() + << "] Loop %" << Header->getName() << " Loop Size = " + << LoopSize << " Trip Count = " << TripCountFull << " - "); uint64_t Size = (uint64_t)LoopSize*TripCountFull; if (Size > UnrollThreshold) { DEBUG(std::cerr << "TOO LARGE: " << Size << ">" << UnrollThreshold << "\n"); @@ -151,114 +152,160 @@ } DEBUG(std::cerr << "UNROLLING!\n"); - unsigned TripCount = (unsigned)TripCountFull; + std::vector LoopBlocks = L->getBlocks(); - BasicBlock *LoopExit = BI->getSuccessor(L->contains(BI->getSuccessor(0))); + unsigned TripCount = (unsigned)TripCountFull; - // Create a new basic block to temporarily hold all of the cloned code. - BasicBlock *NewBlock = new BasicBlock(); + BasicBlock *LoopExit = BI->getSuccessor(L->contains(BI->getSuccessor(0))); // For the first iteration of the loop, we should use the precloned values for // PHI nodes. Insert associations now. std::map LastValueMap; std::vector OrigPHINode; - for (BasicBlock::iterator I = BB->begin(); isa(I); ++I) { + for (BasicBlock::iterator I = Header->begin(); isa(I); ++I) { PHINode *PN = cast(I); OrigPHINode.push_back(PN); - if (Instruction *I =dyn_cast(PN->getIncomingValueForBlock(BB))) - if (I->getParent() == BB) + if (Instruction *I = + dyn_cast(PN->getIncomingValueForBlock(LatchBlock))) + if (L->contains(I->getParent())) LastValueMap[I] = I; } // Remove the exit branch from the loop - BB->getInstList().erase(BI); + LatchBlock->getInstList().erase(BI); + + std::vector Headers; + std::vector Latches; + Headers.push_back(Header); + Latches.push_back(LatchBlock); assert(TripCount != 0 && "Trip count of 0 is impossible!"); for (unsigned It = 1; It != TripCount; ++It) { char SuffixBuffer[100]; sprintf(SuffixBuffer, ".%d", It); - std::map ValueMap; - BasicBlock *New = CloneBasicBlock(BB, ValueMap, SuffixBuffer); + + std::vector NewBlocks; + + for (std::vector::iterator BB = LoopBlocks.begin(), + E = LoopBlocks.end(); BB != E; ++BB) { + std::map ValueMap; + BasicBlock *New = CloneBasicBlock(*BB, ValueMap, SuffixBuffer); + Header->getParent()->getBasicBlockList().push_back(New); + + // Loop over all of the PHI nodes in the block, changing them to use the + // incoming values from the previous block. + if (*BB == Header) + for (unsigned i = 0, e = OrigPHINode.size(); i != e; ++i) { + PHINode *NewPHI = cast(ValueMap[OrigPHINode[i]]); + Value *InVal = NewPHI->getIncomingValueForBlock(LatchBlock); + if (Instruction *InValI = dyn_cast(InVal)) + if (It > 1 && L->contains(InValI->getParent())) + InVal = LastValueMap[InValI]; + ValueMap[OrigPHINode[i]] = InVal; + New->getInstList().erase(NewPHI); + } + + // Update our running map of newest clones + LastValueMap[*BB] = New; + for (std::map::iterator VI = ValueMap.begin(), + VE = ValueMap.end(); VI != VE; ++VI) + LastValueMap[VI->first] = VI->second; + + L->addBasicBlockToLoop(New, *LI); + + // Add phi entries for newly created values to all exit blocks except + // the successor of the latch block. The successor of the exit block will + // be updated specially after unrolling all the way. + if (*BB != LatchBlock) + for (Value::use_iterator UI = (*BB)->use_begin(), UE = (*BB)->use_end(); + UI != UE; ++UI) { + Instruction* UseInst = cast(*UI); + if (isa(UseInst) && !L->contains(UseInst->getParent())) { + PHINode* phi = cast(UseInst); + Value* Incoming = phi->getIncomingValueForBlock(*BB); + if (isa(Incoming)) + Incoming = LastValueMap[Incoming]; + + phi->addIncoming(Incoming, New); + } + } + + // Keep track of new headers and latches as we create them, so that + // we can insert the proper branches later. + if (*BB == Header) + Headers.push_back(New); + if (*BB == LatchBlock) + Latches.push_back(New); - // Loop over all of the PHI nodes in the block, changing them to use the - // incoming values from the previous block. - for (unsigned i = 0, e = OrigPHINode.size(); i != e; ++i) { - PHINode *NewPHI = cast(ValueMap[OrigPHINode[i]]); - Value *InVal = NewPHI->getIncomingValueForBlock(BB); - if (Instruction *InValI = dyn_cast(InVal)) - if (InValI->getParent() == BB) - InVal = LastValueMap[InValI]; - ValueMap[OrigPHINode[i]] = InVal; - New->getInstList().erase(NewPHI); + NewBlocks.push_back(New); } - - for (BasicBlock::iterator I = New->begin(), E = New->end(); I != E; ++I) - RemapInstruction(I, ValueMap); - - // Now that all of the instructions are remapped, splice them into the end - // of the NewBlock. - NewBlock->getInstList().splice(NewBlock->end(), New->getInstList()); - delete New; - - // LastValue map now contains values from this iteration. - std::swap(LastValueMap, ValueMap); + + // Remap all instructions in the most recent iteration + for (unsigned i = 0; i < NewBlocks.size(); ++i) + for (BasicBlock::iterator I = NewBlocks[i]->begin(), + E = NewBlocks[i]->end(); I != E; ++I) + RemapInstruction(I, LastValueMap); } - // If there was more than one iteration, replace any uses of values computed - // in the loop with values computed during the last iteration of the loop. - if (TripCount != 1) { - std::set Users; - for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) - Users.insert(I->use_begin(), I->use_end()); - - // We don't want to reprocess entries with PHI nodes in them. For this - // reason, we look at each operand of each user exactly once, performing the - // substitution exactly once. - for (std::set::iterator UI = Users.begin(), E = Users.end(); UI != E; - ++UI) { - Instruction *I = cast(*UI); - if (I->getParent() != BB && I->getParent() != NewBlock) - RemapInstruction(I, LastValueMap); + // Insert the branches that link the different iterations together + for (unsigned i = 0; i < Latches.size()-1; ++i) + new BranchInst(Headers[i+1], Latches[i]); + + // Finally, add an unconditional branch to the block to continue into the exit + // block. + new BranchInst(LoopExit, Latches[Latches.size()-1]); + + // Update PHI nodes that reference the final latch block + if (TripCount > 1) { + std::set Users; + for (Value::use_iterator UI = LatchBlock->use_begin(), + UE = LatchBlock->use_end(); UI != UE; ++UI) + if (PHINode* phi = dyn_cast(*UI)) + Users.insert(phi); + + for (std::set::iterator SI = Users.begin(), SE = Users.end(); + SI != SE; ++SI) { + Value* InVal = (*SI)->getIncomingValueForBlock(LatchBlock); + if (isa(InVal)) + InVal = LastValueMap[InVal]; + (*SI)->removeIncomingValue(LatchBlock, false); + (*SI)->addIncoming(InVal, cast(LastValueMap[LatchBlock])); } } - // Now that we cloned the block as many times as we needed, stitch the new - // code into the original block and delete the temporary block. - BB->getInstList().splice(BB->end(), NewBlock->getInstList()); - delete NewBlock; - // Now loop over the PHI nodes in the original block, setting them to their // incoming values. BasicBlock *Preheader = L->getLoopPreheader(); for (unsigned i = 0, e = OrigPHINode.size(); i != e; ++i) { PHINode *PN = OrigPHINode[i]; PN->replaceAllUsesWith(PN->getIncomingValueForBlock(Preheader)); - BB->getInstList().erase(PN); - } - - // Finally, add an unconditional branch to the block to continue into the exit - // block. - new BranchInst(LoopExit, BB); + Header->getInstList().erase(PN); + } // At this point, the code is well formed. We now do a quick sweep over the // inserted code, doing constant propagation and dead code elimination as we // go. - for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) { - Instruction *Inst = I++; - - if (isInstructionTriviallyDead(Inst)) - BB->getInstList().erase(Inst); - else if (Constant *C = ConstantFoldInstruction(Inst)) { - Inst->replaceAllUsesWith(C); - BB->getInstList().erase(Inst); + const std::vector &NewLoopBlocks = L->getBlocks(); + for (std::vector::const_iterator BB = NewLoopBlocks.begin(), + E = NewLoopBlocks.end(); BB != E; ++BB) + for (BasicBlock::iterator I = (*BB)->begin(), E = (*BB)->end(); I != E; ) { + Instruction *Inst = I++; + + if (isInstructionTriviallyDead(Inst)) + (*BB)->getInstList().erase(Inst); + else if (Constant *C = ConstantFoldInstruction(Inst)) { + Inst->replaceAllUsesWith(C); + (*BB)->getInstList().erase(Inst); + } } - } // Update the loop information for this loop. Loop *Parent = L->getParentLoop(); // Move all of the basic blocks in the loop into the parent loop. - LI->changeLoopFor(BB, Parent); + for (std::vector::const_iterator BB = NewLoopBlocks.begin(), + E = NewLoopBlocks.end(); BB != E; ++BB) + LI->changeLoopFor(*BB, Parent); // Remove the loop from the parent. if (Parent) @@ -266,55 +313,6 @@ else delete LI->removeLoop(std::find(LI->begin(), LI->end(), L)); - // Remove single-entry Phis from the exit block. - for (BasicBlock::iterator ExitInstr = LoopExit->begin(); - PHINode* PN = dyn_cast(ExitInstr); ++ExitInstr) { - assert(PN->getNumIncomingValues() == 1 - && "Block should only have one pred, so Phi's must be single entry"); - PN->replaceAllUsesWith(PN->getOperand(0)); - PN->eraseFromParent(); - } - - // FIXME: Should update dominator analyses - - // Now that everything is up-to-date that will be, we fold the loop block into - // the preheader and exit block, updating our analyses as we go. - LoopExit->getInstList().splice(LoopExit->begin(), BB->getInstList(), - BB->getInstList().begin(), - prior(BB->getInstList().end())); - LoopExit->getInstList().splice(LoopExit->begin(), Preheader->getInstList(), - Preheader->getInstList().begin(), - prior(Preheader->getInstList().end())); - - // Make all other blocks in the program branch to LoopExit now instead of - // Preheader. - Preheader->replaceAllUsesWith(LoopExit); - - Function *F = LoopExit->getParent(); - if (Parent) { - // Otherwise, if this is a sub-loop, and the preheader was the loop header - // of the parent loop, move the exit block to be the new parent loop header. - if (Parent->getHeader() == Preheader) { - assert(Parent->contains(LoopExit) && - "Exit block isn't contained in parent?"); - Parent->moveToHeader(LoopExit); - } - } else { - // If the preheader was the entry block of this function, move the exit - // block to be the new entry of the function. - if (Preheader == &F->front()) - F->getBasicBlockList().splice(F->begin(), - F->getBasicBlockList(), LoopExit); - } - - // Remove BB and LoopExit from our analyses. - LI->removeBlock(Preheader); - LI->removeBlock(BB); - - // Actually delete the blocks now. - F->getBasicBlockList().erase(Preheader); - F->getBasicBlockList().erase(BB); - ++NumUnrolled; return true; } From resistor at mac.com Thu Aug 24 16:28:35 2006 From: resistor at mac.com (Owen Anderson) Date: Thu, 24 Aug 2006 16:28:35 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll Message-ID: <200608242128.k7OLSZpp024441@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/LoopUnroll: 2006-08-24-MultiBlockLoop.ll added (r1.1) --- Log message: Implement unrolling of multiblock loops. This significantly improves the utility of the LoopUnroll pass. Also, add a testcase for multiblock-loop unrolling. --- Diffs of the changes: (+18 -0) 2006-08-24-MultiBlockLoop.ll | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+) Index: llvm/test/Regression/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll diff -c /dev/null llvm/test/Regression/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll:1.1 *** /dev/null Thu Aug 24 16:28:29 2006 --- llvm/test/Regression/Transforms/LoopUnroll/2006-08-24-MultiBlockLoop.ll Thu Aug 24 16:28:19 2006 *************** *** 0 **** --- 1,18 ---- + ; RUN: llvm-as < %s | opt -loop-unroll | llvm-dis | grep "bb72.2" + + void %vorbis_encode_noisebias_setup() { + entry: + br label %cond_true.outer + + cond_true.outer: + %indvar1.ph = phi uint [ 0, %entry ], [ %indvar.next2, %bb72 ] + br label %bb72 + + bb72: + %indvar.next2 = add uint %indvar1.ph, 1 + %exitcond3 = seteq uint %indvar.next2, 3 + br bool %exitcond3, label %cond_true138, label %cond_true.outer + + cond_true138: + ret void + } From reid at x10sys.com Thu Aug 24 17:39:39 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 24 Aug 2006 17:39:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/GraphWriter.cpp Message-ID: <200608242239.k7OMddgp026540@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: GraphWriter.cpp updated: 1.4 -> 1.5 --- Log message: Remove a character to avoid line exceeding 80 cols. --- Diffs of the changes: (+1 -1) GraphWriter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Support/GraphWriter.cpp diff -u llvm/lib/Support/GraphWriter.cpp:1.4 llvm/lib/Support/GraphWriter.cpp:1.5 --- llvm/lib/Support/GraphWriter.cpp:1.4 Mon Aug 21 01:04:45 2006 +++ llvm/lib/Support/GraphWriter.cpp Thu Aug 24 17:39:25 2006 @@ -77,7 +77,7 @@ if (sys::Program::ExecuteAndWait(dotty, &args[0],0,0,0,&ErrMsg)) { std::cerr << "Error viewing graph: " << ErrMsg << "\n"; } else { -#ifdef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns. +#ifdef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns return; #endif } From reid at x10sys.com Thu Aug 24 17:41:34 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 24 Aug 2006 17:41:34 -0500 Subject: [llvm-commits] CVS: llvm/autoconf/m4/bison.m4 Message-ID: <200608242241.k7OMfYt6026612@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: bison.m4 updated: 1.4 -> 1.5 --- Log message: For PR738: http://llvm.org/PR738 : Demote check for bison from error to warning and make sure that the makefile can handle an empty definition for BISON variable. --- Diffs of the changes: (+3 -2) bison.m4 | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/autoconf/m4/bison.m4 diff -u llvm/autoconf/m4/bison.m4:1.4 llvm/autoconf/m4/bison.m4:1.5 --- llvm/autoconf/m4/bison.m4:1.4 Mon Dec 13 03:37:41 2004 +++ llvm/autoconf/m4/bison.m4 Thu Aug 24 17:41:20 2006 @@ -8,7 +8,8 @@ AC_DEFUN([AC_PROG_BISON], [AC_CACHE_CHECK([],[llvm_cv_has_bison],[AC_PROG_YACC()]) if test "$YACC" != "bison -y"; then - AC_MSG_ERROR([bison not found but required]) + AC_SUBST(BISON,[]) + AC_MSG_WARN([bison not found, can't rebuild grammars]) else - AC_SUBST(BISON,[bison],[location of bison]) + AC_SUBST(BISON,[bison]) fi]) From reid at x10sys.com Thu Aug 24 17:41:36 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 24 Aug 2006 17:41:36 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules configure Message-ID: <200608242241.k7OMfaH9026622@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.395 -> 1.396 configure updated: 1.248 -> 1.249 --- Log message: For PR738: http://llvm.org/PR738 : Demote check for bison from error to warning and make sure that the makefile can handle an empty definition for BISON variable. --- Diffs of the changes: (+7 -3) Makefile.rules | 4 ++++ configure | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.395 llvm/Makefile.rules:1.396 --- llvm/Makefile.rules:1.395 Fri Aug 18 12:22:07 2006 +++ llvm/Makefile.rules Thu Aug 24 17:41:20 2006 @@ -1315,10 +1315,14 @@ # Rule for building the bison based parsers... $(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y +ifneq ($(BISON),) $(Echo) "Bisoning $*.y" $(Verb) $(BISON) -v -d -p $(&5 echo "${ECHO_T}$llvm_cv_has_bison" >&6; } if test "$YACC" != "bison -y"; then - { { echo "$as_me:$LINENO: error: bison not found but required" >&5 -echo "$as_me: error: bison not found but required" >&2;} - { (exit 1); exit 1; }; } + + { echo "$as_me:$LINENO: WARNING: bison not found, can't rebuild grammars" >&5 +echo "$as_me: WARNING: bison not found, can't rebuild grammars" >&2;} else BISON=bison From lattner at cs.uiuc.edu Thu Aug 24 17:44:11 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 24 Aug 2006 17:44:11 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveInterval.h LiveIntervalAnalysis.h Message-ID: <200608242244.k7OMiBgM026698@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveInterval.h updated: 1.19 -> 1.20 LiveIntervalAnalysis.h updated: 1.53 -> 1.54 --- Log message: Take advantage of the recent improvements to the liveintervals set (tracking instructions which define each value#) to simplify and improve the coallescer. In particular, this patch: 1. Implements iterative coallescing. 2. Reverts an unsafe hack from handlePhysRegDef, superceeding it with a better solution. 3. Implements PR865: http://llvm.org/PR865 , "coallescing" away the second copy in code like: A = B ... B = A This also includes changes to symbolically print registers in intervals when possible. --- Diffs of the changes: (+62 -17) LiveInterval.h | 25 +++++++++++++++++++--- LiveIntervalAnalysis.h | 54 ++++++++++++++++++++++++++++++++++++------------- 2 files changed, 62 insertions(+), 17 deletions(-) Index: llvm/include/llvm/CodeGen/LiveInterval.h diff -u llvm/include/llvm/CodeGen/LiveInterval.h:1.19 llvm/include/llvm/CodeGen/LiveInterval.h:1.20 --- llvm/include/llvm/CodeGen/LiveInterval.h:1.19 Tue Aug 22 13:19:46 2006 +++ llvm/include/llvm/CodeGen/LiveInterval.h Thu Aug 24 17:43:55 2006 @@ -82,7 +82,7 @@ /// InstDefiningValue - This tracks the def index of the instruction that /// defines a particular value number in the interval. This may be ~0, - /// which is treated as unknown. + /// which is treated as unknown, or ~1, which is a deleted value number. SmallVector InstDefiningValue; public: @@ -116,10 +116,13 @@ std::swap(weight, other.weight); std::swap(ranges, other.ranges); std::swap(NumValues, other.NumValues); + std::swap(InstDefiningValue, other.InstDefiningValue); } bool containsOneValue() const { return NumValues == 1; } + unsigned getNumValNums() const { return NumValues; } + /// getNextValue - Create a new value number and return it. MIIdx specifies /// the instruction that defines the value number. unsigned getNextValue(unsigned MIIdx) { @@ -138,6 +141,12 @@ void setInstDefiningValNum(unsigned ValNo, unsigned MIIdx) { InstDefiningValue[ValNo] = MIIdx; } + + /// MergeValueNumberInto - This method is called when two value nubmers + /// are found to be equivalent. This eliminates V1, replacing all + /// LiveRanges with the V1 value number with the V2 value number. This can + /// cause merging of V1/V2 values numbers and compaction of the value space. + void MergeValueNumberInto(unsigned V1, unsigned V2); bool empty() const { return ranges.empty(); } @@ -163,9 +172,19 @@ /// getLiveRangeContaining - Return the live range that contains the /// specified index, or null if there is none. - const LiveRange *getLiveRangeContaining(unsigned Idx) const; - + const LiveRange *getLiveRangeContaining(unsigned Idx) const { + const_iterator I = FindLiveRangeContaining(Idx); + return I == end() ? 0 : &*I; + } + /// FindLiveRangeContaining - Return an iterator to the live range that + /// contains the specified index, or end() if there is none. + const_iterator FindLiveRangeContaining(unsigned Idx) const; + + /// FindLiveRangeContaining - Return an iterator to the live range that + /// contains the specified index, or end() if there is none. + iterator FindLiveRangeContaining(unsigned Idx); + /// joinable - Two intervals are joinable if the either don't overlap at all /// or if the destination of the copy is a single assignment value, and it /// only overlaps with one value in the source interval. Index: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h diff -u llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.53 llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.54 --- llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.53 Fri May 12 01:06:34 2006 +++ llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h Thu Aug 24 17:43:55 2006 @@ -53,8 +53,18 @@ std::vector allocatableRegs_; public: - struct InstrSlots - { + struct CopyRec { + MachineInstr *MI; + unsigned SrcReg, DstReg; + }; + CopyRec getCopyRec(MachineInstr *MI, unsigned SrcReg, unsigned DstReg) { + CopyRec R; + R.MI = MI; + R.SrcReg = SrcReg; + R.DstReg = DstReg; + return R; + } + struct InstrSlots { enum { LOAD = 0, USE = 1, @@ -133,16 +143,37 @@ virtual void print(std::ostream &O, const Module* = 0) const; private: + /// RemoveMachineInstrFromMaps - This marks the specified machine instr as + /// deleted. + void RemoveMachineInstrFromMaps(MachineInstr *MI) { + // remove index -> MachineInstr and + // MachineInstr -> index mappings + Mi2IndexMap::iterator mi2i = mi2iMap_.find(MI); + if (mi2i != mi2iMap_.end()) { + i2miMap_[mi2i->second/InstrSlots::NUM] = 0; + mi2iMap_.erase(mi2i); + } + } + /// computeIntervals - compute live intervals void computeIntervals(); /// joinIntervals - join compatible live intervals void joinIntervals(); - /// joinIntervalsInMachineBB - Join intervals based on move - /// instructions in the specified basic block. - void joinIntervalsInMachineBB(MachineBasicBlock *MBB); - + /// CopyCoallesceInMBB - Coallsece copies in the specified MBB, putting + /// copies that cannot yet be coallesced into the "TryAgain" list. + void CopyCoallesceInMBB(MachineBasicBlock *MBB, + std::vector &TryAgain); + + /// JoinCopy - Attempt to join intervals corresponding to SrcReg/DstReg, + /// which are the src/dst of the copy instruction CopyMI. This returns true + /// if the copy was successfully coallesced away, or if it is never possible + /// to coallesce these this copy, due to register constraints. It returns + /// false if it is not currently possible to coallesce this interval, but + /// it may be possible if other things get coallesced. + bool JoinCopy(MachineInstr *CopyMI, unsigned SrcReg, unsigned DstReg); + /// handleRegisterDef - update intervals for a register def /// (calls handlePhysicalRegisterDef and /// handleVirtualRegisterDef) @@ -157,14 +188,10 @@ LiveInterval& interval); /// handlePhysicalRegisterDef - update intervals for a physical register - /// def. If the defining instruction is a move instruction, SrcReg will be - /// the input register, and DestReg will be the result. Note that Interval - /// may not match DestReg (it might be an alias instead). - /// + /// def. void handlePhysicalRegisterDef(MachineBasicBlock* mbb, MachineBasicBlock::iterator mi, LiveInterval& interval, - unsigned SrcReg, unsigned DestReg, bool isLiveIn = false); /// Return true if the two specified registers belong to different @@ -172,9 +199,8 @@ bool differingRegisterClasses(unsigned RegA, unsigned RegB) const; - bool AdjustIfAllOverlappingRangesAreCopiesFrom(LiveInterval &IntA, - LiveInterval &IntB, - unsigned CopyIdx); + bool AdjustCopiesBackFrom(LiveInterval &IntA, LiveInterval &IntB, + MachineInstr *CopyMI, unsigned CopyIdx); bool overlapsAliases(const LiveInterval *lhs, const LiveInterval *rhs) const; From lattner at cs.uiuc.edu Thu Aug 24 17:44:12 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 24 Aug 2006 17:44:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp LiveIntervalAnalysis.cpp VirtRegMap.cpp Message-ID: <200608242244.k7OMiC19026707@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveInterval.cpp updated: 1.28 -> 1.29 LiveIntervalAnalysis.cpp updated: 1.166 -> 1.167 VirtRegMap.cpp updated: 1.70 -> 1.71 --- Log message: Take advantage of the recent improvements to the liveintervals set (tracking instructions which define each value#) to simplify and improve the coallescer. In particular, this patch: 1. Implements iterative coallescing. 2. Reverts an unsafe hack from handlePhysRegDef, superceeding it with a better solution. 3. Implements PR865: http://llvm.org/PR865 , "coallescing" away the second copy in code like: A = B ... B = A This also includes changes to symbolically print registers in intervals when possible. --- Diffs of the changes: (+332 -223) LiveInterval.cpp | 91 +++++++++- LiveIntervalAnalysis.cpp | 424 ++++++++++++++++++++++++++--------------------- VirtRegMap.cpp | 40 +--- 3 files changed, 332 insertions(+), 223 deletions(-) Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.28 llvm/lib/CodeGen/LiveInterval.cpp:1.29 --- llvm/lib/CodeGen/LiveInterval.cpp:1.28 Tue Aug 22 13:19:46 2006 +++ llvm/lib/CodeGen/LiveInterval.cpp Thu Aug 24 17:43:55 2006 @@ -346,18 +346,29 @@ /// getLiveRangeContaining - Return the live range that contains the /// specified index, or null if there is none. -const LiveRange *LiveInterval::getLiveRangeContaining(unsigned Idx) const { - Ranges::const_iterator It = std::upper_bound(ranges.begin(),ranges.end(),Idx); +LiveInterval::const_iterator +LiveInterval::FindLiveRangeContaining(unsigned Idx) const { + const_iterator It = std::upper_bound(begin(), end(), Idx); if (It != ranges.begin()) { - const LiveRange &LR = *prior(It); - if (LR.contains(Idx)) - return &LR; + --It; + if (It->contains(Idx)) + return It; } - return 0; + return end(); } - +LiveInterval::iterator +LiveInterval::FindLiveRangeContaining(unsigned Idx) { + iterator It = std::upper_bound(begin(), end(), Idx); + if (It != ranges.begin()) { + --It; + if (It->contains(Idx)) + return It; + } + + return end(); +} /// join - Join two live intervals (this, and other) together. This operation /// is the result of a copy instruction in the source program, that occurs at @@ -376,6 +387,7 @@ std::swap(MergedSrcValIdx, MergedDstValIdx); std::swap(ranges, Other.ranges); std::swap(NumValues, Other.NumValues); + std::swap(InstDefiningValue, Other.InstDefiningValue); } // Join the ranges of other into the ranges of this interval. @@ -394,10 +406,73 @@ InsertPos = addRangeFrom(*I, InsertPos); } - + + // Update the value number information for the value number defined by the + // copy. The copy is about to be removed, so ensure that the value is defined + // by whatever the other value is defined by. + if (InstDefiningValue[MergedDstValIdx] == CopyIdx) { + InstDefiningValue[MergedDstValIdx] = + Other.InstDefiningValue[MergedSrcValIdx]; + } + weight += Other.weight; } +/// MergeValueNumberInto - This method is called when two value nubmers +/// are found to be equivalent. This eliminates V1, replacing all +/// LiveRanges with the V1 value number with the V2 value number. This can +/// cause merging of V1/V2 values numbers and compaction of the value space. +void LiveInterval::MergeValueNumberInto(unsigned V1, unsigned V2) { + assert(V1 != V2 && "Identical value#'s are always equivalent!"); + + // This code actually merges the (numerically) larger value number into the + // smaller value number, which is likely to allow us to compactify the value + // space. The only thing we have to be careful of is to preserve the + // instruction that defines the result value. + + // Make sure V2 is smaller than V1. + if (V1 < V2) { + setInstDefiningValNum(V1, getInstForValNum(V2)); + std::swap(V1, V2); + } + + // Merge V1 live ranges into V2. + for (iterator I = begin(); I != end(); ) { + iterator LR = I++; + if (LR->ValId != V1) continue; // Not a V1 LiveRange. + + // Okay, we found a V1 live range. If it had a previous, touching, V2 live + // range, extend it. + if (LR != begin()) { + iterator Prev = LR-1; + if (Prev->ValId == V2 && Prev->end == LR->start) { + Prev->end = LR->end; + + // Erase this live-range. + ranges.erase(LR); + I = Prev+1; + LR = Prev; + } + } + + // Okay, now we have a V1 or V2 live range that is maximally merged forward. + // Ensure that it is a V2 live-range. + LR->ValId = V2; + + // If we can merge it into later V2 live ranges, do so now. We ignore any + // following V1 live ranges, as they will be merged in subsequent iterations + // of the loop. + if (I != end()) { + if (I->start == LR->end && I->ValId == V2) { + LR->end = I->end; + ranges.erase(I); + I = LR+1; + } + } + } +} + + std::ostream& llvm::operator<<(std::ostream& os, const LiveRange &LR) { return os << '[' << LR.start << ',' << LR.end << ':' << LR.ValId << ")"; } Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.166 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.167 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.166 Tue Aug 22 13:19:46 2006 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Thu Aug 24 17:43:55 2006 @@ -61,8 +61,7 @@ cl::init(true)); } -void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const -{ +void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); AU.addPreservedID(PHIEliminationID); AU.addRequiredID(PHIEliminationID); @@ -71,8 +70,7 @@ MachineFunctionPass::getAnalysisUsage(AU); } -void LiveIntervals::releaseMemory() -{ +void LiveIntervals::releaseMemory() { mi2iMap_.clear(); i2miMap_.clear(); r2iMap_.clear(); @@ -140,10 +138,10 @@ for (MachineFunction::livein_iterator I = fn.livein_begin(), E = fn.livein_end(); I != E; ++I) { handlePhysicalRegisterDef(Entry, Entry->begin(), - getOrCreateInterval(I->first), 0, 0, true); + getOrCreateInterval(I->first), true); for (const unsigned* AS = mri_->getAliasSet(I->first); *AS; ++AS) handlePhysicalRegisterDef(Entry, Entry->begin(), - getOrCreateInterval(*AS), 0, 0, true); + getOrCreateInterval(*AS), true); } } @@ -179,13 +177,7 @@ (RegRep = rep(srcReg)) == rep(dstReg)) { // remove from def list LiveInterval &interval = getOrCreateInterval(RegRep); - // remove index -> MachineInstr and - // MachineInstr -> index mappings - Mi2IndexMap::iterator mi2i = mi2iMap_.find(mii); - if (mi2i != mi2iMap_.end()) { - i2miMap_[mi2i->second/InstrSlots::NUM] = 0; - mi2iMap_.erase(mi2i); - } + RemoveMachineInstrFromMaps(mii); mii = mbbi->erase(mii); ++numPeep; } @@ -252,8 +244,8 @@ assert(li.weight != HUGE_VAL && "attempt to spill already spilled interval!"); - DEBUG(std::cerr << "\t\t\t\tadding intervals for spills for interval: " - << li << '\n'); + DEBUG(std::cerr << "\t\t\t\tadding intervals for spills for interval: "; + li.print(std::cerr, mri_); std::cerr << '\n'); const TargetRegisterClass* rc = mf_->getSSARegMap()->getRegClass(li.reg); @@ -341,7 +333,8 @@ // a def, we can't do this. if (!mop.isUse()) NewRegLiveIn = 0; - DEBUG(std::cerr << "\t\t\t\tadded new interval: " << nI << '\n'); + DEBUG(std::cerr << "\t\t\t\tadded new interval: "; + nI.print(std::cerr, mri_); std::cerr << '\n'); } } } @@ -478,7 +471,7 @@ if (lv_->RegisterDefIsDead(mi, interval.reg)) interval.addRange(LiveRange(RedefIndex, RedefIndex+1, 0)); - DEBUG(std::cerr << "RESULT: " << interval); + DEBUG(std::cerr << "RESULT: "; interval.print(std::cerr, mri_)); } else { // Otherwise, this must be because of phi elimination. If this is the @@ -492,17 +485,17 @@ MachineInstr *Killer = vi.Kills[0]; unsigned Start = getInstructionIndex(Killer->getParent()->begin()); unsigned End = getUseIndex(getInstructionIndex(Killer))+1; - DEBUG(std::cerr << "Removing [" << Start << "," << End << "] from: " - << interval << "\n"); + DEBUG(std::cerr << "Removing [" << Start << "," << End << "] from: "; + interval.print(std::cerr, mri_); std::cerr << "\n"); interval.removeRange(Start, End); - DEBUG(std::cerr << "RESULT: " << interval); + DEBUG(std::cerr << "RESULT: "; interval.print(std::cerr, mri_)); // Replace the interval with one of a NEW value number. Note that this // value number isn't actually defined by an instruction, weird huh? :) LiveRange LR(Start, End, interval.getNextValue(~0U)); DEBUG(std::cerr << " replace range with " << LR); interval.addRange(LR); - DEBUG(std::cerr << "RESULT: " << interval); + DEBUG(std::cerr << "RESULT: "; interval.print(std::cerr, mri_)); } // In the case of PHI elimination, each variable definition is only @@ -523,7 +516,6 @@ void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock *MBB, MachineBasicBlock::iterator mi, LiveInterval& interval, - unsigned SrcReg, unsigned DestReg, bool isLiveIn) { // A physical register cannot be live across basic block, so its // lifetime must end somewhere in its defining basic block. @@ -564,44 +556,7 @@ exit: assert(start < end && "did not find end of interval?"); - // Finally, if this is defining a new range for the physical register, and if - // that physreg is just a copy from a vreg, and if THAT vreg was a copy from - // the physreg, then the new fragment has the same value as the one copied - // into the vreg. - if (interval.reg == DestReg && !interval.empty() && - MRegisterInfo::isVirtualRegister(SrcReg)) { - - // Get the live interval for the vreg, see if it is defined by a copy. - LiveInterval &SrcInterval = getOrCreateInterval(SrcReg); - - if (SrcInterval.containsOneValue()) { - assert(!SrcInterval.empty() && "Can't contain a value and be empty!"); - - // Get the first index of the first range. Though the interval may have - // multiple liveranges in it, we only check the first. - unsigned StartIdx = SrcInterval.begin()->start; - MachineInstr *SrcDefMI = getInstructionFromIndex(StartIdx); - - // Check to see if the vreg was defined by a copy instruction, and that - // the source was this physreg. - unsigned VRegSrcSrc, VRegSrcDest; - if (tii_->isMoveInstr(*SrcDefMI, VRegSrcSrc, VRegSrcDest) && - SrcReg == VRegSrcDest && VRegSrcSrc == DestReg) { - // Okay, now we know that the vreg was defined by a copy from this - // physreg. Find the value number being copied and use it as the value - // for this range. - const LiveRange *DefRange = interval.getLiveRangeContaining(StartIdx-1); - if (DefRange) { - LiveRange LR(start, end, DefRange->ValId); - interval.addRange(LR); - DEBUG(std::cerr << " +" << LR << '\n'); - return; - } - } - } - } - - LiveRange LR(start, end, interval.getNextValue(start)); + LiveRange LR(start, end, interval.getNextValue(isLiveIn ? ~0U : start)); interval.addRange(LR); DEBUG(std::cerr << " +" << LR << '\n'); } @@ -612,15 +567,9 @@ if (MRegisterInfo::isVirtualRegister(reg)) handleVirtualRegisterDef(MBB, MI, getOrCreateInterval(reg)); else if (allocatableRegs_[reg]) { - unsigned SrcReg = 0, DestReg = 0; - if (!tii_->isMoveInstr(*MI, SrcReg, DestReg)) - SrcReg = DestReg = 0; - - handlePhysicalRegisterDef(MBB, MI, getOrCreateInterval(reg), - SrcReg, DestReg); + handlePhysicalRegisterDef(MBB, MI, getOrCreateInterval(reg)); for (const unsigned* AS = mri_->getAliasSet(reg); *AS; ++AS) - handlePhysicalRegisterDef(MBB, MI, getOrCreateInterval(*AS), - SrcReg, DestReg); + handlePhysicalRegisterDef(MBB, MI, getOrCreateInterval(*AS)); } } @@ -628,8 +577,7 @@ /// registers. for some ordering of the machine instructions [1,N] a /// live interval is an interval [i, j) where 1 <= i <= j < N for /// which a variable is live -void LiveIntervals::computeIntervals() -{ +void LiveIntervals::computeIntervals() { DEBUG(std::cerr << "********** COMPUTING LIVE INTERVALS **********\n"); DEBUG(std::cerr << "********** Function: " << ((Value*)mf_->getFunction())->getName() << '\n'); @@ -664,131 +612,200 @@ } } -/// IntA is defined as a copy from IntB and we know it only has one value -/// number. If all of the places that IntA and IntB overlap are defined by -/// copies from IntA to IntB, we know that these two ranges can really be -/// merged if we adjust the value numbers. If it is safe, adjust the value -/// numbers and return true, allowing coalescing to occur. -bool LiveIntervals:: -AdjustIfAllOverlappingRangesAreCopiesFrom(LiveInterval &IntA, - LiveInterval &IntB, - unsigned CopyIdx) { - std::vector Ranges; - IntA.getOverlapingRanges(IntB, CopyIdx, Ranges); - - assert(!Ranges.empty() && "Why didn't we do a simple join of this?"); - - unsigned IntBRep = rep(IntB.reg); - - // Check to see if all of the overlaps (entries in Ranges) are defined by a - // copy from IntA. If not, exit. - for (unsigned i = 0, e = Ranges.size(); i != e; ++i) { - unsigned Idx = Ranges[i]->start; - MachineInstr *MI = getInstructionFromIndex(Idx); - unsigned SrcReg, DestReg; - if (!tii_->isMoveInstr(*MI, SrcReg, DestReg)) return false; +/// AdjustCopiesBackFrom - We found a non-trivially-coallescable copy with IntA +/// being the source and IntB being the dest, thus this defines a value number +/// in IntB. If the source value number (in IntA) is defined by a copy from B, +/// see if we can merge these two pieces of B into a single value number, +/// eliminating a copy. For example: +/// +/// A3 = B0 +/// ... +/// B1 = A3 <- this copy +/// +/// In this case, B0 can be extended to where the B1 copy lives, allowing the B1 +/// value number to be replaced with B0 (which simplifies the B liveinterval). +/// +/// This returns true if an interval was modified. +/// +bool LiveIntervals::AdjustCopiesBackFrom(LiveInterval &IntA, LiveInterval &IntB, + MachineInstr *CopyMI, + unsigned CopyIdx) { + // BValNo is a value number in B that is defined by a copy from A. 'B3' in + // the example above. + LiveInterval::iterator BLR = IntB.FindLiveRangeContaining(CopyIdx); + unsigned BValNo = BLR->ValId; + + // Get the location that B is defined at. Two options: either this value has + // an unknown definition point or it is defined at CopyIdx. If unknown, we + // can't process it. + unsigned BValNoDefIdx = IntB.getInstForValNum(BValNo); + if (BValNoDefIdx == ~0U) return false; + assert(BValNoDefIdx == CopyIdx && + "Copy doesn't define the value?"); + + // AValNo is the value number in A that defines the copy, A0 in the example. + LiveInterval::iterator AValLR = IntA.FindLiveRangeContaining(CopyIdx-1); + unsigned AValNo = AValLR->ValId; + + // If AValNo is defined as a copy from IntB, we can potentially process this. + + // Get the instruction that defines this value number. + unsigned AValNoInstIdx = IntA.getInstForValNum(AValNo); + + // If it's unknown, ignore it. + if (AValNoInstIdx == ~0U || AValNoInstIdx == ~1U) return false; + // Otherwise, get the instruction for it. + MachineInstr *AValNoInstMI = getInstructionFromIndex(AValNoInstIdx); - // If this copy isn't actually defining this range, it must be a live - // range spanning basic blocks or something. - if (rep(DestReg) != rep(IntA.reg)) return false; + // If the value number is not defined by a copy instruction, ignore it. + unsigned SrcReg, DstReg; + if (!tii_->isMoveInstr(*AValNoInstMI, SrcReg, DstReg)) + return false; - // Check to see if this is coming from IntB. If not, bail out. - if (rep(SrcReg) != IntBRep) return false; - } - - // Okay, we can change this one. Get the IntB value number that IntA is - // copied from. - unsigned ActualValNo = IntA.getLiveRangeContaining(CopyIdx-1)->ValId; + // If the source register comes from an interval other than IntB, we can't + // handle this. + assert(rep(DstReg) == IntA.reg && "Not defining a reg in IntA?"); + if (rep(SrcReg) != IntB.reg) return false; + + // Get the LiveRange in IntB that this value number starts with. + LiveInterval::iterator ValLR = IntB.FindLiveRangeContaining(AValNoInstIdx-1); - // Change all of the value numbers to the same as what we IntA is copied from. - for (unsigned i = 0, e = Ranges.size(); i != e; ++i) - Ranges[i]->ValId = ActualValNo; + // Make sure that the end of the live range is inside the same block as + // CopyMI. + MachineInstr *ValLREndInst = getInstructionFromIndex(ValLR->end-1); + if (ValLREndInst->getParent() != CopyMI->getParent()) return false; + + // Okay, we now know that ValLR ends in the same block that the CopyMI + // live-range starts. If there are no intervening live ranges between them in + // IntB, we can merge them. + if (ValLR+1 != BLR) return false; + DEBUG(std::cerr << "\nExtending: "; IntB.print(std::cerr, mri_)); + + // Okay, we can merge them. We need to insert a new liverange: + // [ValLR.end, BLR.begin) of either value number, then we merge the + // two value numbers. + IntB.addRange(LiveRange(ValLR->end, BLR->start, BValNo)); + + // Okay, merge "B1" into the same value number as "B0". + if (BValNo != ValLR->ValId) + IntB.MergeValueNumberInto(BValNo, ValLR->ValId); + DEBUG(std::cerr << " result = "; IntB.print(std::cerr, mri_); + std::cerr << "\n"); + + // Finally, delete the copy instruction. + RemoveMachineInstrFromMaps(CopyMI); + CopyMI->eraseFromParent(); + ++numPeep; return true; } -void LiveIntervals::joinIntervalsInMachineBB(MachineBasicBlock *MBB) { - DEBUG(std::cerr << ((Value*)MBB->getBasicBlock())->getName() << ":\n"); - for (MachineBasicBlock::iterator mi = MBB->begin(), mie = MBB->end(); - mi != mie; ++mi) { - DEBUG(std::cerr << getInstructionIndex(mi) << '\t' << *mi); - - // we only join virtual registers with allocatable - // physical registers since we do not have liveness information - // on not allocatable physical registers - unsigned SrcReg, DestReg; - if (tii_->isMoveInstr(*mi, SrcReg, DestReg) && - (MRegisterInfo::isVirtualRegister(SrcReg) || allocatableRegs_[SrcReg])&& - (MRegisterInfo::isVirtualRegister(DestReg)||allocatableRegs_[DestReg])){ - - // Get representative registers. - SrcReg = rep(SrcReg); - DestReg = rep(DestReg); - - // If they are already joined we continue. - if (SrcReg == DestReg) - continue; - - // If they are both physical registers, we cannot join them. - if (MRegisterInfo::isPhysicalRegister(SrcReg) && - MRegisterInfo::isPhysicalRegister(DestReg)) - continue; - - // If they are not of the same register class, we cannot join them. - if (differingRegisterClasses(SrcReg, DestReg)) - continue; - - LiveInterval &SrcInt = getInterval(SrcReg); - LiveInterval &DestInt = getInterval(DestReg); - assert(SrcInt.reg == SrcReg && DestInt.reg == DestReg && - "Register mapping is horribly broken!"); - - DEBUG(std::cerr << "\t\tInspecting "; SrcInt.print(std::cerr, mri_); - std::cerr << " and "; DestInt.print(std::cerr, mri_); - std::cerr << ": "); - - // If two intervals contain a single value and are joined by a copy, it - // does not matter if the intervals overlap, they can always be joined. - bool Joinable = SrcInt.containsOneValue() && DestInt.containsOneValue(); +/// JoinCopy - Attempt to join intervals corresponding to SrcReg/DstReg, +/// which are the src/dst of the copy instruction CopyMI. This returns true +/// if the copy was successfully coallesced away, or if it is never possible +/// to coallesce these this copy, due to register constraints. It returns +/// false if it is not currently possible to coallesce this interval, but +/// it may be possible if other things get coallesced. +bool LiveIntervals::JoinCopy(MachineInstr *CopyMI, + unsigned SrcReg, unsigned DstReg) { + + + DEBUG(std::cerr << getInstructionIndex(CopyMI) << '\t' << *CopyMI); + + // Get representative registers. + SrcReg = rep(SrcReg); + DstReg = rep(DstReg); + + // If they are already joined we continue. + if (SrcReg == DstReg) { + DEBUG(std::cerr << "\tCopy already coallesced.\n"); + return true; // Not coallescable. + } + + // If they are both physical registers, we cannot join them. + if (MRegisterInfo::isPhysicalRegister(SrcReg) && + MRegisterInfo::isPhysicalRegister(DstReg)) { + DEBUG(std::cerr << "\tCan not coallesce physregs.\n"); + return true; // Not coallescable. + } + + // We only join virtual registers with allocatable physical registers. + if (MRegisterInfo::isPhysicalRegister(SrcReg) && !allocatableRegs_[SrcReg]){ + DEBUG(std::cerr << "\tSrc reg is unallocatable physreg.\n"); + return true; // Not coallescable. + } + if (MRegisterInfo::isPhysicalRegister(DstReg) && !allocatableRegs_[DstReg]){ + DEBUG(std::cerr << "\tDst reg is unallocatable physreg.\n"); + return true; // Not coallescable. + } + + // If they are not of the same register class, we cannot join them. + if (differingRegisterClasses(SrcReg, DstReg)) { + DEBUG(std::cerr << "\tSrc/Dest are different register classes.\n"); + return true; // Not coallescable. + } + + LiveInterval &SrcInt = getInterval(SrcReg); + LiveInterval &DestInt = getInterval(DstReg); + assert(SrcInt.reg == SrcReg && DestInt.reg == DstReg && + "Register mapping is horribly broken!"); + + DEBUG(std::cerr << "\t\tInspecting "; SrcInt.print(std::cerr, mri_); + std::cerr << " and "; DestInt.print(std::cerr, mri_); + std::cerr << ": "); + + // If two intervals contain a single value and are joined by a copy, it + // does not matter if the intervals overlap, they can always be joined. + + bool Joinable = SrcInt.containsOneValue() && DestInt.containsOneValue(); + + unsigned MIDefIdx = getDefIndex(getInstructionIndex(CopyMI)); + + // If the intervals think that this is joinable, do so now. + if (!Joinable && DestInt.joinable(SrcInt, MIDefIdx)) + Joinable = true; + + // If DestInt is actually a copy from SrcInt (which we know) that is used + // to define another value of SrcInt, we can change the other range of + // SrcInt to be the value of the range that defines DestInt, simplying the + // interval an promoting coallescing. + if (!Joinable && AdjustCopiesBackFrom(SrcInt, DestInt, CopyMI, MIDefIdx)) + return true; + + // If this looks joinable, do the final, expensive last check, checking to see + // if aliases overlap. If they do, we can never join these. + if (Joinable && overlapsAliases(&SrcInt, &DestInt)) { + DEBUG(std::cerr << "Alias Overlap Interference!\n"); + return true; // Can never join these. + } + + if (!Joinable) { + DEBUG(std::cerr << "Interference!\n"); + return false; + } - unsigned MIDefIdx = getDefIndex(getInstructionIndex(mi)); - - // If the intervals think that this is joinable, do so now. - if (!Joinable && DestInt.joinable(SrcInt, MIDefIdx)) - Joinable = true; - - // If DestInt is actually a copy from SrcInt (which we know) that is used - // to define another value of SrcInt, we can change the other range of - // SrcInt to be the value of the range that defines DestInt, allowing a - // coalesce. - if (!Joinable && DestInt.containsOneValue() && - AdjustIfAllOverlappingRangesAreCopiesFrom(SrcInt, DestInt, MIDefIdx)) - Joinable = true; - - if (!Joinable || overlapsAliases(&SrcInt, &DestInt)) { - DEBUG(std::cerr << "Interference!\n"); - } else { - DestInt.join(SrcInt, MIDefIdx); - DEBUG(std::cerr << "Joined. Result = " << DestInt << "\n"); - - if (!MRegisterInfo::isPhysicalRegister(SrcReg)) { - r2iMap_.erase(SrcReg); - r2rMap_[SrcReg] = DestReg; - } else { - // Otherwise merge the data structures the other way so we don't lose - // the physreg information. - r2rMap_[DestReg] = SrcReg; - DestInt.reg = SrcReg; - SrcInt.swap(DestInt); - r2iMap_.erase(DestReg); - } - ++numJoins; - } - } + DestInt.join(SrcInt, MIDefIdx); + DEBUG(std::cerr << "\n\t\tJoined. Result = "; DestInt.print(std::cerr, mri_); + std::cerr << "\n"); + + if (!MRegisterInfo::isPhysicalRegister(SrcReg)) { + r2iMap_.erase(SrcReg); + r2rMap_[SrcReg] = DstReg; + } else { + // Otherwise merge the data structures the other way so we don't lose + // the physreg information. + r2rMap_[DstReg] = SrcReg; + DestInt.reg = SrcReg; + SrcInt.swap(DestInt); + r2iMap_.erase(DstReg); } + ++numJoins; + return true; } + + namespace { // DepthMBBCompare - Comparison predicate that sort first based on the loop // depth of the basic block (the unsigned), and then on the MBB number. @@ -802,15 +819,36 @@ }; } + +void LiveIntervals::CopyCoallesceInMBB(MachineBasicBlock *MBB, + std::vector &TryAgain) { + DEBUG(std::cerr << ((Value*)MBB->getBasicBlock())->getName() << ":\n"); + + for (MachineBasicBlock::iterator MII = MBB->begin(), E = MBB->end(); + MII != E;) { + MachineInstr *Inst = MII++; + + // If this isn't a copy, we can't join intervals. + unsigned SrcReg, DstReg; + if (!tii_->isMoveInstr(*Inst, SrcReg, DstReg)) continue; + + if (!JoinCopy(Inst, SrcReg, DstReg)) + TryAgain.push_back(getCopyRec(Inst, SrcReg, DstReg)); + } +} + + void LiveIntervals::joinIntervals() { DEBUG(std::cerr << "********** JOINING INTERVALS ***********\n"); + std::vector TryAgainList; + const LoopInfo &LI = getAnalysis(); if (LI.begin() == LI.end()) { // If there are no loops in the function, join intervals in function order. for (MachineFunction::iterator I = mf_->begin(), E = mf_->end(); I != E; ++I) - joinIntervalsInMachineBB(I); + CopyCoallesceInMBB(I, TryAgainList); } else { // Otherwise, join intervals in inner loops before other intervals. // Unfortunately we can't just iterate over loop hierarchy here because @@ -825,9 +863,25 @@ // Finally, join intervals in loop nest order. for (unsigned i = 0, e = MBBs.size(); i != e; ++i) - joinIntervalsInMachineBB(MBBs[i].second); + CopyCoallesceInMBB(MBBs[i].second, TryAgainList); } + // Joining intervals can allow other intervals to be joined. Iteratively join + // until we make no progress. + bool ProgressMade = true; + while (ProgressMade) { + ProgressMade = false; + + for (unsigned i = 0, e = TryAgainList.size(); i != e; ++i) { + CopyRec &TheCopy = TryAgainList[i]; + if (TheCopy.MI && + JoinCopy(TheCopy.MI, TheCopy.SrcReg, TheCopy.DstReg)) { + TheCopy.MI = 0; // Mark this one as done. + ProgressMade = true; + } + } + } + DEBUG(std::cerr << "*** Register mapping ***\n"); DEBUG(for (int i = 0, e = r2rMap_.size(); i != e; ++i) if (r2rMap_[i]) { Index: llvm/lib/CodeGen/VirtRegMap.cpp diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.70 llvm/lib/CodeGen/VirtRegMap.cpp:1.71 --- llvm/lib/CodeGen/VirtRegMap.cpp:1.70 Mon Aug 21 02:33:33 2006 +++ llvm/lib/CodeGen/VirtRegMap.cpp Thu Aug 24 17:43:55 2006 @@ -521,7 +521,6 @@ // Process all of the spilled uses and all non spilled reg references. for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) { MachineOperand &MO = MI.getOperand(i); - if (!MO.isRegister() || MO.getReg() == 0) continue; // Ignore non-register operands. @@ -791,37 +790,16 @@ } if (!OpTakenCareOf) { + // Check to see if this is a noop copy. If so, eliminate the + // instruction before considering the dest reg to be changed. unsigned Src, Dst; - if (TII->isMoveInstr(MI, Src, Dst)) { - if (Src == Dst) { - // Check to see if this is a noop copy. If so, eliminate - // the instruction before considering the dest reg to be - // changed. - ++NumDCE; - DEBUG(std::cerr << "Removing now-noop copy: " << MI); - MBB.erase(&MI); - VRM.RemoveFromFoldedVirtMap(&MI); - goto ProcessNextInst; - } else if (MII != MBB.begin()) { - // Check to see if this is a sequence of the form: - // mov R0, R1 - // mov R1, R0 - // Eliminate the second move if so. - MachineBasicBlock::iterator PrevMII = MII; --PrevMII; - MachineInstr& PrevMI = *PrevMII; - unsigned PrevSrc, PrevDst; - - if (TII->isMoveInstr(PrevMI, PrevSrc, PrevDst)) - if (PrevSrc == Dst && PrevDst == Src) { - ++NumDCE; - DEBUG(std::cerr << "Removing now-noop copy: " << MI); - MBB.erase(&MI); - VRM.RemoveFromFoldedVirtMap(&MI); - goto ProcessNextInst; - } - } + if (TII->isMoveInstr(MI, Src, Dst) && Src == Dst) { + ++NumDCE; + DEBUG(std::cerr << "Removing now-noop copy: " << MI); + MBB.erase(&MI); + VRM.RemoveFromFoldedVirtMap(&MI); + goto ProcessNextInst; } - Spills.ClobberPhysReg(VirtReg); continue; } @@ -883,6 +861,8 @@ } } + + llvm::Spiller* llvm::createSpiller() { switch (SpillerOpt) { default: assert(0 && "Unreachable!"); From lattner at cs.uiuc.edu Thu Aug 24 18:03:47 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 24 Aug 2006 18:03:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/README.txt Message-ID: <200608242303.k7ON3l8x027198@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: README.txt updated: 1.34 -> 1.35 --- Log message: Owen implemented this. --- Diffs of the changes: (+0 -11) README.txt | 11 ----------- 1 files changed, 11 deletions(-) Index: llvm/lib/Target/README.txt diff -u llvm/lib/Target/README.txt:1.34 llvm/lib/Target/README.txt:1.35 --- llvm/lib/Target/README.txt:1.34 Tue May 30 16:29:15 2006 +++ llvm/lib/Target/README.txt Thu Aug 24 18:03:33 2006 @@ -140,17 +140,6 @@ //===---------------------------------------------------------------------===// -The loop unroller should be enhanced to be able to unroll loops that aren't -single basic blocks. It should be able to handle stuff like this: - - for (i = 0; i < c1; ++i) - if (c2 & (1 << i)) - foo - -where c1/c2 are constants. - -//===---------------------------------------------------------------------===// - For packed types, TargetData.cpp::getTypeInfo() returns alignment that is equal to the type size. It works but can be overly conservative as the alignment of specific packed types are target dependent. From lattner at cs.uiuc.edu Thu Aug 24 18:06:16 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 24 Aug 2006 18:06:16 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/README.txt Message-ID: <200608242306.k7ON6GPd027282@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: README.txt updated: 1.35 -> 1.36 --- Log message: We compile this into: _swap_16: slwi r2, r3, 24 rlwimi r2, r3, 8, 8, 15 srwi r3, r2, 16 blr now. --- Diffs of the changes: (+0 -18) README.txt | 18 ------------------ 1 files changed, 18 deletions(-) Index: llvm/lib/Target/README.txt diff -u llvm/lib/Target/README.txt:1.35 llvm/lib/Target/README.txt:1.36 --- llvm/lib/Target/README.txt:1.35 Thu Aug 24 18:03:33 2006 +++ llvm/lib/Target/README.txt Thu Aug 24 18:06:02 2006 @@ -162,24 +162,6 @@ //===---------------------------------------------------------------------===// -Consider this: - -unsigned short swap_16(unsigned short v) { return (v>>8) | (v<<8); } - -Compiled with the ppc backend: - -_swap_16: - slwi r2, r3, 8 - srwi r3, r3, 8 - or r2, r3, r2 - rlwinm r3, r2, 0, 16, 31 - blr - -The rlwinm (an and by 65535) is dead. The dag combiner should propagate bits -better than that to see this. - -//===---------------------------------------------------------------------===// - Add support for conditional increments, and other related patterns. Instead of: From lattner at cs.uiuc.edu Thu Aug 24 18:23:13 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 24 Aug 2006 18:23:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp Message-ID: <200608242323.k7ONNDFf027567@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveInterval.cpp updated: 1.29 -> 1.30 --- Log message: When replacing value numbers, make sure to compactify the value # space. --- Diffs of the changes: (+12 -0) LiveInterval.cpp | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.29 llvm/lib/CodeGen/LiveInterval.cpp:1.30 --- llvm/lib/CodeGen/LiveInterval.cpp:1.29 Thu Aug 24 17:43:55 2006 +++ llvm/lib/CodeGen/LiveInterval.cpp Thu Aug 24 18:22:59 2006 @@ -470,6 +470,18 @@ } } } + + // Now that V1 is dead, remove it. If it is the largest value number, just + // nuke it (and any other deleted values neighboring it), otherwise mark it as + // ~1U so it can be nuked later. + if (V1 == NumValues-1) { + do { + InstDefiningValue.pop_back(); + --NumValues; + } while (InstDefiningValue.back() == ~1U); + } else { + InstDefiningValue[V1] = ~1U; + } } From reid at x10sys.com Thu Aug 24 18:45:23 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 24 Aug 2006 18:45:23 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ar/llvm-ar.cpp Message-ID: <200608242345.k7ONjNEV027973@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ar: llvm-ar.cpp updated: 1.36 -> 1.37 --- Log message: For PR797: http://llvm.org/PR797 : Remove exception handling from the bytecode archiver and adjust the llvm-ar tool to accommodate the new interfaces. --- Diffs of the changes: (+9 -5) llvm-ar.cpp | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) Index: llvm/tools/llvm-ar/llvm-ar.cpp diff -u llvm/tools/llvm-ar/llvm-ar.cpp:1.36 llvm/tools/llvm-ar/llvm-ar.cpp:1.37 --- llvm/tools/llvm-ar/llvm-ar.cpp:1.36 Wed Aug 23 01:56:27 2006 +++ llvm/tools/llvm-ar/llvm-ar.cpp Thu Aug 24 18:45:08 2006 @@ -586,7 +586,8 @@ // Append them quickly. for (std::set::iterator PI = Paths.begin(), PE = Paths.end(); PI != PE; ++PI) { - TheArchive->addFileBefore(*PI,TheArchive->end()); + if (TheArchive->addFileBefore(*PI,TheArchive->end(),ErrMsg)) + return true; } // We're done editting, reconstruct the archive. @@ -647,15 +648,17 @@ sys::FileStatus si; std::string Err; if (found->getFileStatus(si, &Err)) - throw Err; + return true; if (si.isDir) { if (OnlyUpdate) { // Replace the item only if it is newer. if (si.modTime > I->getModTime()) - I->replaceWith(*found); + if (I->replaceWith(*found, ErrMsg)) + return true; } else { // Replace the item regardless of time stamp - I->replaceWith(*found); + if (I->replaceWith(*found, ErrMsg)) + return true; } } else { // We purposefully ignore directories. @@ -679,7 +682,8 @@ if (!remaining.empty()) { for (std::set::iterator PI = remaining.begin(), PE = remaining.end(); PI != PE; ++PI) { - TheArchive->addFileBefore(*PI,insert_spot); + if (TheArchive->addFileBefore(*PI,insert_spot, ErrMsg)) + return true; } } From reid at x10sys.com Thu Aug 24 18:45:25 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 24 Aug 2006 18:45:25 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/Archive.h Message-ID: <200608242345.k7ONjPZa027978@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bytecode: Archive.h updated: 1.17 -> 1.18 --- Log message: For PR797: http://llvm.org/PR797 : Remove exception handling from the bytecode archiver and adjust the llvm-ar tool to accommodate the new interfaces. --- Diffs of the changes: (+17 -9) Archive.h | 26 +++++++++++++++++--------- 1 files changed, 17 insertions(+), 9 deletions(-) Index: llvm/include/llvm/Bytecode/Archive.h diff -u llvm/include/llvm/Bytecode/Archive.h:1.17 llvm/include/llvm/Bytecode/Archive.h:1.18 --- llvm/include/llvm/Bytecode/Archive.h:1.17 Fri Jul 28 17:03:43 2006 +++ llvm/include/llvm/Bytecode/Archive.h Thu Aug 24 18:45:08 2006 @@ -167,8 +167,9 @@ /// of the file specified by \p File. The contents of \p this will be /// updated to reflect the new data from \p File. The \p File must exist and /// be readable on entry to this method. + /// @returns true if an error occurred, false otherwise /// @brief Replace contents of archive member with a new file. - void replaceWith(const sys::Path &aFile); + bool replaceWith(const sys::Path &aFile, std::string* ErrMsg); /// @} /// @name ilist methods - do not use @@ -439,8 +440,8 @@ /// name will be truncated at 15 characters. If \p Compress is specified, /// all archive members will be compressed before being written. If /// \p PrintSymTab is true, the symbol table will be printed to std::cout. - /// @returns false if an error occurred, \p error set to error message - /// @returns true if the writing succeeded. + /// @returns true if an error occurred, \p error set to error message + /// @returns false if the writing succeeded. /// @brief Write (possibly modified) archive contents to disk bool writeToDisk( bool CreateSymbolTable=false, ///< Create Symbol table @@ -453,10 +454,13 @@ /// to determine just enough information to create an ArchiveMember object /// which is then inserted into the Archive object's ilist at the location /// given by \p where. - /// @throws std::string if an error occurs reading the \p filename. - /// @returns nothing + /// @returns true if an error occured, false otherwise /// @brief Add a file to the archive. - void addFileBefore(const sys::Path& filename, iterator where); + bool addFileBefore( + const sys::Path& filename, ///< The file to be added + iterator where, ///< Insertion point + std::string* ErrMsg ///< Optional error message location + ); /// @} /// @name Implementation @@ -464,7 +468,7 @@ protected: /// @brief Construct an Archive for \p filename and optionally map it /// into memory. - Archive(const sys::Path& filename, bool map = false ); + Archive(const sys::Path& filename); /// @param error Set to address of a std::string to get error messages /// @returns false on error @@ -500,8 +504,8 @@ /// Writes one ArchiveMember to an ofstream. If an error occurs, returns /// false, otherwise true. If an error occurs and error is non-null then /// it will be set to an error message. - /// @returns true Writing member succeeded - /// @returns false Writing member failed, \p error set to error message + /// @returns false Writing member succeeded + /// @returns true Writing member failed, \p error set to error message bool writeMember( const ArchiveMember& member, ///< The member to be written std::ofstream& ARFile, ///< The file to write member onto @@ -515,6 +519,9 @@ bool fillHeader(const ArchiveMember&mbr, ArchiveMemberHeader& hdr,int sz, bool TruncateNames) const; + /// @brief Maps archive into memory + bool mapToMemory(std::string* ErrMsg); + /// @brief Frees all the members and unmaps the archive file. void cleanUpMemory(); @@ -525,6 +532,7 @@ typedef std::map > ModuleMap; + /// @} /// @name Data /// @{ From reid at x10sys.com Thu Aug 24 18:45:25 2006 From: reid at x10sys.com (Reid Spencer) Date: Thu, 24 Aug 2006 18:45:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/Archive.cpp ArchiveReader.cpp ArchiveWriter.cpp Message-ID: <200608242345.k7ONjPMT027987@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Archive: Archive.cpp updated: 1.13 -> 1.14 ArchiveReader.cpp updated: 1.45 -> 1.46 ArchiveWriter.cpp updated: 1.29 -> 1.30 --- Log message: For PR797: http://llvm.org/PR797 : Remove exception handling from the bytecode archiver and adjust the llvm-ar tool to accommodate the new interfaces. --- Diffs of the changes: (+65 -57) Archive.cpp | 28 ++++++++++------- ArchiveReader.cpp | 8 +++-- ArchiveWriter.cpp | 86 +++++++++++++++++++++++++++--------------------------- 3 files changed, 65 insertions(+), 57 deletions(-) Index: llvm/lib/Bytecode/Archive/Archive.cpp diff -u llvm/lib/Bytecode/Archive/Archive.cpp:1.13 llvm/lib/Bytecode/Archive/Archive.cpp:1.14 --- llvm/lib/Bytecode/Archive/Archive.cpp:1.13 Tue Aug 22 11:07:44 2006 +++ llvm/lib/Bytecode/Archive/Archive.cpp Thu Aug 24 18:45:08 2006 @@ -61,7 +61,7 @@ // This method allows an ArchiveMember to be replaced with the data for a // different file, presumably as an update to the member. It also makes sure // the flags are reset correctly. -void ArchiveMember::replaceWith(const sys::Path& newFile) { +bool ArchiveMember::replaceWith(const sys::Path& newFile, std::string* ErrMsg) { assert(newFile.exists() && "Can't replace with a non-existent file"); data = 0; path = newFile; @@ -110,8 +110,8 @@ path.getMagicNumber(magic,4); signature = magic.c_str(); std::string err; - if (path.getFileStatus(info, &err)) - throw err; + if (path.getFileStatus(info, ErrMsg)) + return true; } // Determine what kind of file it is @@ -127,23 +127,27 @@ flags &= ~(BytecodeFlag|CompressedBytecodeFlag); break; } + return false; } // Archive constructor - this is the only constructor that gets used for the // Archive class. Everything else (default,copy) is deprecated. This just // initializes and maps the file into memory, if requested. -Archive::Archive(const sys::Path& filename, bool map ) +Archive::Archive(const sys::Path& filename) : archPath(filename), members(), mapfile(0), base(0), symTab(), strtab(), symTabSize(0), firstFileOffset(0), modules(), foreignST(0) { - if (map) { - std::string ErrMsg; - mapfile = new sys::MappedFile(); - if (mapfile->open(filename, sys::MappedFile::READ_ACCESS, &ErrMsg)) - throw ErrMsg; - if (!(base = (char*) mapfile->map(&ErrMsg))) - throw ErrMsg; - } +} + +bool +Archive::mapToMemory(std::string* ErrMsg) +{ + mapfile = new sys::MappedFile(); + if (mapfile->open(archPath, sys::MappedFile::READ_ACCESS, ErrMsg)) + return true; + if (!(base = (char*) mapfile->map(ErrMsg))) + return true; + return false; } void Archive::cleanUpMemory() { Index: llvm/lib/Bytecode/Archive/ArchiveReader.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.45 llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.46 --- llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.45 Fri Jul 7 15:56:50 2006 +++ llvm/lib/Bytecode/Archive/ArchiveReader.cpp Thu Aug 24 18:45:08 2006 @@ -330,7 +330,9 @@ Archive* Archive::OpenAndLoad(const sys::Path& file, std::string* ErrorMessage) { - std::auto_ptr result ( new Archive(file, true)); + std::auto_ptr result ( new Archive(file)); + if (result->mapToMemory(ErrorMessage)) + return 0; if (!result->loadArchive(ErrorMessage)) return 0; return result.release(); @@ -437,7 +439,9 @@ // Open the archive and load just the symbol tables Archive* Archive::OpenAndLoadSymbols(const sys::Path& file, std::string* ErrorMessage) { - std::auto_ptr result ( new Archive(file, true) ); + std::auto_ptr result ( new Archive(file) ); + if (result->mapToMemory(ErrorMessage)) + return 0; if (!result->loadSymbolTable(ErrorMessage)) return 0; return result.release(); Index: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.29 llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.30 --- llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.29 Wed Aug 23 02:30:48 2006 +++ llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Thu Aug 24 18:45:08 2006 @@ -64,7 +64,7 @@ // Create an empty archive. Archive* Archive::CreateEmpty(const sys::Path& FilePath ) { - Archive* result = new Archive(FilePath,false); + Archive* result = new Archive(FilePath); return result; } @@ -151,17 +151,17 @@ // Insert a file into the archive before some other member. This also takes care // of extracting the necessary flags and information from the file. -void -Archive::addFileBefore(const sys::Path& filePath, iterator where) { +bool +Archive::addFileBefore(const sys::Path& filePath, iterator where, + std::string* ErrMsg) { assert(filePath.exists() && "Can't add a non-existent file"); ArchiveMember* mbr = new ArchiveMember(this); mbr->data = 0; mbr->path = filePath; - std::string err; - if (mbr->path.getFileStatus(mbr->info, &err)) - throw err; + if (mbr->path.getFileStatus(mbr->info, ErrMsg)) + return true; unsigned flags = 0; bool hasSlash = filePath.toString().find('/') != std::string::npos; @@ -183,6 +183,7 @@ } mbr->flags = flags; members.insert(where,mbr); + return false; } // Write one member out to the file. @@ -193,7 +194,7 @@ bool CreateSymbolTable, bool TruncateNames, bool ShouldCompress, - std::string* error + std::string* ErrMsg ) { unsigned filepos = ARFile.tellp(); @@ -205,12 +206,11 @@ const char* data = (const char*)member.getData(); sys::MappedFile* mFile = 0; if (!data) { - std::string ErrMsg; mFile = new sys::MappedFile(); - if (mFile->open(member.getPath(), sys::MappedFile::READ_ACCESS, &ErrMsg)) - throw ErrMsg; - if (!(data = (const char*) mFile->map(&ErrMsg))) - throw ErrMsg; + if (mFile->open(member.getPath(), sys::MappedFile::READ_ACCESS, ErrMsg)) + return true; + if (!(data = (const char*) mFile->map(ErrMsg))) + return true; fSize = mFile->size(); } @@ -246,8 +246,9 @@ mFile->close(); delete mFile; } - if (error) - *error = "Can't parse bytecode member: " + member.getPath().toString(); + if (ErrMsg) + *ErrMsg = "Can't parse bytecode member: " + member.getPath().toString(); + return true; } } @@ -274,9 +275,9 @@ data +=4; fSize -= 4; } - fSize = Compressor::compressToNewBuffer(data,fSize,output,error); + fSize = Compressor::compressToNewBuffer(data,fSize,output,ErrMsg); if (fSize == 0) - return false; + return true; data = output; if (member.isBytecode()) hdrSize = -fSize-4; @@ -320,7 +321,7 @@ mFile->close(); delete mFile; } - return true; + return false; } // Write out the LLVM symbol table as an archive member to the file. @@ -380,7 +381,7 @@ // compressing each archive member. bool Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress, - std::string* error) + std::string* ErrMsg) { // Make sure they haven't opened up the file, not loaded it, // but are now trying to write it which would wipe out the file. @@ -389,8 +390,8 @@ // Create a temporary file to store the archive in sys::Path TmpArchive = archPath; - if (TmpArchive.createTemporaryFileOnDisk(error)) - return false; + if (TmpArchive.createTemporaryFileOnDisk(ErrMsg)) + return true; // Make sure the temporary gets removed if we crash sys::RemoveFileOnSignal(TmpArchive); @@ -404,9 +405,9 @@ if (!ArchiveFile.is_open() || ArchiveFile.bad()) { if (TmpArchive.exists()) TmpArchive.eraseFromDisk(); - if (error) - *error = "Error opening archive file: " + archPath.toString(); - return false; + if (ErrMsg) + *ErrMsg = "Error opening archive file: " + archPath.toString(); + return true; } // If we're creating a symbol table, reset it now @@ -421,12 +422,12 @@ // Loop over all member files, and write them out. Note that this also // builds the symbol table, symTab. for (MembersList::iterator I = begin(), E = end(); I != E; ++I) { - if (!writeMember(*I, ArchiveFile, CreateSymbolTable, - TruncateNames, Compress, error)) { + if (writeMember(*I, ArchiveFile, CreateSymbolTable, + TruncateNames, Compress, ErrMsg)) { if (TmpArchive.exists()) TmpArchive.eraseFromDisk(); ArchiveFile.close(); - return false; + return true; } } @@ -443,27 +444,26 @@ // Map in the archive we just wrote. sys::MappedFile arch; - std::string ErrMsg; - if (arch.open(TmpArchive, sys::MappedFile::READ_ACCESS, &ErrMsg)) - throw ErrMsg; + if (arch.open(TmpArchive, sys::MappedFile::READ_ACCESS, ErrMsg)) + return true; const char* base; - if (!(base = (const char*) arch.map(&ErrMsg))) - throw ErrMsg; + if (!(base = (const char*) arch.map(ErrMsg))) + return true; // Open another temporary file in order to avoid invalidating the // mmapped data sys::Path FinalFilePath = archPath; - if (FinalFilePath.createTemporaryFileOnDisk(error)) - return false; + if (FinalFilePath.createTemporaryFileOnDisk(ErrMsg)) + return true; sys::RemoveFileOnSignal(FinalFilePath); std::ofstream FinalFile(FinalFilePath.c_str(), io_mode); if (!FinalFile.is_open() || FinalFile.bad()) { if (TmpArchive.exists()) TmpArchive.eraseFromDisk(); - if (error) - *error = "Error opening archive file: " + FinalFilePath.toString(); - return false; + if (ErrMsg) + *ErrMsg = "Error opening archive file: " + FinalFilePath.toString(); + return true; } // Write the file magic number @@ -475,11 +475,11 @@ // compatibility with other ar(1) implementations as well as allowing the // archive to store both native .o and LLVM .bc files, both indexed. if (foreignST) { - if (!writeMember(*foreignST, FinalFile, false, false, false, error)) { + if (writeMember(*foreignST, FinalFile, false, false, false, ErrMsg)) { FinalFile.close(); if (TmpArchive.exists()) TmpArchive.eraseFromDisk(); - return false; + return true; } } @@ -496,8 +496,8 @@ arch.close(); // Move the final file over top of TmpArchive - if (FinalFilePath.renamePathOnDisk(TmpArchive, error)) - return false; + if (FinalFilePath.renamePathOnDisk(TmpArchive, ErrMsg)) + return true; } // Before we replace the actual archive, we need to forget all the @@ -505,8 +505,8 @@ // this because we cannot replace an open file on Windows. cleanUpMemory(); - if (TmpArchive.renamePathOnDisk(archPath, error)) - return false; + if (TmpArchive.renamePathOnDisk(archPath, ErrMsg)) + return true; - return true; + return false; } From resistor at mac.com Thu Aug 24 22:32:27 2006 From: resistor at mac.com (Owen Anderson) Date: Thu, 24 Aug 2006 22:32:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Message-ID: <200608250332.k7P3WRk1031559@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: IndVarSimplify.cpp updated: 1.89 -> 1.90 --- Log message: Specify that indvars actually preserve LCSSA. This has been done for a while, but I forgot to put in the analysis usage. --- Diffs of the changes: (+3 -0) IndVarSimplify.cpp | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.89 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.90 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.89 Fri Aug 18 04:01:07 2006 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Thu Aug 24 22:32:13 2006 @@ -79,6 +79,7 @@ AU.addRequired(); AU.addRequired(); AU.addPreservedID(LoopSimplifyID); + AU.addPreservedID(LCSSAID); AU.setPreservesCFG(); } private: @@ -570,4 +571,6 @@ #endif DeleteTriviallyDeadInstructions(DeadInsts); + + assert(L->isLCSSAForm()); } From resistor at mac.com Thu Aug 24 22:46:11 2006 From: resistor at mac.com (Owen Anderson) Date: Thu, 24 Aug 2006 22:46:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Message-ID: <200608250346.k7P3kBG7031827@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: IndVarSimplify.cpp updated: 1.90 -> 1.91 --- Log message: Revert my previous patch. Since there are some major changes that went in today, I'm going to wait to put this in HEAD until tomorrow, so as not to clutter the nightly tester. --- Diffs of the changes: (+0 -3) IndVarSimplify.cpp | 3 --- 1 files changed, 3 deletions(-) Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.90 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.91 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.90 Thu Aug 24 22:32:13 2006 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Thu Aug 24 22:45:57 2006 @@ -79,7 +79,6 @@ AU.addRequired(); AU.addRequired(); AU.addPreservedID(LoopSimplifyID); - AU.addPreservedID(LCSSAID); AU.setPreservesCFG(); } private: @@ -571,6 +570,4 @@ #endif DeleteTriviallyDeadInstructions(DeadInsts); - - assert(L->isLCSSAForm()); } From reid at x10sys.com Fri Aug 25 00:28:31 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 00:28:31 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ar/llvm-ar.cpp Message-ID: <200608250528.k7P5SViP001135@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ar: llvm-ar.cpp updated: 1.37 -> 1.38 --- Log message: Fix a bug caused by change in the interface of Archive::writeToDisk. --- Diffs of the changes: (+4 -4) llvm-ar.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/tools/llvm-ar/llvm-ar.cpp diff -u llvm/tools/llvm-ar/llvm-ar.cpp:1.37 llvm/tools/llvm-ar/llvm-ar.cpp:1.38 --- llvm/tools/llvm-ar/llvm-ar.cpp:1.37 Thu Aug 24 18:45:08 2006 +++ llvm/tools/llvm-ar/llvm-ar.cpp Fri Aug 25 00:28:17 2006 @@ -511,7 +511,7 @@ } // We're done editting, reconstruct the archive. - if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) + if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) return true; if (ReallyVerbose) printSymbolTable(); @@ -566,7 +566,7 @@ } // We're done editting, reconstruct the archive. - if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) + if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) return true; if (ReallyVerbose) printSymbolTable(); @@ -591,7 +591,7 @@ } // We're done editting, reconstruct the archive. - if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) + if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) return true; if (ReallyVerbose) printSymbolTable(); @@ -688,7 +688,7 @@ } // We're done editting, reconstruct the archive. - if (!TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) + if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) return true; if (ReallyVerbose) printSymbolTable(); From reid at x10sys.com Fri Aug 25 00:29:50 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 00:29:50 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ranlib/llvm-ranlib.cpp Message-ID: <200608250529.k7P5TodS001165@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ranlib: llvm-ranlib.cpp updated: 1.9 -> 1.10 --- Log message: Fix a bug introduced by a change in the Archive::writeToDisk interface. --- Diffs of the changes: (+1 -1) llvm-ranlib.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/llvm-ranlib/llvm-ranlib.cpp diff -u llvm/tools/llvm-ranlib/llvm-ranlib.cpp:1.9 llvm/tools/llvm-ranlib/llvm-ranlib.cpp:1.10 --- llvm/tools/llvm-ranlib/llvm-ranlib.cpp:1.9 Fri Jul 7 14:09:14 2006 +++ llvm/tools/llvm-ranlib/llvm-ranlib.cpp Fri Aug 25 00:29:36 2006 @@ -74,7 +74,7 @@ if (!TheArchive) throw err_msg; - if (!TheArchive->writeToDisk(true, false, false, &err_msg )) + if (TheArchive->writeToDisk(true, false, false, &err_msg )) throw err_msg; if (Verbose) From natebegeman at mac.com Fri Aug 25 01:37:12 2006 From: natebegeman at mac.com (Nate Begeman) Date: Fri, 25 Aug 2006 01:37:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachOWriter.cpp Message-ID: <200608250637.k7P6bCgZ002228@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachOWriter.cpp updated: 1.1 -> 1.2 --- Log message: Get closer to handling globals correctly. We now generally get them in the right section. --- Diffs of the changes: (+70 -5) MachOWriter.cpp | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 70 insertions(+), 5 deletions(-) Index: llvm/lib/CodeGen/MachOWriter.cpp diff -u llvm/lib/CodeGen/MachOWriter.cpp:1.1 llvm/lib/CodeGen/MachOWriter.cpp:1.2 --- llvm/lib/CodeGen/MachOWriter.cpp:1.1 Wed Aug 23 16:08:52 2006 +++ llvm/lib/CodeGen/MachOWriter.cpp Fri Aug 25 01:36:58 2006 @@ -27,10 +27,9 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineRelocation.h" #include "llvm/CodeGen/MachOWriter.h" -#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetJITInfo.h" -#include "llvm/Target/TargetMachine.h" #include "llvm/Support/Mangler.h" +#include "llvm/Support/MathExtras.h" #include using namespace llvm; @@ -137,10 +136,9 @@ // appending linkage is illegal for functions. assert(0 && "Unknown linkage type!"); case GlobalValue::ExternalLinkage: - FnSym.n_type = MachOWriter::MachOSym::N_SECT | MachOWriter::MachOSym::N_EXT; + FnSym.n_type |= MachOWriter::MachOSym::N_EXT; break; case GlobalValue::InternalLinkage: - FnSym.n_type = MachOWriter::MachOSym::N_SECT; break; } @@ -188,8 +186,75 @@ delete MCE; } +void MachOWriter::AddSymbolToSection(MachOSection &Sec, GlobalVariable *GV) { + const Type *Ty = GV->getType()->getElementType(); + unsigned Size = TM.getTargetData()->getTypeSize(Ty); + unsigned Align = Log2_32(TM.getTargetData()->getTypeAlignment(Ty)); + + MachOSym Sym(GV, Sec.Index); + // Reserve space in the .bss section for this symbol while maintaining the + // desired section alignment, which must be at least as much as required by + // this symbol. + if (Align) { + Sec.align = std::max(Sec.align, Align); + Sec.size = (Sec.size + Align - 1) & ~(Align-1); + } + // Record the offset of the symbol, and then allocate space for it. + Sym.n_value = Sec.size; + Sec.size += Size; + + switch (GV->getLinkage()) { + default: // weak/linkonce handled above + assert(0 && "Unexpected linkage type!"); + case GlobalValue::ExternalLinkage: + Sym.n_type |= MachOSym::N_EXT; + break; + case GlobalValue::InternalLinkage: + break; + } + SymbolTable.push_back(Sym); +} + void MachOWriter::EmitGlobal(GlobalVariable *GV) { - // FIXME: do something smart here. + const Type *Ty = GV->getType()->getElementType(); + unsigned Size = TM.getTargetData()->getTypeSize(Ty); + bool NoInit = !GV->hasInitializer(); + + // If this global has a zero initializer, it is part of the .bss or common + // section. + if (NoInit || GV->getInitializer()->isNullValue()) { + // If this global is part of the common block, add it now. Variables are + // part of the common block if they are zero initialized and allowed to be + // merged with other symbols. + if (NoInit || GV->hasLinkOnceLinkage() || GV->hasWeakLinkage()) { + MachOWriter::MachOSym ExtOrCommonSym(GV, MachOSym::NO_SECT); + ExtOrCommonSym.n_type |= MachOSym::N_EXT; + // For undefined (N_UNDF) external (N_EXT) types, n_value is the size in + // bytes of the symbol. + ExtOrCommonSym.n_value = Size; + // If the symbol is external, we'll put it on a list of symbols whose + // addition to the symbol table is being pended until we find a reference + if (NoInit) + PendingSyms.push_back(ExtOrCommonSym); + else + SymbolTable.push_back(ExtOrCommonSym); + return; + } + // Otherwise, this symbol is part of the .bss section. + MachOSection &BSS = getBSSSection(); + AddSymbolToSection(BSS, GV); + return; + } + + // Scalar read-only data goes in a literal section if the scalar is 4, 8, or + // 16 bytes, or a cstring. Other read only data goes into a regular const + // section. Read-write data goes in the data section. + MachOSection &Sec = GV->isConstant() ? getConstSection(Ty) : getDataSection(); + AddSymbolToSection(Sec, GV); + + // FIXME: actually write out the initializer to the section. This will + // require ExecutionEngine's InitializeMemory() function, which will need to + // be enhanced to support relocations. } From natebegeman at mac.com Fri Aug 25 01:37:13 2006 From: natebegeman at mac.com (Nate Begeman) Date: Fri, 25 Aug 2006 01:37:13 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachOWriter.h Message-ID: <200608250637.k7P6bDU3002233@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachOWriter.h updated: 1.3 -> 1.4 --- Log message: Get closer to handling globals correctly. We now generally get them in the right section. --- Diffs of the changes: (+36 -2) MachOWriter.h | 38 ++++++++++++++++++++++++++++++++++++-- 1 files changed, 36 insertions(+), 2 deletions(-) Index: llvm/include/llvm/CodeGen/MachOWriter.h diff -u llvm/include/llvm/CodeGen/MachOWriter.h:1.3 llvm/include/llvm/CodeGen/MachOWriter.h:1.4 --- llvm/include/llvm/CodeGen/MachOWriter.h:1.3 Thu Aug 24 09:25:39 2006 +++ llvm/include/llvm/CodeGen/MachOWriter.h Fri Aug 25 01:36:58 2006 @@ -14,8 +14,10 @@ #ifndef LLVM_CODEGEN_MACHOWRITER_H #define LLVM_CODEGEN_MACHOWRITER_H -#include "llvm/CodeGen/MachineRelocation.h" +#include "llvm/DerivedTypes.h" #include "llvm/CodeGen/MachineFunctionPass.h" +#include "llvm/Target/TargetData.h" +#include "llvm/Target/TargetMachine.h" #include namespace llvm { @@ -377,6 +379,31 @@ MachOSection::S_ATTR_PURE_INSTRUCTIONS | MachOSection::S_ATTR_SOME_INSTRUCTIONS); } + MachOSection &getBSSSection() { + return getSection("__DATA", "__bss", MachOSection::S_ZEROFILL); + } + MachOSection &getDataSection() { + return getSection("__DATA", "__data"); + } + MachOSection &getConstSection(const Type *Ty) { + // FIXME: support cstring literals and pointer literal + if (Ty->isPrimitiveType()) { + unsigned Size = TM.getTargetData()->getTypeSize(Ty); + switch(Size) { + default: break; // Fall through to __TEXT,__const + case 4: + return getSection("__TEXT", "__literal4", + MachOSection::S_4BYTE_LITERALS); + case 8: + return getSection("__TEXT", "__literal8", + MachOSection::S_8BYTE_LITERALS); + case 16: + return getSection("__TEXT", "__literal16", + MachOSection::S_16BYTE_LITERALS); + } + } + return getSection("__TEXT", "__const"); + } /// MachOSymTab - This struct contains information about the offsets and /// size of symbol table information. @@ -488,7 +515,8 @@ static unsigned entrySize() { return 12; } MachOSym(const GlobalValue *gv, uint8_t sect) : GV(gv), n_strx(0), - n_type(N_UNDF), n_sect(sect), n_desc(0), n_value(0) {} + n_type(sect == NO_SECT ? N_UNDF : N_SECT), n_sect(sect), n_desc(0), + n_value(0) {} }; /// SymbolTable - This is the list of symbols we have emitted to the file. @@ -496,6 +524,11 @@ /// local symbols first in the list). std::vector SymbolTable; + /// PendingSyms - This is a list of externally defined symbols that we have + /// been asked to emit, but have not seen a reference to. When a reference + /// is seen, the symbol will move from this list to the SymbolTable. + std::vector PendingSyms; + /// DynamicSymbolTable - This is just a vector of indices into /// SymbolTable to aid in emitting the DYSYMTAB load command. std::vector DynamicSymbolTable; @@ -586,6 +619,7 @@ } private: + void AddSymbolToSection(MachOSection &MOS, GlobalVariable *GV); void EmitGlobal(GlobalVariable *GV); void EmitHeaderAndLoadCommands(); void EmitSections(); From jlaskey at apple.com Fri Aug 25 09:17:09 2006 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 25 Aug 2006 09:17:09 -0500 Subject: [llvm-commits] CVS: llvm/Xcode/LLVM.xcodeproj/project.pbxproj Message-ID: <200608251417.k7PEH9em026345@zion.cs.uiuc.edu> Changes in directory llvm/Xcode/LLVM.xcodeproj: project.pbxproj updated: 1.21 -> 1.22 --- Log message: Bring Xcode project up to date. --- Diffs of the changes: (+162 -49) project.pbxproj | 211 ++++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 162 insertions(+), 49 deletions(-) Index: llvm/Xcode/LLVM.xcodeproj/project.pbxproj diff -u llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.21 llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.22 --- llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.21 Thu Jul 13 17:17:58 2006 +++ llvm/Xcode/LLVM.xcodeproj/project.pbxproj Fri Aug 25 09:16:49 2006 @@ -45,6 +45,8 @@ CF490D15090541D30072DB1C /* TargetSelectionDAG.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TargetSelectionDAG.td; sourceTree = ""; }; CF490E2F0907BBF80072DB1C /* SubtargetEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubtargetEmitter.h; sourceTree = ""; }; CF490E300907BBF80072DB1C /* SubtargetEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubtargetEmitter.cpp; sourceTree = ""; }; + CF4F27E60A7B6E23004359F6 /* MachinePassRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachinePassRegistry.h; sourceTree = ""; }; + CF4F27F60A7B6FA3004359F6 /* MachinePassRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MachinePassRegistry.cpp; sourceTree = ""; }; CF65223409CA39B800C4B521 /* Intrinsics.gen */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Intrinsics.gen; sourceTree = ""; }; CF6527D909D1A53400C4B521 /* MachineLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachineLocation.h; sourceTree = ""; }; CF6527FA09D1BA3800C4B521 /* DelaySlotFiller.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DelaySlotFiller.cpp; path = ../lib/Target/Sparc/DelaySlotFiller.cpp; sourceTree = SOURCE_ROOT; }; @@ -82,7 +84,6 @@ CF73C0A4098A4FDF00627152 /* ValueSymbolTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueSymbolTable.h; sourceTree = ""; }; CF73C0A5098A507300627152 /* ConstantFolding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstantFolding.h; sourceTree = ""; }; CF73C0A6098A507300627152 /* ET-Forest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ET-Forest.h"; sourceTree = ""; }; - CF73C0A7098A507300627152 /* LinkAllAnalyses.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkAllAnalyses.h; sourceTree = ""; }; CF73C0A8098A50C200627152 /* AutoUpgrade.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoUpgrade.h; sourceTree = ""; }; CF73C0A9098A50FD00627152 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = ""; }; CF73C0AD098A519400627152 /* DataTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataTypes.h; sourceTree = ""; }; @@ -103,8 +104,76 @@ CF7FFA2109850864008B0087 /* ScheduleDAG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScheduleDAG.h; sourceTree = ""; }; CF8D62FA09C2226F006017BA /* Intrinsics.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Intrinsics.td; sourceTree = ""; }; CF8E00490989162500DA2399 /* Dwarf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Dwarf.h; sourceTree = ""; }; + CF9720240A9F3969002CEEDD /* MachOWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachOWriter.h; sourceTree = ""; }; + CF9720250A9F3969002CEEDD /* SelectionDAGCSEMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectionDAGCSEMap.h; sourceTree = ""; }; + CF9720260A9F39B9002CEEDD /* LinkAllPasses.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkAllPasses.h; sourceTree = ""; }; + CF9720270A9F39B9002CEEDD /* LinkTimeOptimizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkTimeOptimizer.h; sourceTree = ""; }; + CF9720340A9F3A41002CEEDD /* IncludeFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IncludeFile.h; sourceTree = ""; }; + CF9720350A9F3ADC002CEEDD /* MachOWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MachOWriter.cpp; sourceTree = ""; }; + CF9720360A9F3B1C002CEEDD /* SelectionDAGCSEMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectionDAGCSEMap.cpp; sourceTree = ""; }; + CF9720370A9F3B1C002CEEDD /* TargetLowering.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TargetLowering.cpp; sourceTree = ""; }; + CF97203A0A9F3BBC002CEEDD /* ARM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARM.h; sourceTree = ""; }; + CF97203B0A9F3BBC002CEEDD /* ARM.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ARM.td; sourceTree = ""; }; + CF97203C0A9F3BBC002CEEDD /* ARMAsmPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMAsmPrinter.cpp; sourceTree = ""; }; + CF97203D0A9F3BBC002CEEDD /* ARMFrameInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMFrameInfo.h; sourceTree = ""; }; + CF9720450A9F3BBC002CEEDD /* ARMInstrInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMInstrInfo.cpp; sourceTree = ""; }; + CF9720460A9F3BBC002CEEDD /* ARMInstrInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMInstrInfo.h; sourceTree = ""; }; + CF9720470A9F3BBC002CEEDD /* ARMInstrInfo.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ARMInstrInfo.td; sourceTree = ""; }; + CF9720480A9F3BBC002CEEDD /* ARMISelDAGToDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMISelDAGToDAG.cpp; sourceTree = ""; }; + CF9720490A9F3BBC002CEEDD /* ARMRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMRegisterInfo.cpp; sourceTree = ""; }; + CF97204A0A9F3BBC002CEEDD /* ARMRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMRegisterInfo.h; sourceTree = ""; }; + CF97204B0A9F3BBC002CEEDD /* ARMRegisterInfo.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ARMRegisterInfo.td; sourceTree = ""; }; + CF97204C0A9F3BBC002CEEDD /* ARMTargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMTargetMachine.cpp; sourceTree = ""; }; + CF97204D0A9F3BBC002CEEDD /* ARMTargetMachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMTargetMachine.h; sourceTree = ""; }; + CF9720890A9F3C04002CEEDD /* PPCMachOWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCMachOWriter.cpp; sourceTree = ""; }; + CF97208A0A9F3C6F002CEEDD /* LCSSA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LCSSA.cpp; sourceTree = ""; }; + CF97208B0A9F3C6F002CEEDD /* LowerAllocations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LowerAllocations.cpp; sourceTree = ""; }; + CF97208C0A9F3C6F002CEEDD /* LowerInvoke.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LowerInvoke.cpp; sourceTree = ""; }; + CF97208D0A9F3C6F002CEEDD /* LowerSelect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LowerSelect.cpp; sourceTree = ""; }; + CF97208E0A9F3C6F002CEEDD /* LowerSwitch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LowerSwitch.cpp; sourceTree = ""; }; + CF97208F0A9F3C6F002CEEDD /* Mem2Reg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Mem2Reg.cpp; sourceTree = ""; }; + CF9720900A9F3CA2002CEEDD /* ValueTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueTypes.cpp; path = ../lib/VMCore/ValueTypes.cpp; sourceTree = SOURCE_ROOT; }; + CF9720910A9F3CC7002CEEDD /* FindBugs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FindBugs.cpp; sourceTree = ""; }; + CF9720920A9F3CC7002CEEDD /* ToolRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ToolRunner.cpp; sourceTree = ""; }; + CF9720930A9F3CC7002CEEDD /* ToolRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ToolRunner.h; sourceTree = ""; }; + CF9720970A9F3D4D002CEEDD /* IntrinsicEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntrinsicEmitter.cpp; sourceTree = ""; }; + CF9720980A9F3D4D002CEEDD /* IntrinsicEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntrinsicEmitter.h; sourceTree = ""; }; CF9BCD0808C74DE0001E7011 /* SubtargetFeature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubtargetFeature.h; sourceTree = ""; }; CF9BCD1508C75070001E7011 /* SubtargetFeature.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubtargetFeature.cpp; sourceTree = ""; }; + CFA702BB0A6FA85F0006009A /* AlphaGenAsmWriter.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenAsmWriter.inc; sourceTree = ""; }; + CFA702BC0A6FA85F0006009A /* AlphaGenCodeEmitter.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenCodeEmitter.inc; sourceTree = ""; }; + CFA702BD0A6FA85F0006009A /* AlphaGenDAGISel.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenDAGISel.inc; sourceTree = ""; }; + CFA702BE0A6FA85F0006009A /* AlphaGenInstrInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenInstrInfo.inc; sourceTree = ""; }; + CFA702BF0A6FA85F0006009A /* AlphaGenInstrNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenInstrNames.inc; sourceTree = ""; }; + CFA702C00A6FA85F0006009A /* AlphaGenRegisterInfo.h.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenRegisterInfo.h.inc; sourceTree = ""; }; + CFA702C10A6FA85F0006009A /* AlphaGenRegisterInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenRegisterInfo.inc; sourceTree = ""; }; + CFA702C20A6FA85F0006009A /* AlphaGenRegisterNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenRegisterNames.inc; sourceTree = ""; }; + CFA702C30A6FA85F0006009A /* AlphaGenSubtarget.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = AlphaGenSubtarget.inc; sourceTree = ""; }; + CFA702C40A6FA8910006009A /* IA64GenAsmWriter.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = IA64GenAsmWriter.inc; sourceTree = ""; }; + CFA702C50A6FA8910006009A /* IA64GenDAGISel.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = IA64GenDAGISel.inc; sourceTree = ""; }; + CFA702C60A6FA8910006009A /* IA64GenInstrInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = IA64GenInstrInfo.inc; sourceTree = ""; }; + CFA702C70A6FA8910006009A /* IA64GenInstrNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = IA64GenInstrNames.inc; sourceTree = ""; }; + CFA702C80A6FA8910006009A /* IA64GenRegisterInfo.h.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = IA64GenRegisterInfo.h.inc; sourceTree = ""; }; + CFA702C90A6FA8910006009A /* IA64GenRegisterInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = IA64GenRegisterInfo.inc; sourceTree = ""; }; + CFA702CA0A6FA8910006009A /* IA64GenRegisterNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = IA64GenRegisterNames.inc; sourceTree = ""; }; + CFA702CB0A6FA8AD0006009A /* PPCGenAsmWriter.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenAsmWriter.inc; sourceTree = ""; }; + CFA702CC0A6FA8AD0006009A /* PPCGenCodeEmitter.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenCodeEmitter.inc; sourceTree = ""; }; + CFA702CD0A6FA8AD0006009A /* PPCGenDAGISel.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenDAGISel.inc; sourceTree = ""; }; + CFA702CE0A6FA8AD0006009A /* PPCGenInstrInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenInstrInfo.inc; sourceTree = ""; }; + CFA702CF0A6FA8AD0006009A /* PPCGenInstrNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenInstrNames.inc; sourceTree = ""; }; + CFA702D00A6FA8AD0006009A /* PPCGenRegisterInfo.h.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenRegisterInfo.h.inc; sourceTree = ""; }; + CFA702D10A6FA8AD0006009A /* PPCGenRegisterInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenRegisterInfo.inc; sourceTree = ""; }; + CFA702D20A6FA8AD0006009A /* PPCGenRegisterNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenRegisterNames.inc; sourceTree = ""; }; + CFA702D30A6FA8AD0006009A /* PPCGenSubtarget.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = PPCGenSubtarget.inc; sourceTree = ""; }; + CFA702D40A6FA8DD0006009A /* X86GenAsmWriter.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenAsmWriter.inc; sourceTree = ""; }; + CFA702D50A6FA8DD0006009A /* X86GenAsmWriter1.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenAsmWriter1.inc; sourceTree = ""; }; + CFA702D60A6FA8DD0006009A /* X86GenDAGISel.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenDAGISel.inc; sourceTree = ""; }; + CFA702D70A6FA8DD0006009A /* X86GenInstrInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenInstrInfo.inc; sourceTree = ""; }; + CFA702D80A6FA8DD0006009A /* X86GenInstrNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenInstrNames.inc; sourceTree = ""; }; + CFA702D90A6FA8DD0006009A /* X86GenRegisterInfo.h.inc */ = {isa = PBXFileReference; fileEncoding = 4; languageSpecificationIdentifier = c.cpp; lastKnownFileType = sourcecode.pascal; path = X86GenRegisterInfo.h.inc; sourceTree = ""; }; + CFA702DA0A6FA8DD0006009A /* X86GenRegisterInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenRegisterInfo.inc; sourceTree = ""; }; + CFA702DB0A6FA8DD0006009A /* X86GenRegisterNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenRegisterNames.inc; sourceTree = ""; }; + CFA702DC0A6FA8DD0006009A /* X86GenSubtarget.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenSubtarget.inc; sourceTree = ""; }; CFBD8B1A090E76540020B107 /* AlphaISelDAGToDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaISelDAGToDAG.cpp; sourceTree = ""; }; CFBD8B1B090E76540020B107 /* AlphaISelLowering.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaISelLowering.cpp; sourceTree = ""; }; CFBD8B1C090E76540020B107 /* AlphaISelLowering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlphaISelLowering.h; sourceTree = ""; }; @@ -117,6 +186,9 @@ CFC244BF0959F2E3009F8C47 /* IA64ISelDAGToDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IA64ISelDAGToDAG.cpp; sourceTree = ""; }; CFC244C00959F2E3009F8C47 /* IA64ISelLowering.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IA64ISelLowering.cpp; sourceTree = ""; }; CFC244C10959F2E3009F8C47 /* IA64ISelLowering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IA64ISelLowering.h; sourceTree = ""; }; + CFD7E4F30A798FC3000C7379 /* LinkAllCodegenComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkAllCodegenComponents.h; sourceTree = ""; }; + CFE21C780A80CC0600D3E908 /* RegAllocRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegAllocRegistry.h; sourceTree = ""; }; + CFE21C7B0A80CC1C00D3E908 /* SchedulerRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SchedulerRegistry.h; sourceTree = ""; }; CFE420FA0A66F67300AB4BF6 /* CallTargets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallTargets.h; sourceTree = ""; }; CFE420FB0A66F67300AB4BF6 /* MachineJumpTableInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachineJumpTableInfo.h; sourceTree = ""; }; CFE420FC0A66F67300AB4BF6 /* ValueTypes.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ValueTypes.td; sourceTree = ""; }; @@ -125,13 +197,11 @@ CFE420FF0A66F67300AB4BF6 /* IntrinsicsPowerPC.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IntrinsicsPowerPC.td; sourceTree = ""; }; CFE421000A66F67300AB4BF6 /* IntrinsicsX86.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IntrinsicsX86.td; sourceTree = ""; }; CFE421010A66F67300AB4BF6 /* LinkAllVMCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkAllVMCore.h; sourceTree = ""; }; - CFE421020A66F67300AB4BF6 /* IncludeFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IncludeFile.h; sourceTree = ""; }; CFE421030A66F67300AB4BF6 /* Visibility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Visibility.h; sourceTree = ""; }; CFE421040A66F7AB00AB4BF6 /* ConstantRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConstantRange.cpp; sourceTree = ""; }; CFE421050A66F7D800AB4BF6 /* CallTargets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallTargets.cpp; sourceTree = ""; }; CFE421060A66F86D00AB4BF6 /* ScheduleDAGRRList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScheduleDAGRRList.cpp; sourceTree = ""; }; CFE421070A66F8DC00AB4BF6 /* GraphWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphWriter.cpp; sourceTree = ""; }; - CFE421080A66F8DC00AB4BF6 /* IncludeFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IncludeFile.cpp; sourceTree = ""; }; CFE421090A66F93300AB4BF6 /* Alarm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Alarm.cpp; sourceTree = ""; }; CFE4210A0A66F93300AB4BF6 /* Alarm.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = Alarm.inc; sourceTree = ""; }; CFE4210B0A66F96400AB4BF6 /* AlphaSchedule.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AlphaSchedule.td; sourceTree = ""; }; @@ -185,7 +255,6 @@ DE4DA0390911476D0012D44B /* LoopSimplify.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = LoopSimplify.cpp; path = ../lib/Transforms/Utils/LoopSimplify.cpp; sourceTree = SOURCE_ROOT; }; DE4DA03C091147920012D44B /* LiveInterval.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = LiveInterval.h; path = ../include/llvm/CodeGen/LiveInterval.h; sourceTree = SOURCE_ROOT; }; DE4DA03D091147920012D44B /* LiveIntervalAnalysis.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = LiveIntervalAnalysis.h; path = ../include/llvm/CodeGen/LiveIntervalAnalysis.h; sourceTree = SOURCE_ROOT; }; - DE4DA03E091147C00012D44B /* PrintSCC.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PrintSCC.cpp; path = ../tools/analyze/PrintSCC.cpp; sourceTree = SOURCE_ROOT; }; DE4DA065091148520012D44B /* SubtargetEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = SubtargetEmitter.cpp; path = ../utils/TableGen/SubtargetEmitter.cpp; sourceTree = SOURCE_ROOT; }; DE4DA066091148520012D44B /* SubtargetEmitter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SubtargetEmitter.h; path = ../utils/TableGen/SubtargetEmitter.h; sourceTree = SOURCE_ROOT; }; DE66EC5B08ABE86900323D32 /* AsmWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AsmWriter.cpp; path = ../lib/VMCore/AsmWriter.cpp; sourceTree = SOURCE_ROOT; }; @@ -285,7 +354,6 @@ DE66ED9408ABEC2B00323D32 /* SelectionDAGPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SelectionDAGPrinter.cpp; sourceTree = ""; }; DE66ED9508ABEC2B00323D32 /* TwoAddressInstructionPass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TwoAddressInstructionPass.cpp; sourceTree = ""; }; DE66ED9608ABEC2B00323D32 /* UnreachableBlockElim.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = UnreachableBlockElim.cpp; sourceTree = ""; }; - DE66ED9708ABEC2B00323D32 /* ValueTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ValueTypes.cpp; sourceTree = ""; }; DE66ED9808ABEC2B00323D32 /* VirtRegMap.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = VirtRegMap.cpp; sourceTree = ""; }; DE66ED9908ABEC2B00323D32 /* VirtRegMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VirtRegMap.h; sourceTree = ""; }; DE66EDB108ABEC7300323D32 /* Debugger.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Debugger.cpp; sourceTree = ""; }; @@ -410,7 +478,6 @@ DE66F08B08ABEE6000323D32 /* TargetData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetData.cpp; sourceTree = ""; }; DE66F08C08ABEE6000323D32 /* TargetFrameInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetFrameInfo.cpp; sourceTree = ""; }; DE66F08D08ABEE6000323D32 /* TargetInstrInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetInstrInfo.cpp; sourceTree = ""; }; - DE66F08E08ABEE6000323D32 /* TargetLowering.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetLowering.cpp; sourceTree = ""; }; DE66F08F08ABEE6000323D32 /* TargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetMachine.cpp; sourceTree = ""; }; DE66F09008ABEE6000323D32 /* TargetMachineRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetMachineRegistry.cpp; sourceTree = ""; }; DE66F09208ABEE6000323D32 /* TargetSubtarget.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetSubtarget.cpp; sourceTree = ""; }; @@ -481,13 +548,8 @@ DE66F1A808ABEFB400323D32 /* LoopStrengthReduce.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LoopStrengthReduce.cpp; sourceTree = ""; }; DE66F1A908ABEFB400323D32 /* LoopUnroll.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LoopUnroll.cpp; sourceTree = ""; }; DE66F1AA08ABEFB400323D32 /* LoopUnswitch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LoopUnswitch.cpp; sourceTree = ""; }; - DE66F1AB08ABEFB400323D32 /* LowerAllocations.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LowerAllocations.cpp; sourceTree = ""; }; DE66F1AD08ABEFB400323D32 /* LowerGC.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LowerGC.cpp; sourceTree = ""; }; - DE66F1AE08ABEFB400323D32 /* LowerInvoke.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LowerInvoke.cpp; sourceTree = ""; }; DE66F1AF08ABEFB400323D32 /* LowerPacked.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LowerPacked.cpp; sourceTree = ""; }; - DE66F1B008ABEFB400323D32 /* LowerSelect.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LowerSelect.cpp; sourceTree = ""; }; - DE66F1B108ABEFB400323D32 /* LowerSwitch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LowerSwitch.cpp; sourceTree = ""; }; - DE66F1B308ABEFB400323D32 /* Mem2Reg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Mem2Reg.cpp; sourceTree = ""; }; DE66F1B508ABEFB400323D32 /* Reassociate.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Reassociate.cpp; sourceTree = ""; }; DE66F1B608ABEFB400323D32 /* ScalarReplAggregates.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ScalarReplAggregates.cpp; sourceTree = ""; }; DE66F1B708ABEFB400323D32 /* SCCP.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SCCP.cpp; sourceTree = ""; }; @@ -594,7 +656,6 @@ DE66F24708ABF03100323D32 /* SelectionDAGISel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SelectionDAGISel.h; sourceTree = ""; }; DE66F24808ABF03100323D32 /* SelectionDAGNodes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SelectionDAGNodes.h; sourceTree = ""; }; DE66F24908ABF03100323D32 /* SSARegMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SSARegMap.h; sourceTree = ""; }; - DE66F24A08ABF03100323D32 /* ValueSet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ValueSet.h; sourceTree = ""; }; DE66F24B08ABF03100323D32 /* ValueTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ValueTypes.h; sourceTree = ""; }; DE66F24E08ABF03100323D32 /* alloca.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = alloca.h; sourceTree = ""; }; DE66F25008ABF03100323D32 /* config.h.in */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = config.h.in; sourceTree = ""; }; @@ -680,7 +741,6 @@ DE66F2AA08ABF03200323D32 /* TargetSubtarget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TargetSubtarget.h; sourceTree = ""; }; DE66F2AC08ABF03200323D32 /* Instrumentation.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Instrumentation.h; sourceTree = ""; }; DE66F2AD08ABF03200323D32 /* IPO.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IPO.h; sourceTree = ""; }; - DE66F2AE08ABF03200323D32 /* LinkAllPasses.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LinkAllPasses.h; sourceTree = ""; }; DE66F2AF08ABF03200323D32 /* Scalar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Scalar.h; sourceTree = ""; }; DE66F2B108ABF03200323D32 /* BasicBlockUtils.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BasicBlockUtils.h; sourceTree = ""; }; DE66F2B208ABF03200323D32 /* Cloning.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Cloning.h; sourceTree = ""; }; @@ -692,9 +752,6 @@ DE66F2B808ABF03200323D32 /* Use.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Use.h; sourceTree = ""; }; DE66F2B908ABF03200323D32 /* User.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = User.h; sourceTree = ""; }; DE66F2BA08ABF03200323D32 /* Value.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Value.h; sourceTree = ""; }; - DE66F2BF08ABF14400323D32 /* AnalysisWrappers.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AnalysisWrappers.cpp; sourceTree = ""; }; - DE66F2C008ABF14400323D32 /* analyze.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = analyze.cpp; sourceTree = ""; }; - DE66F2C908ABF14400323D32 /* GraphPrinters.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GraphPrinters.cpp; sourceTree = ""; }; DE66F2CC08ABF14400323D32 /* BugDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BugDriver.cpp; sourceTree = ""; }; DE66F2CD08ABF14400323D32 /* BugDriver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BugDriver.h; sourceTree = ""; }; DE66F2CE08ABF14400323D32 /* bugpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = bugpoint.cpp; sourceTree = ""; }; @@ -866,6 +923,26 @@ name = LLVM; sourceTree = ""; }; + CF9720380A9F3BBC002CEEDD /* ARM */ = { + isa = PBXGroup; + children = ( + CF97203A0A9F3BBC002CEEDD /* ARM.h */, + CF97203B0A9F3BBC002CEEDD /* ARM.td */, + CF97203C0A9F3BBC002CEEDD /* ARMAsmPrinter.cpp */, + CF97203D0A9F3BBC002CEEDD /* ARMFrameInfo.h */, + CF9720450A9F3BBC002CEEDD /* ARMInstrInfo.cpp */, + CF9720460A9F3BBC002CEEDD /* ARMInstrInfo.h */, + CF9720470A9F3BBC002CEEDD /* ARMInstrInfo.td */, + CF9720480A9F3BBC002CEEDD /* ARMISelDAGToDAG.cpp */, + CF9720490A9F3BBC002CEEDD /* ARMRegisterInfo.cpp */, + CF97204A0A9F3BBC002CEEDD /* ARMRegisterInfo.h */, + CF97204B0A9F3BBC002CEEDD /* ARMRegisterInfo.td */, + CF97204C0A9F3BBC002CEEDD /* ARMTargetMachine.cpp */, + CF97204D0A9F3BBC002CEEDD /* ARMTargetMachine.h */, + ); + path = ARM; + sourceTree = ""; + }; CFE4213C0A66FAE100AB4BF6 /* Hello */ = { isa = PBXGroup; children = ( @@ -902,6 +979,7 @@ CF73C0BE098A551F00627152 /* TypeSymbolTable.cpp */, DE66EC6F08ABE86A00323D32 /* Value.cpp */, CF73C0BF098A551F00627152 /* ValueSymbolTable.cpp */, + CF9720900A9F3CA2002CEEDD /* ValueTypes.cpp */, DE66EC7008ABE86A00323D32 /* Verifier.cpp */, ); name = lib/VMCore; @@ -1045,6 +1123,8 @@ CF6529A6095B21A8007F884E /* MachineDebugInfo.cpp */, DE66ED7808ABEC2B00323D32 /* MachineFunction.cpp */, DE66ED7908ABEC2B00323D32 /* MachineInstr.cpp */, + CF4F27F60A7B6FA3004359F6 /* MachinePassRegistry.cpp */, + CF9720350A9F3ADC002CEEDD /* MachOWriter.cpp */, DE66ED7B08ABEC2B00323D32 /* Passes.cpp */, DE66ED7C08ABEC2B00323D32 /* PHIElimination.cpp */, DE66ED7D08ABEC2B00323D32 /* PhysRegTracker.h */, @@ -1054,7 +1134,6 @@ DE66ED8208ABEC2B00323D32 /* RegAllocSimple.cpp */, DE66ED9508ABEC2B00323D32 /* TwoAddressInstructionPass.cpp */, DE66ED9608ABEC2B00323D32 /* UnreachableBlockElim.cpp */, - DE66ED9708ABEC2B00323D32 /* ValueTypes.cpp */, DE66ED9808ABEC2B00323D32 /* VirtRegMap.cpp */, DE66ED9908ABEC2B00323D32 /* VirtRegMap.h */, ); @@ -1071,9 +1150,11 @@ CF7FFA200985081C008B0087 /* ScheduleDAGSimple.cpp */, DE694D9F08B51E0C0039C106 /* ScheduleDAG.cpp */, DE66ED9208ABEC2B00323D32 /* SelectionDAG.cpp */, + CF9720360A9F3B1C002CEEDD /* SelectionDAGCSEMap.cpp */, DE66ED9308ABEC2B00323D32 /* SelectionDAGISel.cpp */, DE66ED9408ABEC2B00323D32 /* SelectionDAGPrinter.cpp */, CFE421060A66F86D00AB4BF6 /* ScheduleDAGRRList.cpp */, + CF9720370A9F3B1C002CEEDD /* TargetLowering.cpp */, ); path = SelectionDAG; sourceTree = ""; @@ -1152,7 +1233,6 @@ CF79495D09B326D4005ADFCA /* Dwarf.cpp */, DE66EE3E08ABEDE600323D32 /* FileUtilities.cpp */, CFE421070A66F8DC00AB4BF6 /* GraphWriter.cpp */, - CFE421080A66F8DC00AB4BF6 /* IncludeFile.cpp */, DE66EE3F08ABEDE600323D32 /* IsInf.cpp */, DE66EE4008ABEDE600323D32 /* IsNAN.cpp */, DE66EE4208ABEDE600323D32 /* PluginLoader.cpp */, @@ -1259,6 +1339,7 @@ isa = PBXGroup; children = ( DE66EE9708ABEE5D00323D32 /* Alpha */, + CF9720380A9F3BBC002CEEDD /* ARM */, DE66EEC908ABEE5E00323D32 /* CBackend */, DE66EEE508ABEE5E00323D32 /* IA64 */, DE66EF1108ABEE5E00323D32 /* PowerPC */, @@ -1270,7 +1351,6 @@ DE66F08B08ABEE6000323D32 /* TargetData.cpp */, DE66F08C08ABEE6000323D32 /* TargetFrameInfo.cpp */, DE66F08D08ABEE6000323D32 /* TargetInstrInfo.cpp */, - DE66F08E08ABEE6000323D32 /* TargetLowering.cpp */, DE66F08F08ABEE6000323D32 /* TargetMachine.cpp */, DE66F09008ABEE6000323D32 /* TargetMachineRegistry.cpp */, CF490D14090541D30072DB1C /* TargetSchedule.td */, @@ -1284,6 +1364,15 @@ DE66EE9708ABEE5D00323D32 /* Alpha */ = { isa = PBXGroup; children = ( + CFA702BB0A6FA85F0006009A /* AlphaGenAsmWriter.inc */, + CFA702BC0A6FA85F0006009A /* AlphaGenCodeEmitter.inc */, + CFA702BD0A6FA85F0006009A /* AlphaGenDAGISel.inc */, + CFA702BE0A6FA85F0006009A /* AlphaGenInstrInfo.inc */, + CFA702BF0A6FA85F0006009A /* AlphaGenInstrNames.inc */, + CFA702C00A6FA85F0006009A /* AlphaGenRegisterInfo.h.inc */, + CFA702C10A6FA85F0006009A /* AlphaGenRegisterInfo.inc */, + CFA702C20A6FA85F0006009A /* AlphaGenRegisterNames.inc */, + CFA702C30A6FA85F0006009A /* AlphaGenSubtarget.inc */, DE66EE9808ABEE5E00323D32 /* Alpha.h */, CFBD8B1A090E76540020B107 /* AlphaISelDAGToDAG.cpp */, CFBD8B1B090E76540020B107 /* AlphaISelLowering.cpp */, @@ -1322,6 +1411,13 @@ DE66EEE508ABEE5E00323D32 /* IA64 */ = { isa = PBXGroup; children = ( + CFA702C40A6FA8910006009A /* IA64GenAsmWriter.inc */, + CFA702C50A6FA8910006009A /* IA64GenDAGISel.inc */, + CFA702C60A6FA8910006009A /* IA64GenInstrInfo.inc */, + CFA702C70A6FA8910006009A /* IA64GenInstrNames.inc */, + CFA702C80A6FA8910006009A /* IA64GenRegisterInfo.h.inc */, + CFA702C90A6FA8910006009A /* IA64GenRegisterInfo.inc */, + CFA702CA0A6FA8910006009A /* IA64GenRegisterNames.inc */, DE66EEF808ABEE5E00323D32 /* IA64.h */, DE66EEF908ABEE5E00323D32 /* IA64.td */, DE66EEFA08ABEE5E00323D32 /* IA64AsmPrinter.cpp */, @@ -1348,6 +1444,15 @@ DE66EF1108ABEE5E00323D32 /* PowerPC */ = { isa = PBXGroup; children = ( + CFA702CB0A6FA8AD0006009A /* PPCGenAsmWriter.inc */, + CFA702CC0A6FA8AD0006009A /* PPCGenCodeEmitter.inc */, + CFA702CD0A6FA8AD0006009A /* PPCGenDAGISel.inc */, + CFA702CE0A6FA8AD0006009A /* PPCGenInstrInfo.inc */, + CFA702CF0A6FA8AD0006009A /* PPCGenInstrNames.inc */, + CFA702D00A6FA8AD0006009A /* PPCGenRegisterInfo.h.inc */, + CFA702D10A6FA8AD0006009A /* PPCGenRegisterInfo.inc */, + CFA702D20A6FA8AD0006009A /* PPCGenRegisterNames.inc */, + CFA702D30A6FA8AD0006009A /* PPCGenSubtarget.inc */, CFE421130A66FA2D00AB4BF6 /* LICENSE.TXT */, CFE421140A66FA2D00AB4BF6 /* PPC.h */, CFE421150A66FA2D00AB4BF6 /* PPC.td */, @@ -1369,6 +1474,7 @@ CFE421250A66FA2D00AB4BF6 /* PPCISelLowering.h */, CFE421260A66FA2D00AB4BF6 /* PPCJITInfo.cpp */, CFE421270A66FA2D00AB4BF6 /* PPCJITInfo.h */, + CF9720890A9F3C04002CEEDD /* PPCMachOWriter.cpp */, CFE421280A66FA2D00AB4BF6 /* PPCPerfectShuffle.h */, CFE421290A66FA2D00AB4BF6 /* PPCRegisterInfo.cpp */, CFE4212A0A66FA2D00AB4BF6 /* PPCRegisterInfo.h */, @@ -1392,13 +1498,6 @@ DE66EF7008ABEE5F00323D32 /* Sparc */ = { isa = PBXGroup; children = ( - CF6527FA09D1BA3800C4B521 /* DelaySlotFiller.cpp */, - CF6527FB09D1BA3800C4B521 /* FPMover.cpp */, - CF6527FC09D1BA3800C4B521 /* Makefile */, - CF6527FD09D1BA3800C4B521 /* README.txt */, - CF6527FE09D1BA3800C4B521 /* Sparc.h */, - CF6527FF09D1BA3800C4B521 /* Sparc.td */, - CF65280009D1BA3800C4B521 /* SparcAsmPrinter.cpp */, CF65280109D1BA3800C4B521 /* SparcGenAsmWriter.inc */, CF65280209D1BA3800C4B521 /* SparcGenDAGISel.inc */, CF65280309D1BA3800C4B521 /* SparcGenInstrInfo.inc */, @@ -1407,6 +1506,13 @@ CF65280609D1BA3800C4B521 /* SparcGenRegisterInfo.inc */, CF65280709D1BA3800C4B521 /* SparcGenRegisterNames.inc */, CF65280809D1BA3800C4B521 /* SparcGenSubtarget.inc */, + CF6527FA09D1BA3800C4B521 /* DelaySlotFiller.cpp */, + CF6527FB09D1BA3800C4B521 /* FPMover.cpp */, + CF6527FC09D1BA3800C4B521 /* Makefile */, + CF6527FD09D1BA3800C4B521 /* README.txt */, + CF6527FE09D1BA3800C4B521 /* Sparc.h */, + CF6527FF09D1BA3800C4B521 /* Sparc.td */, + CF65280009D1BA3800C4B521 /* SparcAsmPrinter.cpp */, CF65280909D1BA3800C4B521 /* SparcInstrFormats.td */, CF65280A09D1BA3800C4B521 /* SparcInstrInfo.cpp */, CF65280B09D1BA3800C4B521 /* SparcInstrInfo.h */, @@ -1420,13 +1526,21 @@ CF65281309D1BA3800C4B521 /* SparcTargetMachine.cpp */, CF65281409D1BA3800C4B521 /* SparcTargetMachine.h */, ); - name = Sparc; - path = Skeleton; + path = Sparc; sourceTree = ""; }; DE66F09308ABEE6000323D32 /* X86 */ = { isa = PBXGroup; children = ( + CFA702D40A6FA8DD0006009A /* X86GenAsmWriter.inc */, + CFA702D50A6FA8DD0006009A /* X86GenAsmWriter1.inc */, + CFA702D60A6FA8DD0006009A /* X86GenDAGISel.inc */, + CFA702D70A6FA8DD0006009A /* X86GenInstrInfo.inc */, + CFA702D80A6FA8DD0006009A /* X86GenInstrNames.inc */, + CFA702D90A6FA8DD0006009A /* X86GenRegisterInfo.h.inc */, + CFA702DA0A6FA8DD0006009A /* X86GenRegisterInfo.inc */, + CFA702DB0A6FA8DD0006009A /* X86GenRegisterNames.inc */, + CFA702DC0A6FA8DD0006009A /* X86GenSubtarget.inc */, CFE421380A66FA8000AB4BF6 /* README-FPStack.txt */, CFE421390A66FA8000AB4BF6 /* README-SSE.txt */, CFE4213A0A66FA8000AB4BF6 /* README.txt */, @@ -1543,13 +1657,8 @@ DE66F1A808ABEFB400323D32 /* LoopStrengthReduce.cpp */, DE66F1A908ABEFB400323D32 /* LoopUnroll.cpp */, DE66F1AA08ABEFB400323D32 /* LoopUnswitch.cpp */, - DE66F1AB08ABEFB400323D32 /* LowerAllocations.cpp */, DE66F1AD08ABEFB400323D32 /* LowerGC.cpp */, - DE66F1AE08ABEFB400323D32 /* LowerInvoke.cpp */, DE66F1AF08ABEFB400323D32 /* LowerPacked.cpp */, - DE66F1B008ABEFB400323D32 /* LowerSelect.cpp */, - DE66F1B108ABEFB400323D32 /* LowerSwitch.cpp */, - DE66F1B308ABEFB400323D32 /* Mem2Reg.cpp */, DE66F1B508ABEFB400323D32 /* Reassociate.cpp */, CF73C0B9098A546000627152 /* Reg2Mem.cpp */, DE66F1B608ABEFB400323D32 /* ScalarReplAggregates.cpp */, @@ -1572,8 +1681,14 @@ DE66F1C308ABEFB400323D32 /* CodeExtractor.cpp */, DE66F1E008ABEFB400323D32 /* DemoteRegToStack.cpp */, DE66F1E108ABEFB400323D32 /* InlineFunction.cpp */, + CF97208A0A9F3C6F002CEEDD /* LCSSA.cpp */, DE66F1E208ABEFB400323D32 /* Local.cpp */, DE4DA0390911476D0012D44B /* LoopSimplify.cpp */, + CF97208B0A9F3C6F002CEEDD /* LowerAllocations.cpp */, + CF97208C0A9F3C6F002CEEDD /* LowerInvoke.cpp */, + CF97208D0A9F3C6F002CEEDD /* LowerSelect.cpp */, + CF97208E0A9F3C6F002CEEDD /* LowerSwitch.cpp */, + CF97208F0A9F3C6F002CEEDD /* Mem2Reg.cpp */, DE66F1E408ABEFB400323D32 /* PromoteMemoryToRegister.cpp */, DE66F1E508ABEFB400323D32 /* SimplifyCFG.cpp */, DE66F1E608ABEFB400323D32 /* UnifyFunctionExitNodes.cpp */, @@ -1620,7 +1735,9 @@ CFE420FF0A66F67300AB4BF6 /* IntrinsicsPowerPC.td */, CFE421000A66F67300AB4BF6 /* IntrinsicsX86.td */, CF8D62FA09C2226F006017BA /* Intrinsics.td */, + CF9720260A9F39B9002CEEDD /* LinkAllPasses.h */, CFE421010A66F67300AB4BF6 /* LinkAllVMCore.h */, + CF9720270A9F39B9002CEEDD /* LinkTimeOptimizer.h */, DE66F26708ABF03100323D32 /* Linker.h */, DE66F26808ABF03100323D32 /* Module.h */, DE66F26908ABF03200323D32 /* ModuleProvider.h */, @@ -1684,7 +1801,6 @@ DE66F21308ABF03100323D32 /* Interval.h */, DE66F21408ABF03100323D32 /* IntervalIterator.h */, DE66F21508ABF03100323D32 /* IntervalPartition.h */, - CF73C0A7098A507300627152 /* LinkAllAnalyses.h */, DE66F21608ABF03100323D32 /* LoadValueNumbering.h */, DE66F21708ABF03100323D32 /* LoopInfo.h */, DE66F21808ABF03100323D32 /* Passes.h */, @@ -1750,6 +1866,7 @@ DE66F23708ABF03100323D32 /* ELFWriter.h */, DE66F23808ABF03100323D32 /* InstrScheduling.h */, DE66F23908ABF03100323D32 /* IntrinsicLowering.h */, + CFD7E4F30A798FC3000C7379 /* LinkAllCodegenComponents.h */, DE4DA03C091147920012D44B /* LiveInterval.h */, DE4DA03D091147920012D44B /* LiveIntervalAnalysis.h */, DE66F23A08ABF03100323D32 /* LiveVariables.h */, @@ -1764,15 +1881,19 @@ DE66F24208ABF03100323D32 /* MachineInstrBuilder.h */, CFE420FB0A66F67300AB4BF6 /* MachineJumpTableInfo.h */, CF6527D909D1A53400C4B521 /* MachineLocation.h */, + CF4F27E60A7B6E23004359F6 /* MachinePassRegistry.h */, DE66F24308ABF03100323D32 /* MachineRelocation.h */, + CF9720240A9F3969002CEEDD /* MachOWriter.h */, DE66F24408ABF03100323D32 /* Passes.h */, + CFE21C780A80CC0600D3E908 /* RegAllocRegistry.h */, DE66F24508ABF03100323D32 /* SchedGraphCommon.h */, CF7FFA2109850864008B0087 /* ScheduleDAG.h */, + CFE21C7B0A80CC1C00D3E908 /* SchedulerRegistry.h */, DE66F24608ABF03100323D32 /* SelectionDAG.h */, + CF9720250A9F3969002CEEDD /* SelectionDAGCSEMap.h */, DE66F24708ABF03100323D32 /* SelectionDAGISel.h */, DE66F24808ABF03100323D32 /* SelectionDAGNodes.h */, DE66F24908ABF03100323D32 /* SSARegMap.h */, - DE66F24A08ABF03100323D32 /* ValueSet.h */, DE66F24B08ABF03100323D32 /* ValueTypes.h */, CFE420FC0A66F67300AB4BF6 /* ValueTypes.td */, ); @@ -1834,7 +1955,6 @@ DE66F27E08ABF03200323D32 /* FileUtilities.h */, DE66F27F08ABF03200323D32 /* GetElementPtrTypeIterator.h */, DE66F28008ABF03200323D32 /* GraphWriter.h */, - CFE421020A66F67300AB4BF6 /* IncludeFile.h */, DE66F28108ABF03200323D32 /* InstIterator.h */, DE66F28208ABF03200323D32 /* InstVisitor.h */, DE66F28308ABF03200323D32 /* LeakDetector.h */, @@ -1860,6 +1980,7 @@ children = ( CF73C0AE098A51AD00627152 /* Alarm.h */, DE66F29508ABF03200323D32 /* DynamicLibrary.h */, + CF9720340A9F3A41002CEEDD /* IncludeFile.h */, DE66F29608ABF03200323D32 /* LICENSE.TXT */, DE66F29708ABF03200323D32 /* MappedFile.h */, DE66F29808ABF03200323D32 /* Memory.h */, @@ -1897,7 +2018,6 @@ children = ( DE66F2AC08ABF03200323D32 /* Instrumentation.h */, DE66F2AD08ABF03200323D32 /* IPO.h */, - DE66F2AE08ABF03200323D32 /* LinkAllPasses.h */, CF73C0AF098A51DD00627152 /* RSProfiling.h */, DE66F2AF08ABF03200323D32 /* Scalar.h */, DE66F2B008ABF03200323D32 /* Utils */, @@ -1921,7 +2041,6 @@ DE66F2BD08ABF14400323D32 /* tools */ = { isa = PBXGroup; children = ( - DE66F2BE08ABF14400323D32 /* analyze */, DE66F2CB08ABF14400323D32 /* bugpoint */, DE66F2F008ABF14400323D32 /* gccld */, DE66F31E08ABF14400323D32 /* llvm-db */, @@ -1945,17 +2064,6 @@ path = ../tools; sourceTree = SOURCE_ROOT; }; - DE66F2BE08ABF14400323D32 /* analyze */ = { - isa = PBXGroup; - children = ( - DE66F2BF08ABF14400323D32 /* AnalysisWrappers.cpp */, - DE66F2C008ABF14400323D32 /* analyze.cpp */, - DE66F2C908ABF14400323D32 /* GraphPrinters.cpp */, - DE4DA03E091147C00012D44B /* PrintSCC.cpp */, - ); - path = analyze; - sourceTree = ""; - }; DE66F2CB08ABF14400323D32 /* bugpoint */ = { isa = PBXGroup; children = ( @@ -1965,10 +2073,13 @@ DE66F2CF08ABF14400323D32 /* CrashDebugger.cpp */, DE66F2E208ABF14400323D32 /* ExecutionDriver.cpp */, DE66F2E308ABF14400323D32 /* ExtractFunction.cpp */, + CF9720910A9F3CC7002CEEDD /* FindBugs.cpp */, DE66F2E408ABF14400323D32 /* ListReducer.h */, DE66F2E608ABF14400323D32 /* Miscompilation.cpp */, DE66F2E708ABF14400323D32 /* OptimizerDriver.cpp */, DE66F2E808ABF14400323D32 /* TestPasses.cpp */, + CF9720920A9F3CC7002CEEDD /* ToolRunner.cpp */, + CF9720930A9F3CC7002CEEDD /* ToolRunner.h */, ); path = bugpoint; sourceTree = ""; @@ -2152,6 +2263,8 @@ DE81706808CFB44D0093BDEF /* DAGISelEmitter.h */, DE81708408CFB44D0093BDEF /* FileLexer.l */, DE81708808CFB44D0093BDEF /* FileParser.y */, + CF9720970A9F3D4D002CEEDD /* IntrinsicEmitter.cpp */, + CF9720980A9F3D4D002CEEDD /* IntrinsicEmitter.h */, DE81708908CFB44D0093BDEF /* InstrInfoEmitter.cpp */, DE81708A08CFB44D0093BDEF /* InstrInfoEmitter.h */, DE81708E08CFB44D0093BDEF /* Record.cpp */, From lattner at cs.uiuc.edu Fri Aug 25 12:15:38 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 25 Aug 2006 12:15:38 -0500 Subject: [llvm-commits] CVS: llvm/projects/Stacker/lib/compiler/Makefile Message-ID: <200608251715.k7PHFcpa029301@zion.cs.uiuc.edu> Changes in directory llvm/projects/Stacker/lib/compiler: Makefile updated: 1.9 -> 1.10 --- Log message: Fix a race condition in the makefile that broke grawp's tester last night. --- Diffs of the changes: (+1 -0) Makefile | 1 + 1 files changed, 1 insertion(+) Index: llvm/projects/Stacker/lib/compiler/Makefile diff -u llvm/projects/Stacker/lib/compiler/Makefile:1.9 llvm/projects/Stacker/lib/compiler/Makefile:1.10 --- llvm/projects/Stacker/lib/compiler/Makefile:1.9 Thu Jul 6 19:20:39 2006 +++ llvm/projects/Stacker/lib/compiler/Makefile Fri Aug 25 12:15:23 2006 @@ -18,3 +18,4 @@ CompileCommonOpts := $(filter-out -Wno-long-long,$(CompileCommonOpts)) $(ObjDir)/Lexer.o : $(PROJ_SRC_DIR)/StackerParser.h +$(ObjDir)/StackerCompiler.o : $(PROJ_SRC_DIR)/StackerParser.h From resistor at mac.com Fri Aug 25 12:41:39 2006 From: resistor at mac.com (Owen Anderson) Date: Fri, 25 Aug 2006 12:41:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Message-ID: <200608251741.k7PHfdo6029755@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: IndVarSimplify.cpp updated: 1.91 -> 1.92 --- Log message: Reapply the indvars patch, since nothing blew up last night. --- Diffs of the changes: (+1 -0) IndVarSimplify.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.91 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.92 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.91 Thu Aug 24 22:45:57 2006 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Fri Aug 25 12:41:25 2006 @@ -79,6 +79,7 @@ AU.addRequired(); AU.addRequired(); AU.addPreservedID(LoopSimplifyID); + AU.addPreservedID(LCSSAID); AU.setPreservesCFG(); } private: From reid at x10sys.com Fri Aug 25 12:43:35 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 12:43:35 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvmc/CompilerDriver.cpp Message-ID: <200608251743.k7PHhZPV029891@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: CompilerDriver.cpp updated: 1.40 -> 1.41 --- Log message: For PR797: http://llvm.org/PR797 : Remove exception throwing/handling from lib/Bytecode, and adjust its users to compensate for changes in the interface. --- Diffs of the changes: (+3 -2) CompilerDriver.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/tools/llvmc/CompilerDriver.cpp diff -u llvm/tools/llvmc/CompilerDriver.cpp:1.40 llvm/tools/llvmc/CompilerDriver.cpp:1.41 --- llvm/tools/llvmc/CompilerDriver.cpp:1.40 Tue Aug 22 14:01:30 2006 +++ llvm/tools/llvmc/CompilerDriver.cpp Fri Aug 25 12:43:11 2006 @@ -576,7 +576,7 @@ if (fullpath.isBytecodeFile()) { // Process the dependent libraries recursively Module::LibraryListType modlibs; - if (GetBytecodeDependentLibraries(fullpath.toString(),modlibs)) { + if (GetBytecodeDependentLibraries(fullpath.toString(),modlibs,&err)) { // Traverse the dependent libraries list Module::lib_iterator LI = modlibs.begin(); Module::lib_iterator LE = modlibs.end(); @@ -598,7 +598,8 @@ "The dependent libraries could not be extracted from '") + fullpath.toString(); return false; - } + } else + return false; } return true; } From reid at x10sys.com Fri Aug 25 12:43:34 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 12:43:34 -0500 Subject: [llvm-commits] CVS: llvm/tools/lli/lli.cpp Message-ID: <200608251743.k7PHhYJV029885@zion.cs.uiuc.edu> Changes in directory llvm/tools/lli: lli.cpp updated: 1.58 -> 1.59 --- Log message: For PR797: http://llvm.org/PR797 : Remove exception throwing/handling from lib/Bytecode, and adjust its users to compensate for changes in the interface. --- Diffs of the changes: (+3 -4) lli.cpp | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) Index: llvm/tools/lli/lli.cpp diff -u llvm/tools/lli/lli.cpp:1.58 llvm/tools/lli/lli.cpp:1.59 --- llvm/tools/lli/lli.cpp:1.58 Tue Aug 1 17:34:35 2006 +++ llvm/tools/lli/lli.cpp Fri Aug 25 12:43:11 2006 @@ -59,11 +59,10 @@ // Load the bytecode... std::string ErrorMsg; ModuleProvider *MP = 0; - try { - MP = getBytecodeModuleProvider(InputFile); - } catch (std::string &err) { + MP = getBytecodeModuleProvider(InputFile, &ErrorMsg); + if (!MP) { std::cerr << "Error loading program '" << InputFile << "': " - << err << "\n"; + << ErrorMsg << "\n"; exit(1); } From reid at x10sys.com Fri Aug 25 12:43:31 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 12:43:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/Debugger/Debugger.cpp Message-ID: <200608251743.k7PHhVla029879@zion.cs.uiuc.edu> Changes in directory llvm/lib/Debugger: Debugger.cpp updated: 1.6 -> 1.7 --- Log message: For PR797: http://llvm.org/PR797 : Remove exception throwing/handling from lib/Bytecode, and adjust its users to compensate for changes in the interface. --- Diffs of the changes: (+1 -9) Debugger.cpp | 10 +--------- 1 files changed, 1 insertion(+), 9 deletions(-) Index: llvm/lib/Debugger/Debugger.cpp diff -u llvm/lib/Debugger/Debugger.cpp:1.6 llvm/lib/Debugger/Debugger.cpp:1.7 --- llvm/lib/Debugger/Debugger.cpp:1.6 Fri Mar 10 16:39:48 2006 +++ llvm/lib/Debugger/Debugger.cpp Fri Aug 25 12:43:11 2006 @@ -45,15 +45,7 @@ static Module * getMaterializedModuleProvider(const std::string &Filename) { - try { - std::auto_ptr Result(getBytecodeModuleProvider(Filename)); - if (!Result.get()) return 0; - - Result->materializeModule(); - return Result.release()->releaseModule(); - } catch (...) { - return 0; - } + return ParseBytecodeFile(Filename); } /// loadProgram - If a program is currently loaded, unload it. Then search From reid at x10sys.com Fri Aug 25 12:43:34 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 12:43:34 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/Reader.h Message-ID: <200608251743.k7PHhYE8029882@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bytecode: Reader.h updated: 1.25 -> 1.26 --- Log message: For PR797: http://llvm.org/PR797 : Remove exception throwing/handling from lib/Bytecode, and adjust its users to compensate for changes in the interface. --- Diffs of the changes: (+52 -24) Reader.h | 76 +++++++++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 52 insertions(+), 24 deletions(-) Index: llvm/include/llvm/Bytecode/Reader.h diff -u llvm/include/llvm/Bytecode/Reader.h:1.25 llvm/include/llvm/Bytecode/Reader.h:1.26 --- llvm/include/llvm/Bytecode/Reader.h:1.25 Thu Apr 21 22:27:20 2005 +++ llvm/include/llvm/Bytecode/Reader.h Fri Aug 25 12:43:11 2006 @@ -29,48 +29,75 @@ // Forward declare the handler class class BytecodeHandler; -/// getBytecodeModuleProvider - lazy function-at-a-time loading from a file -/// +/// This function returns a ModuleProvider that can be used to do lazy +/// function-at-a-time loading from a bytecode file. +/// @returns NULL on error +/// @returns ModuleProvider* if successful +/// @brief Get a ModuleProvide for a bytecode file. ModuleProvider *getBytecodeModuleProvider( - const std::string &Filename, ///< Name of file to be read - BytecodeHandler* H = 0 ///< Optional handler for reader events + const std::string &Filename, ///< Name of file to be read + std::string* ErrMsg, ///< Optional error message holder + BytecodeHandler* H = 0 ///< Optional handler for reader events ); -/// getBytecodeBufferModuleProvider - lazy function-at-a-time loading from a -/// buffer -/// -ModuleProvider *getBytecodeBufferModuleProvider(const unsigned char *Buffer, - unsigned BufferSize, - const std::string &ModuleID="", - BytecodeHandler* H = 0); +/// This function returns a ModuleProvider that can be used to do lazy +/// function function-at-a-time loading from a bytecode buffer. +/// @returns NULL on error +/// @returns ModuleProvider* if successful +/// @brief Get a ModuleProvider for a bytecode buffer. +ModuleProvider *getBytecodeBufferModuleProvider( + const unsigned char *Buffer, ///< Start of buffer to parse + unsigned BufferSize, ///< Size of the buffer + const std::string &ModuleID, ///< Name to give the module + std::string* ErrMsg, ///< Optional place to return an error message + BytecodeHandler* H ///< Optional handler for reader events +); +/// This is the main interface to bytecode parsing. It opens the file specified +/// by \p Filename and parses the entire file, returing the corresponding Module +/// object if successful. +/// @returns NULL on error +/// @returns the module corresponding to the bytecode file, if successful /// @brief Parse the given bytecode file -Module* ParseBytecodeFile(const std::string &Filename, - std::string *ErrorStr = 0); +Module* ParseBytecodeFile( + const std::string &Filename, ///< Name of file to parse + std::string *ErrMsg = 0 ///< Optional place to return an error message +); +/// Parses a bytecode buffer specified by \p Buffer and \p BufferSize. +/// @returns NULL on error +/// @returns the module corresponding to the bytecode buffer, if successful /// @brief Parse a given bytecode buffer -Module* ParseBytecodeBuffer(const unsigned char *Buffer, - unsigned BufferSize, - const std::string &ModuleID = "", - std::string *ErrorStr = 0); +Module* ParseBytecodeBuffer( + const unsigned char *Buffer, ///< Start of buffer to parse + unsigned BufferSize, ///< Size of the buffer + const std::string &ModuleID="", ///< Name to give the module + std::string *ErrMsg = 0 ///< Optional place to return an error message +); /// This function will read only the necessary parts of a bytecode file in order /// to determine the list of dependent libraries encoded within it. The \p /// deplibs parameter will contain a vector of strings of the bytecode module's /// dependent libraries. -/// @returns true on success, false otherwise +/// @returns true on error, false otherwise /// @brief Get the list of dependent libraries from a bytecode file. -bool GetBytecodeDependentLibraries(const std::string &fileName, - Module::LibraryListType& deplibs); +bool GetBytecodeDependentLibraries( + const std::string &fileName, ///< File name to read bytecode from + Module::LibraryListType& deplibs, ///< List of dependent libraries extracted + std::string* ErrMsg ///< Optional error message holder +); /// This function will read only the necessary parts of a bytecode file in order /// to obtain a list of externally visible global symbols that the bytecode /// module defines. This is used for archiving and linking when only the list /// of symbols the module defines is needed. -/// @returns true on success, false otherwise +/// @returns true on error, false otherwise /// @brief Get a bytecode file's externally visibile defined global symbols. -bool GetBytecodeSymbols(const sys::Path& fileName, - std::vector& syms); +bool GetBytecodeSymbols( + const sys::Path& fileName, ///< Filename to read bytecode from + std::vector& syms, ///< Vector to return symbols in + std::string* ErrMsg ///< Optional error message holder +); /// This function will read only the necessary parts of a bytecode buffer in /// order to obtain a list of externally visible global symbols that the @@ -83,7 +110,8 @@ const unsigned char*Buffer, ///< The buffer to be parsed unsigned Length, ///< The length of \p Buffer const std::string& ModuleID, ///< An identifier for the module - std::vector& symbols ///< The symbols defined in the module + std::vector& symbols, ///< The symbols defined in the module + std::string* ErrMsg ///< Optional error message holder ); } // End llvm namespace From reid at x10sys.com Fri Aug 25 12:43:34 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 12:43:34 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Message-ID: <200608251743.k7PHhYVT029888@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ReaderWrappers.cpp updated: 1.56 -> 1.57 --- Log message: For PR797: http://llvm.org/PR797 : Remove exception throwing/handling from lib/Bytecode, and adjust its users to compensate for changes in the interface. --- Diffs of the changes: (+134 -103) ReaderWrappers.cpp | 237 +++++++++++++++++++++++++++++------------------------ 1 files changed, 134 insertions(+), 103 deletions(-) Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.56 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.57 --- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.56 Tue Aug 22 11:10:12 2006 +++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Fri Aug 25 12:43:11 2006 @@ -35,6 +35,7 @@ /// class BytecodeFileReader : public BytecodeReader { private: + std::string fileName; sys::MappedFile mapFile; BytecodeFileReader(const BytecodeFileReader&); // Do not implement @@ -42,23 +43,30 @@ public: BytecodeFileReader(const std::string &Filename, llvm::BytecodeHandler* H=0); + bool read(std::string* ErrMsg); }; } BytecodeFileReader::BytecodeFileReader(const std::string &Filename, llvm::BytecodeHandler* H ) : BytecodeReader(H) + , fileName(Filename) , mapFile() { - std::string ErrMsg; - if (mapFile.open(sys::Path(Filename), sys::MappedFile::READ_ACCESS, &ErrMsg)) - throw ErrMsg; - if (!mapFile.map(&ErrMsg)) - throw ErrMsg; +} + +bool BytecodeFileReader::read(std::string* ErrMsg) { + if (mapFile.open(sys::Path(fileName), sys::MappedFile::READ_ACCESS, ErrMsg)) + return true; + if (!mapFile.map(ErrMsg)) { + mapFile.close(); + return true; + } unsigned char* buffer = reinterpret_cast(mapFile.base()); - if (ParseBytecode(buffer, mapFile.size(), Filename, &ErrMsg)) { - throw ErrMsg; + if (ParseBytecode(buffer, mapFile.size(), fileName, ErrMsg)) { + return true; } + return false; } //===----------------------------------------------------------------------===// @@ -71,6 +79,9 @@ class BytecodeBufferReader : public BytecodeReader { private: const unsigned char *Buffer; + const unsigned char *Buf; + unsigned Length; + std::string ModuleID; bool MustDelete; BytecodeBufferReader(const BytecodeBufferReader&); // Do not implement @@ -82,15 +93,30 @@ llvm::BytecodeHandler* Handler = 0); ~BytecodeBufferReader(); + bool read(std::string* ErrMsg); + }; } -BytecodeBufferReader::BytecodeBufferReader(const unsigned char *Buf, - unsigned Length, - const std::string &ModuleID, - llvm::BytecodeHandler* H ) +BytecodeBufferReader::BytecodeBufferReader(const unsigned char *buf, + unsigned len, + const std::string &modID, + llvm::BytecodeHandler* H) : BytecodeReader(H) + , Buffer(0) + , Buf(buf) + , Length(len) + , ModuleID(modID) + , MustDelete(false) { +} + +BytecodeBufferReader::~BytecodeBufferReader() { + if (MustDelete) delete [] Buffer; +} + +bool +BytecodeBufferReader::read(std::string* ErrMsg) { // If not aligned, allocate a new buffer to hold the bytecode... const unsigned char *ParseBegin = 0; if (reinterpret_cast(Buf) & 3) { @@ -104,15 +130,11 @@ ParseBegin = Buffer = Buf; MustDelete = false; } - std::string ErrMsg; - if (ParseBytecode(ParseBegin, Length, ModuleID, &ErrMsg)) { + if (ParseBytecode(ParseBegin, Length, ModuleID, ErrMsg)) { if (MustDelete) delete [] Buffer; - throw ErrMsg; + return true; } -} - -BytecodeBufferReader::~BytecodeBufferReader() { - if (MustDelete) delete [] Buffer; + return false; } //===----------------------------------------------------------------------===// @@ -132,12 +154,18 @@ public: BytecodeStdinReader( llvm::BytecodeHandler* H = 0 ); + bool read(std::string* ErrMsg); }; } BytecodeStdinReader::BytecodeStdinReader( BytecodeHandler* H ) : BytecodeReader(H) { +} + +bool +BytecodeStdinReader::read(std::string* ErrMsg) +{ sys::Program::ChangeStdinToBinary(); char Buffer[4096*4]; @@ -150,14 +178,16 @@ FileData.insert(FileData.end(), Buffer, Buffer+BlockSize); } - if (FileData.empty()) - throw std::string("Standard Input empty!"); + if (FileData.empty()) { + if (ErrMsg) + *ErrMsg = "Standard Input is empty!"; + return true; + } FileBuf = &FileData[0]; - std::string ErrMsg; - if (ParseBytecode(FileBuf, FileData.size(), "", &ErrMsg)) { - throw ErrMsg; - } + if (ParseBytecode(FileBuf, FileData.size(), "", ErrMsg)) + return true; + return false; } //===----------------------------------------------------------------------===// @@ -270,66 +300,71 @@ llvm::getBytecodeBufferModuleProvider(const unsigned char *Buffer, unsigned Length, const std::string &ModuleID, - BytecodeHandler* H ) { - return CheckVarargs( - new BytecodeBufferReader(Buffer, Length, ModuleID, H)); + std::string* ErrMsg, + BytecodeHandler* H) { + BytecodeBufferReader* rdr = + new BytecodeBufferReader(Buffer, Length, ModuleID, H); + if (rdr->read(ErrMsg)) + return 0; + return CheckVarargs(rdr); } /// ParseBytecodeBuffer - Parse a given bytecode buffer /// Module *llvm::ParseBytecodeBuffer(const unsigned char *Buffer, unsigned Length, const std::string &ModuleID, - std::string *ErrorStr){ - try { - std::auto_ptr - AMP(getBytecodeBufferModuleProvider(Buffer, Length, ModuleID)); - return AMP->releaseModule(); - } catch (std::string &err) { - if (ErrorStr) *ErrorStr = err; + std::string *ErrMsg){ + ModuleProvider* MP = + getBytecodeBufferModuleProvider(Buffer, Length, ModuleID, ErrMsg, 0); + if (!MP) return 0; - } + return MP->releaseModule(); } /// getBytecodeModuleProvider - lazy function-at-a-time loading from a file /// -ModuleProvider *llvm::getBytecodeModuleProvider(const std::string &Filename, - BytecodeHandler* H) { - if (Filename != std::string("-")) // Read from a file... - return CheckVarargs(new BytecodeFileReader(Filename,H)); - else // Read from stdin - return CheckVarargs(new BytecodeStdinReader(H)); +ModuleProvider * +llvm::getBytecodeModuleProvider(const std::string &Filename, + std::string* ErrMsg, + BytecodeHandler* H) { + // Read from a file + if (Filename != std::string("-")) { + BytecodeFileReader* rdr = new BytecodeFileReader(Filename, H); + if (rdr->read(ErrMsg)) + return 0; + return CheckVarargs(rdr); + } + + // Read from stdin + BytecodeStdinReader* rdr = new BytecodeStdinReader(H); + if (rdr->read(ErrMsg)) + return 0; + return CheckVarargs(rdr); } /// ParseBytecodeFile - Parse the given bytecode file /// Module *llvm::ParseBytecodeFile(const std::string &Filename, - std::string *ErrorStr) { - try { - std::auto_ptr AMP(getBytecodeModuleProvider(Filename)); - return AMP->releaseModule(); - } catch (std::string &err) { - if (ErrorStr) *ErrorStr = err; + std::string *ErrMsg) { + ModuleProvider* MP = getBytecodeModuleProvider(Filename, ErrMsg); + if (!MP) return 0; - } + return MP->releaseModule(); } // AnalyzeBytecodeFile - analyze one file Module* llvm::AnalyzeBytecodeFile( const std::string &Filename, ///< File to analyze BytecodeAnalysis& bca, ///< Statistical output - std::string *ErrorStr, ///< Error output + std::string *ErrMsg, ///< Error output std::ostream* output ///< Dump output ) { - try { - BytecodeHandler* analyzerHandler =createBytecodeAnalyzerHandler(bca,output); - std::auto_ptr AMP( - getBytecodeModuleProvider(Filename,analyzerHandler)); - return AMP->releaseModule(); - } catch (std::string &err) { - if (ErrorStr) *ErrorStr = err; + BytecodeHandler* AH = createBytecodeAnalyzerHandler(bca,output); + ModuleProvider* MP = getBytecodeModuleProvider(Filename, ErrMsg, AH); + if (!MP) return 0; - } + return MP->releaseModule(); } // AnalyzeBytecodeBuffer - analyze a buffer @@ -338,34 +373,30 @@ unsigned Length, ///< Size of the bytecode buffer const std::string& ModuleID, ///< Identifier for the module BytecodeAnalysis& bca, ///< The results of the analysis - std::string* ErrorStr, ///< Errors, if any. + std::string* ErrMsg, ///< Errors, if any. std::ostream* output ///< Dump output, if any ) { - try { - BytecodeHandler* hdlr = createBytecodeAnalyzerHandler(bca, output); - std::auto_ptr - AMP(getBytecodeBufferModuleProvider(Buffer, Length, ModuleID, hdlr)); - return AMP->releaseModule(); - } catch (std::string &err) { - if (ErrorStr) *ErrorStr = err; + BytecodeHandler* hdlr = createBytecodeAnalyzerHandler(bca, output); + ModuleProvider* MP = + getBytecodeBufferModuleProvider(Buffer, Length, ModuleID, ErrMsg, hdlr); + if (!MP) return 0; - } + return MP->releaseModule(); } bool llvm::GetBytecodeDependentLibraries(const std::string &fname, - Module::LibraryListType& deplibs) { - try { - std::auto_ptr AMP( getBytecodeModuleProvider(fname)); - Module* M = AMP->releaseModule(); - - deplibs = M->getLibraries(); - delete M; - return true; - } catch (...) { + Module::LibraryListType& deplibs, + std::string* ErrMsg) { + ModuleProvider* MP = getBytecodeModuleProvider(fname, ErrMsg); + if (!MP) { deplibs.clear(); - return false; + return true; } + Module* M = MP->releaseModule(); + deplibs = M->getLibraries(); + delete M; + return false; } static void getSymbols(Module*M, std::vector& symbols) { @@ -384,13 +415,16 @@ // Get just the externally visible defined symbols from the bytecode bool llvm::GetBytecodeSymbols(const sys::Path& fName, - std::vector& symbols) { - std::auto_ptr AMP( - getBytecodeModuleProvider(fName.toString())); + std::vector& symbols, + std::string* ErrMsg) { + ModuleProvider* MP = getBytecodeModuleProvider(fName.toString(), ErrMsg); + if (!MP) + return true; // Get the module from the provider - Module* M = AMP->materializeModule(); - if (M == 0) return false; + Module* M = MP->materializeModule(); + if (M == 0) + return true; // Get the symbols getSymbols(M, symbols); @@ -402,29 +436,26 @@ ModuleProvider* llvm::GetBytecodeSymbols(const unsigned char*Buffer, unsigned Length, const std::string& ModuleID, - std::vector& symbols) { + std::vector& symbols, + std::string* ErrMsg) { + // Get the module provider + ModuleProvider* MP = + getBytecodeBufferModuleProvider(Buffer, Length, ModuleID, ErrMsg, 0); + if (!MP) + return 0; - ModuleProvider* MP = 0; - try { - // Get the module provider - MP = getBytecodeBufferModuleProvider(Buffer, Length, ModuleID); - - // Get the module from the provider - Module* M = MP->materializeModule(); - if (M == 0) return 0; - - // Get the symbols - getSymbols(M, symbols); - - // Done with the module. Note that ModuleProvider will delete the - // Module when it is deleted. Also note that its the caller's responsibility - // to delete the ModuleProvider. - return MP; - - } catch (...) { - // We delete only the ModuleProvider here because its destructor will - // also delete the Module (we used materializeModule not releaseModule). + // Get the module from the provider + Module* M = MP->materializeModule(); + if (M == 0) { delete MP; + return 0; } - return 0; + + // Get the symbols + getSymbols(M, symbols); + + // Done with the module. Note that ModuleProvider will delete the + // Module when it is deleted. Also note that its the caller's responsibility + // to delete the ModuleProvider. + return MP; } From reid at x10sys.com Fri Aug 25 12:43:28 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 12:43:28 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Constants.h Message-ID: <200608251743.k7PHhSYn029870@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constants.h updated: 1.85 -> 1.86 --- Log message: For PR797: http://llvm.org/PR797 : Remove exception throwing/handling from lib/Bytecode, and adjust its users to compensate for changes in the interface. --- Diffs of the changes: (+114 -80) Constants.h | 194 +++++++++++++++++++++++++++++++++++------------------------- 1 files changed, 114 insertions(+), 80 deletions(-) Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.85 llvm/include/llvm/Constants.h:1.86 --- llvm/include/llvm/Constants.h:1.85 Fri Jul 14 17:19:18 2006 +++ llvm/include/llvm/Constants.h Fri Aug 25 12:43:11 2006 @@ -7,13 +7,13 @@ // //===----------------------------------------------------------------------===// // -// This file contains the declarations for the subclasses of Constant, which -// represent the different flavors of constant values that live in LLVM. Note -// that Constants are immutable (once created they never change) and are fully -// shared by structural equivalence. This means that two structurally -// equivalent constants will always have the same address. Constant's are -// created on demand as needed and never deleted: thus clients don't have to -// worry about the lifetime of the objects. +/// @file This file contains the declarations for the subclasses of Constant, +/// which represent the different flavors of constant values that live in LLVM. +/// Note that Constants are immutable (once created they never change) and are +/// fully shared by structural equivalence. This means that two structurally +/// equivalent constants will always have the same address. Constant's are +/// created on demand as needed and never deleted: thus clients don't have to +/// worry about the lifetime of the objects. // //===----------------------------------------------------------------------===// @@ -36,10 +36,9 @@ struct ConvertConstantType; //===----------------------------------------------------------------------===// -/// ConstantIntegral - Shared superclass of boolean and integer constants. -/// -/// This class just defines some common interfaces to be implemented. -/// +/// This is the shared superclass of boolean and integer constants. This class +/// just defines some common interfaces to be implemented by the subclasses. +/// @brief An abstract class for integer constants. class ConstantIntegral : public Constant { protected: union { @@ -49,52 +48,66 @@ ConstantIntegral(const Type *Ty, ValueTy VT, uint64_t V); public: - /// getRawValue - return the underlying value of this constant as a 64-bit - /// unsigned integer value. - /// + /// @brief Return the raw value of the constant as a 64-bit integer value. inline uint64_t getRawValue() const { return Val.Unsigned; } - /// getZExtValue - Return the constant zero extended as appropriate for this - /// type. + /// Return the constant as a 64-bit unsigned integer value after it + /// has been zero extended as appropriate for the type of this constant. + /// @brief Return the zero extended value. inline uint64_t getZExtValue() const { unsigned Size = getType()->getPrimitiveSizeInBits(); return Val.Unsigned & (~uint64_t(0UL) >> (64-Size)); } - /// getSExtValue - Return the constant sign extended as appropriate for this - /// type. + /// Return the constant as a 64-bit integer value after it has been sign + /// sign extended as appropriate for the type of this constant. + /// @brief REturn the sign extended value. inline int64_t getSExtValue() const { unsigned Size = getType()->getPrimitiveSizeInBits(); return (Val.Signed << (64-Size)) >> (64-Size); } - /// isNullValue - Return true if this is the value that would be returned by - /// getNullValue. - /// + /// This function is implemented by subclasses and will return true iff this + /// constant represents the the "null" value that would be returned by the + /// getNullValue method. + /// @returns true if the constant's value is 0. + /// @brief Determine if the value is null. virtual bool isNullValue() const = 0; - /// isMaxValue - Return true if this is the largest value that may be - /// represented by this type. - /// + /// This function is implemented by sublcasses and will return true iff this + /// constant represents the the largest value that may be represented by this + /// constant's type. + /// @returns true if the constant's value is maximal. + /// @brief Determine if the value is maximal. virtual bool isMaxValue() const = 0; - /// isMinValue - Return true if this is the smallest value that may be - /// represented by this type. - /// + /// This function is implemented by subclasses and will return true iff this + /// constant represents the smallest value that may be represented by this + /// constant's type. + /// @returns true if the constant's value is minimal + /// @brief Determine if the value is minimal. virtual bool isMinValue() const = 0; - /// isAllOnesValue - Return true if every bit in this constant is set to true. - /// + /// This function is implemented by subclasses and will return true iff every + /// bit in this constant is set to true. + /// @returns true if all bits of the constant are ones. + /// @brief Determine if the value is all ones. virtual bool isAllOnesValue() const = 0; - /// Static constructor to get the maximum/minimum/allones constant of - /// specified (integral) type... - /// + /// @returns the largest value for an integer constant of the given type + /// @brief Get the maximal value static ConstantIntegral *getMaxValue(const Type *Ty); + + /// @returns the smallest value for an integer constant of the given type + /// @brief Get the minimal value static ConstantIntegral *getMinValue(const Type *Ty); + + /// @returns the value for an integer constant of the given type that has all + /// its bits set to true. + /// @brief Get the all ones value static ConstantIntegral *getAllOnesValue(const Type *Ty); - /// Methods for support type inquiry through isa, cast, and dyn_cast: + /// Methods to support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantIntegral *) { return true; } static bool classof(const Value *V) { return V->getValueType() == ConstantBoolVal || @@ -105,33 +118,41 @@ //===----------------------------------------------------------------------===// -/// ConstantBool - Boolean Values -/// +/// This concrete class represents constant values of type BoolTy. There are +/// only two instances of this class constructed: the True and False static +/// members. The constructor is hidden to ensure this invariant. +/// @brief Constant Boolean class class ConstantBool : public ConstantIntegral { ConstantBool(bool V); public: - static ConstantBool *True, *False; // The True & False values + static ConstantBool *True, *False; ///< The True & False values - /// get() - Static factory methods - Return objects of the specified value + /// This method is provided mostly for compatibility with the other + /// ConstantIntegral subclasses. + /// @brief Static factory method for getting a ConstantBool instance. static ConstantBool *get(bool Value) { return Value ? True : False; } + + /// This method is provided mostly for compatibility with the other + /// ConstantIntegral subclasses. + /// @brief Static factory method for getting a ConstantBool instance. static ConstantBool *get(const Type *Ty, bool Value) { return get(Value); } - /// inverted - Return the opposite value of the current value. + /// Returns the opposite value of this ConstantBool value. + /// @brief Get inverse value. inline ConstantBool *inverted() const { return (this==True) ? False : True; } - /// getValue - return the boolean value of this constant. - /// + /// @returns the value of this ConstantBool + /// @brief return the boolean value of this constant. inline bool getValue() const { return static_cast(getRawValue()); } - /// isNullValue - Return true if this is the value that would be returned by - /// getNullValue. - /// + /// @see ConstantIntegral for details + /// @brief Implement overrides virtual bool isNullValue() const { return this == False; } virtual bool isMaxValue() const { return this == True; } virtual bool isMinValue() const { return this == False; } virtual bool isAllOnesValue() const { return this == True; } - /// Methods for support type inquiry through isa, cast, and dyn_cast: + /// @brief Methods to support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantBool *) { return true; } static bool classof(const Value *V) { return V->getValueType() == ConstantBoolVal; @@ -140,37 +161,36 @@ //===----------------------------------------------------------------------===// -/// ConstantInt - Superclass of ConstantSInt & ConstantUInt, to make dealing -/// with integral constants easier. -/// +/// This is the abstract superclass of ConstantSInt & ConstantUInt, to make +/// dealing with integral constants easier when sign is irrelevant. +/// @brief Abstract clas for constant integers. class ConstantInt : public ConstantIntegral { protected: ConstantInt(const ConstantInt &); // DO NOT IMPLEMENT ConstantInt(const Type *Ty, ValueTy VT, uint64_t V); public: - /// equalsInt - Provide a helper method that can be used to determine if the - /// constant contained within is equal to a constant. This only works for - /// very small values, because this is all that can be represented with all - /// types. - /// + /// A helper method that can be used to determine if the constant contained + /// within is equal to a constant. This only works for very small values, + /// because this is all that can be represented with all types. + /// @brief Determine if this constant's value is same as an unsigned char. bool equalsInt(unsigned char V) const { assert(V <= 127 && "equalsInt: Can only be used with very small positive constants!"); return Val.Unsigned == V; } - /// ConstantInt::get static method: return a ConstantInt with the specified - /// value. as above, we work only with very small values here. - /// + /// Return a ConstantInt with the specified value for the specified type. + /// This only works for very small values, because this is all that can be + /// represented with all types integer types. + /// @brief Get a ConstantInt for a specific value. static ConstantInt *get(const Type *Ty, unsigned char V); - /// isNullValue - Return true if this is the value that would be returned by - /// getNullValue. + /// @returns true if this is the null integer value. + /// @see ConstantIntegral for details + /// @brief Implement override. virtual bool isNullValue() const { return Val.Unsigned == 0; } - virtual bool isMaxValue() const = 0; - virtual bool isMinValue() const = 0; - /// Methods for support type inquiry through isa, cast, and dyn_cast: + /// @brief Methods to support type inquiry through isa, cast, and dyn_cast. static inline bool classof(const ConstantInt *) { return true; } static bool classof(const Value *V) { return V->getValueType() == ConstantSIntVal || @@ -180,8 +200,9 @@ //===----------------------------------------------------------------------===// -/// ConstantSInt - Signed Integer Values [sbyte, short, int, long] -/// +/// A concrete class to represent constant signed integer values for the types +/// sbyte, short, int, and long. +/// @brief Constant Signed Integer Class. class ConstantSInt : public ConstantInt { ConstantSInt(const ConstantSInt &); // DO NOT IMPLEMENT friend struct ConstantCreator; @@ -189,23 +210,35 @@ protected: ConstantSInt(const Type *Ty, int64_t V); public: - /// get() - Static factory methods - Return objects of the specified value - /// - static ConstantSInt *get(const Type *Ty, int64_t V); - - /// isValueValidForType - return true if Ty is big enough to represent V. - /// + /// This static factory methods returns objects of the specified value. Note + /// that repeated calls with the same operands return the same object. + /// @returns A ConstantSInt instant for the type and value requested. + /// @brief Get a signed integer constant. + static ConstantSInt *get( + const Type *Ty, ///< The type of constant (SByteTy, IntTy, ShortTy, LongTy) + int64_t V ///< The value for the constant integer. + ); + + /// This static method returns true if the type Ty is big enough to + /// represent the value V. This can be used to avoid having the get method + /// assert when V is larger than Ty can represent. + /// @returns true if V is a valid value for type Ty + /// @brief Determine if the value is in range for the given type. static bool isValueValidForType(const Type *Ty, int64_t V); - /// getValue - return the underlying value of this constant. - /// + /// @returns the underlying value of this constant. + /// @brief Get the constant value. inline int64_t getValue() const { return Val.Signed; } + /// @returns true iff this constant's bits are all set to true. + /// @see ConstantIntegral + /// @brief Override implementation virtual bool isAllOnesValue() const { return getValue() == -1; } - /// isMaxValue - Return true if this is the largest value that may be - /// represented by this type. - /// + /// @returns true iff this is the largest value that may be represented + /// by this type. + /// @see ConstantIntegeral + /// @brief Override implementation virtual bool isMaxValue() const { int64_t V = getValue(); if (V < 0) return false; // Be careful about wrap-around on 'long's @@ -213,9 +246,10 @@ return !isValueValidForType(getType(), V) || V < 0; } - /// isMinValue - Return true if this is the smallest value that may be - /// represented by this type. - /// + /// @returns true if this is the smallest value that may be represented by + /// this type. + /// @see ConstantIntegral + /// @brief Override implementation virtual bool isMinValue() const { int64_t V = getValue(); if (V > 0) return false; // Be careful about wrap-around on 'long's @@ -223,8 +257,7 @@ return !isValueValidForType(getType(), V) || V > 0; } - /// Methods for support type inquiry through isa, cast, and dyn_cast: - /// + /// @brief Methods to support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantSInt *) { return true; } static bool classof(const Value *V) { return V->getValueType() == ConstantSIntVal; @@ -232,8 +265,9 @@ }; //===----------------------------------------------------------------------===// -/// ConstantUInt - Unsigned Integer Values [ubyte, ushort, uint, ulong] -/// +/// A concrete class that represents constant unsigned integer values of type +/// Type::UByteTy, Type::UShortTy, Type::UIntTy, or Type::ULongTy. +/// @brief Constant Unsigned Integer Class class ConstantUInt : public ConstantInt { ConstantUInt(const ConstantUInt &); // DO NOT IMPLEMENT friend struct ConstantCreator; From reid at x10sys.com Fri Aug 25 12:43:31 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 12:43:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/ArchiveReader.cpp ArchiveWriter.cpp Message-ID: <200608251743.k7PHhVPY029876@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Archive: ArchiveReader.cpp updated: 1.46 -> 1.47 ArchiveWriter.cpp updated: 1.30 -> 1.31 --- Log message: For PR797: http://llvm.org/PR797 : Remove exception throwing/handling from lib/Bytecode, and adjust its users to compensate for changes in the interface. --- Diffs of the changes: (+9 -6) ArchiveReader.cpp | 10 ++++++---- ArchiveWriter.cpp | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) Index: llvm/lib/Bytecode/Archive/ArchiveReader.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.46 llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.47 --- llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.46 Thu Aug 24 18:45:08 2006 +++ llvm/lib/Bytecode/Archive/ArchiveReader.cpp Fri Aug 25 12:43:11 2006 @@ -475,14 +475,16 @@ const char* modptr = base + fileOffset; ArchiveMember* mbr = parseMemberHeader(modptr, base + mapfile->size(),ErrMsg); if (!mbr) - return false; + return 0; // Now, load the bytecode module to get the ModuleProvider std::string FullMemberName = archPath.toString() + "(" + mbr->getPath().toString() + ")"; ModuleProvider* mp = getBytecodeBufferModuleProvider( (const unsigned char*) mbr->getData(), mbr->getSize(), - FullMemberName, 0); + FullMemberName, ErrMsg, 0); + if (!mp) + return 0; modules.insert(std::make_pair(fileOffset, std::make_pair(mp, mbr))); @@ -523,7 +525,7 @@ std::string FullMemberName = archPath.toString() + "(" + mbr->getPath().toString() + ")"; ModuleProvider* MP = GetBytecodeSymbols((const unsigned char*)At, - mbr->getSize(), FullMemberName, symbols); + mbr->getSize(), FullMemberName, symbols, error); if (MP) { // Insert the module's symbols into the symbol table @@ -537,7 +539,7 @@ } else { if (error) *error = "Can't parse bytecode member: " + - mbr->getPath().toString(); + mbr->getPath().toString() + ": " + *error; delete mbr; return false; } Index: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.30 llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.31 --- llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.30 Thu Aug 24 18:45:08 2006 +++ llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Fri Aug 25 12:43:11 2006 @@ -223,7 +223,7 @@ member.getPath().toString() + ")"; ModuleProvider* MP = GetBytecodeSymbols( - (const unsigned char*)data,fSize,FullMemberName, symbols); + (const unsigned char*)data,fSize,FullMemberName, symbols, ErrMsg); // If the bytecode parsed successfully if ( MP ) { @@ -247,7 +247,8 @@ delete mFile; } if (ErrMsg) - *ErrMsg = "Can't parse bytecode member: " + member.getPath().toString(); + *ErrMsg = "Can't parse bytecode member: " + member.getPath().toString() + + ": " + *ErrMsg; return true; } } From rafael.espindola at gmail.com Fri Aug 25 12:55:30 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Fri, 25 Aug 2006 12:55:30 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp ARMFrameInfo.h ARMISelDAGToDAG.cpp Message-ID: <200608251755.k7PHtU50030330@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.13 -> 1.14 ARMFrameInfo.h updated: 1.1 -> 1.2 ARMISelDAGToDAG.cpp updated: 1.36 -> 1.37 --- Log message: use @ for comments store LR in an arbitrary stack slot add support for writing varargs functions --- Diffs of the changes: (+61 -14) ARMAsmPrinter.cpp | 2 - ARMFrameInfo.h | 8 ------ ARMISelDAGToDAG.cpp | 65 ++++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 61 insertions(+), 14 deletions(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.13 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.14 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.13 Thu Aug 24 11:13:15 2006 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Fri Aug 25 12:55:16 2006 @@ -43,7 +43,7 @@ Data32bitsDirective = "\t.word\t"; Data64bitsDirective = 0; ZeroDirective = "\t.skip\t"; - CommentString = "#"; + CommentString = "@"; ConstantPoolSection = "\t.text\n"; AlignmentIsInBytes = false; } Index: llvm/lib/Target/ARM/ARMFrameInfo.h diff -u llvm/lib/Target/ARM/ARMFrameInfo.h:1.1 llvm/lib/Target/ARM/ARMFrameInfo.h:1.2 --- llvm/lib/Target/ARM/ARMFrameInfo.h:1.1 Wed Aug 16 09:43:33 2006 +++ llvm/lib/Target/ARM/ARMFrameInfo.h Fri Aug 25 12:55:16 2006 @@ -22,20 +22,12 @@ namespace llvm { class ARMFrameInfo: public TargetFrameInfo { - std::pair LR[1]; public: ARMFrameInfo() : TargetFrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) { - LR[0].first = ARM::R14; - LR[0].second = -4; } - const std::pair * - getCalleeSaveSpillSlots(unsigned &NumEntries) const { - NumEntries = 1; - return &LR[0]; - } }; } // End llvm namespace Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.36 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.37 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.36 Thu Aug 24 12:19:08 2006 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Fri Aug 25 12:55:16 2006 @@ -32,6 +32,7 @@ namespace { class ARMTargetLowering : public TargetLowering { + int VarArgsFrameIndex; // FrameIndex for start of varargs area. public: ARMTargetLowering(TargetMachine &TM); virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG); @@ -55,6 +56,9 @@ setOperationAction(ISD::SELECT_CC, MVT::i32, Custom); setOperationAction(ISD::BR_CC, MVT::i32, Custom); + setOperationAction(ISD::VASTART, MVT::Other, Custom); + setOperationAction(ISD::VAEND, MVT::Other, Expand); + setSchedulingPreference(SchedulingForRegPressure); computeRegisterProperties(); } @@ -238,6 +242,7 @@ } static SDOperand LowerFORMAL_ARGUMENT(SDOperand Op, SelectionDAG &DAG, + unsigned *vRegs, unsigned ArgNo) { MachineFunction &MF = DAG.getMachineFunction(); MVT::ValueType ObjectVT = Op.getValue(ArgNo).getValueType(); @@ -253,6 +258,7 @@ if(ArgNo < num_regs) { unsigned VReg = RegMap->createVirtualRegister(&ARM::IntRegsRegClass); MF.addLiveIn(REGS[ArgNo], VReg); + vRegs[ArgNo] = VReg; return DAG.getCopyFromReg(Root, VReg, MVT::i32); } else { // If the argument is actually used, emit a load from the right stack @@ -291,18 +297,65 @@ DAG.getSrcValue(NULL)); } -static SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG) { +static SDOperand LowerVASTART(SDOperand Op, SelectionDAG &DAG, + unsigned VarArgsFrameIndex) { + // vastart just stores the address of the VarArgsFrameIndex slot into the + // memory location argument. + MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); + SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, PtrVT); + return DAG.getNode(ISD::STORE, MVT::Other, Op.getOperand(0), FR, + Op.getOperand(1), Op.getOperand(2)); +} + +static SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG, + int &VarArgsFrameIndex) { std::vector ArgValues; SDOperand Root = Op.getOperand(0); + unsigned VRegs[4]; - for (unsigned ArgNo = 0, e = Op.Val->getNumValues()-1; ArgNo != e; ++ArgNo) { - SDOperand ArgVal = LowerFORMAL_ARGUMENT(Op, DAG, ArgNo); + unsigned NumArgs = Op.Val->getNumValues()-1; + for (unsigned ArgNo = 0; ArgNo < NumArgs; ++ArgNo) { + SDOperand ArgVal = LowerFORMAL_ARGUMENT(Op, DAG, VRegs, ArgNo); ArgValues.push_back(ArgVal); } bool isVarArg = cast(Op.getOperand(2))->getValue() != 0; - assert(!isVarArg); + if (isVarArg) { + MachineFunction &MF = DAG.getMachineFunction(); + SSARegMap *RegMap = MF.getSSARegMap(); + MachineFrameInfo *MFI = MF.getFrameInfo(); + VarArgsFrameIndex = MFI->CreateFixedObject(MVT::getSizeInBits(MVT::i32)/8, + -16 + NumArgs * 4); + + + static const unsigned REGS[] = { + ARM::R0, ARM::R1, ARM::R2, ARM::R3 + }; + // If this function is vararg, store r0-r3 to their spots on the stack + // so that they may be loaded by deferencing the result of va_next. + SmallVector MemOps; + for (unsigned ArgNo = 0; ArgNo < 4; ++ArgNo) { + int ArgOffset = - (4 - ArgNo) * 4; + int FI = MFI->CreateFixedObject(MVT::getSizeInBits(MVT::i32)/8, + ArgOffset); + SDOperand FIN = DAG.getFrameIndex(FI, MVT::i32); + + unsigned VReg; + if (ArgNo < NumArgs) + VReg = VRegs[ArgNo]; + else + VReg = RegMap->createVirtualRegister(&ARM::IntRegsRegClass); + if (ArgNo >= NumArgs) + MF.addLiveIn(REGS[ArgNo], VReg); + + SDOperand Val = DAG.getCopyFromReg(Root, VReg, MVT::i32); + SDOperand Store = DAG.getNode(ISD::STORE, MVT::Other, Val.getValue(1), + Val, FIN, DAG.getSrcValue(NULL)); + MemOps.push_back(Store); + } + Root = DAG.getNode(ISD::TokenFactor, MVT::Other,&MemOps[0],MemOps.size()); + } ArgValues.push_back(Root); @@ -346,7 +399,7 @@ case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG); case ISD::FORMAL_ARGUMENTS: - return LowerFORMAL_ARGUMENTS(Op, DAG); + return LowerFORMAL_ARGUMENTS(Op, DAG, VarArgsFrameIndex); case ISD::CALL: return LowerCALL(Op, DAG); case ISD::RET: @@ -355,6 +408,8 @@ return LowerSELECT_CC(Op, DAG); case ISD::BR_CC: return LowerBR_CC(Op, DAG); + case ISD::VASTART: + return LowerVASTART(Op, DAG, VarArgsFrameIndex); } } From rafael.espindola at gmail.com Fri Aug 25 12:57:50 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Fri, 25 Aug 2006 12:57:50 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/vargs2.ll Message-ID: <200608251757.k7PHvoio030396@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/ARM: vargs2.ll added (r1.1) --- Log message: test case for varargs functions --- Diffs of the changes: (+33 -0) vargs2.ll | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+) Index: llvm/test/Regression/CodeGen/ARM/vargs2.ll diff -c /dev/null llvm/test/Regression/CodeGen/ARM/vargs2.ll:1.1 *** /dev/null Fri Aug 25 12:57:46 2006 --- llvm/test/Regression/CodeGen/ARM/vargs2.ll Fri Aug 25 12:57:36 2006 *************** *** 0 **** --- 1,33 ---- + ; RUN: llvm-as < %s | llc -march=arm + %str = internal constant [4 x sbyte] c"%d\0A\00" ; <[4 x sbyte]*> [#uses=1] + + implementation ; Functions: + + void %f(int %a, ...) { + entry: + %va = alloca sbyte*, align 4 ; [#uses=4] + call void %llvm.va_start( sbyte** %va ) + br label %bb + + bb: ; preds = %bb, %entry + %a_addr.0 = phi int [ %a, %entry ], [ %tmp5, %bb ] ; [#uses=2] + %tmp = volatile load sbyte** %va ; [#uses=2] + %tmp2 = getelementptr sbyte* %tmp, int 4 ; [#uses=1] + volatile store sbyte* %tmp2, sbyte** %va + %tmp5 = add int %a_addr.0, -1 ; [#uses=1] + %tmp = seteq int %a_addr.0, 1 ; [#uses=1] + br bool %tmp, label %bb7, label %bb + + bb7: ; preds = %bb + %tmp3 = cast sbyte* %tmp to int* ; [#uses=1] + %tmp = load int* %tmp3 ; [#uses=1] + %tmp10 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([4 x sbyte]* %str, int 0, uint 0), int %tmp ) ; [#uses=0] + call void %llvm.va_end( sbyte** %va ) + ret void + } + + declare void %llvm.va_start(sbyte**) + + declare int %printf(sbyte*, ...) + + declare void %llvm.va_end(sbyte**) From reid at x10sys.com Fri Aug 25 13:18:52 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 13:18:52 -0500 Subject: [llvm-commits] CVS: llvm-test/Makefile.rules Message-ID: <200608251818.k7PIIqcD030824@zion.cs.uiuc.edu> Changes in directory llvm-test: Makefile.rules updated: 1.15 -> 1.16 --- Log message: For PR879: http://llvm.org/PR879 : Temporarily work around this problem by using -D__NO_MATH_INLINES on the command line for X86/Linux targets. The inline math uses an fp stack that LLVM doesn't currently support. Undo this patch when 879 is fixed. --- Diffs of the changes: (+6 -0) Makefile.rules | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm-test/Makefile.rules diff -u llvm-test/Makefile.rules:1.15 llvm-test/Makefile.rules:1.16 --- llvm-test/Makefile.rules:1.15 Fri Jul 21 18:06:51 2006 +++ llvm-test/Makefile.rules Fri Aug 25 13:18:38 2006 @@ -321,6 +321,12 @@ TARGET_FLAGS := -mdynamic-no-pic -fomit-frame-pointer endif +ifeq ($(OS),Linux) +ifeq ($(ARCH),x86) +CPPFLAGS += -D__NO_MATH_INLINES +endif +endif + ifdef EXTRA_OPTIONS TARGET_FLAGS += $(EXTRA_OPTIONS) endif From jlaskey at apple.com Fri Aug 25 14:40:06 2006 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 25 Aug 2006 14:40:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp Message-ID: <200608251940.k7PJe6pf032231@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.70 -> 1.71 --- Log message: Allow for register numbers > 31. --- Diffs of the changes: (+14 -4) DwarfWriter.cpp | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.70 llvm/lib/CodeGen/DwarfWriter.cpp:1.71 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.70 Mon Aug 21 16:20:18 2006 +++ llvm/lib/CodeGen/DwarfWriter.cpp Fri Aug 25 14:39:52 2006 @@ -1219,12 +1219,22 @@ void DwarfWriter::AddAddress(DIE *Die, unsigned Attribute, const MachineLocation &Location) { DIEBlock *Block = new DIEBlock(); + unsigned Reg = RI->getDwarfRegNum(Location.getRegister()); + if (Location.isRegister()) { - Block->AddUInt(DW_FORM_data1, - DW_OP_reg0 + RI->getDwarfRegNum(Location.getRegister())); + if (Reg < 32) { + Block->AddUInt(DW_FORM_data1, DW_OP_reg0 + Reg); + } else { + Block->AddUInt(DW_FORM_data1, DW_OP_regx); + Block->AddUInt(DW_FORM_udata, Reg); + } } else { - Block->AddUInt(DW_FORM_data1, - DW_OP_breg0 + RI->getDwarfRegNum(Location.getRegister())); + if (Reg < 32) { + Block->AddUInt(DW_FORM_data1, DW_OP_breg0 + Reg); + } else { + Block->AddUInt(DW_FORM_data1, DW_OP_bregx); + Block->AddUInt(DW_FORM_udata, Reg); + } Block->AddUInt(DW_FORM_sdata, Location.getOffset()); } Block->ComputeSize(*this); From jlaskey at apple.com Fri Aug 25 14:41:13 2006 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 25 Aug 2006 14:41:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Message-ID: <200608251941.k7PJfD3h032260@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCRegisterInfo.cpp updated: 1.73 -> 1.74 --- Log message: Fix some comments. --- Diffs of the changes: (+4 -1) PPCRegisterInfo.cpp | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.73 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.74 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.73 Tue Jul 11 15:53:55 2006 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Fri Aug 25 14:40:59 2006 @@ -673,7 +673,10 @@ MachineLocation Src(MachineLocation::VirtualFP, NegNumbytes); Moves.push_back(new MachineMove(LabelID, Dst, Src)); + // Mark effective beginning of when frame pointer becomes valid. BuildMI(MBB, MBBI, PPC::DWARF_LABEL, 1).addImm(LabelID); + + } // If there is a frame pointer, copy R1 (SP) into R31 (FP) @@ -727,7 +730,7 @@ void PPCRegisterInfo::getInitialFrameState(std::vector &Moves) const { - // Initial state is the frame pointer is R1. + // Initial state of the frame pointer is R1. MachineLocation Dst(MachineLocation::VirtualFP); MachineLocation Src(PPC::R1, 0); Moves.push_back(new MachineMove(0, Dst, Src)); From jlaskey at apple.com Fri Aug 25 14:46:08 2006 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 25 Aug 2006 14:46:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/PrologEpilogInserter.cpp Message-ID: <200608251946.k7PJk8IS032359@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: PrologEpilogInserter.cpp updated: 1.55 -> 1.56 --- Log message: Consolidate callee saved register information so that it can me used by debug information and exception handling. --- Diffs of the changes: (+21 -20) PrologEpilogInserter.cpp | 41 +++++++++++++++++++++-------------------- 1 files changed, 21 insertions(+), 20 deletions(-) Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp diff -u llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.55 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.56 --- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.55 Wed Jun 28 17:17:39 2006 +++ llvm/lib/CodeGen/PrologEpilogInserter.cpp Fri Aug 25 14:45:51 2006 @@ -71,15 +71,10 @@ // replaceFrameIndices(Fn); - RegsToSave.clear(); - StackSlots.clear(); return true; } - + private: - std::vector > RegsToSave; - std::vector StackSlots; - void calculateCallerSavedRegisters(MachineFunction &Fn); void saveCallerSavedRegisters(MachineFunction &Fn); void calculateFrameObjectOffsets(MachineFunction &Fn); @@ -144,23 +139,24 @@ const bool *PhysRegsUsed = Fn.getUsedPhysregs(); const TargetRegisterClass* const *CSRegClasses = RegInfo->getCalleeSaveRegClasses(); + std::vector &CSI = FFI->getCalleeSavedInfo(); for (unsigned i = 0; CSRegs[i]; ++i) { unsigned Reg = CSRegs[i]; if (PhysRegsUsed[Reg]) { // If the reg is modified, save it! - RegsToSave.push_back(std::make_pair(Reg, CSRegClasses[i])); + CSI.push_back(CalleeSavedInfo(Reg, CSRegClasses[i])); } else { for (const unsigned *AliasSet = RegInfo->getAliasSet(Reg); *AliasSet; ++AliasSet) { // Check alias registers too. if (PhysRegsUsed[*AliasSet]) { - RegsToSave.push_back(std::make_pair(Reg, CSRegClasses[i])); + CSI.push_back(CalleeSavedInfo(Reg, CSRegClasses[i])); break; } } } } - if (RegsToSave.empty()) + if (CSI.empty()) return; // Early exit if no caller saved registers are modified! unsigned NumFixedSpillSlots; @@ -169,9 +165,9 @@ // Now that we know which registers need to be saved and restored, allocate // stack slots for them. - for (unsigned i = 0, e = RegsToSave.size(); i != e; ++i) { - unsigned Reg = RegsToSave[i].first; - const TargetRegisterClass *RC = RegsToSave[i].second; + for (unsigned i = 0, e = CSI.size(); i != e; ++i) { + unsigned Reg = CSI[i].getReg(); + const TargetRegisterClass *RC = CSI[i].getRegClass(); // Check to see if this physreg must be spilled to a particular stack slot // on this target. @@ -188,7 +184,7 @@ // Spill it to the stack where we must. FrameIdx = FFI->CreateFixedObject(RC->getSize(), FixedSlot->second); } - StackSlots.push_back(FrameIdx); + CSI[i].setFrameIdx(FrameIdx); } } @@ -196,8 +192,12 @@ /// that are modified in the function. /// void PEI::saveCallerSavedRegisters(MachineFunction &Fn) { + // Get callee saved register information. + MachineFrameInfo *FFI = Fn.getFrameInfo(); + std::vector &CSI = FFI->getCalleeSavedInfo(); + // Early exit if no caller saved registers are modified! - if (RegsToSave.empty()) + if (CSI.empty()) return; const MRegisterInfo *RegInfo = Fn.getTarget().getRegisterInfo(); @@ -206,10 +206,10 @@ // code into the entry block. MachineBasicBlock *MBB = Fn.begin(); MachineBasicBlock::iterator I = MBB->begin(); - for (unsigned i = 0, e = RegsToSave.size(); i != e; ++i) { + for (unsigned i = 0, e = CSI.size(); i != e; ++i) { // Insert the spill to the stack frame. - RegInfo->storeRegToStackSlot(*MBB, I, RegsToSave[i].first, StackSlots[i], - RegsToSave[i].second); + RegInfo->storeRegToStackSlot(*MBB, I, CSI[i].getReg(), CSI[i].getFrameIdx(), + CSI[i].getRegClass()); } // Add code to restore the callee-save registers in each exiting block. @@ -233,9 +233,10 @@ // Restore all registers immediately before the return and any terminators // that preceed it. - for (unsigned i = 0, e = RegsToSave.size(); i != e; ++i) { - RegInfo->loadRegFromStackSlot(*MBB, I, RegsToSave[i].first, - StackSlots[i], RegsToSave[i].second); + for (unsigned i = 0, e = CSI.size(); i != e; ++i) { + RegInfo->loadRegFromStackSlot(*MBB, I, CSI[i].getReg(), + CSI[i].getFrameIdx(), + CSI[i].getRegClass()); assert(I != MBB->begin() && "loadRegFromStackSlot didn't insert any code!"); // Insert in reverse order. loadRegFromStackSlot can insert multiple From jlaskey at apple.com Fri Aug 25 14:46:08 2006 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 25 Aug 2006 14:46:08 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineFrameInfo.h Message-ID: <200608251946.k7PJk8Sr032356@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineFrameInfo.h updated: 1.18 -> 1.19 --- Log message: Consolidate callee saved register information so that it can me used by debug information and exception handling. --- Diffs of the changes: (+32 -0) MachineFrameInfo.h | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+) Index: llvm/include/llvm/CodeGen/MachineFrameInfo.h diff -u llvm/include/llvm/CodeGen/MachineFrameInfo.h:1.18 llvm/include/llvm/CodeGen/MachineFrameInfo.h:1.19 --- llvm/include/llvm/CodeGen/MachineFrameInfo.h:1.18 Tue May 23 10:32:15 2006 +++ llvm/include/llvm/CodeGen/MachineFrameInfo.h Fri Aug 25 14:45:51 2006 @@ -20,6 +20,28 @@ class MachineDebugInfo; class MachineFunction; +/// The CalleeSavedInfo class tracks the information need to locate where a +/// callee saved register in the current frame. +class CalleeSavedInfo { + +private: + unsigned Reg; + const TargetRegisterClass *RegClass; + int FrameIdx; + +public: + CalleeSavedInfo(unsigned R, const TargetRegisterClass *RC, int FI = 0) + : Reg(R) + , RegClass(RC) + , FrameIdx(FI) + {} + + // Accessors. + unsigned getReg() const { return Reg; } + const TargetRegisterClass *getRegClass() const { return RegClass; } + int getFrameIdx() const { return FrameIdx; } + void setFrameIdx(int FI) { FrameIdx = FI; } +}; /// The MachineFrameInfo class represents an abstract stack frame until /// prolog/epilog code is inserted. This class is key to allowing stack frame @@ -111,6 +133,12 @@ /// unsigned MaxCallFrameSize; + /// CSInfo - The prolog/epilog code inserter fills in this vector with each + /// callee saved register saved in the frame. Beyond it's use by the prolog/ + /// epilog code inserter, this data used for debug info and exception + /// handling. + std::vector CSInfo; + /// DebugInfo - This field is set (via setMachineDebugInfo) by a debug info /// consumer (ex. DwarfWriter) to indicate that frame layout information /// should be acquired. Typically, it's the responsibility of the target's @@ -242,6 +270,10 @@ Objects.push_back(StackObject(0, 1, -1)); return Objects.size()-NumFixedObjects-1; } + + /// getCalleeSavedInfo - Returns a reference to call saved info vector for the + /// current function. + std::vector &getCalleeSavedInfo() { return CSInfo; } /// getMachineDebugInfo - Used by a prologue/epilogue emitter (MRegisterInfo) /// to provide frame layout information. From reid at x10sys.com Fri Aug 25 14:55:10 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 14:55:10 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/DynamicLibrary.h Message-ID: <200608251955.k7PJtAmK032562@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: DynamicLibrary.h updated: 1.8 -> 1.9 --- Log message: For PR797: http://llvm.org/PR797 : Final commit for this bug. This removes the last EH holdouts in LLVM and turns off exception support by using the -fno-exceptions option. This leads to the following reduction in library and executable sizes: DEBUG BUILD RELEASE BUILD before after delta before after delta lib 162,328K 157,616K 4,712 17,864K 16,416K 1,448K bin 571,444K 557,156K 14,288 63,296K 56,996K 6,300K Debug Improvement: 19,000K (2.59%) Release Improvement: 7,748K (9.55%) --- Diffs of the changes: (+0 -6) DynamicLibrary.h | 6 ------ 1 files changed, 6 deletions(-) Index: llvm/include/llvm/System/DynamicLibrary.h diff -u llvm/include/llvm/System/DynamicLibrary.h:1.8 llvm/include/llvm/System/DynamicLibrary.h:1.9 --- llvm/include/llvm/System/DynamicLibrary.h:1.8 Wed Jul 26 11:55:39 2006 +++ llvm/include/llvm/System/DynamicLibrary.h Fri Aug 25 14:54:53 2006 @@ -45,12 +45,6 @@ /// @brief Open program as dynamic library. DynamicLibrary(); - /// This is the constructor for DynamicLibrary instances. It will open - /// the dynamic library specified by the filename Path. - /// @throws std::string indicating why the library couldn't be opened. - /// @brief Open a dynamic library. - DynamicLibrary(const char* filename); - /// After destruction, the symbols of the library will no longer be /// available to the program. It is important to make sure the lifespan /// of a DynamicLibrary exceeds the lifetime of the pointers returned From reid at x10sys.com Fri Aug 25 14:55:11 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 14:55:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/DynamicLibrary.cpp README.txt Message-ID: <200608251955.k7PJtBCG032570@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: DynamicLibrary.cpp updated: 1.16 -> 1.17 README.txt updated: 1.6 -> 1.7 --- Log message: For PR797: http://llvm.org/PR797 : Final commit for this bug. This removes the last EH holdouts in LLVM and turns off exception support by using the -fno-exceptions option. This leads to the following reduction in library and executable sizes: DEBUG BUILD RELEASE BUILD before after delta before after delta lib 162,328K 157,616K 4,712 17,864K 16,416K 1,448K bin 571,444K 557,156K 14,288 63,296K 56,996K 6,300K Debug Improvement: 19,000K (2.59%) Release Improvement: 7,748K (9.55%) --- Diffs of the changes: (+7 -8) DynamicLibrary.cpp | 11 +++++------ README.txt | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) Index: llvm/lib/System/DynamicLibrary.cpp diff -u llvm/lib/System/DynamicLibrary.cpp:1.16 llvm/lib/System/DynamicLibrary.cpp:1.17 --- llvm/lib/System/DynamicLibrary.cpp:1.16 Wed Jul 26 11:55:39 2006 +++ llvm/lib/System/DynamicLibrary.cpp Fri Aug 25 14:54:53 2006 @@ -45,12 +45,10 @@ //=== independent code. //===----------------------------------------------------------------------===// -static bool did_initialize_ltdl = false; - static inline void check_ltdl_initialization() { + static bool did_initialize_ltdl = false; if (!did_initialize_ltdl) { - if (0 != lt_dlinit()) - throw std::string(lt_dlerror()); + assert(0 == lt_dlinit() || "Can't init the ltdl library"); did_initialize_ltdl = true; } } @@ -62,13 +60,13 @@ lt_dlhandle a_handle = lt_dlopen(0); - if (a_handle == 0) - throw std::string("Can't open program as dynamic library"); + assert(a_handle == 0 || "Can't open program as dynamic library"); handle = a_handle; OpenedHandles.push_back(a_handle); } +/* DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) { check_ltdl_initialization(); @@ -83,6 +81,7 @@ handle = a_handle; OpenedHandles.push_back(a_handle); } +*/ DynamicLibrary::~DynamicLibrary() { lt_dlhandle a_handle = (lt_dlhandle) handle; Index: llvm/lib/System/README.txt diff -u llvm/lib/System/README.txt:1.6 llvm/lib/System/README.txt:1.7 --- llvm/lib/System/README.txt:1.6 Mon Mar 13 23:54:51 2006 +++ llvm/lib/System/README.txt Fri Aug 25 14:54:53 2006 @@ -25,8 +25,8 @@ 3. No exposed system-specific functions. 4. No exposed system-specific data. 5. Data in lib/System classes must use only simple C++ intrinsic types. - 6. Errors are handled by throwing std::string *only*. - 7. Library must not throw any exceptions except std::string. + 6. Errors are handled by returning "true" and setting an optional std::string + 7. Library must not throw any exceptions, period. 8. Interface functions must not have throw() specifications. 9. No duplicate function impementations are permitted within an operating system class. From reid at x10sys.com Fri Aug 25 14:55:13 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 14:55:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/Makefile Message-ID: <200608251955.k7PJtDw0032580@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Archive: Makefile updated: 1.5 -> 1.6 --- Log message: For PR797: http://llvm.org/PR797 : Final commit for this bug. This removes the last EH holdouts in LLVM and turns off exception support by using the -fno-exceptions option. This leads to the following reduction in library and executable sizes: DEBUG BUILD RELEASE BUILD before after delta before after delta lib 162,328K 157,616K 4,712 17,864K 16,416K 1,448K bin 571,444K 557,156K 14,288 63,296K 56,996K 6,300K Debug Improvement: 19,000K (2.59%) Release Improvement: 7,748K (9.55%) --- Diffs of the changes: (+0 -1) Makefile | 1 - 1 files changed, 1 deletion(-) Index: llvm/lib/Bytecode/Archive/Makefile diff -u llvm/lib/Bytecode/Archive/Makefile:1.5 llvm/lib/Bytecode/Archive/Makefile:1.6 --- llvm/lib/Bytecode/Archive/Makefile:1.5 Fri Jul 28 17:00:24 2006 +++ llvm/lib/Bytecode/Archive/Makefile Fri Aug 25 14:54:53 2006 @@ -9,7 +9,6 @@ LEVEL = ../../.. LIBRARYNAME = LLVMArchive -REQUIRES_EH := 1 # We only want an archive so only those modules actually used by a tool are # included. From reid at x10sys.com Fri Aug 25 14:55:14 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 14:55:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Makefile Reader.cpp Reader.h Message-ID: <200608251955.k7PJtEuZ032589@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Makefile updated: 1.6 -> 1.7 Reader.cpp updated: 1.195 -> 1.196 Reader.h updated: 1.31 -> 1.32 --- Log message: For PR797: http://llvm.org/PR797 : Final commit for this bug. This removes the last EH holdouts in LLVM and turns off exception support by using the -fno-exceptions option. This leads to the following reduction in library and executable sizes: DEBUG BUILD RELEASE BUILD before after delta before after delta lib 162,328K 157,616K 4,712 17,864K 16,416K 1,448K bin 571,444K 557,156K 14,288 63,296K 56,996K 6,300K Debug Improvement: 19,000K (2.59%) Release Improvement: 7,748K (9.55%) --- Diffs of the changes: (+20 -24) Makefile | 1 - Reader.cpp | 16 ++++++++++++---- Reader.h | 27 ++++++++------------------- 3 files changed, 20 insertions(+), 24 deletions(-) Index: llvm/lib/Bytecode/Reader/Makefile diff -u llvm/lib/Bytecode/Reader/Makefile:1.6 llvm/lib/Bytecode/Reader/Makefile:1.7 --- llvm/lib/Bytecode/Reader/Makefile:1.6 Fri Jul 7 11:44:31 2006 +++ llvm/lib/Bytecode/Reader/Makefile Fri Aug 25 14:54:53 2006 @@ -9,7 +9,6 @@ LEVEL = ../../.. LIBRARYNAME = LLVMBCReader BUILD_ARCHIVE = 1 -REQUIRES_EH := 1 include $(LEVEL)/Makefile.common Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.195 llvm/lib/Bytecode/Reader/Reader.cpp:1.196 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.195 Tue Aug 22 11:09:19 2006 +++ llvm/lib/Bytecode/Reader/Reader.cpp Fri Aug 25 14:54:53 2006 @@ -1943,14 +1943,18 @@ /// ParseAllFunctionBodies. /// @see ParseAllFunctionBodies /// @see ParseBytecode -void BytecodeReader::ParseFunction(Function* Func) { +bool BytecodeReader::ParseFunction(Function* Func, std::string* ErrMsg) { + + if (setjmp(context)) + return true; + // Find {start, end} pointers and slot in the map. If not there, we're done. LazyFunctionMap::iterator Fi = LazyFunctionLoadMap.find(Func); // Make sure we found it if (Fi == LazyFunctionLoadMap.end()) { error("Unrecognized function of type " + Func->getType()->getDescription()); - return; + return true; } BlockStart = At = Fi->second.Buf; @@ -1960,6 +1964,7 @@ LazyFunctionLoadMap.erase(Fi); this->ParseFunctionBody(Func); + return false; } /// The ParseAllFunctionBodies method parses through all the previously @@ -1969,7 +1974,10 @@ /// the function definitions are located. This function uses that information /// to materialize the functions. /// @see ParseBytecode -void BytecodeReader::ParseAllFunctionBodies() { +bool BytecodeReader::ParseAllFunctionBodies(std::string* ErrMsg) { + if (setjmp(context)) + return true; + LazyFunctionMap::iterator Fi = LazyFunctionLoadMap.begin(); LazyFunctionMap::iterator Fe = LazyFunctionLoadMap.end(); @@ -1981,7 +1989,7 @@ ++Fi; } LazyFunctionLoadMap.clear(); - + return false; } /// Parse the global type list Index: llvm/lib/Bytecode/Reader/Reader.h diff -u llvm/lib/Bytecode/Reader/Reader.h:1.31 llvm/lib/Bytecode/Reader/Reader.h:1.32 --- llvm/lib/Bytecode/Reader/Reader.h:1.31 Tue Aug 22 11:09:19 2006 +++ llvm/lib/Bytecode/Reader/Reader.h Fri Aug 25 14:54:53 2006 @@ -147,26 +147,21 @@ ); /// @brief Parse all function bodies - void ParseAllFunctionBodies(); + bool ParseAllFunctionBodies(std::string* ErrMsg); /// @brief Parse the next function of specific type - void ParseFunction(Function* Func) ; + bool ParseFunction(Function* Func, std::string* ErrMsg) ; /// This method is abstract in the parent ModuleProvider class. Its /// implementation is identical to the ParseFunction method. /// @see ParseFunction /// @brief Make a specific function materialize. - virtual bool materializeFunction(Function *F, std::string *ErrInfo = 0) { + virtual bool materializeFunction(Function *F, std::string *ErrMsg = 0) { LazyFunctionMap::iterator Fi = LazyFunctionLoadMap.find(F); - if (Fi == LazyFunctionLoadMap.end()) return false; - try { - ParseFunction(F); - } catch (std::string &ErrStr) { - if (ErrInfo) *ErrInfo = ErrStr; + if (Fi == LazyFunctionLoadMap.end()) + return false; + if (ParseFunction(F,ErrMsg)) return true; - } catch (...) { - return true; - } return false; } @@ -174,15 +169,9 @@ /// implementation is identical to ParseAllFunctionBodies. /// @see ParseAllFunctionBodies /// @brief Make the whole module materialize - virtual Module* materializeModule(std::string *ErrInfo = 0) { - try { - ParseAllFunctionBodies(); - } catch (std::string &ErrStr) { - if (ErrInfo) *ErrInfo = ErrStr; + virtual Module* materializeModule(std::string *ErrMsg = 0) { + if (ParseAllFunctionBodies(ErrMsg)) return 0; - } catch (...) { - return 0; - } return TheModule; } From reid at x10sys.com Fri Aug 25 14:55:13 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 14:55:13 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200608251955.k7PJtCmL032575@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.396 -> 1.397 --- Log message: For PR797: http://llvm.org/PR797 : Final commit for this bug. This removes the last EH holdouts in LLVM and turns off exception support by using the -fno-exceptions option. This leads to the following reduction in library and executable sizes: DEBUG BUILD RELEASE BUILD before after delta before after delta lib 162,328K 157,616K 4,712 17,864K 16,416K 1,448K bin 571,444K 557,156K 14,288 63,296K 56,996K 6,300K Debug Improvement: 19,000K (2.59%) Release Improvement: 7,748K (9.55%) --- Diffs of the changes: (+5 -5) Makefile.rules | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.396 llvm/Makefile.rules:1.397 --- llvm/Makefile.rules:1.396 Thu Aug 24 17:41:20 2006 +++ llvm/Makefile.rules Fri Aug 25 14:54:53 2006 @@ -206,11 +206,6 @@ OPTIMIZE_OPTION := -O2 endif -# IF REQUIRES_EH=1 is specified then don't disable exceptions -#ifndef REQUIRES_EH -# CXX.Flags += -fno-exceptions -#endif - ifdef ENABLE_PROFILING BuildMode := Profile CXX.Flags := $(OPTIMIZE_OPTION) -pg -g @@ -243,6 +238,11 @@ endif endif +# IF REQUIRES_EH=1 is specified then don't disable exceptions +#ifndef REQUIRES_EH +# CXX.Flags += -fno-exceptions +#endif + # If DISABLE_ASSERTIONS=1 is specified (make command line or configured), # then disable assertions by defining the appropriate preprocessor symbols. ifdef DISABLE_ASSERTIONS From reid at x10sys.com Fri Aug 25 15:57:13 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 15:57:13 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200608252057.k7PKvDaf001142@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.397 -> 1.398 --- Log message: Doh! Commit the change that turns ON -fno-exceptions. --- Diffs of the changes: (+3 -3) Makefile.rules | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.397 llvm/Makefile.rules:1.398 --- llvm/Makefile.rules:1.397 Fri Aug 25 14:54:53 2006 +++ llvm/Makefile.rules Fri Aug 25 15:56:59 2006 @@ -239,9 +239,9 @@ endif # IF REQUIRES_EH=1 is specified then don't disable exceptions -#ifndef REQUIRES_EH -# CXX.Flags += -fno-exceptions -#endif +ifndef REQUIRES_EH + CXX.Flags += -fno-exceptions +endif # If DISABLE_ASSERTIONS=1 is specified (make command line or configured), # then disable assertions by defining the appropriate preprocessor symbols. From reid at x10sys.com Fri Aug 25 16:37:34 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 16:37:34 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/DynamicLibrary.inc MappedFile.inc Memory.inc Path.inc Signals.inc Win32.h Message-ID: <200608252137.k7PLbYDc002079@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: DynamicLibrary.inc updated: 1.16 -> 1.17 MappedFile.inc updated: 1.6 -> 1.7 Memory.inc updated: 1.8 -> 1.9 Path.inc updated: 1.56 -> 1.57 Signals.inc updated: 1.21 -> 1.22 Win32.h updated: 1.8 -> 1.9 --- Log message: For PR797: http://llvm.org/PR797 : Make the Win32 code exception free (untested/uncompiled) which forced some interface changes which had ripple effect. This should be the last of 797. --- Diffs of the changes: (+51 -67) DynamicLibrary.inc | 12 +----------- MappedFile.inc | 29 ++++++++++++++++++----------- Memory.inc | 4 ++-- Path.inc | 22 +++++++++++----------- Signals.inc | 27 +++++++++++++++++++-------- Win32.h | 24 ------------------------ 6 files changed, 51 insertions(+), 67 deletions(-) Index: llvm/lib/System/Win32/DynamicLibrary.inc diff -u llvm/lib/System/Win32/DynamicLibrary.inc:1.16 llvm/lib/System/Win32/DynamicLibrary.inc:1.17 --- llvm/lib/System/Win32/DynamicLibrary.inc:1.16 Fri Jul 7 12:12:36 2006 +++ llvm/lib/System/Win32/DynamicLibrary.inc Fri Aug 25 16:37:17 2006 @@ -65,16 +65,6 @@ OpenedHandles.push_back((HMODULE)handle); } -DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) { - HMODULE a_handle = LoadLibrary(filename); - - if (a_handle == 0) - ThrowError(std::string(filename) + ": Can't open : "); - - handle = a_handle; - OpenedHandles.push_back(a_handle); -} - DynamicLibrary::~DynamicLibrary() { if (handle == 0) return; @@ -100,7 +90,7 @@ HMODULE a_handle = LoadLibrary(filename); if (a_handle == 0) - return GetError(std::string(filename) + ": Can't open : ", ErrMsg); + return MakeErrMsg(ErrMsg, std::string(filename) + ": Can't open : "); OpenedHandles.push_back(a_handle); } else { Index: llvm/lib/System/Win32/MappedFile.inc diff -u llvm/lib/System/Win32/MappedFile.inc:1.6 llvm/lib/System/Win32/MappedFile.inc:1.7 --- llvm/lib/System/Win32/MappedFile.inc:1.6 Thu May 5 17:33:09 2005 +++ llvm/lib/System/Win32/MappedFile.inc Fri Aug 25 16:37:17 2006 @@ -27,7 +27,7 @@ size_t size; }; -void MappedFile::initialize() { +bool MappedFile::initialize(std::string* ErrMsg) { assert(!info_); info_ = new MappedFileInfo; info_->hFile = INVALID_HANDLE_VALUE; @@ -42,7 +42,8 @@ if (info_->hFile == INVALID_HANDLE_VALUE) { delete info_; info_ = NULL; - ThrowError(std::string("Can't open file: ") + path_.toString()); + return MakeErrMsg(ErrMsg, + std::string("Can't open file: ") + path_.toString()); } LARGE_INTEGER size; @@ -51,7 +52,8 @@ CloseHandle(info_->hFile); delete info_; info_ = NULL; - ThrowError(std::string("Can't get size of file: ") + path_.toString()); + return MakeErrMsg(ErrMsg, + std::string("Can't get size of file: ") + path_.toString()); } } @@ -75,7 +77,7 @@ } } -void* MappedFile::map() { +void* MappedFile::map(std::string* ErrMsg) { if (!isMapped()) { DWORD prot = PAGE_READONLY; if (options_ & EXEC_ACCESS) @@ -83,15 +85,18 @@ else if (options_ & WRITE_ACCESS) prot = PAGE_READWRITE; info_->hMapping = CreateFileMapping(info_->hFile, NULL, prot, 0, 0, NULL); - if (info_->hMapping == NULL) - ThrowError(std::string("Can't map file: ") + path_.toString()); + if (info_->hMapping == NULL) { + MakeErrMsg(ErrMsg, std::string("Can't map file: ") + path_.toString()); + return 0; + } prot = (options_ & WRITE_ACCESS) ? FILE_MAP_WRITE : FILE_MAP_READ; base_ = MapViewOfFileEx(info_->hMapping, prot, 0, 0, 0, NULL); if (base_ == NULL) { CloseHandle(info_->hMapping); info_->hMapping = NULL; - ThrowError(std::string("Can't map file: ") + path_.toString()); + MakeErrMsg(ErrMsg, std::string("Can't map file: ") + path_.toString()); + return 0; } } return base_; @@ -102,7 +107,7 @@ return info_->size; } -void MappedFile::size(size_t new_size) { +bool MappedFile::size(size_t new_size, std::string* ErrMsg) { assert(info_ && "MappedFile not initialized"); // Take the mapping out of memory. @@ -117,14 +122,16 @@ LARGE_INTEGER eof; eof.QuadPart = new_size; if (!SetFilePointerEx(info_->hFile, eof, NULL, FILE_BEGIN)) - ThrowError(std::string("Can't set end of file: ") + path_.toString()); + return MakeErrMsg(ErrMsg, + std::string("Can't set end of file: ") + path_.toString()); if (!SetEndOfFile(info_->hFile)) - ThrowError(std::string("Can't set end of file: ") + path_.toString()); + return MakeErrMsg(ErrMsg, + std::string("Can't set end of file: ") + path_.toString()); info_->size = new_size; } // Remap the file. - map(); + return map(ErrMsg); } } Index: llvm/lib/System/Win32/Memory.inc diff -u llvm/lib/System/Win32/Memory.inc:1.8 llvm/lib/System/Win32/Memory.inc:1.9 --- llvm/lib/System/Win32/Memory.inc:1.8 Wed Jul 26 15:37:11 2006 +++ llvm/lib/System/Win32/Memory.inc Fri Aug 25 16:37:17 2006 @@ -36,7 +36,7 @@ void *pa = VirtualAlloc(NULL, NumPages*pageSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE); if (pa == NULL) { - GetError("Can't allocate RWX Memory: ", ErrMsg); + MakeErrMsg(ErrMsg, "Can't allocate RWX Memory: "); return MemoryBlock(); } @@ -49,7 +49,7 @@ bool Memory::ReleaseRWX(MemoryBlock &M, std::string *ErrMsg) { if (M.Address == 0 || M.Size == 0) return false; if (!VirtualFree(M.Address, 0, MEM_RELEASE)) - return GetError("Can't release RWX Memory: ", ErrMsg); + return MakeErrMsg(ErrMsg, "Can't release RWX Memory: "); return false; } Index: llvm/lib/System/Win32/Path.inc diff -u llvm/lib/System/Win32/Path.inc:1.56 llvm/lib/System/Win32/Path.inc:1.57 --- llvm/lib/System/Win32/Path.inc:1.56 Thu Aug 24 13:58:37 2006 +++ llvm/lib/System/Win32/Path.inc Fri Aug 25 16:37:17 2006 @@ -292,8 +292,8 @@ Path::getFileStatus(FileStatus &info, std::string *ErrStr) const { WIN32_FILE_ATTRIBUTE_DATA fi; if (!GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi)) - return GetError("getStatusInfo():" + std::string(path) + - ": Can't get status: ", ErrStr); + return MakeErrMsg(ErrStr, "getStatusInfo():" + std::string(path) + + ": Can't get status: "); info.fileSize = fi.nFileSizeHigh; info.fileSize <<= sizeof(fi.nFileSizeHigh)*8; @@ -547,7 +547,7 @@ // attribute first. if (attr & FILE_ATTRIBUTE_READONLY) { if (!SetFileAttributes(path.c_str(), attr & ~FILE_ATTRIBUTE_READONLY)) - return GetError(path + ": Can't destroy file: ", ErrStr); + return MakeErrMsg(ErrStr, path + ": Can't destroy file: "); } if (!DeleteFile(path.c_str())) @@ -593,7 +593,7 @@ FindClose(h); if (err != ERROR_NO_MORE_FILES) { SetLastError(err); - return GetError(path + ": Can't read directory: ", ErrStr); + return MakeErrMsg(ErrStr, path + ": Can't read directory: "); } for (std::vector::iterator I = list.begin(); I != list.end(); @@ -603,14 +603,14 @@ } } else { if (GetLastError() != ERROR_FILE_NOT_FOUND) - return GetError(path + ": Can't read directory: ", ErrStr); + return MakeErrMsg(ErrStr, path + ": Can't read directory: "); } } pathname[lastchar] = 0; if (!RemoveDirectory(pathname)) - return GetError(std::string(pathname) + ": Can't destroy directory: ", - ErrStr); + return MakeErrMsg(ErrStr, + std::string(pathname) + ": Can't destroy directory: "); return false; } // It appears the path doesn't exist. @@ -671,7 +671,7 @@ DWORD err = GetLastError(); CloseHandle(h); SetLastError(err); - return GetError(path + ": GetFileInformationByHandle: ", ErrStr); + return MakeErrMsg(ErrStr, path + ": GetFileInformationByHandle: "); } FILETIME ft; @@ -681,7 +681,7 @@ CloseHandle(h); if (!ret) { SetLastError(err); - return GetError(path + ": SetFileTime: ", ErrStr); + return MakeErrMsg(path + ": SetFileTime: "); } // Best we can do with Unix permission bits is to interpret the owner @@ -690,13 +690,13 @@ if (bhfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { if (!SetFileAttributes(path.c_str(), bhfi.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY)) - return GetError(path + ": SetFileAttributes: ", ErrStr); + return MakeErrMsg(ErrStr, path + ": SetFileAttributes: "); } } else { if (!(bhfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) { if (!SetFileAttributes(path.c_str(), bhfi.dwFileAttributes | FILE_ATTRIBUTE_READONLY)) - return GetError(path + ": SetFileAttributes: ", ErrStr); + return MakeErrMsg(ErrStr, path + ": SetFileAttributes: "); } } Index: llvm/lib/System/Win32/Signals.inc diff -u llvm/lib/System/Win32/Signals.inc:1.21 llvm/lib/System/Win32/Signals.inc:1.22 --- llvm/lib/System/Win32/Signals.inc:1.21 Tue Aug 1 12:59:14 2006 +++ llvm/lib/System/Win32/Signals.inc Fri Aug 25 16:37:17 2006 @@ -80,11 +80,14 @@ } // RemoveFileOnSignal - The public API -void sys::RemoveFileOnSignal(const sys::Path &Filename) { +bool sys::RemoveFileOnSignal(const sys::Path &Filename, std::string* ErrMsg) { RegisterHandler(); - if (CleanupExecuted) - throw std::string("Process terminating -- cannot register for removal"); + if (CleanupExecuted) { + if (ErrMsg) + *ErrMsg = "Process terminating -- cannot register for removal"; + return true; + } if (FilesToRemove == NULL) FilesToRemove = new std::vector; @@ -92,25 +95,33 @@ FilesToRemove->push_back(Filename); LeaveCriticalSection(&CriticalSection); + return false; } // RemoveDirectoryOnSignal - The public API -void sys::RemoveDirectoryOnSignal(const sys::Path& path) { +bool sys::RemoveDirectoryOnSignal(const sys::Path& path, std::string* ErrMsg) { // Not a directory? sys::FileStatus Status; - if (path.getFileStatus(Status) || !Status.isDir) - return; + if (path.getFileStatus(Status) || !Status.isDir) { + if (ErrMsg) + *ErrMsg = path.toString() + " is not a directory"; + return true; + } RegisterHandler(); - if (CleanupExecuted) - throw std::string("Process terminating -- cannot register for removal"); + if (CleanupExecuted) { + if (ErrMsg) + *ErrMsg = "Process terminating -- cannot register for removal"; + return true; + } if (DirectoriesToRemove == NULL) DirectoriesToRemove = new std::vector; DirectoriesToRemove->push_back(path); LeaveCriticalSection(&CriticalSection); + return false; } /// PrintStackTraceOnErrorSignal - When an error signal (such as SIBABRT or Index: llvm/lib/System/Win32/Win32.h diff -u llvm/lib/System/Win32/Win32.h:1.8 llvm/lib/System/Win32/Win32.h:1.9 --- llvm/lib/System/Win32/Win32.h:1.8 Wed Aug 23 02:30:48 2006 +++ llvm/lib/System/Win32/Win32.h Fri Aug 25 16:37:17 2006 @@ -24,26 +24,6 @@ #include #include -inline bool GetError(const std::string &Prefix, std::string *Dest) { - if (Dest == 0) return true; - char *buffer = NULL; - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, - NULL, GetLastError(), 0, (LPSTR)&buffer, 1, NULL); - *Dest = Prefix + buffer; - LocalFree(buffer); - return true; -} - -inline void ThrowError(const std::string& msg) { - char *buffer = NULL; - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, - NULL, GetLastError(), 0, (LPSTR)&buffer, 1, NULL); - std::string s(msg); - s += buffer; - LocalFree(buffer); - throw s; -} - inline bool MakeErrMsg(std::string* ErrMsg, const std::string& prefix) { if (!ErrMsg) return true; @@ -55,10 +35,6 @@ return true; } -inline void ThrowErrno(const std::string& prefix) { - ThrowError(prefix + ": " + strerror(errno)); -} - inline void MakeErrnoMsg(std::string* ErrMsg, const std::string & prefix) { MakeErrorMsg(prefix + ": " + strerror(errno)); } From reid at x10sys.com Fri Aug 25 16:37:34 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 16:37:34 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/MappedFile.inc Signals.inc Unix.h Message-ID: <200608252137.k7PLbYoF002088@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: MappedFile.inc updated: 1.17 -> 1.18 Signals.inc updated: 1.14 -> 1.15 Unix.h updated: 1.18 -> 1.19 --- Log message: For PR797: http://llvm.org/PR797 : Make the Win32 code exception free (untested/uncompiled) which forced some interface changes which had ripple effect. This should be the last of 797. --- Diffs of the changes: (+16 -9) MappedFile.inc | 10 ++++++---- Signals.inc | 13 +++++++++---- Unix.h | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) Index: llvm/lib/System/Unix/MappedFile.inc diff -u llvm/lib/System/Unix/MappedFile.inc:1.17 llvm/lib/System/Unix/MappedFile.inc:1.18 --- llvm/lib/System/Unix/MappedFile.inc:1.17 Tue Aug 22 11:04:22 2006 +++ llvm/lib/System/Unix/MappedFile.inc Fri Aug 25 16:37:17 2006 @@ -122,7 +122,7 @@ return info_->Size; } -void MappedFile::size(size_t new_size) { +bool MappedFile::size(size_t new_size, std::string* ErrMsg) { assert(info_ && "MappedFile not initialized"); // Take the mapping out of memory @@ -140,12 +140,14 @@ if (new_size > cur_size) { // Ensure we can allocate at least the idodes necessary to handle the // file size requested. - ::lseek(info_->FD, new_size, SEEK_SET); - ::write(info_->FD, "\0", 1); + if ((off_t)-1 == ::lseek(info_->FD, new_size, SEEK_SET)) + return MakeErrMsg(ErrMsg, "Can't lseek: "); + if (-1 == ::write(info_->FD, "\0", 1)) + return MakeErrMsg(ErrMsg, "Can't write: "); } // Put the mapping back into memory. - this->map(0); + return this->map(ErrMsg); } } Index: llvm/lib/System/Unix/Signals.inc diff -u llvm/lib/System/Unix/Signals.inc:1.14 llvm/lib/System/Unix/Signals.inc:1.15 --- llvm/lib/System/Unix/Signals.inc:1.14 Mon Aug 7 00:36:24 2006 +++ llvm/lib/System/Unix/Signals.inc Fri Aug 25 16:37:17 2006 @@ -154,7 +154,7 @@ } // RemoveFileOnSignal - The public API -void sys::RemoveFileOnSignal(const sys::Path &Filename) { +bool sys::RemoveFileOnSignal(const sys::Path &Filename, std::string* ErrMsg) { if (FilesToRemove == 0) FilesToRemove = new std::vector; @@ -162,14 +162,18 @@ std::for_each(IntSigs, IntSigsEnd, RegisterHandler); std::for_each(KillSigs, KillSigsEnd, RegisterHandler); + return false; } // RemoveDirectoryOnSignal - The public API -void sys::RemoveDirectoryOnSignal(const sys::Path& path) { +bool sys::RemoveDirectoryOnSignal(const sys::Path& path, std::string* ErrMsg) { // Not a directory? sys::FileStatus Status; - if (path.getFileStatus(Status) || !Status.isDir) - return; + if (path.getFileStatus(Status) || !Status.isDir) { + if (ErrMsg) + *ErrMsg = path.toString() + " is not a directory"; + return true; + } if (DirectoriesToRemove == 0) DirectoriesToRemove = new std::vector; @@ -178,6 +182,7 @@ std::for_each(IntSigs, IntSigsEnd, RegisterHandler); std::for_each(KillSigs, KillSigsEnd, RegisterHandler); + return false; } /// PrintStackTraceOnErrorSignal - When an error signal (such as SIBABRT or Index: llvm/lib/System/Unix/Unix.h diff -u llvm/lib/System/Unix/Unix.h:1.18 llvm/lib/System/Unix/Unix.h:1.19 --- llvm/lib/System/Unix/Unix.h:1.18 Wed Aug 23 15:34:57 2006 +++ llvm/lib/System/Unix/Unix.h Fri Aug 25 16:37:17 2006 @@ -94,7 +94,7 @@ // but, oh well, just use a generic message sprintf(buffer, "Error #%d", errnum); #endif - *ErrMsg = buffer; + *ErrMsg = prefix + buffer; return true; } From reid at x10sys.com Fri Aug 25 16:37:33 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 25 Aug 2006 16:37:33 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/MappedFile.h Signals.h Message-ID: <200608252137.k7PLbXpr002064@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: MappedFile.h updated: 1.11 -> 1.12 Signals.h updated: 1.17 -> 1.18 --- Log message: For PR797: http://llvm.org/PR797 : Make the Win32 code exception free (untested/uncompiled) which forced some interface changes which had ripple effect. This should be the last of 797. --- Diffs of the changes: (+3 -3) MappedFile.h | 2 +- Signals.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/include/llvm/System/MappedFile.h diff -u llvm/include/llvm/System/MappedFile.h:1.11 llvm/include/llvm/System/MappedFile.h:1.12 --- llvm/include/llvm/System/MappedFile.h:1.11 Tue Aug 22 11:04:22 2006 +++ llvm/include/llvm/System/MappedFile.h Fri Aug 25 16:37:17 2006 @@ -134,7 +134,7 @@ /// areas of memory after this call. /// @throws std::string if an error occurs /// @brief Set the size of the file and memory mapping. - void size(size_t new_size); + bool size(size_t new_size, std::string* ErrMsg = 0); void close() { if (info_) terminate(); } Index: llvm/include/llvm/System/Signals.h diff -u llvm/include/llvm/System/Signals.h:1.17 llvm/include/llvm/System/Signals.h:1.18 --- llvm/include/llvm/System/Signals.h:1.17 Wed Jul 26 11:55:39 2006 +++ llvm/include/llvm/System/Signals.h Fri Aug 25 16:37:17 2006 @@ -24,13 +24,13 @@ /// This function registers signal handlers to ensure that if a signal gets /// delivered that the named file is removed. /// @brief Remove a file if a fatal signal occurs. - void RemoveFileOnSignal(const Path &Filename); + bool RemoveFileOnSignal(const Path &Filename, std::string* ErrMsg = 0); /// This function registers a signal handler to ensure that if a fatal signal /// gets delivered to the process that the named directory and all its /// contents are removed. /// @brief Remove a directory if a fatal signal occurs. - void RemoveDirectoryOnSignal(const Path& path); + bool RemoveDirectoryOnSignal(const Path& path, std::string* ErrMsg = 0); /// When an error signal (such as SIBABRT or SIGSEGV) is delivered to the /// process, print a stack trace and then exit. From evan.cheng at apple.com Fri Aug 25 16:54:58 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 25 Aug 2006 16:54:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp PPCBranchSelector.cpp Message-ID: <200608252154.k7PLswTm002346@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.190 -> 1.191 PPCBranchSelector.cpp updated: 1.25 -> 1.26 --- Log message: Encode pc-relative conditional branch offset as pc+(num of bytes / 4). The asm printer will print it as offset*4. e.g. bne cr0, $+8. The PPC code emitter was expecting the offset to be number of instructions, not number of bytes. This fixes a whole bunch of JIT failures. --- Diffs of the changes: (+2 -2) PPCAsmPrinter.cpp | 2 +- PPCBranchSelector.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.190 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.191 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.190 Sat Aug 12 16:29:52 2006 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Fri Aug 25 16:54:44 2006 @@ -131,7 +131,7 @@ // Branches can take an immediate operand. This is used by the branch // selection pass to print $+8, an eight byte displacement from the PC. if (MI->getOperand(OpNo).isImmediate()) { - O << "$+" << MI->getOperand(OpNo).getImmedValue(); + O << "$+" << MI->getOperand(OpNo).getImmedValue()*4; } else { printOp(MI->getOperand(OpNo)); } Index: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp diff -u llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.25 llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.26 --- llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.25 Wed Jun 28 18:17:23 2006 +++ llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Fri Aug 25 16:54:44 2006 @@ -133,7 +133,7 @@ if (Displacement >= -32768 && Displacement <= 32767) { BuildMI(*MBB, MBBJ, Opcode, 2).addReg(CRReg).addMBB(trueMBB); } else { - BuildMI(*MBB, MBBJ, Inverted, 2).addReg(CRReg).addImm(8); + BuildMI(*MBB, MBBJ, Inverted, 2).addReg(CRReg).addImm(2); BuildMI(*MBB, MBBJ, PPC::B, 1).addMBB(trueMBB); } From natebegeman at mac.com Fri Aug 25 16:59:32 2006 From: natebegeman at mac.com (Nate Begeman) Date: Fri, 25 Aug 2006 14:59:32 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp PPCBranchSelector.cpp In-Reply-To: <200608252154.k7PLswTm002346@zion.cs.uiuc.edu> References: <200608252154.k7PLswTm002346@zion.cs.uiuc.edu> Message-ID: <8D73A177-FB44-4240-BFBC-589AD7518720@mac.com> Evan, Please add a comment in PPCBranchSelect as to what "2" means in .addImm(2) On Aug 25, 2006, at 2:54 PM, Evan Cheng wrote: > > > Changes in directory llvm/lib/Target/PowerPC: > > PPCAsmPrinter.cpp updated: 1.190 -> 1.191 > PPCBranchSelector.cpp updated: 1.25 -> 1.26 > --- > Log message: > > Encode pc-relative conditional branch offset as pc+(num of bytes / > 4). The > asm printer will print it as offset*4. e.g. bne cr0, $+8. > > The PPC code emitter was expecting the offset to be number of > instructions, not > number of bytes. This fixes a whole bunch of JIT failures. > > > --- > Diffs of the changes: (+2 -2) > > PPCAsmPrinter.cpp | 2 +- > PPCBranchSelector.cpp | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > > Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp > diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.190 llvm/lib/ > Target/PowerPC/PPCAsmPrinter.cpp:1.191 > --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.190 Sat Aug 12 > 16:29:52 2006 > +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Fri Aug 25 16:54:44 2006 > @@ -131,7 +131,7 @@ > // Branches can take an immediate operand. This is used by > the branch > // selection pass to print $+8, an eight byte displacement > from the PC. > if (MI->getOperand(OpNo).isImmediate()) { > - O << "$+" << MI->getOperand(OpNo).getImmedValue(); > + O << "$+" << MI->getOperand(OpNo).getImmedValue()*4; > } else { > printOp(MI->getOperand(OpNo)); > } > > > Index: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp > diff -u llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.25 llvm/lib/ > Target/PowerPC/PPCBranchSelector.cpp:1.26 > --- llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.25 Wed Jun 28 > 18:17:23 2006 > +++ llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Fri Aug 25 > 16:54:44 2006 > @@ -133,7 +133,7 @@ > if (Displacement >= -32768 && Displacement <= 32767) { > BuildMI(*MBB, MBBJ, Opcode, 2).addReg(CRReg).addMBB > (trueMBB); > } else { > - BuildMI(*MBB, MBBJ, Inverted, 2).addReg(CRReg).addImm(8); > + BuildMI(*MBB, MBBJ, Inverted, 2).addReg(CRReg).addImm(2); > BuildMI(*MBB, MBBJ, PPC::B, 1).addMBB(trueMBB); > } > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From resistor at mac.com Fri Aug 25 17:12:50 2006 From: resistor at mac.com (Owen Anderson) Date: Fri, 25 Aug 2006 17:12:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Message-ID: <200608252212.k7PMCo4I002620@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: IndVarSimplify.cpp updated: 1.92 -> 1.93 --- Log message: Add an assertion to check that we're really preserving LCSSA. --- Diffs of the changes: (+2 -0) IndVarSimplify.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.92 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.93 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.92 Fri Aug 25 12:41:25 2006 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Fri Aug 25 17:12:36 2006 @@ -571,4 +571,6 @@ #endif DeleteTriviallyDeadInstructions(DeadInsts); + + if (mustPreserveAnalysisID(LCSSAID)) assert(L->isLCSSAForm()); } From resistor at mac.com Fri Aug 25 17:14:09 2006 From: resistor at mac.com (Owen Anderson) Date: Fri, 25 Aug 2006 17:14:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnroll.cpp Message-ID: <200608252214.k7PME9pJ002652@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopUnroll.cpp updated: 1.24 -> 1.25 --- Log message: Fix a crash related to updating Phi nodes in the original header block. This was causing a crash in 175.vpr --- Diffs of the changes: (+2 -1) LoopUnroll.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.24 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.25 --- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.24 Thu Aug 24 16:28:19 2006 +++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp Fri Aug 25 17:13:55 2006 @@ -269,7 +269,8 @@ if (isa(InVal)) InVal = LastValueMap[InVal]; (*SI)->removeIncomingValue(LatchBlock, false); - (*SI)->addIncoming(InVal, cast(LastValueMap[LatchBlock])); + if (InVal) + (*SI)->addIncoming(InVal, cast(LastValueMap[LatchBlock])); } } From jlaskey at apple.com Fri Aug 25 17:56:44 2006 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 25 Aug 2006 17:56:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/PrologEpilogInserter.cpp Message-ID: <200608252256.k7PMuiEc003491@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: PrologEpilogInserter.cpp updated: 1.56 -> 1.57 --- Log message: Tidy up. --- Diffs of the changes: (+4 -2) PrologEpilogInserter.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp diff -u llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.56 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.57 --- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.56 Fri Aug 25 14:45:51 2006 +++ llvm/lib/CodeGen/PrologEpilogInserter.cpp Fri Aug 25 17:56:30 2006 @@ -139,7 +139,7 @@ const bool *PhysRegsUsed = Fn.getUsedPhysregs(); const TargetRegisterClass* const *CSRegClasses = RegInfo->getCalleeSaveRegClasses(); - std::vector &CSI = FFI->getCalleeSavedInfo(); + std::vector CSI; for (unsigned i = 0; CSRegs[i]; ++i) { unsigned Reg = CSRegs[i]; if (PhysRegsUsed[Reg]) { @@ -186,6 +186,8 @@ } CSI[i].setFrameIdx(FrameIdx); } + + FFI->setCalleeSavedInfo(CSI); } /// saveCallerSavedRegisters - Insert spill code for any caller saved registers @@ -194,7 +196,7 @@ void PEI::saveCallerSavedRegisters(MachineFunction &Fn) { // Get callee saved register information. MachineFrameInfo *FFI = Fn.getFrameInfo(); - std::vector &CSI = FFI->getCalleeSavedInfo(); + const std::vector &CSI = FFI->getCalleeSavedInfo(); // Early exit if no caller saved registers are modified! if (CSI.empty()) From jlaskey at apple.com Fri Aug 25 17:56:45 2006 From: jlaskey at apple.com (Jim Laskey) Date: Fri, 25 Aug 2006 17:56:45 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineFrameInfo.h Message-ID: <200608252256.k7PMujAK003496@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineFrameInfo.h updated: 1.19 -> 1.20 --- Log message: Tidy up. --- Diffs of the changes: (+10 -2) MachineFrameInfo.h | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) Index: llvm/include/llvm/CodeGen/MachineFrameInfo.h diff -u llvm/include/llvm/CodeGen/MachineFrameInfo.h:1.19 llvm/include/llvm/CodeGen/MachineFrameInfo.h:1.20 --- llvm/include/llvm/CodeGen/MachineFrameInfo.h:1.19 Fri Aug 25 14:45:51 2006 +++ llvm/include/llvm/CodeGen/MachineFrameInfo.h Fri Aug 25 17:56:30 2006 @@ -134,7 +134,7 @@ unsigned MaxCallFrameSize; /// CSInfo - The prolog/epilog code inserter fills in this vector with each - /// callee saved register saved in the frame. Beyond it's use by the prolog/ + /// callee saved register saved in the frame. Beyond its use by the prolog/ /// epilog code inserter, this data used for debug info and exception /// handling. std::vector CSInfo; @@ -273,7 +273,15 @@ /// getCalleeSavedInfo - Returns a reference to call saved info vector for the /// current function. - std::vector &getCalleeSavedInfo() { return CSInfo; } + const std::vector &getCalleeSavedInfo() const { + return CSInfo; + } + + /// setCalleeSavedInfo - Used by prolog/epilog inserter to set the function's + /// callee saved information. + void setCalleeSavedInfo(const std::vector &CSI) { + CSInfo = CSI; + } /// getMachineDebugInfo - Used by a prologue/epilogue emitter (MRegisterInfo) /// to provide frame layout information. From evan.cheng at apple.com Fri Aug 25 18:29:20 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 25 Aug 2006 18:29:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Message-ID: <200608252329.k7PNTKXW004051@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCBranchSelector.cpp updated: 1.26 -> 1.27 --- Log message: Add a comment. --- Diffs of the changes: (+1 -0) PPCBranchSelector.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp diff -u llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.26 llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.27 --- llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.26 Fri Aug 25 16:54:44 2006 +++ llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Fri Aug 25 18:29:06 2006 @@ -133,6 +133,7 @@ if (Displacement >= -32768 && Displacement <= 32767) { BuildMI(*MBB, MBBJ, Opcode, 2).addReg(CRReg).addMBB(trueMBB); } else { + // Long branch, skip next branch instruction (i.e. $PC+8). BuildMI(*MBB, MBBJ, Inverted, 2).addReg(CRReg).addImm(2); BuildMI(*MBB, MBBJ, PPC::B, 1).addMBB(trueMBB); } From lattner at cs.uiuc.edu Fri Aug 25 18:41:38 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 25 Aug 2006 18:41:38 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp LiveIntervalAnalysis.cpp Message-ID: <200608252341.k7PNfcTw004339@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveInterval.cpp updated: 1.30 -> 1.31 LiveIntervalAnalysis.cpp updated: 1.167 -> 1.168 --- Log message: Completely change the way that joining with physregs is implemented. This paves the way for future changes, increases coallescing opportunities (in theory, not witnessed in practice), and eliminates the really expensive LiveIntervals::overlapsAliases method. --- Diffs of the changes: (+72 -35) LiveInterval.cpp | 47 +++++++++++++++++++++++++++++++----- LiveIntervalAnalysis.cpp | 60 +++++++++++++++++++++++++---------------------- 2 files changed, 72 insertions(+), 35 deletions(-) Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.30 llvm/lib/CodeGen/LiveInterval.cpp:1.31 --- llvm/lib/CodeGen/LiveInterval.cpp:1.30 Thu Aug 24 18:22:59 2006 +++ llvm/lib/CodeGen/LiveInterval.cpp Fri Aug 25 18:41:24 2006 @@ -261,15 +261,15 @@ return MergeTo; } -LiveInterval::Ranges::iterator -LiveInterval::addRangeFrom(LiveRange LR, Ranges::iterator From) { +LiveInterval::iterator +LiveInterval::addRangeFrom(LiveRange LR, iterator From) { unsigned Start = LR.start, End = LR.end; - Ranges::iterator it = std::upper_bound(From, ranges.end(), Start); + iterator it = std::upper_bound(From, ranges.end(), Start); // If the inserted interval starts in the middle or right at the end of // another interval, just extend that interval to contain the range of LR. if (it != ranges.begin()) { - Ranges::iterator B = prior(it); + iterator B = prior(it); if (LR.ValId == B->ValId) { if (B->start <= Start && B->end >= Start) { extendIntervalEndTo(B, End); @@ -391,10 +391,9 @@ } // Join the ranges of other into the ranges of this interval. - Ranges::iterator InsertPos = ranges.begin(); std::map Dst2SrcIdxMap; - for (Ranges::iterator I = Other.ranges.begin(), - E = Other.ranges.end(); I != E; ++I) { + iterator InsertPos = begin(); + for (iterator I = Other.begin(), E = Other.end(); I != E; ++I) { // Map the ValId in the other live range to the current live range. if (I->ValId == MergedSrcValIdx) I->ValId = MergedDstValIdx; @@ -418,6 +417,40 @@ weight += Other.weight; } +/// MergeInClobberRanges - For any live ranges that are not defined in the +/// current interval, but are defined in the Clobbers interval, mark them +/// used with an unknown definition value. +void LiveInterval::MergeInClobberRanges(const LiveInterval &Clobbers) { + if (Clobbers.begin() == Clobbers.end()) return; + + // Find a value # to use for the clobber ranges. If there is already a value# + // for unknown values, use it. + // FIXME: Use a single sentinal number for these! + unsigned ClobberValNo = getNextValue(~0U); + + iterator IP = begin(); + for (const_iterator I = Clobbers.begin(), E = Clobbers.end(); I != E; ++I) { + unsigned Start = I->start, End = I->end; + IP = std::upper_bound(IP, end(), Start); + + // If the start of this range overlaps with an existing liverange, trim it. + if (IP != begin() && IP[-1].end > Start) { + Start = IP[-1].end; + // Trimmed away the whole range? + if (Start >= End) continue; + } + // If the end of this range overlaps with an existing liverange, trim it. + if (IP != end() && End > IP->start) { + End = IP->start; + // If this trimmed away the whole range, ignore it. + if (Start == End) continue; + } + + // Insert the clobber interval. + IP = addRangeFrom(LiveRange(Start, End, ClobberValNo), IP); + } +} + /// MergeValueNumberInto - This method is called when two value nubmers /// are found to be equivalent. This eliminates V1, replacing all /// LiveRanges with the V1 value number with the V2 value number. This can Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.167 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.168 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.167 Thu Aug 24 17:43:55 2006 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Fri Aug 25 18:41:24 2006 @@ -673,7 +673,8 @@ // Make sure that the end of the live range is inside the same block as // CopyMI. MachineInstr *ValLREndInst = getInstructionFromIndex(ValLR->end-1); - if (ValLREndInst->getParent() != CopyMI->getParent()) return false; + if (!ValLREndInst || + ValLREndInst->getParent() != CopyMI->getParent()) return false; // Okay, we now know that ValLR ends in the same block that the CopyMI // live-range starts. If there are no intervening live ranges between them in @@ -685,7 +686,18 @@ // Okay, we can merge them. We need to insert a new liverange: // [ValLR.end, BLR.begin) of either value number, then we merge the // two value numbers. - IntB.addRange(LiveRange(ValLR->end, BLR->start, BValNo)); + unsigned FillerStart = ValLR->end, FillerEnd = BLR->start; + IntB.addRange(LiveRange(FillerStart, FillerEnd, BValNo)); + + // If the IntB live range is assigned to a physical register, and if that + // physreg has aliases, + if (MRegisterInfo::isPhysicalRegister(IntB.reg)) { + for (const unsigned *AS = mri_->getAliasSet(IntB.reg); *AS; ++AS) { + LiveInterval &AliasLI = getInterval(*AS); + AliasLI.addRange(LiveRange(FillerStart, FillerEnd, + AliasLI.getNextValue(~0U))); + } + } // Okay, merge "B1" into the same value number as "B0". if (BValNo != ValLR->ValId) @@ -773,19 +785,30 @@ if (!Joinable && AdjustCopiesBackFrom(SrcInt, DestInt, CopyMI, MIDefIdx)) return true; - // If this looks joinable, do the final, expensive last check, checking to see - // if aliases overlap. If they do, we can never join these. - if (Joinable && overlapsAliases(&SrcInt, &DestInt)) { - DEBUG(std::cerr << "Alias Overlap Interference!\n"); - return true; // Can never join these. - } - if (!Joinable) { DEBUG(std::cerr << "Interference!\n"); return false; } + // If we're about to merge live ranges into a physical register live range, + // we have to update any aliased register's live ranges to indicate that they + // have clobbered values for this range. + if (MRegisterInfo::isPhysicalRegister(SrcReg) || + MRegisterInfo::isPhysicalRegister(DstReg)) { + // Figure out which register is the physical reg and which one is the + // virtreg. + LiveInterval *PhysRegLI = &SrcInt, *VirtRegLI = &DestInt; + if (MRegisterInfo::isPhysicalRegister(DstReg)) + std::swap(PhysRegLI, VirtRegLI); + + for (const unsigned *AS = mri_->getAliasSet(PhysRegLI->reg); *AS; ++AS) + getInterval(*AS).MergeInClobberRanges(*VirtRegLI); + } + DestInt.join(SrcInt, MIDefIdx); + // FIXME: If SrcInt/DestInt are physregs, we must insert the new liveranges + // into all aliasing registers as clobbers. + DEBUG(std::cerr << "\n\t\tJoined. Result = "; DestInt.print(std::cerr, mri_); std::cerr << "\n"); @@ -911,25 +934,6 @@ return !RegClass->contains(RegB); } -bool LiveIntervals::overlapsAliases(const LiveInterval *LHS, - const LiveInterval *RHS) const { - if (!MRegisterInfo::isPhysicalRegister(LHS->reg)) { - if (!MRegisterInfo::isPhysicalRegister(RHS->reg)) - return false; // vreg-vreg merge has no aliases! - std::swap(LHS, RHS); - } - - assert(MRegisterInfo::isPhysicalRegister(LHS->reg) && - MRegisterInfo::isVirtualRegister(RHS->reg) && - "first interval must describe a physical register"); - - for (const unsigned *AS = mri_->getAliasSet(LHS->reg); *AS; ++AS) - if (RHS->overlaps(getInterval(*AS))) - return true; - - return false; -} - LiveInterval LiveIntervals::createInterval(unsigned reg) { float Weight = MRegisterInfo::isPhysicalRegister(reg) ? (float)HUGE_VAL :0.0F; From lattner at cs.uiuc.edu Fri Aug 25 18:41:39 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 25 Aug 2006 18:41:39 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveInterval.h Message-ID: <200608252341.k7PNfdmD004344@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveInterval.h updated: 1.20 -> 1.21 --- Log message: Completely change the way that joining with physregs is implemented. This paves the way for future changes, increases coallescing opportunities (in theory, not witnessed in practice), and eliminates the really expensive LiveIntervals::overlapsAliases method. --- Diffs of the changes: (+4 -0) LiveInterval.h | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/include/llvm/CodeGen/LiveInterval.h diff -u llvm/include/llvm/CodeGen/LiveInterval.h:1.20 llvm/include/llvm/CodeGen/LiveInterval.h:1.21 --- llvm/include/llvm/CodeGen/LiveInterval.h:1.20 Thu Aug 24 17:43:55 2006 +++ llvm/include/llvm/CodeGen/LiveInterval.h Fri Aug 25 18:41:24 2006 @@ -148,6 +148,10 @@ /// cause merging of V1/V2 values numbers and compaction of the value space. void MergeValueNumberInto(unsigned V1, unsigned V2); + /// MergeInClobberRanges - For any live ranges that are not defined in the + /// current interval, but are defined in the Clobbers interval, mark them + /// used with an unknown definition value. + void MergeInClobberRanges(const LiveInterval &Clobbers); bool empty() const { return ranges.empty(); } From lattner at cs.uiuc.edu Fri Aug 25 19:47:18 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 25 Aug 2006 19:47:18 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp Message-ID: <200608260047.k7Q0lI8f005455@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.112 -> 1.113 --- Log message: Give a good error message when we try to jit inline asm. --- Diffs of the changes: (+3 -0) X86CodeEmitter.cpp | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.112 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.113 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.112 Thu Jul 27 13:21:10 2006 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Fri Aug 25 19:47:03 2006 @@ -385,6 +385,9 @@ switch (Opcode) { default: assert(0 && "psuedo instructions should be removed before code emission"); + case TargetInstrInfo::INLINEASM: + std::cerr << "JIT does not support inline asm!\n"; + abort(); case X86::IMPLICIT_USE: case X86::IMPLICIT_DEF: case X86::IMPLICIT_DEF_GR8: From evan.cheng at apple.com Fri Aug 25 19:59:18 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 25 Aug 2006 19:59:18 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp DAGISelEmitter.h Message-ID: <200608260059.k7Q0xI6U005660@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.245 -> 1.246 DAGISelEmitter.h updated: 1.67 -> 1.68 --- Log message: - Clean up tablegen dag isel generator code. - Clean up the code generated by tablegen: * AddToISelQueue now takes one argument. * ComplexPattern matching condition can now be shared. * Eliminate passing unnecessary arguments to emit routines. * Eliminate some unneeded SDOperand declarations in select routines. * Other minor clean ups. - This reduces foot print slightly: X86ISelDAGToDAG.o is reduced from 971k to 823k. --- Diffs of the changes: (+240 -237) DAGISelEmitter.cpp | 473 ++++++++++++++++++++++++++--------------------------- DAGISelEmitter.h | 4 2 files changed, 240 insertions(+), 237 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.245 llvm/utils/TableGen/DAGISelEmitter.cpp:1.246 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.245 Wed Aug 16 02:25:15 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Fri Aug 25 19:59:04 2006 @@ -1909,7 +1909,6 @@ } } - // NodeIsComplexPattern - return true if N is a leaf node and a subclass of // ComplexPattern. static bool NodeIsComplexPattern(TreePatternNode *N) @@ -2120,11 +2119,11 @@ std::vector > FoldedChains; std::set Duplicates; - /// GeneratedCode - This is the buffer that we emit code to. The first bool + /// GeneratedCode - This is the buffer that we emit code to. The first int /// indicates whether this is an exit predicate (something that should be - /// tested, and if true, the match fails) [when true] or normal code to emit - /// [when false]. - std::vector > &GeneratedCode; + /// tested, and if true, the match fails) [when 1], or normal code to emit + /// [when 0], or initialization code to emit [when 2]. + std::vector > &GeneratedCode; /// GeneratedDecl - This is the set of all SDOperand declarations needed for /// the set of patterns for each top-level opcode. std::set > &GeneratedDecl; @@ -2140,11 +2139,15 @@ void emitCheck(const std::string &S) { if (!S.empty()) - GeneratedCode.push_back(std::make_pair(true, S)); + GeneratedCode.push_back(std::make_pair(1, S)); } void emitCode(const std::string &S) { if (!S.empty()) - GeneratedCode.push_back(std::make_pair(false, S)); + GeneratedCode.push_back(std::make_pair(0, S)); + } + void emitInit(const std::string &S) { + if (!S.empty()) + GeneratedCode.push_back(std::make_pair(2, S)); } void emitDecl(const std::string &S, unsigned T=0) { assert(!S.empty() && "Invalid declaration"); @@ -2161,12 +2164,13 @@ public: PatternCodeEmitter(DAGISelEmitter &ise, ListInit *preds, TreePatternNode *pattern, TreePatternNode *instr, - std::vector > &gc, + std::vector > &gc, std::set > &gd, std::vector &to, std::vector &tv) : ISE(ise), Predicates(preds), Pattern(pattern), Instruction(instr), - GeneratedCode(gc), GeneratedDecl(gd), TargetOpcodes(to), TargetVTs(tv), + GeneratedCode(gc), GeneratedDecl(gd), + TargetOpcodes(to), TargetVTs(tv), TmpNo(0), OpcNo(0), VTNo(0) {} /// EmitMatchCode - Emit a matcher for N, going to the label for PatternNo @@ -2290,8 +2294,7 @@ else FoundChain = true; ChainName = "Chain" + ChainSuffix; - emitDecl(ChainName); - emitCode(ChainName + " = " + RootName + + emitInit("SDOperand " + ChainName + " = " + RootName + ".getOperand(0);"); } } @@ -2312,12 +2315,12 @@ } } + const ComplexPattern *CP; for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i, ++OpNo) { - emitDecl(RootName + utostr(OpNo)); - emitCode(RootName + utostr(OpNo) + " = " + + emitInit("SDOperand " + RootName + utostr(OpNo) + " = " + RootName + ".getOperand(" +utostr(OpNo) + ");"); - TreePatternNode *Child = N->getChild(i); - + + TreePatternNode *Child = N->getChild(i); if (!Child->isLeaf()) { // If it's not a leaf, recursively match. const SDNodeInfo &CInfo = ISE.getSDNodeInfo(Child->getOperator()); @@ -2354,7 +2357,19 @@ } else if (LeafRec->isSubClassOf("Register")) { // Handle register references. } else if (LeafRec->isSubClassOf("ComplexPattern")) { - // Handle complex pattern. Nothing to do here. + // Handle complex pattern. + CP = NodeGetComplexPattern(Child, ISE); + std::string Fn = CP->getSelectFunc(); + unsigned NumOps = CP->getNumOperands(); + for (unsigned i = 0; i < NumOps; ++i) { + emitDecl("CPTmp" + utostr(i)); + emitCode("SDOperand CPTmp" + utostr(i) + ";"); + } + + std::string Code = Fn + "(" + RootName + utostr(OpNo); + for (unsigned i = 0; i < NumOps; i++) + Code += ", CPTmp" + utostr(i); + emitCheck(Code + ")"); } else if (LeafRec->getName() == "srcvalue") { // Place holder for SRCVALUE nodes. Nothing to do here. } else if (LeafRec->isSubClassOf("ValueType")) { @@ -2389,6 +2404,21 @@ } } + // Handle cases when root is a complex pattern. + if (isRoot && N->isLeaf() && (CP = NodeGetComplexPattern(N, ISE))) { + std::string Fn = CP->getSelectFunc(); + unsigned NumOps = CP->getNumOperands(); + for (unsigned i = 0; i < NumOps; ++i) { + emitDecl("CPTmp" + utostr(i)); + emitCode("SDOperand CPTmp" + utostr(i) + ";"); + } + + std::string Code = Fn + "(" + RootName; + for (unsigned i = 0; i < NumOps; i++) + Code += ", CPTmp" + utostr(i); + emitCheck(Code + ")"); + } + // If there is a node predicate for this, emit the call. if (!N->getPredicateFn().empty()) emitCheck(N->getPredicateFn() + "(" + RootName + ".Val)"); @@ -2396,9 +2426,12 @@ /// EmitResultCode - Emit the action for a pattern. Now that it has matched /// we actually have to build a DAG! - std::pair - EmitResultCode(TreePatternNode *N, bool &RetSelected, bool LikeLeaf = false, - bool isRoot = false) { + std::vector + EmitResultCode(TreePatternNode *N, bool RetSelected, + bool InFlagDecled, bool ResNodeDecled, + bool LikeLeaf = false, bool isRoot = false) { + // List of arguments of getTargetNode() or SelectNodeTo(). + std::vector NodeOps; // This is something selected from the pattern we matched. if (!N->getName().empty()) { std::string &Val = VariableMap[N->getName()]; @@ -2406,12 +2439,12 @@ "Variable referenced but not defined and not caught earlier!"); if (Val[0] == 'T' && Val[1] == 'm' && Val[2] == 'p') { // Already selected this operand, just return the tmpval. - return std::make_pair(1, atoi(Val.c_str()+3)); + NodeOps.push_back(Val); + return NodeOps; } const ComplexPattern *CP; unsigned ResNo = TmpNo++; - unsigned NumRes = 1; if (!N->isLeaf() && N->getOperator()->getName() == "imm") { assert(N->getExtTypes().size() == 1 && "Multiple types not handled!"); std::string CastType; @@ -2423,107 +2456,101 @@ case MVT::i32: CastType = "unsigned"; break; case MVT::i64: CastType = "uint64_t"; break; } - emitDecl("Tmp" + utostr(ResNo)); - emitCode("Tmp" + utostr(ResNo) + + emitCode("SDOperand Tmp" + utostr(ResNo) + " = CurDAG->getTargetConstant(((" + CastType + ") cast(" + Val + ")->getValue()), " + getEnumName(N->getTypeNum(0)) + ");"); + NodeOps.push_back("Tmp" + utostr(ResNo)); + // Add Tmp to VariableMap, so that we don't multiply select this + // value if used multiple times by this pattern result. + Val = "Tmp"+utostr(ResNo); } else if (!N->isLeaf() && N->getOperator()->getName() == "texternalsym"){ Record *Op = OperatorMap[N->getName()]; // Transform ExternalSymbol to TargetExternalSymbol if (Op && Op->getName() == "externalsym") { - emitDecl("Tmp" + utostr(ResNo)); - emitCode("Tmp" + utostr(ResNo) + " = CurDAG->getTarget" + emitCode("SDOperand Tmp" + utostr(ResNo) + " = CurDAG->getTarget" "ExternalSymbol(cast(" + Val + ")->getSymbol(), " + getEnumName(N->getTypeNum(0)) + ");"); + NodeOps.push_back("Tmp" + utostr(ResNo)); + // Add Tmp to VariableMap, so that we don't multiply select this + // value if used multiple times by this pattern result. + Val = "Tmp"+utostr(ResNo); } else { - emitDecl("Tmp" + utostr(ResNo)); - emitCode("Tmp" + utostr(ResNo) + " = " + Val + ";"); + NodeOps.push_back(Val); } } else if (!N->isLeaf() && N->getOperator()->getName() == "tglobaladdr") { Record *Op = OperatorMap[N->getName()]; // Transform GlobalAddress to TargetGlobalAddress if (Op && Op->getName() == "globaladdr") { - emitDecl("Tmp" + utostr(ResNo)); - emitCode("Tmp" + utostr(ResNo) + " = CurDAG->getTarget" + emitCode("SDOperand Tmp" + utostr(ResNo) + " = CurDAG->getTarget" "GlobalAddress(cast(" + Val + ")->getGlobal(), " + getEnumName(N->getTypeNum(0)) + ");"); + NodeOps.push_back("Tmp" + utostr(ResNo)); + // Add Tmp to VariableMap, so that we don't multiply select this + // value if used multiple times by this pattern result. + Val = "Tmp"+utostr(ResNo); } else { - emitDecl("Tmp" + utostr(ResNo)); - emitCode("Tmp" + utostr(ResNo) + " = " + Val + ";"); + NodeOps.push_back(Val); } } else if (!N->isLeaf() && N->getOperator()->getName() == "texternalsym"){ - emitDecl("Tmp" + utostr(ResNo)); - emitCode("Tmp" + utostr(ResNo) + " = " + Val + ";"); + NodeOps.push_back(Val); + // Add Tmp to VariableMap, so that we don't multiply select this + // value if used multiple times by this pattern result. + Val = "Tmp"+utostr(ResNo); } else if (!N->isLeaf() && N->getOperator()->getName() == "tconstpool") { - emitDecl("Tmp" + utostr(ResNo)); - emitCode("Tmp" + utostr(ResNo) + " = " + Val + ";"); + NodeOps.push_back(Val); + // Add Tmp to VariableMap, so that we don't multiply select this + // 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(); - NumRes = CP->getNumOperands(); - for (unsigned i = 0; i < NumRes; ++i) - emitDecl("CPTmp" + utostr(i+ResNo)); - - std::string Code = Fn + "(" + Val; - for (unsigned i = 0; i < NumRes; i++) - Code += ", CPTmp" + utostr(i + ResNo); - emitCheck(Code + ")"); - - for (unsigned i = 0; i < NumRes; ++i) { - emitDecl("Tmp" + utostr(i+ResNo)); - emitCode("AddToQueue(Tmp" + utostr(i+ResNo) + ", CPTmp" + - utostr(i+ResNo) + ");"); + for (unsigned i = 0; i < CP->getNumOperands(); ++i) { + emitCode("AddToISelQueue(CPTmp" + utostr(i) + ");"); + NodeOps.push_back("CPTmp" + utostr(i)); } - - TmpNo = ResNo + NumRes; } else { - emitDecl("Tmp" + utostr(ResNo)); - // This node, probably wrapped in a SDNodeXForms, behaves like a leaf + // This node, probably wrapped in a SDNodeXForm, behaves like a leaf // node even if it isn't one. Don't select it. - if (LikeLeaf) - emitCode("Tmp" + utostr(ResNo) + " = " + Val + ";"); - else { - emitCode("AddToQueue(Tmp" + utostr(ResNo) + ", " + Val + ");"); + if (!LikeLeaf) { + emitCode("AddToISelQueue(" + Val + ");"); if (isRoot && N->isLeaf()) { - emitCode("ReplaceUses(N, Tmp" + utostr(ResNo) + ");"); - emitCode("Result = Tmp" + utostr(ResNo) + ";"); + emitCode("ReplaceUses(N, " + Val + ");"); + emitCode("Result = " + Val + ";"); emitCode("return NULL;"); } } + NodeOps.push_back(Val); } - // Add Tmp to VariableMap, so that we don't multiply select this - // value if used multiple times by this pattern result. - Val = "Tmp"+utostr(ResNo); - return std::make_pair(NumRes, ResNo); + return NodeOps; } if (N->isLeaf()) { // If this is an explicit register reference, handle it. if (DefInit *DI = dynamic_cast(N->getLeafValue())) { unsigned ResNo = TmpNo++; if (DI->getDef()->isSubClassOf("Register")) { - emitDecl("Tmp" + utostr(ResNo)); - emitCode("Tmp" + utostr(ResNo) + " = CurDAG->getRegister(" + + emitCode("SDOperand Tmp" + utostr(ResNo) + " = CurDAG->getRegister(" + ISE.getQualifiedName(DI->getDef()) + ", " + getEnumName(N->getTypeNum(0)) + ");"); - return std::make_pair(1, ResNo); + NodeOps.push_back("Tmp" + utostr(ResNo)); + return NodeOps; } } else if (IntInit *II = dynamic_cast(N->getLeafValue())) { unsigned ResNo = TmpNo++; assert(N->getExtTypes().size() == 1 && "Multiple types not handled!"); - emitDecl("Tmp" + utostr(ResNo)); - emitCode("Tmp" + utostr(ResNo) + + emitCode("SDOperand Tmp" + utostr(ResNo) + " = CurDAG->getTargetConstant(" + itostr(II->getValue()) + ", " + getEnumName(N->getTypeNum(0)) + ");"); - return std::make_pair(1, ResNo); + NodeOps.push_back("Tmp" + utostr(ResNo)); + return NodeOps; } #ifndef NDEBUG N->dump(); #endif assert(0 && "Unknown leaf type!"); - return std::make_pair(1, ~0U); + return NodeOps; } Record *Op = N->getOperator(); @@ -2552,11 +2579,8 @@ bool InputHasChain = isRoot && NodeHasProperty(Pattern, SDNodeInfo::SDNPHasChain, ISE); - if (NodeHasInFlag || NodeHasOutFlag || NodeHasOptInFlag || HasImpInputs) - emitDecl("InFlag"); if (NodeHasOptInFlag) { - emitDecl("HasInFlag", 2); - emitCode("HasInFlag = " + emitCode("bool HasInFlag = " "(N.getOperand(N.getNumOperands()-1).getValueType() == MVT::Flag);"); } if (HasVarOps) @@ -2570,47 +2594,29 @@ PatResults++; } - // Determine operand emission order. Complex pattern first. - std::vector > EmitOrder; - std::vector >::iterator OI; + std::vector AllOps; for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i) { - TreePatternNode *Child = N->getChild(i); - if (i == 0) { - EmitOrder.push_back(std::make_pair(i, Child)); - OI = EmitOrder.begin(); - } else if (NodeIsComplexPattern(Child)) { - OI = EmitOrder.insert(OI, std::make_pair(i, Child)); - } else { - EmitOrder.push_back(std::make_pair(i, Child)); - } - } - - // Emit all of the operands. - std::vector > NumTemps(EmitOrder.size()); - for (unsigned i = 0, e = EmitOrder.size(); i != e; ++i) { - unsigned OpOrder = EmitOrder[i].first; - TreePatternNode *Child = EmitOrder[i].second; - std::pair NumTemp = - EmitResultCode(Child, RetSelected); - NumTemps[OpOrder] = NumTemp; - } - - // List all the operands in the right order. - std::vector Ops; - for (unsigned i = 0, e = NumTemps.size(); i != e; i++) { - for (unsigned j = 0; j < NumTemps[i].first; j++) - Ops.push_back(NumTemps[i].second + j); + std::vector Ops = EmitResultCode(N->getChild(i), + RetSelected, InFlagDecled, ResNodeDecled); + AllOps.insert(AllOps.end(), Ops.begin(), Ops.end()); } // Emit all the chain and CopyToReg stuff. bool ChainEmitted = NodeHasChain; if (NodeHasChain) - emitCode("AddToQueue(" + ChainName + ", " + ChainName + ");"); + emitCode("AddToISelQueue(" + ChainName + ");"); if (NodeHasInFlag || HasImpInputs) - EmitInFlagSelectCode(Pattern, "N", ChainEmitted, true); + EmitInFlagSelectCode(Pattern, "N", ChainEmitted, + InFlagDecled, ResNodeDecled, true); if (NodeHasOptInFlag) { - emitCode("if (HasInFlag)"); - emitCode(" AddToQueue(InFlag, N.getOperand(N.getNumOperands()-1));"); + if (!InFlagDecled) { + emitCode("SDOperand InFlag(0, 0);"); + InFlagDecled = true; + } + emitCode("if (HasInFlag) {"); + emitCode(" InFlag = N.getOperand(N.getNumOperands()-1);"); + emitCode(" AddToISelQueue(InFlag);"); + emitCode("}"); } unsigned NumResults = Inst.getNumResults(); @@ -2622,12 +2628,13 @@ std::string NodeName; if (!isRoot) { NodeName = "Tmp" + utostr(ResNo); - emitDecl(NodeName); - Code2 = NodeName + " = SDOperand("; + Code2 = "SDOperand " + NodeName + " = SDOperand("; } else { NodeName = "ResNode"; - emitDecl(NodeName, true); - Code2 = NodeName + " = "; + if (!ResNodeDecled) + Code2 = "SDNode *" + NodeName + " = "; + else + Code2 = NodeName + " = "; } Code = "CurDAG->getTargetNode(Opc" + utostr(OpcNo); emitOpcode(II.Namespace + "::" + II.TheDef->getName()); @@ -2644,12 +2651,14 @@ Code += ", MVT::Flag"; // Inputs. - for (unsigned i = 0, e = Ops.size(); i != e; ++i) { + for (unsigned i = 0, e = AllOps.size(); i != e; ++i) { + std::string OpName = AllOps[i]; if (HasVarOps) - emitCode("Ops.push_back(Tmp" + utostr(Ops[i]) + ");"); + emitCode("Ops.push_back(" + OpName + ");"); else - Code += ", Tmp" + utostr(Ops[i]); + Code += ", " + OpName; } + //AllOps.clear(); if (HasVarOps) { if (NodeHasInFlag || HasImpInputs) @@ -2661,9 +2670,8 @@ else emitCode("for (unsigned i = 2, e = N.getNumOperands(); " "i != e; ++i) {"); - emitCode(" SDOperand VarOp(0, 0);"); - emitCode(" AddToQueue(VarOp, N.getOperand(i));"); - emitCode(" Ops.push_back(VarOp);"); + emitCode(" AddToISelQueue(N.getOperand(i));"); + emitCode(" Ops.push_back(N.getOperand(i));"); emitCode("}"); } @@ -2674,19 +2682,28 @@ Code += ", " + ChainName; } if (NodeHasInFlag || HasImpInputs) { - if (HasVarOps) + if (!InFlagDecled) { + emitCode("SDOperand InFlag(0, 0);"); + InFlagDecled = true; + } + if (HasVarOps) { emitCode("Ops.push_back(InFlag);"); - else + } else Code += ", InFlag"; } else if (NodeHasOptInFlag && HasVarOps) { + if (!InFlagDecled) { + emitCode("SDOperand InFlag(0, 0);"); + InFlagDecled = true; + } emitCode("if (HasInFlag)"); emitCode(" Ops.push_back(InFlag);"); } if (HasVarOps) Code += ", &Ops[0], Ops.size()"; - else if (NodeHasOptInFlag) + else if (NodeHasOptInFlag) { Code = "HasInFlag ? " + Code + ", InFlag) : " + Code; + } if (!isRoot) Code += "), 0"; @@ -2701,15 +2718,23 @@ emitCode(ChainName + " = SDOperand(" + NodeName + ", " + utostr(PatResults) + ");"); - if (!isRoot) - return std::make_pair(1, ResNo); + if (!isRoot) { + NodeOps.push_back("Tmp" + utostr(ResNo)); + return NodeOps; + } bool NeedReplace = false; - if (NodeHasOutFlag) - emitCode("InFlag = SDOperand(ResNode, " + - utostr(NumResults + (unsigned)NodeHasChain) + ");"); + if (NodeHasOutFlag) { + if (!InFlagDecled) { + emitCode("SDOperand InFlag = SDOperand(ResNode, " + + utostr(NumResults + (unsigned)NodeHasChain) + ");"); + InFlagDecled = true; + } else + emitCode("InFlag = SDOperand(ResNode, " + + utostr(NumResults + (unsigned)NodeHasChain) + ");"); + } - if (HasImpResults && EmitCopyFromRegs(N, ChainEmitted)) { + if (HasImpResults && EmitCopyFromRegs(N, ResNodeDecled, ChainEmitted)) { emitCode("ReplaceUses(SDOperand(N.Val, 0), SDOperand(ResNode, 0));"); NumResults = 1; } @@ -2780,56 +2805,41 @@ else emitCode("return NULL;"); } else { - // If this instruction is the root, and if there is only one use of it, - // use SelectNodeTo instead of getTargetNode to avoid an allocation. - emitCode("if (N.Val->hasOneUse()) {"); - std::string Code = " Result = CurDAG->SelectNodeTo(N.Val, Opc" + + std::string Code = "Result = CurDAG->SelectNodeTo(N.Val, Opc" + utostr(OpcNo); if (N->getTypeNum(0) != MVT::isVoid) Code += ", VT" + utostr(VTNo); if (NodeHasOutFlag) Code += ", MVT::Flag"; - for (unsigned i = 0, e = Ops.size(); i != e; ++i) - Code += ", Tmp" + utostr(Ops[i]); + for (unsigned i = 0, e = AllOps.size(); i != e; ++i) + Code += ", " + AllOps[i]; + //AllOps.clear(); if (NodeHasInFlag || HasImpInputs) Code += ", InFlag"; emitCode(Code + ");"); - emitCode("} else {"); - emitDecl("ResNode", 1); - Code = " ResNode = CurDAG->getTargetNode(Opc" + utostr(OpcNo); + emitCode("return Result.Val;"); emitOpcode(II.Namespace + "::" + II.TheDef->getName()); - if (N->getTypeNum(0) != MVT::isVoid) { - Code += ", VT" + utostr(VTNo); + if (N->getTypeNum(0) != MVT::isVoid) emitVT(getEnumName(N->getTypeNum(0))); - } - if (NodeHasOutFlag) - Code += ", MVT::Flag"; - for (unsigned i = 0, e = Ops.size(); i != e; ++i) - Code += ", Tmp" + utostr(Ops[i]); - if (NodeHasInFlag || HasImpInputs) - Code += ", InFlag"; - emitCode(Code + ");"); - emitCode(" Result = SDOperand(ResNode, 0);"); - emitCode("}"); - emitCode("return Result.Val;"); } - return std::make_pair(1, ResNo); + return NodeOps; } else if (Op->isSubClassOf("SDNodeXForm")) { assert(N->getNumChildren() == 1 && "node xform should have one child!"); // PatLeaf node - the operand may or may not be a leaf node. But it should // behave like one. - unsigned OpVal = EmitResultCode(N->getChild(0), RetSelected, true).second; + std::vector Ops = + EmitResultCode(N->getChild(0), RetSelected, InFlagDecled, + ResNodeDecled, true); unsigned ResNo = TmpNo++; - emitDecl("Tmp" + utostr(ResNo)); - emitCode("Tmp" + utostr(ResNo) + " = Transform_" + Op->getName() - + "(Tmp" + utostr(OpVal) + ".Val);"); + emitCode("SDOperand Tmp" + utostr(ResNo) + " = Transform_" + Op->getName() + + "(" + Ops.back() + ".Val);"); + NodeOps.push_back("Tmp" + utostr(ResNo)); if (isRoot) { - //emitCode("ReplaceUses(N, Tmp" + utostr(ResNo) + ");"); emitCode("Result = Tmp" + utostr(ResNo) + ";"); emitCode("return Result.Val;"); } - return std::make_pair(1, ResNo); + return NodeOps; } else { N->dump(); std::cerr << "\n"; @@ -2867,7 +2877,8 @@ /// EmitInFlagSelectCode - Emit the flag operands for the DAG that is /// being built. void EmitInFlagSelectCode(TreePatternNode *N, const std::string &RootName, - bool &ChainEmitted, bool isRoot = false) { + bool &ChainEmitted, bool &InFlagDecled, + bool &ResNodeDecled, bool isRoot = false) { const CodeGenTarget &T = ISE.getTargetInfo(); unsigned OpNo = (unsigned) NodeHasProperty(N, SDNodeInfo::SDNPHasChain, ISE); @@ -2875,7 +2886,8 @@ for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i, ++OpNo) { TreePatternNode *Child = N->getChild(i); if (!Child->isLeaf()) { - EmitInFlagSelectCode(Child, RootName + utostr(OpNo), ChainEmitted); + EmitInFlagSelectCode(Child, RootName + utostr(OpNo), ChainEmitted, + InFlagDecled, ResNodeDecled); } else { if (DefInit *DI = dynamic_cast(Child->getLeafValue())) { if (!Child->getName().empty()) { @@ -2889,20 +2901,29 @@ if (RR->isSubClassOf("Register")) { MVT::ValueType RVT = getRegisterValueType(RR, T); if (RVT == MVT::Flag) { - emitCode("AddToQueue(InFlag, " + RootName + utostr(OpNo) + ");"); + if (!InFlagDecled) { + emitCode("SDOperand InFlag = " + RootName + utostr(OpNo) + ";"); + InFlagDecled = true; + } else + emitCode("InFlag = " + RootName + utostr(OpNo) + ";"); + emitCode("AddToISelQueue(InFlag);"); } else { if (!ChainEmitted) { - emitDecl("Chain"); - emitCode("Chain = CurDAG->getEntryNode();"); + emitCode("SDOperand Chain = CurDAG->getEntryNode();"); ChainName = "Chain"; ChainEmitted = true; } - emitCode("AddToQueue(" + RootName + utostr(OpNo) + ", " + - RootName + utostr(OpNo) + ");"); - emitCode("ResNode = CurDAG->getCopyToReg(" + ChainName + + emitCode("AddToISelQueue(" + RootName + utostr(OpNo) + ");"); + if (!InFlagDecled) { + emitCode("SDOperand InFlag(0, 0);"); + InFlagDecled = true; + } + std::string Decl = (!ResNodeDecled) ? "SDNode *" : ""; + emitCode(Decl + "ResNode = CurDAG->getCopyToReg(" + ChainName + ", CurDAG->getRegister(" + ISE.getQualifiedName(RR) + ", " + getEnumName(RVT) + "), " + RootName + utostr(OpNo) + ", InFlag).Val;"); + ResNodeDecled = true; emitCode(ChainName + " = SDOperand(ResNode, 0);"); emitCode("InFlag = SDOperand(ResNode, 1);"); } @@ -2911,15 +2932,23 @@ } } - if (HasInFlag) - emitCode("AddToQueue(InFlag, " + RootName + - ".getOperand(" + utostr(OpNo) + "));"); + if (HasInFlag) { + if (!InFlagDecled) { + emitCode("SDOperand InFlag = " + RootName + + ".getOperand(" + utostr(OpNo) + ");"); + InFlagDecled = true; + } else + emitCode("InFlag = " + RootName + + ".getOperand(" + utostr(OpNo) + ");"); + emitCode("AddToISelQueue(InFlag);"); + } } /// EmitCopyFromRegs - Emit code to copy result to physical registers /// as specified by the instruction. It returns true if any copy is /// emitted. - bool EmitCopyFromRegs(TreePatternNode *N, bool &ChainEmitted) { + bool EmitCopyFromRegs(TreePatternNode *N, bool &ResNodeDecled, + bool &ChainEmitted) { bool RetVal = false; Record *Op = N->getOperator(); if (Op->isSubClassOf("Instruction")) { @@ -2932,14 +2961,15 @@ MVT::ValueType RVT = getRegisterValueType(RR, CGT); if (RVT != MVT::Flag) { if (!ChainEmitted) { - emitDecl("Chain"); - emitCode("Chain = CurDAG->getEntryNode();"); + emitCode("SDOperand Chain = CurDAG->getEntryNode();"); ChainEmitted = true; ChainName = "Chain"; } - emitCode("ResNode = CurDAG->getCopyFromReg(" + ChainName + + std::string Decl = (!ResNodeDecled) ? "SDNode *" : ""; + emitCode(Decl + "ResNode = CurDAG->getCopyFromReg(" + ChainName + ", " + ISE.getQualifiedName(RR) + ", " + getEnumName(RVT) + ", InFlag).Val;"); + ResNodeDecled = true; emitCode(ChainName + " = SDOperand(ResNode, 1);"); emitCode("InFlag = SDOperand(ResNode, 2);"); RetVal = true; @@ -2955,8 +2985,8 @@ /// stream to match the pattern, and generate the code for the match if it /// succeeds. Returns true if the pattern is not guaranteed to match. void DAGISelEmitter::GenerateCodeForPattern(PatternToMatch &Pattern, - std::vector > &GeneratedCode, - std::set > &GeneratedDecl, + std::vector > &GeneratedCode, + std::set > &GeneratedDecl, std::vector &TargetOpcodes, std::vector &TargetVTs) { PatternCodeEmitter Emitter(*this, Pattern.getPredicates(), @@ -3005,8 +3035,8 @@ // otherwise we are done. } while (Emitter.InsertOneTypeCheck(Pat, Pattern.getSrcPattern(), "N", true)); - bool RetSelected = false; - Emitter.EmitResultCode(Pattern.getDstPattern(), RetSelected, false, true); + Emitter.EmitResultCode(Pattern.getDstPattern(), + false, false, false, false, true); delete Pat; } @@ -3014,7 +3044,7 @@ /// a line causes any of them to be empty, remove them and return true when /// done. static bool EraseCodeLine(std::vector > > > + std::vector > > > &Patterns) { bool ErasedPatterns = false; for (unsigned i = 0, e = Patterns.size(); i != e; ++i) { @@ -3031,10 +3061,10 @@ /// EmitPatterns - Emit code for at least one pattern, but try to group common /// code together between the patterns. void DAGISelEmitter::EmitPatterns(std::vector > > > + std::vector > > > &Patterns, unsigned Indent, std::ostream &OS) { - typedef std::pair CodeLine; + typedef std::pair CodeLine; typedef std::vector CodeList; typedef std::vector > PatternList; @@ -3070,12 +3100,12 @@ << " size = " << getResultPatternSize(Pattern.getDstPattern(), *this) << "\n"; } - if (!FirstCodeLine.first) { + if (FirstCodeLine.first != 1) { OS << std::string(Indent, ' ') << "{\n"; Indent += 2; } EmitPatterns(Shared, Indent, OS); - if (!FirstCodeLine.first) { + if (FirstCodeLine.first != 1) { Indent -= 2; OS << std::string(Indent, ' ') << "}\n"; } @@ -3102,7 +3132,7 @@ // Remove this code from all of the patterns that share it. bool ErasedPatterns = EraseCodeLine(Patterns); - bool isPredicate = FirstCodeLine.first; + bool isPredicate = FirstCodeLine.first == 1; // Otherwise, every pattern in the list has this line. Emit it. if (!isPredicate) { @@ -3114,7 +3144,7 @@ // If the next code line is another predicate, and if all of the pattern // in this group share the same next line, emit it inline now. Do this // until we run out of common predicates. - while (!ErasedPatterns && Patterns.back().second.back().first) { + while (!ErasedPatterns && Patterns.back().second.back().first == 1) { // Check that all of fhe patterns in Patterns end with the same predicate. bool AllEndWithSamePredicate = true; for (unsigned i = 0, e = Patterns.size(); i != e; ++i) @@ -3238,14 +3268,13 @@ ++II) { MVT::ValueType OpVT = II->first; std::vector &Patterns = II->second; - typedef std::vector > CodeList; - typedef std::vector >::iterator CodeListI; + typedef std::vector > CodeList; + typedef std::vector >::iterator CodeListI; std::vector > CodeForPatterns; std::vector > PatternOpcodes; std::vector > PatternVTs; std::vector > > PatternDecls; - std::set > AllGenDecls; for (unsigned i = 0, e = Patterns.size(); i != e; ++i) { CodeList GeneratedCode; std::set > GeneratedDecl; @@ -3253,9 +3282,6 @@ std::vector TargetVTs; GenerateCodeForPattern(*Patterns[i], GeneratedCode, GeneratedDecl, TargetOpcodes, TargetVTs); - for (std::set >::iterator - si = GeneratedDecl.begin(), se = GeneratedDecl.end(); si!=se; ++si) - AllGenDecls.insert(*si); CodeForPatterns.push_back(std::make_pair(Patterns[i], GeneratedCode)); PatternDecls.push_back(GeneratedDecl); PatternOpcodes.push_back(TargetOpcodes); @@ -3270,7 +3296,7 @@ mightNotMatch = false; for (unsigned j = 0, e = GeneratedCode.size(); j != e; ++j) { - if (GeneratedCode[j].first) { // predicate. + if (GeneratedCode[j].first == 1) { // predicate. mightNotMatch = true; break; } @@ -3280,7 +3306,7 @@ // patterns after it CANNOT ever match. Error out. if (mightNotMatch == false && i != CodeForPatterns.size()-1) { std::cerr << "Pattern '"; - CodeForPatterns[i+1].first->getSrcPattern()->print(std::cerr); + CodeForPatterns[i].first->getSrcPattern()->print(std::cerr); std::cerr << "' is impossible to select!\n"; exit(1); } @@ -3294,16 +3320,16 @@ std::vector &TargetOpcodes = PatternOpcodes[i]; std::vector &TargetVTs = PatternVTs[i]; std::set > Decls = PatternDecls[i]; + std::vector AddedInits; int CodeSize = (int)GeneratedCode.size(); int LastPred = -1; for (int j = CodeSize-1; j >= 0; --j) { - if (GeneratedCode[j].first) { + if (LastPred == -1 && GeneratedCode[j].first == 1) LastPred = j; - break; - } + else if (LastPred != -1 && GeneratedCode[j].first == 2) + AddedInits.push_back(GeneratedCode[j].second); } - std::string CalleeDecls; std::string CalleeCode = "(SDOperand &Result, const SDOperand &N"; std::string CallerCode = "(Result, N"; for (unsigned j = 0, e = TargetOpcodes.size(); j != e; ++j) { @@ -3317,35 +3343,25 @@ for (std::set >::iterator I = Decls.begin(), E = Decls.end(); I != E; ++I) { std::string Name = I->second; - if (I->first == 0) { - if (Name == "InFlag" || - (Name.size() > 3 && - Name[0] == 'T' && Name[1] == 'm' && Name[2] == 'p')) { - CalleeDecls += " SDOperand " + Name + "(0, 0);\n"; - continue; - } - CalleeCode += ", SDOperand &" + Name; - CallerCode += ", " + Name; - } else if (I->first == 1) { - if (Name == "ResNode") { - CalleeDecls += " SDNode *" + Name + " = NULL;\n"; - continue; - } - CalleeCode += ", SDNode *" + Name; - CallerCode += ", " + Name; - } else { - CalleeCode += ", bool " + Name; - CallerCode += ", " + Name; - } + CalleeCode += ", SDOperand &" + Name; + CallerCode += ", " + Name; } CallerCode += ");"; CalleeCode += ") "; // Prevent emission routines from being inlined to reduce selection // routines stack frame sizes. CalleeCode += "NOINLINE "; - CalleeCode += "{\n" + CalleeDecls; - for (int j = LastPred+1; j < CodeSize; ++j) - CalleeCode += " " + GeneratedCode[j].second + '\n'; + CalleeCode += "{\n"; + + for (std::vector::const_reverse_iterator + I = AddedInits.rbegin(), E = AddedInits.rend(); I != E; ++I) + CalleeCode += " " + *I + "\n"; + + for (int j = LastPred+1; j < CodeSize; ++j) { + std::string code = GeneratedCode[j].second; + // if (!AddedDecls.count(code)) + CalleeCode += " " + code + "\n"; + } for (int j = LastPred+1; j < CodeSize; ++j) GeneratedCode.pop_back(); CalleeCode += "}\n"; @@ -3383,16 +3399,6 @@ OS << "SDNode *Select_" << OpName << (OpVTStr != "" ? "_" : "") << OpVTStr << "(SDOperand &Result, const SDOperand &N) {\n"; - // Print all declarations. - for (std::set >::iterator - I = AllGenDecls.begin(), E = AllGenDecls.end(); I != E; ++I) - if (I->first == 0) - OS << " SDOperand " << I->second << "(0, 0);\n"; - else if (I->first == 1) - OS << " SDNode *" << I->second << " = NULL;\n"; - else - OS << " bool " << I->second << " = false;\n"; - // Loop through and reverse all of the CodeList vectors, as we will be // accessing them from their logical front, but accessing the end of a // vector is more efficient. @@ -3432,10 +3438,10 @@ // Emit boilerplate. OS << "SDNode *Select_INLINEASM(SDOperand& Result, SDOperand N) {\n" << " std::vector Ops(N.Val->op_begin(), N.Val->op_end());\n" - << " AddToQueue(Ops[0], N.getOperand(0)); // Select the chain.\n\n" + << " AddToISelQueue(N.getOperand(0)); // Select the chain.\n\n" << " // Select the flag operand.\n" << " if (Ops.back().getValueType() == MVT::Flag)\n" - << " AddToQueue(Ops.back(), Ops.back());\n" + << " AddToISelQueue(Ops.back());\n" << " SelectInlineAsmMemoryOperands(Ops, *CurDAG);\n" << " std::vector VTs;\n" << " VTs.push_back(MVT::Other);\n" @@ -3470,17 +3476,15 @@ << " }\n" << " case ISD::AssertSext:\n" << " case ISD::AssertZext: {\n" - << " AddToQueue(Result, N.getOperand(0));\n" - << " ReplaceUses(N, Result);\n" + << " AddToISelQueue(N.getOperand(0));\n" + << " ReplaceUses(N, N.getOperand(0));\n" << " return NULL;\n" << " }\n" << " case ISD::TokenFactor:\n" << " case ISD::CopyFromReg:\n" << " case ISD::CopyToReg: {\n" - << " for (unsigned i = 0, e = N.getNumOperands(); i != e; ++i) {\n" - << " SDOperand Dummy;\n" - << " AddToQueue(Dummy, N.getOperand(i));\n" - << " }\n" + << " for (unsigned i = 0, e = N.getNumOperands(); i != e; ++i)\n" + << " AddToISelQueue(N.getOperand(i));\n" << " Result = N;\n" << " return NULL;\n" << " }\n" @@ -3601,8 +3605,7 @@ OS << " return ISelSelected[Id / 8] & (1 << (Id % 8));\n"; OS << "}\n\n"; - OS << "void AddToQueue(SDOperand &Result, SDOperand N) NOINLINE {\n"; - OS << " Result = N;\n"; + OS << "void AddToISelQueue(SDOperand N) NOINLINE {\n"; OS << " int Id = N.Val->getNodeId();\n"; OS << " if (Id != -1 && !isQueued(Id)) {\n"; OS << " ISelQueue.push_back(N.Val);\n"; Index: llvm/utils/TableGen/DAGISelEmitter.h diff -u llvm/utils/TableGen/DAGISelEmitter.h:1.67 llvm/utils/TableGen/DAGISelEmitter.h:1.68 --- llvm/utils/TableGen/DAGISelEmitter.h:1.67 Mon Aug 7 17:17:58 2006 +++ llvm/utils/TableGen/DAGISelEmitter.h Fri Aug 25 19:59:04 2006 @@ -520,12 +520,12 @@ std::vector &InstImpInputs, std::vector &InstImpResults); void GenerateCodeForPattern(PatternToMatch &Pattern, - std::vector > &GeneratedCode, + std::vector > &GeneratedCode, std::set > &GeneratedDecl, std::vector &TargetOpcodes, std::vector &TargetVTs); void EmitPatterns(std::vector > > > &Patterns, + std::vector > > > &Patterns, unsigned Indent, std::ostream &OS); void EmitInstructionSelector(std::ostream &OS); }; From evan.cheng at apple.com Fri Aug 25 20:02:33 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 25 Aug 2006 20:02:33 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp DAGISelEmitter.h Message-ID: <200608260102.k7Q12Xjr005745@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.246 -> 1.247 DAGISelEmitter.h updated: 1.68 -> 1.69 --- Log message: A bit more clean up. --- Diffs of the changes: (+14 -17) DAGISelEmitter.cpp | 29 +++++++++++++---------------- DAGISelEmitter.h | 2 +- 2 files changed, 14 insertions(+), 17 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.246 llvm/utils/TableGen/DAGISelEmitter.cpp:1.247 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.246 Fri Aug 25 19:59:04 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Fri Aug 25 20:02:19 2006 @@ -2126,7 +2126,7 @@ std::vector > &GeneratedCode; /// GeneratedDecl - This is the set of all SDOperand declarations needed for /// the set of patterns for each top-level opcode. - std::set > &GeneratedDecl; + std::set &GeneratedDecl; /// TargetOpcodes - The target specific opcodes used by the resulting /// instructions. std::vector &TargetOpcodes; @@ -2149,9 +2149,9 @@ if (!S.empty()) GeneratedCode.push_back(std::make_pair(2, S)); } - void emitDecl(const std::string &S, unsigned T=0) { + void emitDecl(const std::string &S) { assert(!S.empty() && "Invalid declaration"); - GeneratedDecl.insert(std::make_pair(T, S)); + GeneratedDecl.insert(S); } void emitOpcode(const std::string &Opc) { TargetOpcodes.push_back(Opc); @@ -2165,7 +2165,7 @@ PatternCodeEmitter(DAGISelEmitter &ise, ListInit *preds, TreePatternNode *pattern, TreePatternNode *instr, std::vector > &gc, - std::set > &gd, + std::set &gd, std::vector &to, std::vector &tv) : ISE(ise), Predicates(preds), Pattern(pattern), Instruction(instr), @@ -2986,9 +2986,9 @@ /// succeeds. Returns true if the pattern is not guaranteed to match. void DAGISelEmitter::GenerateCodeForPattern(PatternToMatch &Pattern, std::vector > &GeneratedCode, - std::set > &GeneratedDecl, + std::set &GeneratedDecl, std::vector &TargetOpcodes, - std::vector &TargetVTs) { + std::vector &TargetVTs) { PatternCodeEmitter Emitter(*this, Pattern.getPredicates(), Pattern.getSrcPattern(), Pattern.getDstPattern(), GeneratedCode, GeneratedDecl, @@ -3274,10 +3274,10 @@ std::vector > CodeForPatterns; std::vector > PatternOpcodes; std::vector > PatternVTs; - std::vector > > PatternDecls; + std::vector > PatternDecls; for (unsigned i = 0, e = Patterns.size(); i != e; ++i) { CodeList GeneratedCode; - std::set > GeneratedDecl; + std::set GeneratedDecl; std::vector TargetOpcodes; std::vector TargetVTs; GenerateCodeForPattern(*Patterns[i], GeneratedCode, GeneratedDecl, @@ -3319,7 +3319,7 @@ CodeList &GeneratedCode = CodeForPatterns[i].second; std::vector &TargetOpcodes = PatternOpcodes[i]; std::vector &TargetVTs = PatternVTs[i]; - std::set > Decls = PatternDecls[i]; + std::set Decls = PatternDecls[i]; std::vector AddedInits; int CodeSize = (int)GeneratedCode.size(); int LastPred = -1; @@ -3340,9 +3340,9 @@ CalleeCode += ", MVT::ValueType VT" + utostr(j); CallerCode += ", " + TargetVTs[j]; } - for (std::set >::iterator + for (std::set::iterator I = Decls.begin(), E = Decls.end(); I != E; ++I) { - std::string Name = I->second; + std::string Name = *I; CalleeCode += ", SDOperand &" + Name; CallerCode += ", " + Name; } @@ -3357,11 +3357,8 @@ I = AddedInits.rbegin(), E = AddedInits.rend(); I != E; ++I) CalleeCode += " " + *I + "\n"; - for (int j = LastPred+1; j < CodeSize; ++j) { - std::string code = GeneratedCode[j].second; - // if (!AddedDecls.count(code)) - CalleeCode += " " + code + "\n"; - } + for (int j = LastPred+1; j < CodeSize; ++j) + CalleeCode += " " + GeneratedCode[j].second + "\n"; for (int j = LastPred+1; j < CodeSize; ++j) GeneratedCode.pop_back(); CalleeCode += "}\n"; Index: llvm/utils/TableGen/DAGISelEmitter.h diff -u llvm/utils/TableGen/DAGISelEmitter.h:1.68 llvm/utils/TableGen/DAGISelEmitter.h:1.69 --- llvm/utils/TableGen/DAGISelEmitter.h:1.68 Fri Aug 25 19:59:04 2006 +++ llvm/utils/TableGen/DAGISelEmitter.h Fri Aug 25 20:02:19 2006 @@ -521,7 +521,7 @@ std::vector &InstImpResults); void GenerateCodeForPattern(PatternToMatch &Pattern, std::vector > &GeneratedCode, - std::set > &GeneratedDecl, + std::set &GeneratedDecl, std::vector &TargetOpcodes, std::vector &TargetVTs); void EmitPatterns(std::vector Changes in directory llvm/lib/Target/X86: X86ISelDAGToDAG.cpp updated: 1.93 -> 1.94 --- Log message: Match tblgen changes; clean up. --- Diffs of the changes: (+34 -79) X86ISelDAGToDAG.cpp | 113 +++++++++++++++------------------------------------- 1 files changed, 34 insertions(+), 79 deletions(-) Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.93 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.94 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.93 Wed Aug 16 18:59:00 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Fri Aug 25 20:05:16 2006 @@ -134,13 +134,6 @@ SDOperand &Base, SDOperand &Scale, SDOperand &Index, SDOperand &Disp); - virtual void SelectRootInit() { - DAGSize = CurDAG->AssignTopologicalOrder(TopOrder); - unsigned NumBytes = (DAGSize + 7) / 8; - UnfoldableSet = new unsigned char[NumBytes]; - memset(UnfoldableSet, 0, NumBytes); - } - /// SelectInlineAsmMemoryOperand - Implement addressing mode selection for /// inline asm expressions. virtual bool SelectInlineAsmMemoryOperand(const SDOperand &Op, @@ -185,21 +178,6 @@ /// base register. Return the virtual register that holds this value. SDOperand getGlobalBaseReg(); - /// UnfoldableSet - An boolean array representing nodes which have been - /// folded into addressing modes and therefore should not be folded in - /// another operation. - unsigned char *UnfoldableSet; - - inline void setUnfoldable(SDNode *N) { - unsigned Id = N->getNodeId(); - UnfoldableSet[Id / 8] |= 1 << (Id % 8); - } - - inline bool isUnfoldable(SDNode *N) { - unsigned Id = N->getNodeId(); - return UnfoldableSet[Id / 8] & (1 << (Id % 8)); - } - #ifndef NDEBUG unsigned Indent; #endif @@ -239,10 +217,6 @@ bool X86DAGToDAGISel::CanBeFoldedBy(SDNode *N, SDNode *U) { - // Is it already folded by SelectAddr / SelectLEAAddr? - if (isUnfoldable(N)) - return false; - // If U use can somehow reach N through another path then U can't fold N or // it will create a cycle. e.g. In the following diagram, U can reach N // through X. If N is folded into into U, then X is both a predecessor and @@ -274,7 +248,6 @@ DEBUG(std::cerr << "===== Instruction selection ends:\n"); #endif - UnfoldableSet = NULL; DAG.RemoveDeadNodes(); // Emit machine code to BB. @@ -539,14 +512,6 @@ AM.IndexReg = CurDAG->getRegister(0, MVT::i32); getAddressOperands(AM, Base, Scale, Index, Disp); - - int Id = Base.Val ? Base.Val->getNodeId() : -1; - if (Id != -1) - setUnfoldable(Base.Val); - Id = Index.Val ? Index.Val->getNodeId() : -1; - if (Id != -1) - setUnfoldable(Index.Val); - return true; } @@ -594,14 +559,6 @@ getAddressOperands(AM, Base, Scale, Index, Disp); return true; } - - int Id = Base.Val ? Base.Val->getNodeId() : -1; - if (Id != -1) - setUnfoldable(Base.Val); - Id = Index.Val ? Index.Val->getNodeId() : -1; - if (Id != -1) - setUnfoldable(Index.Val); - return false; } @@ -702,15 +659,8 @@ CP->getOffset()+Offset); } - if (C.Val) { - if (N.Val->hasOneUse()) { - return CurDAG->SelectNodeTo(N.Val, X86::MOV32ri, MVT::i32, C).Val; - } else { - SDNode *ResNode = CurDAG->getTargetNode(X86::MOV32ri, MVT::i32, C); - Result = SDOperand(ResNode, 0); - return ResNode; - } - } + if (C.Val) + return CurDAG->SelectNodeTo(N.Val, X86::MOV32ri, MVT::i32, C).Val; } // Other cases are handled by auto-generated code. @@ -758,29 +708,30 @@ } SDOperand Chain; - if (foldedLoad) - AddToQueue(Chain, N1.getOperand(0)); - else + if (foldedLoad) { + Chain = N1.getOperand(0); + AddToISelQueue(Chain); + } else Chain = CurDAG->getEntryNode(); SDOperand InFlag(0, 0); - AddToQueue(N0, N0); + AddToISelQueue(N0); Chain = CurDAG->getCopyToReg(Chain, CurDAG->getRegister(LoReg, NVT), N0, InFlag); InFlag = Chain.getValue(1); if (foldedLoad) { - AddToQueue(Tmp0, Tmp0); - AddToQueue(Tmp1, Tmp1); - AddToQueue(Tmp2, Tmp2); - AddToQueue(Tmp3, Tmp3); + AddToISelQueue(Tmp0); + AddToISelQueue(Tmp1); + AddToISelQueue(Tmp2); + AddToISelQueue(Tmp3); SDNode *CNode = CurDAG->getTargetNode(MOpc, MVT::Other, MVT::Flag, Tmp0, Tmp1, Tmp2, Tmp3, Chain, InFlag); Chain = SDOperand(CNode, 0); InFlag = SDOperand(CNode, 1); } else { - AddToQueue(N1, N1); + AddToISelQueue(N1); InFlag = SDOperand(CurDAG->getTargetNode(Opc, MVT::Flag, N1, InFlag), 0); } @@ -849,13 +800,14 @@ SDOperand Tmp0, Tmp1, Tmp2, Tmp3; foldedLoad = TryFoldLoad(N, N1, Tmp0, Tmp1, Tmp2, Tmp3); SDOperand Chain; - if (foldedLoad) - AddToQueue(Chain, N1.getOperand(0)); - else + if (foldedLoad) { + Chain = N1.getOperand(0); + AddToISelQueue(Chain); + } else Chain = CurDAG->getEntryNode(); SDOperand InFlag(0, 0); - AddToQueue(N0, N0); + AddToISelQueue(N0); Chain = CurDAG->getCopyToReg(Chain, CurDAG->getRegister(LoReg, NVT), N0, InFlag); InFlag = Chain.getValue(1); @@ -873,17 +825,17 @@ } if (foldedLoad) { - AddToQueue(Tmp0, Tmp0); - AddToQueue(Tmp1, Tmp1); - AddToQueue(Tmp2, Tmp2); - AddToQueue(Tmp3, Tmp3); + AddToISelQueue(Tmp0); + AddToISelQueue(Tmp1); + AddToISelQueue(Tmp2); + AddToISelQueue(Tmp3); SDNode *CNode = CurDAG->getTargetNode(MOpc, MVT::Other, MVT::Flag, Tmp0, Tmp1, Tmp2, Tmp3, Chain, InFlag); Chain = SDOperand(CNode, 0); InFlag = SDOperand(CNode, 1); } else { - AddToQueue(N1, N1); + AddToISelQueue(N1); InFlag = SDOperand(CurDAG->getTargetNode(Opc, MVT::Flag, N1, InFlag), 0); } @@ -923,10 +875,10 @@ break; } - SDOperand Tmp0, Tmp1; - AddToQueue(Tmp0, Node->getOperand(0)); - Tmp1 = SDOperand(CurDAG->getTargetNode(Opc, VT, Tmp0), 0); - Result = SDOperand(CurDAG->getTargetNode(Opc2, NVT, Tmp1), 0); + AddToISelQueue(Node->getOperand(0)); + SDOperand Tmp = + SDOperand(CurDAG->getTargetNode(Opc, VT, Node->getOperand(0)), 0); + Result = SDOperand(CurDAG->getTargetNode(Opc2, NVT, Tmp), 0); #ifndef NDEBUG DEBUG(std::cerr << std::string(Indent-2, ' ')); @@ -969,11 +921,14 @@ break; } - OutOps.resize(4); - AddToQueue(OutOps[0], Op0); - AddToQueue(OutOps[1], Op1); - AddToQueue(OutOps[2], Op2); - AddToQueue(OutOps[3], Op3); + OutOps.push_back(Op0); + OutOps.push_back(Op1); + OutOps.push_back(Op2); + OutOps.push_back(Op3); + AddToISelQueue(Op0); + AddToISelQueue(Op1); + AddToISelQueue(Op2); + AddToISelQueue(Op3); return false; } From evan.cheng at apple.com Fri Aug 25 20:06:55 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 25 Aug 2006 20:06:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Message-ID: <200608260106.k7Q16tUQ005845@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaISelDAGToDAG.cpp updated: 1.51 -> 1.52 --- Log message: Match tblgen changes. --- Diffs of the changes: (+29 -23) AlphaISelDAGToDAG.cpp | 52 +++++++++++++++++++++++++++----------------------- 1 files changed, 29 insertions(+), 23 deletions(-) Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.51 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.52 --- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.51 Wed Aug 16 02:25:54 2006 +++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Fri Aug 25 20:06:41 2006 @@ -130,7 +130,8 @@ switch (ConstraintCode) { default: return true; case 'm': // memory - AddToQueue(Op0, Op); + Op0 = Op; + AddToISelQueue(Op0); break; } @@ -212,10 +213,12 @@ case AlphaISD::DivCall: { SDOperand Chain = CurDAG->getEntryNode(); - SDOperand N0, N1, N2; - AddToQueue(N0, Op.getOperand(0)); - AddToQueue(N1, Op.getOperand(1)); - AddToQueue(N2, Op.getOperand(2)); + SDOperand N0 = Op.getOperand(0); + SDOperand N1 = Op.getOperand(1); + SDOperand N2 = Op.getOperand(2); + AddToISelQueue(N0); + AddToISelQueue(N1); + AddToISelQueue(N2); Chain = CurDAG->getCopyToReg(Chain, Alpha::R24, N1, SDOperand(0,0)); Chain = CurDAG->getCopyToReg(Chain, Alpha::R25, N2, @@ -231,8 +234,8 @@ } case ISD::READCYCLECOUNTER: { - SDOperand Chain; - AddToQueue(Chain, N->getOperand(0)); //Select chain + SDOperand Chain = N->getOperand(0); + AddToISelQueue(Chain); //Select chain Result = SDOperand(CurDAG->getTargetNode(Alpha::RPCC, MVT::i64, MVT::Other, Chain), Op.ResNo); return Result.Val; @@ -300,9 +303,10 @@ case ISD::SETGE: case ISD::SETOGE: case ISD::SETUGE: Opc = Alpha::CMPTLE; rev = true; break; case ISD::SETNE: case ISD::SETONE: case ISD::SETUNE: Opc = Alpha::CMPTEQ; isNE = true; break; }; - SDOperand tmp1, tmp2; - AddToQueue(tmp1, N->getOperand(0)); - AddToQueue(tmp2, N->getOperand(1)); + SDOperand tmp1 = N->getOperand(0); + SDOperand tmp2 = N->getOperand(1); + AddToISelQueue(tmp1); + AddToISelQueue(tmp2); SDNode *cmp = CurDAG->getTargetNode(Opc, MVT::f64, rev?tmp2:tmp1, rev?tmp1:tmp2); @@ -341,10 +345,13 @@ // so that things like this can be caught in fall though code //move int to fp bool isDouble = N->getValueType(0) == MVT::f64; - SDOperand LD, cond, TV, FV; - AddToQueue(cond, N->getOperand(0)); - AddToQueue(TV, N->getOperand(1)); - AddToQueue(FV, N->getOperand(2)); + SDOperand LD; + SDOperand cond = N->getOperand(0); + SDOperand TV = N->getOperand(1); + SDOperand FV = N->getOperand(2); + AddToISelQueue(cond); + AddToISelQueue(TV); + AddToISelQueue(FV); if (AlphaLowering.hasITOF()) { LD = CurDAG->getNode(AlphaISD::ITOFT_, MVT::f64, cond); @@ -385,10 +392,10 @@ mask = mask | dontcare; if (get_zapImm(mask)) { - SDOperand Src; - AddToQueue(Src, N->getOperand(0).getOperand(0)); + AddToISelQueue(N->getOperand(0).getOperand(0)); SDOperand Z = - SDOperand(CurDAG->getTargetNode(Alpha::ZAPNOTi, MVT::i64, Src, + SDOperand(CurDAG->getTargetNode(Alpha::ZAPNOTi, MVT::i64, + N->getOperand(0).getOperand(0), getI64Imm(get_zapImm(mask))), 0); Result = SDOperand(CurDAG->getTargetNode(Alpha::SRL, MVT::i64, Z, getI64Imm(sval)), 0); @@ -407,20 +414,19 @@ //TODO: add flag stuff to prevent nondeturministic breakage! SDNode *N = Op.Val; - SDOperand Chain; + SDOperand Chain = N->getOperand(0); SDOperand Addr = N->getOperand(1); SDOperand InFlag(0,0); // Null incoming flag value. - AddToQueue(Chain, N->getOperand(0)); + AddToISelQueue(Chain); std::vector CallOperands; std::vector TypeOperands; //grab the arguments for(int i = 2, e = N->getNumOperands(); i < e; ++i) { - SDOperand Tmp; TypeOperands.push_back(N->getOperand(i).getValueType()); - AddToQueue(Tmp, N->getOperand(i)); - CallOperands.push_back(Tmp); + AddToISelQueue(N->getOperand(i)); + CallOperands.push_back(N->getOperand(i)); } int count = N->getNumOperands() - 2; @@ -464,7 +470,7 @@ Chain = SDOperand(CurDAG->getTargetNode(Alpha::BSR, MVT::Other, MVT::Flag, Addr.getOperand(0), Chain, InFlag), 0); } else { - AddToQueue(Addr, Addr); + AddToISelQueue(Addr); Chain = CurDAG->getCopyToReg(Chain, Alpha::R27, Addr, InFlag); InFlag = Chain.getValue(1); Chain = SDOperand(CurDAG->getTargetNode(Alpha::JSR, MVT::Other, MVT::Flag, From evan.cheng at apple.com Fri Aug 25 20:07:30 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 25 Aug 2006 20:07:30 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp Message-ID: <200608260107.k7Q17Uuq005867@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64ISelDAGToDAG.cpp updated: 1.49 -> 1.50 --- Log message: Match tblgen changes. --- Diffs of the changes: (+38 -30) IA64ISelDAGToDAG.cpp | 68 ++++++++++++++++++++++++++++----------------------- 1 files changed, 38 insertions(+), 30 deletions(-) Index: llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp diff -u llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.49 llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.50 --- llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.49 Wed Aug 16 02:29:13 2006 +++ llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp Fri Aug 25 20:07:16 2006 @@ -113,11 +113,13 @@ SDOperand IA64DAGToDAGISel::SelectDIV(SDOperand Op) { SDNode *N = Op.Val; - SDOperand Chain, Tmp1, Tmp2; - AddToQueue(Chain, N->getOperand(0)); + SDOperand Chain = N->getOperand(0); + SDOperand Tmp1 = N->getOperand(0); + SDOperand Tmp2 = N->getOperand(1); + AddToISelQueue(Chain); - AddToQueue(Tmp1, N->getOperand(0)); - AddToQueue(Tmp2, N->getOperand(1)); + AddToISelQueue(Tmp1); + AddToISelQueue(Tmp2); bool isFP=false; @@ -308,12 +310,14 @@ default: break; case IA64ISD::BRCALL: { // XXX: this is also a hack! - SDOperand Chain; + SDOperand Chain = N->getOperand(0); SDOperand InFlag; // Null incoming flag value. - AddToQueue(Chain, N->getOperand(0)); - if(N->getNumOperands()==3) // we have an incoming chain, callee and flag - AddToQueue(InFlag, N->getOperand(2)); + AddToISelQueue(Chain); + if(N->getNumOperands()==3) { // we have an incoming chain, callee and flag + InFlag = N->getOperand(2); + AddToISelQueue(InFlag); + } unsigned CallOpcode; SDOperand CallOperand; @@ -334,8 +338,8 @@ // otherwise we need to load the function descriptor, // load the branch target (function)'s entry point and GP, // branch (call) then restore the GP - SDOperand FnDescriptor; - AddToQueue(FnDescriptor, N->getOperand(1)); + SDOperand FnDescriptor = N->getOperand(1); + AddToISelQueue(FnDescriptor); // load the branch target's entry point [mem] and // GP value [mem+8] @@ -380,8 +384,8 @@ } case IA64ISD::GETFD: { - SDOperand Input; - AddToQueue(Input, N->getOperand(0)); + SDOperand Input = N->getOperand(0); + AddToISelQueue(Input); Result = SDOperand(CurDAG->getTargetNode(IA64::GETFD, MVT::i64, Input), 0); return Result.Val; } @@ -447,9 +451,10 @@ case ISD::LOAD: case ISD::EXTLOAD: // FIXME: load -1, not 1, for bools? case ISD::ZEXTLOAD: { - SDOperand Chain, Address; - AddToQueue(Chain, N->getOperand(0)); - AddToQueue(Address, N->getOperand(1)); + SDOperand Chain = N->getOperand(0); + SDOperand Address = N->getOperand(1); + AddToISelQueue(Chain); + AddToISelQueue(Address); MVT::ValueType TypeBeingLoaded = (N->getOpcode() == ISD::LOAD) ? N->getValueType(0) : cast(N->getOperand(3))->getVT(); @@ -487,9 +492,10 @@ case ISD::TRUNCSTORE: case ISD::STORE: { - SDOperand Address, Chain; - AddToQueue(Address, N->getOperand(2)); - AddToQueue(Chain, N->getOperand(0)); + SDOperand Address = N->getOperand(2); + SDOperand Chain = N->getOperand(0); + AddToISelQueue(Address); + AddToISelQueue(Chain); unsigned Opc; if (N->getOpcode() == ISD::STORE) { @@ -501,8 +507,8 @@ SDOperand Initial = CurDAG->getCopyFromReg(Chain, IA64::r0, MVT::i64); Chain = Initial.getValue(1); // then load 1 into the same reg iff the predicate to store is 1 - SDOperand Tmp; - AddToQueue(Tmp, N->getOperand(1)); + SDOperand Tmp = N->getOperand(1); + AddToISelQueue(Tmp); Tmp = SDOperand(CurDAG->getTargetNode(IA64::TPCADDS, MVT::i64, Initial, CurDAG->getConstant(1, MVT::i64), Tmp), 0); @@ -521,16 +527,18 @@ } } - SDOperand N1, N2; - AddToQueue(N1, N->getOperand(1)); - AddToQueue(N2, N->getOperand(2)); + SDOperand N1 = N->getOperand(1); + SDOperand N2 = N->getOperand(2); + AddToISelQueue(N1); + AddToISelQueue(N2); return CurDAG->SelectNodeTo(N, Opc, MVT::Other, N2, N1, Chain).Val; } case ISD::BRCOND: { - SDOperand Chain, CC; - AddToQueue(Chain, N->getOperand(0)); - AddToQueue(CC, N->getOperand(1)); + SDOperand Chain = N->getOperand(0); + SDOperand CC = N->getOperand(1); + AddToISelQueue(Chain); + AddToISelQueue(CC); MachineBasicBlock *Dest = cast(N->getOperand(2))->getBasicBlock(); //FIXME - we do NOT need long branches all the time @@ -543,15 +551,15 @@ int64_t Amt = cast(N->getOperand(1))->getValue(); unsigned Opc = N->getOpcode() == ISD::CALLSEQ_START ? IA64::ADJUSTCALLSTACKDOWN : IA64::ADJUSTCALLSTACKUP; - SDOperand N0; - AddToQueue(N0, N->getOperand(0)); + SDOperand N0 = N->getOperand(0); + AddToISelQueue(N0); return CurDAG->SelectNodeTo(N, Opc, MVT::Other, getI64Imm(Amt), N0).Val; } case ISD::BR: // FIXME: we don't need long branches all the time! - SDOperand N0; - AddToQueue(N0, N->getOperand(0)); + SDOperand N0 = N->getOperand(0); + AddToISelQueue(N0); return CurDAG->SelectNodeTo(N, IA64::BRL_NOTCALL, MVT::Other, N->getOperand(1), N0).Val; } From evan.cheng at apple.com Fri Aug 25 20:07:58 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 25 Aug 2006 20:07:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Message-ID: <200608260107.k7Q17wYL005885@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.203 -> 1.204 --- Log message: Match tblgen changes. --- Diffs of the changes: (+68 -53) PPCISelDAGToDAG.cpp | 121 +++++++++++++++++++++++++++++----------------------- 1 files changed, 68 insertions(+), 53 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.203 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.204 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.203 Tue Aug 15 18:48:22 2006 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Fri Aug 25 20:07:44 2006 @@ -124,7 +124,8 @@ break; case 'o': // offsetable if (!SelectAddrImm(Op, Op0, Op1)) { - AddToQueue(Op0, Op); // r+0. + Op0 = Op; + AddToISelQueue(Op0); // r+0. Op1 = getSmallIPtrImm(0); } break; @@ -453,10 +454,10 @@ } Tmp3 = (Op0Opc == ISD::AND && DisjointMask) ? Op0.getOperand(0) : Op0; - AddToQueue(Tmp1, Tmp3); - AddToQueue(Tmp2, Op1); + AddToISelQueue(Tmp3); + AddToISelQueue(Op1); SH &= 31; - return CurDAG->getTargetNode(PPC::RLWIMI, MVT::i32, Tmp1, Tmp2, + return CurDAG->getTargetNode(PPC::RLWIMI, MVT::i32, Tmp3, Op1, getI32Imm(SH), getI32Imm(MB), getI32Imm(ME)); } } @@ -692,7 +693,7 @@ SDOperand PPCDAGToDAGISel::SelectCC(SDOperand LHS, SDOperand RHS, ISD::CondCode CC) { // Always select the LHS. - AddToQueue(LHS, LHS); + AddToISelQueue(LHS); unsigned Opc; if (LHS.getValueType() == MVT::i32) { @@ -731,7 +732,7 @@ assert(LHS.getValueType() == MVT::f64 && "Unknown vt!"); Opc = PPC::FCMPUD; } - AddToQueue(RHS, RHS); + AddToISelQueue(RHS); return SDOperand(CurDAG->getTargetNode(Opc, MVT::i32, LHS, RHS), 0); } @@ -804,8 +805,8 @@ // Check for those cases here. // setcc op, 0 if (Imm == 0) { - SDOperand Op; - AddToQueue(Op, N->getOperand(0)); + SDOperand Op = N->getOperand(0); + AddToISelQueue(Op); switch (CC) { default: break; case ISD::SETEQ: @@ -831,8 +832,8 @@ } } } else if (Imm == ~0U) { // setcc op, -1 - SDOperand Op; - AddToQueue(Op, N->getOperand(0)); + SDOperand Op = N->getOperand(0); + AddToISelQueue(Op); switch (CC) { default: break; case ISD::SETEQ: @@ -928,8 +929,8 @@ } case PPCISD::MFCR: { - SDOperand InFlag; - AddToQueue(InFlag, N->getOperand(1)); + SDOperand InFlag = N->getOperand(1); + AddToISelQueue(InFlag); // Use MFOCRF if supported. if (TLI.getTargetMachine().getSubtarget().isGigaProcessor()) return CurDAG->getTargetNode(PPC::MFOCRF, MVT::i32, @@ -946,8 +947,8 @@ // sra/addze rather than having to handle sdiv ourselves. oh well. unsigned Imm; if (isInt32Immediate(N->getOperand(1), Imm)) { - SDOperand N0; - AddToQueue(N0, N->getOperand(0)); + SDOperand N0 = N->getOperand(0); + AddToISelQueue(N0); if ((signed)Imm > 0 && isPowerOf2_32(Imm)) { SDNode *Op = CurDAG->getTargetNode(PPC::SRAWI, MVT::i32, MVT::Flag, @@ -978,14 +979,16 @@ SDOperand Val; unsigned SH, MB, ME; if (isRotateAndMask(N->getOperand(0).Val, Imm, false, SH, MB, ME)) { - AddToQueue(Val, N->getOperand(0).getOperand(0)); + Val = N->getOperand(0).getOperand(0); + AddToISelQueue(Val); } else if (Imm == 0) { // AND X, 0 -> 0, not "rlwinm 32". - AddToQueue(Result, N->getOperand(1)); + AddToISelQueue(N->getOperand(1)); ReplaceUses(SDOperand(N, 0), N->getOperand(1)); return NULL; } else { - AddToQueue(Val, N->getOperand(0)); + Val = N->getOperand(0); + AddToISelQueue(Val); isRunOfOnes(Imm, MB, ME); SH = 0; } @@ -1001,10 +1004,11 @@ unsigned MB, ME; Imm = ~(Imm^Imm2); if (isRunOfOnes(Imm, MB, ME)) { - SDOperand Tmp1, Tmp2; - AddToQueue(Tmp1, N->getOperand(0).getOperand(0)); - AddToQueue(Tmp2, N->getOperand(0).getOperand(1)); - return CurDAG->getTargetNode(PPC::RLWIMI, MVT::i32, Tmp1, Tmp2, + AddToISelQueue(N->getOperand(0).getOperand(0)); + AddToISelQueue(N->getOperand(0).getOperand(1)); + return CurDAG->getTargetNode(PPC::RLWIMI, MVT::i32, + N->getOperand(0).getOperand(0), + N->getOperand(0).getOperand(1), getI32Imm(0), getI32Imm(MB),getI32Imm(ME)); } } @@ -1023,10 +1027,10 @@ unsigned Imm, SH, MB, ME; if (isOpcWithIntImmediate(N->getOperand(0).Val, ISD::AND, Imm) && isRotateAndMask(N, Imm, true, SH, MB, ME)) { - SDOperand Val; - AddToQueue(Val, N->getOperand(0).getOperand(0)); + AddToISelQueue(N->getOperand(0).getOperand(0)); return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, - Val, getI32Imm(SH), getI32Imm(MB), + N->getOperand(0).getOperand(0), + getI32Imm(SH), getI32Imm(MB), getI32Imm(ME)).Val; } @@ -1037,10 +1041,10 @@ unsigned Imm, SH, MB, ME; if (isOpcWithIntImmediate(N->getOperand(0).Val, ISD::AND, Imm) && isRotateAndMask(N, Imm, true, SH, MB, ME)) { - SDOperand Val; - AddToQueue(Val, N->getOperand(0).getOperand(0)); + AddToISelQueue(N->getOperand(0).getOperand(0)); return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, - Val, getI32Imm(SH), getI32Imm(MB), + N->getOperand(0).getOperand(0), + getI32Imm(SH), getI32Imm(MB), getI32Imm(ME)).Val; } @@ -1058,13 +1062,12 @@ N2C->getValue() == 1ULL && CC == ISD::SETNE && // FIXME: Implement this optzn for PPC64. N->getValueType(0) == MVT::i32) { - SDOperand LHS; - AddToQueue(LHS, N->getOperand(0)); + AddToISelQueue(N->getOperand(0)); SDNode *Tmp = CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag, - LHS, getI32Imm(~0U)); + N->getOperand(0), getI32Imm(~0U)); return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, - SDOperand(Tmp, 0), LHS, + SDOperand(Tmp, 0), N->getOperand(0), SDOperand(Tmp, 1)).Val; } @@ -1084,26 +1087,26 @@ else SelectCCOp = PPC::SELECT_CC_VRRC; - SDOperand N2, N3; - AddToQueue(N2, N->getOperand(2)); - AddToQueue(N3, N->getOperand(3)); + AddToISelQueue(N->getOperand(2)); + AddToISelQueue(N->getOperand(3)); return CurDAG->SelectNodeTo(N, SelectCCOp, N->getValueType(0), CCReg, - N2, N3, getI32Imm(BROpc)).Val; + N->getOperand(2), N->getOperand(3), + getI32Imm(BROpc)).Val; } case ISD::BR_CC: { - SDOperand Chain; - AddToQueue(Chain, N->getOperand(0)); + AddToISelQueue(N->getOperand(0)); ISD::CondCode CC = cast(N->getOperand(1))->get(); SDOperand CondCode = SelectCC(N->getOperand(2), N->getOperand(3), CC); return CurDAG->SelectNodeTo(N, PPC::COND_BRANCH, MVT::Other, CondCode, getI32Imm(getBCCForSetCC(CC)), - N->getOperand(4), Chain).Val; + N->getOperand(4), N->getOperand(0)).Val; } case ISD::BRIND: { // FIXME: Should custom lower this. - SDOperand Chain, Target; - AddToQueue(Chain, N->getOperand(0)); - AddToQueue(Target,N->getOperand(1)); + SDOperand Chain = N->getOperand(0); + SDOperand Target = N->getOperand(1); + AddToISelQueue(Chain); + AddToISelQueue(Target); unsigned Opc = Target.getValueType() == MVT::i32 ? PPC::MTCTR : PPC::MTCTR8; Chain = SDOperand(CurDAG->getTargetNode(Opc, MVT::Other, Target, Chain), 0); @@ -1130,15 +1133,18 @@ SmallVector Ops; // Push varargs arguments, including optional flag. for (unsigned i = 1, e = N.getNumOperands()-hasFlag; i != e; ++i) { - AddToQueue(Chain, N.getOperand(i)); + Chain = N.getOperand(i); + AddToISelQueue(Chain); Ops.push_back(Chain); } - AddToQueue(Chain, N.getOperand(0)); + Chain = N.getOperand(0); + AddToISelQueue(Chain); Ops.push_back(Chain); if (hasFlag) { - AddToQueue(Chain, N.getOperand(N.getNumOperands()-1)); + Chain = N.getOperand(N.getNumOperands()-1); + AddToISelQueue(Chain); Ops.push_back(Chain); } @@ -1170,13 +1176,16 @@ // Push varargs arguments, not including optional flag. for (unsigned i = 2, e = N.getNumOperands()-hasFlag; i != e; ++i) { - AddToQueue(Chain, N.getOperand(i)); + Chain = N.getOperand(i); + AddToISelQueue(Chain); Ops.push_back(Chain); } - AddToQueue(Chain, N.getOperand(0)); + Chain = N.getOperand(0); + AddToISelQueue(Chain); Ops.push_back(Chain); if (hasFlag) { - AddToQueue(Chain, N.getOperand(N.getNumOperands()-1)); + Chain = N.getOperand(N.getNumOperands()-1); + AddToISelQueue(Chain); Ops.push_back(Chain); } return CurDAG->getTargetNode(PPC::BLA, MVT::Other, MVT::Flag, @@ -1195,13 +1204,16 @@ // Push varargs arguments, not including optional flag. for (unsigned i = 2, e = N.getNumOperands()-hasFlag; i != e; ++i) { - AddToQueue(Chain, N.getOperand(i)); + Chain = N.getOperand(i); + AddToISelQueue(Chain); Ops.push_back(Chain); } - AddToQueue(Chain, N.getOperand(0)); + Chain = N.getOperand(0); + AddToISelQueue(Chain); Ops.push_back(Chain); if (hasFlag) { - AddToQueue(Chain, N.getOperand(N.getNumOperands()-1)); + Chain = N.getOperand(N.getNumOperands()-1); + AddToISelQueue(Chain); Ops.push_back(Chain); } @@ -1221,13 +1233,16 @@ // Push varargs arguments, not including optional flag. for (unsigned i = 2, e = N.getNumOperands()-hasFlag; i != e; ++i) { - AddToQueue(Chain, N.getOperand(i)); + Chain = N.getOperand(i); + AddToISelQueue(Chain); Ops.push_back(Chain); } - AddToQueue(Chain, N.getOperand(0)); + Chain = N.getOperand(0); + AddToISelQueue(Chain); Ops.push_back(Chain); if (hasFlag) { - AddToQueue(Chain, N.getOperand(N.getNumOperands()-1)); + Chain = N.getOperand(N.getNumOperands()-1); + AddToISelQueue(Chain); Ops.push_back(Chain); } From evan.cheng at apple.com Fri Aug 25 20:08:13 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 25 Aug 2006 20:08:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Message-ID: <200608260108.k7Q18DBV005901@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcISelDAGToDAG.cpp updated: 1.104 -> 1.105 --- Log message: Match tblgen changes. --- Diffs of the changes: (+8 -6) SparcISelDAGToDAG.cpp | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) Index: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp diff -u llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.104 llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.105 --- llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.104 Wed Aug 16 02:29:40 2006 +++ llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Fri Aug 25 20:07:58 2006 @@ -1076,9 +1076,10 @@ case ISD::SDIV: case ISD::UDIV: { // FIXME: should use a custom expander to expose the SRA to the dag. - SDOperand DivLHS, DivRHS; - AddToQueue(DivLHS, N->getOperand(0)); - AddToQueue(DivRHS, N->getOperand(1)); + SDOperand DivLHS = N->getOperand(0); + SDOperand DivRHS = N->getOperand(1); + AddToISelQueue(DivLHS); + AddToISelQueue(DivRHS); // Set the Y register to the high-part. SDOperand TopPart; @@ -1099,9 +1100,10 @@ case ISD::MULHU: case ISD::MULHS: { // FIXME: Handle mul by immediate. - SDOperand MulLHS, MulRHS; - AddToQueue(MulLHS, N->getOperand(0)); - AddToQueue(MulRHS, N->getOperand(1)); + SDOperand MulLHS = N->getOperand(0); + SDOperand MulRHS = N->getOperand(1); + AddToISelQueue(MulLHS); + AddToISelQueue(MulRHS); unsigned Opcode = N->getOpcode() == ISD::MULHU ? SP::UMULrr : SP::SMULrr; SDNode *Mul = CurDAG->getTargetNode(Opcode, MVT::i32, MVT::Flag, MulLHS, MulRHS); From lattner at cs.uiuc.edu Fri Aug 25 20:28:30 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 25 Aug 2006 20:28:30 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp LiveIntervalAnalysis.cpp Message-ID: <200608260128.k7Q1SUCL006245@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveInterval.cpp updated: 1.31 -> 1.32 LiveIntervalAnalysis.cpp updated: 1.168 -> 1.169 --- Log message: Simplifications to liveinterval analysis, no functionality change. --- Diffs of the changes: (+36 -37) LiveInterval.cpp | 26 +++++++++++++++----------- LiveIntervalAnalysis.cpp | 47 +++++++++++++++++++++-------------------------- 2 files changed, 36 insertions(+), 37 deletions(-) Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.31 llvm/lib/CodeGen/LiveInterval.cpp:1.32 --- llvm/lib/CodeGen/LiveInterval.cpp:1.31 Fri Aug 25 18:41:24 2006 +++ llvm/lib/CodeGen/LiveInterval.cpp Fri Aug 25 20:28:16 2006 @@ -374,21 +374,25 @@ /// is the result of a copy instruction in the source program, that occurs at /// index 'CopyIdx' that copies from 'Other' to 'this'. void LiveInterval::join(LiveInterval &Other, unsigned CopyIdx) { - const LiveRange *SourceLR = Other.getLiveRangeContaining(CopyIdx-1); - const LiveRange *DestLR = getLiveRangeContaining(CopyIdx); - assert(SourceLR && DestLR && "Not joining due to a copy?"); - unsigned MergedSrcValIdx = SourceLR->ValId; - unsigned MergedDstValIdx = DestLR->ValId; - // Try to do the least amount of work possible. In particular, if there are // more liverange chunks in the other set than there are in the 'this' set, // swap sets to merge the fewest chunks in possible. - if (Other.ranges.size() > ranges.size()) { - std::swap(MergedSrcValIdx, MergedDstValIdx); - std::swap(ranges, Other.ranges); - std::swap(NumValues, Other.NumValues); - std::swap(InstDefiningValue, Other.InstDefiningValue); + // + // Also, if one range is a physreg and one is a vreg, we always merge from the + // vreg into the physreg, which leaves the vreg intervals pristine. + unsigned OtherOffs = 1, ThisOffs = 0; + if ((Other.ranges.size() > ranges.size() && + MRegisterInfo::isVirtualRegister(reg)) || + MRegisterInfo::isPhysicalRegister(Other.reg)) { + swap(Other); + std::swap(ThisOffs, OtherOffs); } + + const LiveRange *SourceLR = Other.getLiveRangeContaining(CopyIdx-OtherOffs); + const LiveRange *DestLR = getLiveRangeContaining(CopyIdx-ThisOffs); + assert(SourceLR && DestLR && "Not joining due to a copy?"); + unsigned MergedSrcValIdx = SourceLR->ValId; + unsigned MergedDstValIdx = DestLR->ValId; // Join the ranges of other into the ranges of this interval. std::map Dst2SrcIdxMap; Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.168 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.169 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.168 Fri Aug 25 18:41:24 2006 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Fri Aug 25 20:28:16 2006 @@ -790,39 +790,34 @@ return false; } + // Okay, we can join these two intervals. If one of the intervals being + // joined is a physreg, this method always canonicalizes DestInt to be it. + // The output "SrcInt" will not have been modified. + DestInt.join(SrcInt, MIDefIdx); + + bool Swapped = SrcReg == DestInt.reg; + if (Swapped) + std::swap(SrcReg, DstReg); + assert(MRegisterInfo::isVirtualRegister(SrcReg) && + "LiveInterval::join didn't work right!"); + // If we're about to merge live ranges into a physical register live range, // we have to update any aliased register's live ranges to indicate that they // have clobbered values for this range. - if (MRegisterInfo::isPhysicalRegister(SrcReg) || - MRegisterInfo::isPhysicalRegister(DstReg)) { - // Figure out which register is the physical reg and which one is the - // virtreg. - LiveInterval *PhysRegLI = &SrcInt, *VirtRegLI = &DestInt; - if (MRegisterInfo::isPhysicalRegister(DstReg)) - std::swap(PhysRegLI, VirtRegLI); - - for (const unsigned *AS = mri_->getAliasSet(PhysRegLI->reg); *AS; ++AS) - getInterval(*AS).MergeInClobberRanges(*VirtRegLI); + if (MRegisterInfo::isPhysicalRegister(DstReg)) { + for (const unsigned *AS = mri_->getAliasSet(DstReg); *AS; ++AS) + getInterval(*AS).MergeInClobberRanges(SrcInt); } - DestInt.join(SrcInt, MIDefIdx); - // FIXME: If SrcInt/DestInt are physregs, we must insert the new liveranges - // into all aliasing registers as clobbers. - DEBUG(std::cerr << "\n\t\tJoined. Result = "; DestInt.print(std::cerr, mri_); std::cerr << "\n"); - - if (!MRegisterInfo::isPhysicalRegister(SrcReg)) { - r2iMap_.erase(SrcReg); - r2rMap_[SrcReg] = DstReg; - } else { - // Otherwise merge the data structures the other way so we don't lose - // the physreg information. - r2rMap_[DstReg] = SrcReg; - DestInt.reg = SrcReg; - SrcInt.swap(DestInt); - r2iMap_.erase(DstReg); - } + + // If the intervals were swapped by Join, swap them back so that the register + // mapping (in the r2i map) is correct. + if (Swapped) SrcInt.swap(DestInt); + r2iMap_.erase(SrcReg); + r2rMap_[SrcReg] = DstReg; + ++numJoins; return true; } From evan.cheng at apple.com Fri Aug 25 20:34:29 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 25 Aug 2006 20:34:29 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200608260134.k7Q1YTEv006345@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.247 -> 1.248 --- Log message: Remove dead code. --- Diffs of the changes: (+0 -2) DAGISelEmitter.cpp | 2 -- 1 files changed, 2 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.247 llvm/utils/TableGen/DAGISelEmitter.cpp:1.248 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.247 Fri Aug 25 20:02:19 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Fri Aug 25 20:34:15 2006 @@ -2658,7 +2658,6 @@ else Code += ", " + OpName; } - //AllOps.clear(); if (HasVarOps) { if (NodeHasInFlag || HasImpInputs) @@ -2813,7 +2812,6 @@ Code += ", MVT::Flag"; for (unsigned i = 0, e = AllOps.size(); i != e; ++i) Code += ", " + AllOps[i]; - //AllOps.clear(); if (NodeHasInFlag || HasImpInputs) Code += ", InFlag"; emitCode(Code + ");"); From llvm at cs.uiuc.edu Fri Aug 25 21:41:58 2006 From: llvm at cs.uiuc.edu (LLVM) Date: Fri, 25 Aug 2006 21:41:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/Assembly/ Message-ID: <200608260241.k7Q2fwO6007444@zion.cs.uiuc.edu> Changes in directory llvm/lib/Assembly: --- Log message: Directory /var/cvs/llvm/llvm/lib/Assembly added to the repository --- Diffs of the changes: (+0 -0) 0 files changed From evan.cheng at apple.com Sat Aug 26 00:30:11 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 00:30:11 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200608260530.k7Q5UBpe009998@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.248 -> 1.249 --- Log message: Select() no longer require Result operand by reference. --- Diffs of the changes: (+18 -44) DAGISelEmitter.cpp | 62 +++++++++++++++-------------------------------------- 1 files changed, 18 insertions(+), 44 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.248 llvm/utils/TableGen/DAGISelEmitter.cpp:1.249 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.248 Fri Aug 25 20:34:15 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Sat Aug 26 00:29:57 2006 @@ -2517,7 +2517,6 @@ emitCode("AddToISelQueue(" + Val + ");"); if (isRoot && N->isLeaf()) { emitCode("ReplaceUses(N, " + Val + ");"); - emitCode("Result = " + Val + ";"); emitCode("return NULL;"); } } @@ -2768,43 +2767,26 @@ // User does not expect the instruction would produce a chain! if ((!InputHasChain && NodeHasChain) && NodeHasOutFlag) { - if (PatResults == 0) { - emitCode("Result = SDOperand(ResNode, N.ResNo+1);"); - } else { - assert(PatResults == 1); - emitCode("Result = (N.ResNo == 0) ? SDOperand(ResNode, 0) :" - " SDOperand(ResNode, 1);"); - } + ; } else if (InputHasChain && !NodeHasChain) { // One of the inner node produces a chain. - if (NodeHasOutFlag) { - emitCode("Result = (N.ResNo < " + utostr(PatResults) + - ") ? SDOperand(ResNode, N.ResNo) : " + - "(N.ResNo > " + utostr(PatResults) + ") ? " + - "SDOperand(ResNode, N.ResNo-1) : " + ChainName + "));"); + if (NodeHasOutFlag) emitCode("ReplaceUses(SDOperand(N.Val, " + utostr(PatResults+1) + "), SDOperand(ResNode, N.ResNo-1));"); - } else { - emitCode("Result = (N.ResNo < " + utostr(PatResults) + - ") ? SDOperand(ResNode, N.ResNo) : " + - ChainName + ";"); - } for (unsigned i = 0; i < PatResults; ++i) emitCode("ReplaceUses(SDOperand(N.Val, " + utostr(i) + "), SDOperand(ResNode, " + utostr(i) + "));"); emitCode("ReplaceUses(SDOperand(N.Val, " + utostr(PatResults) + "), " + ChainName + ");"); RetSelected = false; - } else { - emitCode("Result = SDOperand(ResNode, N.ResNo);"); } if (RetSelected) - emitCode("return Result.Val;"); + emitCode("return ResNode;"); else emitCode("return NULL;"); } else { - std::string Code = "Result = CurDAG->SelectNodeTo(N.Val, Opc" + + std::string Code = "return CurDAG->SelectNodeTo(N.Val, Opc" + utostr(OpcNo); if (N->getTypeNum(0) != MVT::isVoid) Code += ", VT" + utostr(VTNo); @@ -2814,8 +2796,7 @@ Code += ", " + AllOps[i]; if (NodeHasInFlag || HasImpInputs) Code += ", InFlag"; - emitCode(Code + ");"); - emitCode("return Result.Val;"); + emitCode(Code + ").Val;"); emitOpcode(II.Namespace + "::" + II.TheDef->getName()); if (N->getTypeNum(0) != MVT::isVoid) emitVT(getEnumName(N->getTypeNum(0))); @@ -2833,10 +2814,8 @@ emitCode("SDOperand Tmp" + utostr(ResNo) + " = Transform_" + Op->getName() + "(" + Ops.back() + ".Val);"); NodeOps.push_back("Tmp" + utostr(ResNo)); - if (isRoot) { - emitCode("Result = Tmp" + utostr(ResNo) + ";"); - emitCode("return Result.Val;"); - } + if (isRoot) + emitCode("return Tmp" + utostr(ResNo) + ".Val;"); return NodeOps; } else { N->dump(); @@ -3328,8 +3307,8 @@ AddedInits.push_back(GeneratedCode[j].second); } - std::string CalleeCode = "(SDOperand &Result, const SDOperand &N"; - std::string CallerCode = "(Result, N"; + std::string CalleeCode = "(const SDOperand &N"; + std::string CallerCode = "(N"; for (unsigned j = 0, e = TargetOpcodes.size(); j != e; ++j) { CalleeCode += ", unsigned Opc" + utostr(j); CallerCode += ", " + TargetOpcodes[j]; @@ -3392,7 +3371,7 @@ OpVTI->second.push_back(OpVTStr); OS << "SDNode *Select_" << OpName << (OpVTStr != "" ? "_" : "") - << OpVTStr << "(SDOperand &Result, const SDOperand &N) {\n"; + << OpVTStr << "(const SDOperand &N) {\n"; // Loop through and reverse all of the CodeList vectors, as we will be // accessing them from their logical front, but accessing the end of a @@ -3431,7 +3410,7 @@ } // Emit boilerplate. - OS << "SDNode *Select_INLINEASM(SDOperand& Result, SDOperand N) {\n" + OS << "SDNode *Select_INLINEASM(SDOperand N) {\n" << " std::vector Ops(N.Val->op_begin(), N.Val->op_end());\n" << " AddToISelQueue(N.getOperand(0)); // Select the chain.\n\n" << " // Select the flag operand.\n" @@ -3443,16 +3422,14 @@ << " VTs.push_back(MVT::Flag);\n" << " SDOperand New = CurDAG->getNode(ISD::INLINEASM, VTs, &Ops[0], " "Ops.size());\n" - << " Result = New.getValue(N.ResNo);\n" - << " return Result.Val;\n" + << " return New.Val;\n" << "}\n\n"; OS << "// The main instruction selector code.\n" - << "SDNode *SelectCode(SDOperand &Result, SDOperand N) {\n" + << "SDNode *SelectCode(SDOperand N) {\n" << " if (N.getOpcode() >= ISD::BUILTIN_OP_END &&\n" << " N.getOpcode() < (ISD::BUILTIN_OP_END+" << InstNS << "INSTRUCTION_LIST_END)) {\n" - << " Result = N;\n" << " return NULL; // Already selected.\n" << " }\n\n" << " switch (N.getOpcode()) {\n" @@ -3466,7 +3443,6 @@ << " case ISD::TargetFrameIndex:\n" << " case ISD::TargetJumpTable:\n" << " case ISD::TargetGlobalAddress: {\n" - << " Result = N;\n" << " return NULL;\n" << " }\n" << " case ISD::AssertSext:\n" @@ -3480,10 +3456,9 @@ << " case ISD::CopyToReg: {\n" << " for (unsigned i = 0, e = N.getNumOperands(); i != e; ++i)\n" << " AddToISelQueue(N.getOperand(i));\n" - << " Result = N;\n" << " return NULL;\n" << " }\n" - << " case ISD::INLINEASM: return Select_INLINEASM(Result, N);\n"; + << " case ISD::INLINEASM: return Select_INLINEASM(N);\n"; // Loop over all of the case statements, emiting a call to each method we @@ -3503,7 +3478,7 @@ if (OpVTs.size() == 1) { std::string &VTStr = OpVTs[0]; OS << " return Select_" << OpName - << (VTStr != "" ? "_" : "") << VTStr << "(Result, N);\n"; + << (VTStr != "" ? "_" : "") << VTStr << "(N);\n"; } else { if (OpcodeInfo.getNumResults()) OS << " MVT::ValueType NVT = N.Val->getValueType(0);\n"; @@ -3523,11 +3498,11 @@ } OS << " case MVT::" << VTStr << ":\n" << " return Select_" << OpName - << "_" << VTStr << "(Result, N);\n"; + << "_" << VTStr << "(N);\n"; } OS << " default:\n"; if (Default != -1) - OS << " return Select_" << OpName << "(Result, N);\n"; + OS << " return Select_" << OpName << "(N);\n"; else OS << " break;\n"; OS << " }\n"; @@ -3647,12 +3622,11 @@ << " HandleSDNode Dummy(CurDAG->getRoot());\n" << " ISelQueue.push_back(CurDAG->getRoot().Val);\n"; OS << " while (!ISelQueue.empty()) {\n"; - OS << " SDOperand Tmp;\n"; OS << " SDNode *Node = ISelQueue.front();\n"; OS << " std::pop_heap(ISelQueue.begin(), ISelQueue.end(), isel_sort());\n"; OS << " ISelQueue.pop_back();\n"; OS << " if (!isSelected(Node->getNodeId())) {\n"; - OS << " SDNode *ResNode = Select(Tmp, SDOperand(Node, 0));\n"; + OS << " SDNode *ResNode = Select(SDOperand(Node, 0));\n"; OS << " if (ResNode && ResNode != Node) ReplaceUses(Node, ResNode);\n"; OS << " }\n"; OS << " }\n"; From evan.cheng at apple.com Sat Aug 26 00:33:00 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 00:33:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Message-ID: <200608260533.k7Q5X0Je010056@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelDAGToDAG.cpp updated: 1.37 -> 1.38 --- Log message: Select() no longer require Result operand by reference. --- Diffs of the changes: (+3 -3) ARMISelDAGToDAG.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.37 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.38 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.37 Fri Aug 25 12:55:16 2006 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Sat Aug 26 00:32:46 2006 @@ -430,7 +430,7 @@ : SelectionDAGISel(Lowering), Lowering(TM) { } - SDNode *Select(SDOperand &Result, SDOperand Op); + SDNode *Select(SDOperand Op); virtual void InstructionSelectBasicBlock(SelectionDAG &DAG); bool SelectAddrRegImm(SDOperand N, SDOperand &Offset, SDOperand &Base); @@ -496,12 +496,12 @@ return true; //any address fits in a register } -SDNode *ARMDAGToDAGISel::Select(SDOperand &Result, SDOperand Op) { +SDNode *ARMDAGToDAGISel::Select(SDOperand Op) { SDNode *N = Op.Val; switch (N->getOpcode()) { default: - return SelectCode(Result, Op); + return SelectCode(Op); break; } return NULL; From evan.cheng at apple.com Sat Aug 26 00:33:14 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 00:33:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Message-ID: <200608260533.k7Q5XEba010072@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaISelDAGToDAG.cpp updated: 1.52 -> 1.53 --- Log message: Select() no longer require Result operand by reference. --- Diffs of the changes: (+23 -27) AlphaISelDAGToDAG.cpp | 50 +++++++++++++++++++++++--------------------------- 1 files changed, 23 insertions(+), 27 deletions(-) Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.52 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.53 --- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.52 Fri Aug 25 20:06:41 2006 +++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Sat Aug 26 00:33:00 2006 @@ -110,7 +110,7 @@ // Select - Convert the specified operand from a target-independent to a // target-specific node if it hasn't already been changed. - SDNode *Select(SDOperand &Result, SDOperand Op); + SDNode *Select(SDOperand Op); /// InstructionSelectBasicBlock - This callback is invoked by /// SelectionDAGISel when it has created a SelectionDAG for us to codegen. @@ -145,7 +145,7 @@ private: SDOperand getGlobalBaseReg(); SDOperand getGlobalRetAddr(); - SDOperand SelectCALL(SDOperand Op); + void SelectCALL(SDOperand Op); }; } @@ -182,18 +182,17 @@ // Select - Convert the specified operand from a target-independent to a // target-specific node if it hasn't already been changed. -SDNode *AlphaDAGToDAGISel::Select(SDOperand &Result, SDOperand Op) { +SDNode *AlphaDAGToDAGISel::Select(SDOperand Op) { SDNode *N = Op.Val; if (N->getOpcode() >= ISD::BUILTIN_OP_END && N->getOpcode() < AlphaISD::FIRST_NUMBER) { - Result = Op; return NULL; // Already selected. } switch (N->getOpcode()) { default: break; case AlphaISD::CALL: - Result = SelectCALL(Op); + SelectCALL(Op); return NULL; case ISD::FrameIndex: { @@ -202,14 +201,16 @@ CurDAG->getTargetFrameIndex(FI, MVT::i32), getI64Imm(0)).Val; } - case AlphaISD::GlobalBaseReg: - Result = getGlobalBaseReg(); + case AlphaISD::GlobalBaseReg: { + SDOperand Result = getGlobalBaseReg(); ReplaceUses(Op, Result); return NULL; - case AlphaISD::GlobalRetAddr: - Result = getGlobalRetAddr(); + } + case AlphaISD::GlobalRetAddr: { + SDOperand Result = getGlobalRetAddr(); ReplaceUses(Op, Result); return NULL; + } case AlphaISD::DivCall: { SDOperand Chain = CurDAG->getEntryNode(); @@ -236,17 +237,16 @@ case ISD::READCYCLECOUNTER: { SDOperand Chain = N->getOperand(0); AddToISelQueue(Chain); //Select chain - Result = SDOperand(CurDAG->getTargetNode(Alpha::RPCC, MVT::i64, MVT::Other, - Chain), Op.ResNo); - return Result.Val; + return CurDAG->getTargetNode(Alpha::RPCC, MVT::i64, MVT::Other, + Chain); } case ISD::Constant: { uint64_t uval = cast(N)->getValue(); if (uval == 0) { - Result = CurDAG->getCopyFromReg(CurDAG->getEntryNode(), Alpha::R31, - MVT::i64); + SDOperand Result = CurDAG->getCopyFromReg(CurDAG->getEntryNode(), + Alpha::R31, MVT::i64); ReplaceUses(Op, Result); return NULL; } @@ -329,10 +329,9 @@ CurDAG->getRegister(Alpha::R31, MVT::i64), ST), 0); } - Result = SDOperand(CurDAG->getTargetNode(Alpha::CMPULT, MVT::i64, - CurDAG->getRegister(Alpha::R31, MVT::i64), - LD), 0); - return Result.Val; + return CurDAG->getTargetNode(Alpha::CMPULT, MVT::i64, + CurDAG->getRegister(Alpha::R31, MVT::i64), + LD); } break; @@ -366,9 +365,8 @@ CurDAG->getRegister(Alpha::R31, MVT::i64), ST), 0); } - Result = SDOperand(CurDAG->getTargetNode(isDouble?Alpha::FCMOVNET:Alpha::FCMOVNES, - MVT::f64, FV, TV, LD), 0); - return Result.Val; + return CurDAG->getTargetNode(isDouble?Alpha::FCMOVNET:Alpha::FCMOVNES, + MVT::f64, FV, TV, LD); } break; @@ -397,9 +395,8 @@ SDOperand(CurDAG->getTargetNode(Alpha::ZAPNOTi, MVT::i64, N->getOperand(0).getOperand(0), getI64Imm(get_zapImm(mask))), 0); - Result = SDOperand(CurDAG->getTargetNode(Alpha::SRL, MVT::i64, Z, - getI64Imm(sval)), 0); - return Result.Val; + return CurDAG->getTargetNode(Alpha::SRL, MVT::i64, Z, + getI64Imm(sval)); } } break; @@ -407,10 +404,10 @@ } - return SelectCode(Result, Op); + return SelectCode(Op); } -SDOperand AlphaDAGToDAGISel::SelectCALL(SDOperand Op) { +void AlphaDAGToDAGISel::SelectCALL(SDOperand Op) { //TODO: add flag stuff to prevent nondeturministic breakage! SDNode *N = Op.Val; @@ -500,7 +497,6 @@ CallResults.push_back(Chain); for (unsigned i = 0, e = CallResults.size(); i != e; ++i) ReplaceUses(Op.getValue(i), CallResults[i]); - return CallResults[Op.ResNo]; } From evan.cheng at apple.com Sat Aug 26 00:33:29 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 00:33:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp Message-ID: <200608260533.k7Q5XTcZ010088@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64ISelDAGToDAG.cpp updated: 1.50 -> 1.51 --- Log message: Select() no longer require Result operand by reference. --- Diffs of the changes: (+13 -20) IA64ISelDAGToDAG.cpp | 33 +++++++++++++-------------------- 1 files changed, 13 insertions(+), 20 deletions(-) Index: llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp diff -u llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.50 llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.51 --- llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.50 Fri Aug 25 20:07:16 2006 +++ llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp Sat Aug 26 00:33:15 2006 @@ -65,7 +65,7 @@ // Select - Convert the specified operand from a target-independent to a // target-specific node if it hasn't already been changed. - SDNode *Select(SDOperand &Result, SDOperand N); + SDNode *Select(SDOperand N); SDNode *SelectIntImmediateExpr(SDOperand LHS, SDOperand RHS, unsigned OCHi, unsigned OCLo, @@ -94,7 +94,7 @@ #include "IA64GenDAGISel.inc" private: - SDOperand SelectDIV(SDOperand Op); + SDNode *SelectDIV(SDOperand Op); }; } @@ -111,7 +111,7 @@ ScheduleAndEmitDAG(DAG); } -SDOperand IA64DAGToDAGISel::SelectDIV(SDOperand Op) { +SDNode *IA64DAGToDAGISel::SelectDIV(SDOperand Op) { SDNode *N = Op.Val; SDOperand Chain = N->getOperand(0); SDOperand Tmp1 = N->getOperand(0); @@ -245,7 +245,7 @@ Result = CurDAG->getTargetNode(IA64::TCFMADS0, MVT::f64, // d.p. s0 rndg! TmpF5, TmpY3, TmpR0, TmpQ0, TmpPR); Chain = SDOperand(Result, 1); - return SDOperand(Result, 0); // XXX: early exit! + return Result; // XXX: early exit! } else { // this is *not* an FP divide, so there's a bit left to do: SDOperand TmpQ2, TmpR2, TmpQ3, TmpQ; @@ -292,19 +292,17 @@ Chain = SDOperand(Result, 1); } - return SDOperand(Result, 0); + return Result; } // wasn't an FP divide } // Select - Convert the specified operand from a target-independent to a // target-specific node if it hasn't already been changed. -SDNode *IA64DAGToDAGISel::Select(SDOperand &Result, SDOperand Op) { +SDNode *IA64DAGToDAGISel::Select(SDOperand Op) { SDNode *N = Op.Val; if (N->getOpcode() >= ISD::BUILTIN_OP_END && - N->getOpcode() < IA64ISD::FIRST_NUMBER) { - Result = Op; + N->getOpcode() < IA64ISD::FIRST_NUMBER) return NULL; // Already selected. - } switch (N->getOpcode()) { default: break; @@ -379,15 +377,13 @@ for (unsigned i = 0, e = CallResults.size(); i != e; ++i) ReplaceUses(Op.getValue(i), CallResults[i]); - Result = CallResults[Op.ResNo]; return NULL; } case IA64ISD::GETFD: { SDOperand Input = N->getOperand(0); AddToISelQueue(Input); - Result = SDOperand(CurDAG->getTargetNode(IA64::GETFD, MVT::i64, Input), 0); - return Result.Val; + return CurDAG->getTargetNode(IA64::GETFD, MVT::i64, Input); } case ISD::FDIV: @@ -395,8 +391,7 @@ case ISD::UDIV: case ISD::SREM: case ISD::UREM: - Result = SelectDIV(Op); - return Result.Val; + return SelectDIV(Op); case ISD::TargetConstantFP: { SDOperand Chain = CurDAG->getEntryNode(); // this is a constant, so.. @@ -425,9 +420,8 @@ Constant *C = CP->get(); SDOperand CPI = CurDAG->getTargetConstantPool(C, MVT::i64, CP->getAlignment()); - Result = SDOperand(CurDAG->getTargetNode(IA64::ADDL_GA, MVT::i64, // ? - CurDAG->getRegister(IA64::r1, MVT::i64), CPI), 0); - return Result.Val; + return CurDAG->getTargetNode(IA64::ADDL_GA, MVT::i64, // ? + CurDAG->getRegister(IA64::r1, MVT::i64), CPI); } case ISD::GlobalAddress: { @@ -435,8 +429,7 @@ SDOperand GA = CurDAG->getTargetGlobalAddress(GV, MVT::i64); SDOperand Tmp = SDOperand(CurDAG->getTargetNode(IA64::ADDL_GA, MVT::i64, CurDAG->getRegister(IA64::r1, MVT::i64), GA), 0); - Result = SDOperand(CurDAG->getTargetNode(IA64::LD8, MVT::i64, Tmp), 0); - return Result.Val; + return CurDAG->getTargetNode(IA64::LD8, MVT::i64, Tmp); } /* XXX case ISD::ExternalSymbol: { @@ -564,7 +557,7 @@ N->getOperand(1), N0).Val; } - return SelectCode(Result, Op); + return SelectCode(Op); } From evan.cheng at apple.com Sat Aug 26 00:34:22 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 00:34:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Message-ID: <200608260534.k7Q5YMx0010118@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.204 -> 1.205 --- Log message: Select() no longer require Result operand by reference. --- Diffs of the changes: (+8 -10) PPCISelDAGToDAG.cpp | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.204 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.205 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.204 Fri Aug 25 20:07:44 2006 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Sat Aug 26 00:34:08 2006 @@ -79,11 +79,11 @@ /// getGlobalBaseReg - insert code into the entry mbb to materialize the PIC /// base register. Return the virtual register that holds this value. - SDOperand getGlobalBaseReg(); + SDNode *getGlobalBaseReg(); // Select - Convert the specified operand from a target-independent to a // target-specific node if it hasn't already been changed. - SDNode *Select(SDOperand &Result, SDOperand Op); + SDNode *Select(SDOperand Op); SDNode *SelectBitfieldInsert(SDNode *N); @@ -252,7 +252,7 @@ /// getGlobalBaseReg - Output the instructions required to put the /// base address to use for accessing globals into a register. /// -SDOperand PPCDAGToDAGISel::getGlobalBaseReg() { +SDNode *PPCDAGToDAGISel::getGlobalBaseReg() { if (!GlobalBaseReg) { // Insert the set of GlobalBaseReg into the first MBB of the function MachineBasicBlock &FirstMBB = BB->getParent()->front(); @@ -267,7 +267,7 @@ BuildMI(FirstMBB, MBBI, PPC::MovePCtoLR, 0, PPC::LR); BuildMI(FirstMBB, MBBI, PPC::MFLR, 1, GlobalBaseReg); } - return CurDAG->getRegister(GlobalBaseReg, PPCLowering.getPointerTy()); + return CurDAG->getRegister(GlobalBaseReg, PPCLowering.getPointerTy()).Val; } /// isIntS16Immediate - This method tests to see if the node is either a 32-bit @@ -902,20 +902,18 @@ // Select - Convert the specified operand from a target-independent to a // target-specific node if it hasn't already been changed. -SDNode *PPCDAGToDAGISel::Select(SDOperand &Result, SDOperand Op) { +SDNode *PPCDAGToDAGISel::Select(SDOperand Op) { SDNode *N = Op.Val; if (N->getOpcode() >= ISD::BUILTIN_OP_END && - N->getOpcode() < PPCISD::FIRST_NUMBER) { - Result = Op; + N->getOpcode() < PPCISD::FIRST_NUMBER) return NULL; // Already selected. - } switch (N->getOpcode()) { default: break; case ISD::SETCC: return SelectSETCC(Op); case PPCISD::GlobalBaseReg: - return getGlobalBaseReg().Val; + return getGlobalBaseReg(); case ISD::FrameIndex: { int FI = cast(N)->getIndex(); @@ -1118,7 +1116,7 @@ case PPCISD::CALL: return MySelect_PPCcall(Op); } - return SelectCode(Result, Op); + return SelectCode(Op); } From evan.cheng at apple.com Sat Aug 26 00:34:36 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 00:34:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Message-ID: <200608260534.k7Q5Ya9N010134@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcISelDAGToDAG.cpp updated: 1.105 -> 1.106 --- Log message: Select() no longer require Result operand by reference. --- Diffs of the changes: (+4 -6) SparcISelDAGToDAG.cpp | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) Index: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp diff -u llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.105 llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.106 --- llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.105 Fri Aug 25 20:07:58 2006 +++ llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Sat Aug 26 00:34:22 2006 @@ -966,7 +966,7 @@ Subtarget(TM.getSubtarget()) { } - SDNode *Select(SDOperand &Result, SDOperand Op); + SDNode *Select(SDOperand Op); // Complex Pattern Selectors. bool SelectADDRrr(SDOperand N, SDOperand &R1, SDOperand &R2); @@ -1063,13 +1063,11 @@ return true; } -SDNode *SparcDAGToDAGISel::Select(SDOperand &Result, SDOperand Op) { +SDNode *SparcDAGToDAGISel::Select(SDOperand Op) { SDNode *N = Op.Val; if (N->getOpcode() >= ISD::BUILTIN_OP_END && - N->getOpcode() < SPISD::FIRST_NUMBER) { - Result = Op; + N->getOpcode() < SPISD::FIRST_NUMBER) return NULL; // Already selected. - } switch (N->getOpcode()) { default: break; @@ -1113,7 +1111,7 @@ } } - return SelectCode(Result, Op); + return SelectCode(Op); } From evan.cheng at apple.com Sat Aug 26 00:35:00 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 00:35:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Message-ID: <200608260535.k7Q5Z0RV010151@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelDAGToDAG.cpp updated: 1.94 -> 1.95 --- Log message: Select() no longer require Result operand by reference. --- Diffs of the changes: (+17 -16) X86ISelDAGToDAG.cpp | 33 +++++++++++++++++---------------- 1 files changed, 17 insertions(+), 16 deletions(-) Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.94 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.95 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.94 Fri Aug 25 20:05:16 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Sat Aug 26 00:34:46 2006 @@ -123,7 +123,7 @@ #include "X86GenDAGISel.inc" private: - SDNode *Select(SDOperand &Result, SDOperand N); + SDNode *Select(SDOperand N); bool MatchAddress(SDOperand N, X86ISelAddressMode &AM, bool isRoot = true); bool SelectAddr(SDOperand N, SDOperand &Base, SDOperand &Scale, @@ -176,7 +176,7 @@ /// getGlobalBaseReg - insert code into the entry mbb to materialize the PIC /// base register. Return the virtual register that holds this value. - SDOperand getGlobalBaseReg(); + SDNode *getGlobalBaseReg(); #ifndef NDEBUG unsigned Indent; @@ -582,7 +582,7 @@ /// getGlobalBaseReg - Output the instructions required to put the /// base address to use for accessing globals into a register. /// -SDOperand X86DAGToDAGISel::getGlobalBaseReg() { +SDNode *X86DAGToDAGISel::getGlobalBaseReg() { if (!GlobalBaseReg) { // Insert the set of GlobalBaseReg into the first MBB of the function MachineBasicBlock &FirstMBB = BB->getParent()->front(); @@ -594,7 +594,7 @@ BuildMI(FirstMBB, MBBI, X86::MovePCtoStack, 0); BuildMI(FirstMBB, MBBI, X86::POP32r, 1, GlobalBaseReg); } - return CurDAG->getRegister(GlobalBaseReg, MVT::i32); + return CurDAG->getRegister(GlobalBaseReg, MVT::i32).Val; } static SDNode *FindCallStartFromCall(SDNode *Node) { @@ -604,7 +604,7 @@ return FindCallStartFromCall(Node->getOperand(0).Val); } -SDNode *X86DAGToDAGISel::Select(SDOperand &Result, SDOperand N) { +SDNode *X86DAGToDAGISel::Select(SDOperand N) { SDNode *Node = N.Val; MVT::ValueType NVT = Node->getValueType(0); unsigned Opc, MOpc; @@ -619,7 +619,6 @@ #endif if (Opcode >= ISD::BUILTIN_OP_END && Opcode < X86ISD::FIRST_NUMBER) { - Result = N; #ifndef NDEBUG DEBUG(std::cerr << std::string(Indent-2, ' ')); DEBUG(std::cerr << "== "); @@ -633,8 +632,7 @@ switch (Opcode) { default: break; case X86ISD::GlobalBaseReg: - Result = getGlobalBaseReg(); - return Result.Val; + return getGlobalBaseReg(); case ISD::ADD: { // Turn ADD X, c to MOV32ri X+c. This cannot be done with tblgen'd @@ -736,7 +734,7 @@ SDOperand(CurDAG->getTargetNode(Opc, MVT::Flag, N1, InFlag), 0); } - Result = CurDAG->getCopyFromReg(Chain, HiReg, NVT, InFlag); + SDOperand Result = CurDAG->getCopyFromReg(Chain, HiReg, NVT, InFlag); ReplaceUses(N.getValue(0), Result); if (foldedLoad) ReplaceUses(N1.getValue(1), Result.getValue(1)); @@ -840,8 +838,8 @@ SDOperand(CurDAG->getTargetNode(Opc, MVT::Flag, N1, InFlag), 0); } - Result = CurDAG->getCopyFromReg(Chain, isDiv ? LoReg : HiReg, - NVT, InFlag); + SDOperand Result = CurDAG->getCopyFromReg(Chain, isDiv ? LoReg : HiReg, + NVT, InFlag); ReplaceUses(N.getValue(0), Result); if (foldedLoad) ReplaceUses(N1.getValue(1), Result.getValue(1)); @@ -878,28 +876,31 @@ AddToISelQueue(Node->getOperand(0)); SDOperand Tmp = SDOperand(CurDAG->getTargetNode(Opc, VT, Node->getOperand(0)), 0); - Result = SDOperand(CurDAG->getTargetNode(Opc2, NVT, Tmp), 0); + SDNode *ResNode = CurDAG->getTargetNode(Opc2, NVT, Tmp); #ifndef NDEBUG DEBUG(std::cerr << std::string(Indent-2, ' ')); DEBUG(std::cerr << "=> "); - DEBUG(Result.Val->dump(CurDAG)); + DEBUG(ResNode->dump(CurDAG)); DEBUG(std::cerr << "\n"); Indent -= 2; #endif - return Result.Val; + return ResNode; } break; } } - SDNode *ResNode = SelectCode(Result, N); + SDNode *ResNode = SelectCode(N); #ifndef NDEBUG DEBUG(std::cerr << std::string(Indent-2, ' ')); DEBUG(std::cerr << "=> "); - DEBUG(Result.Val->dump(CurDAG)); + if (ResNode == NULL || ResNode == N.Val) + DEBUG(N.Val->dump(CurDAG)); + else + DEBUG(ResNode->dump(CurDAG)); DEBUG(std::cerr << "\n"); Indent -= 2; #endif From rspencer at reidspencer.com Sat Aug 26 01:18:37 2006 From: rspencer at reidspencer.com (Reid Spencer) Date: Fri, 25 Aug 2006 23:18:37 -0700 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp In-Reply-To: <200608260530.k7Q5UBpe009998@zion.cs.uiuc.edu> References: <200608260530.k7Q5UBpe009998@zion.cs.uiuc.edu> Message-ID: <1156573117.10524.506.camel@bashful.x10sys.com> Evan, Something in this patch or the subsequent ones has broken all builds. Can you fix before the nightly testers all die? Reid. On Sat, 2006-08-26 at 00:30 -0500, Evan Cheng wrote: > > Changes in directory llvm/utils/TableGen: > > DAGISelEmitter.cpp updated: 1.248 -> 1.249 > --- > Log message: > > Select() no longer require Result operand by reference. > > --- > Diffs of the changes: (+18 -44) > > DAGISelEmitter.cpp | 62 +++++++++++++++-------------------------------------- > 1 files changed, 18 insertions(+), 44 deletions(-) > > > Index: llvm/utils/TableGen/DAGISelEmitter.cpp > diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.248 llvm/utils/TableGen/DAGISelEmitter.cpp:1.249 > --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.248 Fri Aug 25 20:34:15 2006 > +++ llvm/utils/TableGen/DAGISelEmitter.cpp Sat Aug 26 00:29:57 2006 > @@ -2517,7 +2517,6 @@ > emitCode("AddToISelQueue(" + Val + ");"); > if (isRoot && N->isLeaf()) { > emitCode("ReplaceUses(N, " + Val + ");"); > - emitCode("Result = " + Val + ";"); > emitCode("return NULL;"); > } > } > @@ -2768,43 +2767,26 @@ > > // User does not expect the instruction would produce a chain! > if ((!InputHasChain && NodeHasChain) && NodeHasOutFlag) { > - if (PatResults == 0) { > - emitCode("Result = SDOperand(ResNode, N.ResNo+1);"); > - } else { > - assert(PatResults == 1); > - emitCode("Result = (N.ResNo == 0) ? SDOperand(ResNode, 0) :" > - " SDOperand(ResNode, 1);"); > - } > + ; > } else if (InputHasChain && !NodeHasChain) { > // One of the inner node produces a chain. > - if (NodeHasOutFlag) { > - emitCode("Result = (N.ResNo < " + utostr(PatResults) + > - ") ? SDOperand(ResNode, N.ResNo) : " + > - "(N.ResNo > " + utostr(PatResults) + ") ? " + > - "SDOperand(ResNode, N.ResNo-1) : " + ChainName + "));"); > + if (NodeHasOutFlag) > emitCode("ReplaceUses(SDOperand(N.Val, " + utostr(PatResults+1) + > "), SDOperand(ResNode, N.ResNo-1));"); > - } else { > - emitCode("Result = (N.ResNo < " + utostr(PatResults) + > - ") ? SDOperand(ResNode, N.ResNo) : " + > - ChainName + ";"); > - } > for (unsigned i = 0; i < PatResults; ++i) > emitCode("ReplaceUses(SDOperand(N.Val, " + utostr(i) + > "), SDOperand(ResNode, " + utostr(i) + "));"); > emitCode("ReplaceUses(SDOperand(N.Val, " + utostr(PatResults) + > "), " + ChainName + ");"); > RetSelected = false; > - } else { > - emitCode("Result = SDOperand(ResNode, N.ResNo);"); > } > > if (RetSelected) > - emitCode("return Result.Val;"); > + emitCode("return ResNode;"); > else > emitCode("return NULL;"); > } else { > - std::string Code = "Result = CurDAG->SelectNodeTo(N.Val, Opc" + > + std::string Code = "return CurDAG->SelectNodeTo(N.Val, Opc" + > utostr(OpcNo); > if (N->getTypeNum(0) != MVT::isVoid) > Code += ", VT" + utostr(VTNo); > @@ -2814,8 +2796,7 @@ > Code += ", " + AllOps[i]; > if (NodeHasInFlag || HasImpInputs) > Code += ", InFlag"; > - emitCode(Code + ");"); > - emitCode("return Result.Val;"); > + emitCode(Code + ").Val;"); > emitOpcode(II.Namespace + "::" + II.TheDef->getName()); > if (N->getTypeNum(0) != MVT::isVoid) > emitVT(getEnumName(N->getTypeNum(0))); > @@ -2833,10 +2814,8 @@ > emitCode("SDOperand Tmp" + utostr(ResNo) + " = Transform_" + Op->getName() > + "(" + Ops.back() + ".Val);"); > NodeOps.push_back("Tmp" + utostr(ResNo)); > - if (isRoot) { > - emitCode("Result = Tmp" + utostr(ResNo) + ";"); > - emitCode("return Result.Val;"); > - } > + if (isRoot) > + emitCode("return Tmp" + utostr(ResNo) + ".Val;"); > return NodeOps; > } else { > N->dump(); > @@ -3328,8 +3307,8 @@ > AddedInits.push_back(GeneratedCode[j].second); > } > > - std::string CalleeCode = "(SDOperand &Result, const SDOperand &N"; > - std::string CallerCode = "(Result, N"; > + std::string CalleeCode = "(const SDOperand &N"; > + std::string CallerCode = "(N"; > for (unsigned j = 0, e = TargetOpcodes.size(); j != e; ++j) { > CalleeCode += ", unsigned Opc" + utostr(j); > CallerCode += ", " + TargetOpcodes[j]; > @@ -3392,7 +3371,7 @@ > OpVTI->second.push_back(OpVTStr); > > OS << "SDNode *Select_" << OpName << (OpVTStr != "" ? "_" : "") > - << OpVTStr << "(SDOperand &Result, const SDOperand &N) {\n"; > + << OpVTStr << "(const SDOperand &N) {\n"; > > // Loop through and reverse all of the CodeList vectors, as we will be > // accessing them from their logical front, but accessing the end of a > @@ -3431,7 +3410,7 @@ > } > > // Emit boilerplate. > - OS << "SDNode *Select_INLINEASM(SDOperand& Result, SDOperand N) {\n" > + OS << "SDNode *Select_INLINEASM(SDOperand N) {\n" > << " std::vector Ops(N.Val->op_begin(), N.Val->op_end());\n" > << " AddToISelQueue(N.getOperand(0)); // Select the chain.\n\n" > << " // Select the flag operand.\n" > @@ -3443,16 +3422,14 @@ > << " VTs.push_back(MVT::Flag);\n" > << " SDOperand New = CurDAG->getNode(ISD::INLINEASM, VTs, &Ops[0], " > "Ops.size());\n" > - << " Result = New.getValue(N.ResNo);\n" > - << " return Result.Val;\n" > + << " return New.Val;\n" > << "}\n\n"; > > OS << "// The main instruction selector code.\n" > - << "SDNode *SelectCode(SDOperand &Result, SDOperand N) {\n" > + << "SDNode *SelectCode(SDOperand N) {\n" > << " if (N.getOpcode() >= ISD::BUILTIN_OP_END &&\n" > << " N.getOpcode() < (ISD::BUILTIN_OP_END+" << InstNS > << "INSTRUCTION_LIST_END)) {\n" > - << " Result = N;\n" > << " return NULL; // Already selected.\n" > << " }\n\n" > << " switch (N.getOpcode()) {\n" > @@ -3466,7 +3443,6 @@ > << " case ISD::TargetFrameIndex:\n" > << " case ISD::TargetJumpTable:\n" > << " case ISD::TargetGlobalAddress: {\n" > - << " Result = N;\n" > << " return NULL;\n" > << " }\n" > << " case ISD::AssertSext:\n" > @@ -3480,10 +3456,9 @@ > << " case ISD::CopyToReg: {\n" > << " for (unsigned i = 0, e = N.getNumOperands(); i != e; ++i)\n" > << " AddToISelQueue(N.getOperand(i));\n" > - << " Result = N;\n" > << " return NULL;\n" > << " }\n" > - << " case ISD::INLINEASM: return Select_INLINEASM(Result, N);\n"; > + << " case ISD::INLINEASM: return Select_INLINEASM(N);\n"; > > > // Loop over all of the case statements, emiting a call to each method we > @@ -3503,7 +3478,7 @@ > if (OpVTs.size() == 1) { > std::string &VTStr = OpVTs[0]; > OS << " return Select_" << OpName > - << (VTStr != "" ? "_" : "") << VTStr << "(Result, N);\n"; > + << (VTStr != "" ? "_" : "") << VTStr << "(N);\n"; > } else { > if (OpcodeInfo.getNumResults()) > OS << " MVT::ValueType NVT = N.Val->getValueType(0);\n"; > @@ -3523,11 +3498,11 @@ > } > OS << " case MVT::" << VTStr << ":\n" > << " return Select_" << OpName > - << "_" << VTStr << "(Result, N);\n"; > + << "_" << VTStr << "(N);\n"; > } > OS << " default:\n"; > if (Default != -1) > - OS << " return Select_" << OpName << "(Result, N);\n"; > + OS << " return Select_" << OpName << "(N);\n"; > else > OS << " break;\n"; > OS << " }\n"; > @@ -3647,12 +3622,11 @@ > << " HandleSDNode Dummy(CurDAG->getRoot());\n" > << " ISelQueue.push_back(CurDAG->getRoot().Val);\n"; > OS << " while (!ISelQueue.empty()) {\n"; > - OS << " SDOperand Tmp;\n"; > OS << " SDNode *Node = ISelQueue.front();\n"; > OS << " std::pop_heap(ISelQueue.begin(), ISelQueue.end(), isel_sort());\n"; > OS << " ISelQueue.pop_back();\n"; > OS << " if (!isSelected(Node->getNodeId())) {\n"; > - OS << " SDNode *ResNode = Select(Tmp, SDOperand(Node, 0));\n"; > + OS << " SDNode *ResNode = Select(SDOperand(Node, 0));\n"; > OS << " if (ResNode && ResNode != Node) ReplaceUses(Node, ResNode);\n"; > OS << " }\n"; > OS << " }\n"; > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Sat Aug 26 02:38:50 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 02:38:50 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-05-08-InstrSched.ll Message-ID: <200608260738.k7Q7co8e020670@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: 2006-05-08-InstrSched.ll updated: 1.3 -> 1.4 --- Log message: Improved codegen due to Chris' live interval joining changes. --- Diffs of the changes: (+1 -1) 2006-05-08-InstrSched.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/X86/2006-05-08-InstrSched.ll diff -u llvm/test/Regression/CodeGen/X86/2006-05-08-InstrSched.ll:1.3 llvm/test/Regression/CodeGen/X86/2006-05-08-InstrSched.ll:1.4 --- llvm/test/Regression/CodeGen/X86/2006-05-08-InstrSched.ll:1.3 Thu May 11 20:59:17 2006 +++ llvm/test/Regression/CodeGen/X86/2006-05-08-InstrSched.ll Sat Aug 26 02:38:36 2006 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -relocation-model=static | not grep 'xorb $16, %cl' +; RUN: llvm-as < %s | llc -march=x86 -relocation-model=static | not grep 'subl.*%esp' %A = external global ushort* %B = external global uint From evan.cheng at apple.com Sat Aug 26 02:39:42 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 02:39:42 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200608260739.k7Q7dg9m020695@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.249 -> 1.250 --- Log message: Minor getCopyToReg() call change. --- Diffs of the changes: (+2 -3) DAGISelEmitter.cpp | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.249 llvm/utils/TableGen/DAGISelEmitter.cpp:1.250 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.249 Sat Aug 26 00:29:57 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Sat Aug 26 02:39:28 2006 @@ -2897,9 +2897,8 @@ } std::string Decl = (!ResNodeDecled) ? "SDNode *" : ""; emitCode(Decl + "ResNode = CurDAG->getCopyToReg(" + ChainName + - ", CurDAG->getRegister(" + ISE.getQualifiedName(RR) + - ", " + getEnumName(RVT) + "), " + - RootName + utostr(OpNo) + ", InFlag).Val;"); + ", " + ISE.getQualifiedName(RR) + + ", " + RootName + utostr(OpNo) + ", InFlag).Val;"); ResNodeDecled = true; emitCode(ChainName + " = SDOperand(ResNode, 0);"); emitCode("InFlag = SDOperand(ResNode, 1);"); From evan.cheng at apple.com Sat Aug 26 02:55:49 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 02:55:49 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h Message-ID: <200608260755.k7Q7tnCj020939@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.125 -> 1.126 --- Log message: SelectNodeTo now returns a SDNode*. --- Diffs of the changes: (+35 -35) SelectionDAG.h | 70 ++++++++++++++++++++++++++++----------------------------- 1 files changed, 35 insertions(+), 35 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.125 llvm/include/llvm/CodeGen/SelectionDAG.h:1.126 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.125 Wed Aug 16 17:57:08 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Sat Aug 26 02:55:35 2006 @@ -304,41 +304,41 @@ /// operands. Note that target opcodes are stored as /// ISD::BUILTIN_OP_END+TargetOpcode in the node opcode field. The 0th value /// of the resultant node is returned. - SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT); - SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1); - SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2); - SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3); - SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4); - SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5); - SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6); - SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, - SDOperand Op7); - SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, - SDOperand Op7, SDOperand Op8); - SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2); - SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3); - SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4); - SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, + SDOperand Op1); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, + SDOperand Op1, SDOperand Op2); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, + SDOperand Op1, SDOperand Op2, SDOperand Op3); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, + SDOperand Op1, SDOperand Op2, SDOperand Op3, + SDOperand Op4); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, + SDOperand Op1, SDOperand Op2, SDOperand Op3, + SDOperand Op4, SDOperand Op5); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, + SDOperand Op1, SDOperand Op2, SDOperand Op3, + SDOperand Op4, SDOperand Op5, SDOperand Op6); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, + SDOperand Op1, SDOperand Op2, SDOperand Op3, + SDOperand Op4, SDOperand Op5, SDOperand Op6, + SDOperand Op7); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, + SDOperand Op1, SDOperand Op2, SDOperand Op3, + SDOperand Op4, SDOperand Op5, SDOperand Op6, + SDOperand Op7, SDOperand Op8); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, + MVT::ValueType VT2, SDOperand Op1, SDOperand Op2); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, + MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, + SDOperand Op3); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, + MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, + SDOperand Op3, SDOperand Op4); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, + MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, + SDOperand Op3, SDOperand Op4, SDOperand Op5); /// getTargetNode - These are used for target selectors to create a new node /// with specified return type(s), target opcode, and operands. From evan.cheng at apple.com Sat Aug 26 02:56:14 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 02:56:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200608260756.k7Q7uERI020967@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.333 -> 1.334 --- Log message: SelectNodeTo now returns a SDNode*. --- Diffs of the changes: (+74 -74) SelectionDAG.cpp | 148 +++++++++++++++++++++++++++---------------------------- 1 files changed, 74 insertions(+), 74 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.333 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.334 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.333 Wed Aug 16 17:57:46 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Sat Aug 26 02:56:00 2006 @@ -1834,13 +1834,13 @@ /// Note that SelectNodeTo returns the resultant node. If there is already a /// node of the specified opcode and operands, it returns that node instead of /// the current one. -SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT) { +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT) { SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return SDOperand(ON, 0); + return ON; RemoveNodeFromCSEMaps(N); @@ -1848,35 +1848,35 @@ N->setValueTypes(VTs); CSEMap.InsertNode(N, IP); - return SDOperand(N, 0); + return N; } -SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT, SDOperand Op1) { +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT, SDOperand Op1) { // If an identical node already exists, use it. SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, Op1); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return SDOperand(ON, 0); + return ON; RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); N->setValueTypes(VTs); N->setOperands(Op1); CSEMap.InsertNode(N, IP); - return SDOperand(N, 0); + return N; } -SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT, SDOperand Op1, - SDOperand Op2) { +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT, SDOperand Op1, + SDOperand Op2) { // If an identical node already exists, use it. SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, Op1, Op2); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return SDOperand(ON, 0); + return ON; RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); @@ -1884,19 +1884,19 @@ N->setOperands(Op1, Op2); CSEMap.InsertNode(N, IP); // Memoize the new node. - return SDOperand(N, 0); + return N; } -SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT, SDOperand Op1, - SDOperand Op2, SDOperand Op3) { +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT, SDOperand Op1, + SDOperand Op2, SDOperand Op3) { // If an identical node already exists, use it. SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, Op1, Op2, Op3); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return SDOperand(ON, 0); + return ON; RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); @@ -1904,13 +1904,13 @@ N->setOperands(Op1, Op2, Op3); CSEMap.InsertNode(N, IP); // Memoize the new node. - return SDOperand(N, 0); + return N; } -SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT, SDOperand Op1, - SDOperand Op2, SDOperand Op3, - SDOperand Op4) { +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT, SDOperand Op1, + SDOperand Op2, SDOperand Op3, + SDOperand Op4) { // If an identical node already exists, use it. SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); @@ -1920,7 +1920,7 @@ ID.AddOperand(Op4); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return SDOperand(ON, 0); + return ON; RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); @@ -1928,13 +1928,13 @@ N->setOperands(Op1, Op2, Op3, Op4); CSEMap.InsertNode(N, IP); // Memoize the new node. - return SDOperand(N, 0); + return N; } -SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT, SDOperand Op1, - SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5) { +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT, SDOperand Op1, + SDOperand Op2, SDOperand Op3, + SDOperand Op4, SDOperand Op5) { SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); @@ -1944,7 +1944,7 @@ ID.AddOperand(Op5); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return SDOperand(ON, 0); + return ON; RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); @@ -1952,13 +1952,13 @@ N->setOperands(Op1, Op2, Op3, Op4, Op5); CSEMap.InsertNode(N, IP); // Memoize the new node. - return SDOperand(N, 0); + return N; } -SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT, SDOperand Op1, - SDOperand Op2, SDOperand Op3,SDOperand Op4, - SDOperand Op5, SDOperand Op6) { +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT, SDOperand Op1, + SDOperand Op2, SDOperand Op3, SDOperand Op4, + SDOperand Op5, SDOperand Op6) { SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); @@ -1969,7 +1969,7 @@ ID.AddOperand(Op6); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return SDOperand(ON, 0); + return ON; RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); @@ -1977,14 +1977,14 @@ N->setOperands(Op1, Op2, Op3, Op4, Op5, Op6); CSEMap.InsertNode(N, IP); // Memoize the new node. - return SDOperand(N, 0); + return N; } -SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT, SDOperand Op1, - SDOperand Op2, SDOperand Op3,SDOperand Op4, - SDOperand Op5, SDOperand Op6, - SDOperand Op7) { +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT, SDOperand Op1, + SDOperand Op2, SDOperand Op3,SDOperand Op4, + SDOperand Op5, SDOperand Op6, + SDOperand Op7) { SDVTList VTs = getVTList(VT); // If an identical node already exists, use it. SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); @@ -1997,7 +1997,7 @@ ID.AddOperand(Op7); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return SDOperand(ON, 0); + return ON; RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); @@ -2005,13 +2005,13 @@ N->setOperands(Op1, Op2, Op3, Op4, Op5, Op6, Op7); CSEMap.InsertNode(N, IP); // Memoize the new node. - return SDOperand(N, 0); + return N; } -SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT, SDOperand Op1, - SDOperand Op2, SDOperand Op3,SDOperand Op4, - SDOperand Op5, SDOperand Op6, - SDOperand Op7, SDOperand Op8) { +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT, SDOperand Op1, + SDOperand Op2, SDOperand Op3,SDOperand Op4, + SDOperand Op5, SDOperand Op6, + SDOperand Op7, SDOperand Op8) { // If an identical node already exists, use it. SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); @@ -2025,7 +2025,7 @@ ID.AddOperand(Op8); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return SDOperand(ON, 0); + return ON; RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); @@ -2033,17 +2033,17 @@ N->setOperands(Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8); CSEMap.InsertNode(N, IP); // Memoize the new node. - return SDOperand(N, 0); + return N; } -SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT1, MVT::ValueType VT2, - SDOperand Op1, SDOperand Op2) { +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT1, MVT::ValueType VT2, + SDOperand Op1, SDOperand Op2) { SDVTList VTs = getVTList(VT1, VT2); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, Op1, Op2); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return SDOperand(ON, 0); + return ON; RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); @@ -2051,20 +2051,20 @@ N->setOperands(Op1, Op2); CSEMap.InsertNode(N, IP); // Memoize the new node. - return SDOperand(N, 0); + return N; } -SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT1, MVT::ValueType VT2, - SDOperand Op1, SDOperand Op2, - SDOperand Op3) { +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT1, MVT::ValueType VT2, + SDOperand Op1, SDOperand Op2, + SDOperand Op3) { // If an identical node already exists, use it. SDVTList VTs = getVTList(VT1, VT2); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, Op1, Op2, Op3); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return SDOperand(ON, 0); + return ON; RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); @@ -2072,13 +2072,13 @@ N->setOperands(Op1, Op2, Op3); CSEMap.InsertNode(N, IP); // Memoize the new node. - return SDOperand(N, 0); + return N; } -SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT1, MVT::ValueType VT2, - SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4) { +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT1, MVT::ValueType VT2, + SDOperand Op1, SDOperand Op2, + SDOperand Op3, SDOperand Op4) { // If an identical node already exists, use it. SDVTList VTs = getVTList(VT1, VT2); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); @@ -2088,7 +2088,7 @@ ID.AddOperand(Op4); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return SDOperand(ON, 0); + return ON; RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); @@ -2096,14 +2096,14 @@ N->setOperands(Op1, Op2, Op3, Op4); CSEMap.InsertNode(N, IP); // Memoize the new node. - return SDOperand(N, 0); + return N; } -SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT1, MVT::ValueType VT2, - SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, - SDOperand Op5) { +SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT1, MVT::ValueType VT2, + SDOperand Op1, SDOperand Op2, + SDOperand Op3, SDOperand Op4, + SDOperand Op5) { // If an identical node already exists, use it. SDVTList VTs = getVTList(VT1, VT2); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); @@ -2114,7 +2114,7 @@ ID.AddOperand(Op5); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return SDOperand(ON, 0); + return ON; RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); @@ -2122,7 +2122,7 @@ N->setOperands(Op1, Op2, Op3, Op4, Op5); CSEMap.InsertNode(N, IP); // Memoize the new node. - return SDOperand(N, 0); + return N; } /// getTargetNode - These are used for target selectors to create a new node From evan.cheng at apple.com Sat Aug 26 02:56:53 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 02:56:53 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200608260756.k7Q7urhR020988@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.250 -> 1.251 --- Log message: SelectNodeTo now returns a SDNode*. --- Diffs of the changes: (+1 -1) DAGISelEmitter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.250 llvm/utils/TableGen/DAGISelEmitter.cpp:1.251 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.250 Sat Aug 26 02:39:28 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Sat Aug 26 02:56:39 2006 @@ -2796,7 +2796,7 @@ Code += ", " + AllOps[i]; if (NodeHasInFlag || HasImpInputs) Code += ", InFlag"; - emitCode(Code + ").Val;"); + emitCode(Code + ");"); emitOpcode(II.Namespace + "::" + II.TheDef->getName()); if (N->getTypeNum(0) != MVT::isVoid) emitVT(getEnumName(N->getTypeNum(0))); From evan.cheng at apple.com Sat Aug 26 02:57:55 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 02:57:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Message-ID: <200608260757.k7Q7vtwq021025@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaISelDAGToDAG.cpp updated: 1.53 -> 1.54 --- Log message: SelectNodeTo now returns a SDNode*. --- Diffs of the changes: (+5 -5) AlphaISelDAGToDAG.cpp | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.53 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.54 --- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.53 Sat Aug 26 00:33:00 2006 +++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Sat Aug 26 02:57:39 2006 @@ -199,7 +199,7 @@ int FI = cast(N)->getIndex(); return CurDAG->SelectNodeTo(N, Alpha::LDA, MVT::i64, CurDAG->getTargetFrameIndex(FI, MVT::i32), - getI64Imm(0)).Val; + getI64Imm(0)); } case AlphaISD::GlobalBaseReg: { SDOperand Result = getGlobalBaseReg(); @@ -231,7 +231,7 @@ Chain, Chain.getValue(1)); Chain = CurDAG->getCopyFromReg(Chain, Alpha::R27, MVT::i64, SDOperand(CNode, 1)); - return CurDAG->SelectNodeTo(N, Alpha::BIS, MVT::i64, Chain, Chain).Val; + return CurDAG->SelectNodeTo(N, Alpha::BIS, MVT::i64, Chain, Chain); } case ISD::READCYCLECOUNTER: { @@ -268,7 +268,7 @@ SDNode *Tmp = CurDAG->getTargetNode(Alpha::LDAHr, MVT::i64, CPI, getGlobalBaseReg()); return CurDAG->SelectNodeTo(N, Alpha::LDQr, MVT::i64, MVT::Other, - CPI, SDOperand(Tmp, 0), CurDAG->getEntryNode()).Val; + CPI, SDOperand(Tmp, 0), CurDAG->getEntryNode()); } case ISD::TargetConstantFP: { ConstantFPSDNode *CN = cast(N); @@ -277,11 +277,11 @@ if (CN->isExactlyValue(+0.0)) { return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYST : Alpha::CPYSS, T, CurDAG->getRegister(Alpha::F31, T), - CurDAG->getRegister(Alpha::F31, T)).Val; + CurDAG->getRegister(Alpha::F31, T)); } else if ( CN->isExactlyValue(-0.0)) { return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYSNT : Alpha::CPYSNS, T, CurDAG->getRegister(Alpha::F31, T), - CurDAG->getRegister(Alpha::F31, T)).Val; + CurDAG->getRegister(Alpha::F31, T)); } else { abort(); } From evan.cheng at apple.com Sat Aug 26 02:58:10 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 02:58:10 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp Message-ID: <200608260758.k7Q7wANP021041@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64ISelDAGToDAG.cpp updated: 1.51 -> 1.52 --- Log message: SelectNodeTo now returns a SDNode*. --- Diffs of the changes: (+10 -10) IA64ISelDAGToDAG.cpp | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) Index: llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp diff -u llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.51 llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.52 --- llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.51 Sat Aug 26 00:33:15 2006 +++ llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp Sat Aug 26 02:57:56 2006 @@ -408,10 +408,10 @@ int FI = cast(N)->getIndex(); if (N->hasOneUse()) return CurDAG->SelectNodeTo(N, IA64::MOV, MVT::i64, - CurDAG->getTargetFrameIndex(FI, MVT::i64)).Val; + CurDAG->getTargetFrameIndex(FI, MVT::i64)); else - return SDOperand(CurDAG->getTargetNode(IA64::MOV, MVT::i64, - CurDAG->getTargetFrameIndex(FI, MVT::i64)), 0).Val; + return CurDAG->getTargetNode(IA64::MOV, MVT::i64, + CurDAG->getTargetFrameIndex(FI, MVT::i64)); } case ISD::ConstantPool: { // TODO: nuke the constant pool @@ -464,7 +464,7 @@ return CurDAG->SelectNodeTo(N, IA64::CMPNE, MVT::i1, MVT::Other, SDOperand(CurDAG->getTargetNode(Opc, MVT::i64, Address), 0), CurDAG->getRegister(IA64::r0, MVT::i64), - Chain).getValue(Op.ResNo).Val; + Chain); } /* otherwise, we want to load a bool into something bigger: LD1 will do that for us, so we just fall through */ @@ -480,7 +480,7 @@ // TODO: comment this return CurDAG->SelectNodeTo(N, Opc, N->getValueType(0), MVT::Other, - Address, Chain).getValue(Op.ResNo).Val; + Address, Chain); } case ISD::TRUNCSTORE: @@ -505,7 +505,7 @@ Tmp = SDOperand(CurDAG->getTargetNode(IA64::TPCADDS, MVT::i64, Initial, CurDAG->getConstant(1, MVT::i64), Tmp), 0); - return CurDAG->SelectNodeTo(N, Opc, MVT::Other, Address, Tmp, Chain).Val; + return CurDAG->SelectNodeTo(N, Opc, MVT::Other, Address, Tmp, Chain); } case MVT::i64: Opc = IA64::ST8; break; case MVT::f64: Opc = IA64::STF8; break; @@ -524,7 +524,7 @@ SDOperand N2 = N->getOperand(2); AddToISelQueue(N1); AddToISelQueue(N2); - return CurDAG->SelectNodeTo(N, Opc, MVT::Other, N2, N1, Chain).Val; + return CurDAG->SelectNodeTo(N, Opc, MVT::Other, N2, N1, Chain); } case ISD::BRCOND: { @@ -536,7 +536,7 @@ cast(N->getOperand(2))->getBasicBlock(); //FIXME - we do NOT need long branches all the time return CurDAG->SelectNodeTo(N, IA64::BRLCOND_NOTCALL, MVT::Other, CC, - CurDAG->getBasicBlock(Dest), Chain).Val; + CurDAG->getBasicBlock(Dest), Chain); } case ISD::CALLSEQ_START: @@ -546,7 +546,7 @@ IA64::ADJUSTCALLSTACKDOWN : IA64::ADJUSTCALLSTACKUP; SDOperand N0 = N->getOperand(0); AddToISelQueue(N0); - return CurDAG->SelectNodeTo(N, Opc, MVT::Other, getI64Imm(Amt), N0).Val; + return CurDAG->SelectNodeTo(N, Opc, MVT::Other, getI64Imm(Amt), N0); } case ISD::BR: @@ -554,7 +554,7 @@ SDOperand N0 = N->getOperand(0); AddToISelQueue(N0); return CurDAG->SelectNodeTo(N, IA64::BRL_NOTCALL, MVT::Other, - N->getOperand(1), N0).Val; + N->getOperand(1), N0); } return SelectCode(Op); From evan.cheng at apple.com Sat Aug 26 02:58:25 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 02:58:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Message-ID: <200608260758.k7Q7wPOm021057@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.205 -> 1.206 --- Log message: SelectNodeTo now returns a SDNode*. --- Diffs of the changes: (+20 -20) PPCISelDAGToDAG.cpp | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.205 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.206 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.205 Sat Aug 26 00:34:08 2006 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Sat Aug 26 02:58:11 2006 @@ -812,23 +812,23 @@ case ISD::SETEQ: Op = SDOperand(CurDAG->getTargetNode(PPC::CNTLZW, MVT::i32, Op), 0); return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Op, getI32Imm(27), - getI32Imm(5), getI32Imm(31)).Val; + getI32Imm(5), getI32Imm(31)); case ISD::SETNE: { SDOperand AD = SDOperand(CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag, Op, getI32Imm(~0U)), 0); return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, AD, Op, - AD.getValue(1)).Val; + AD.getValue(1)); } case ISD::SETLT: return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Op, getI32Imm(1), - getI32Imm(31), getI32Imm(31)).Val; + getI32Imm(31), getI32Imm(31)); case ISD::SETGT: { SDOperand T = SDOperand(CurDAG->getTargetNode(PPC::NEG, MVT::i32, Op), 0); T = SDOperand(CurDAG->getTargetNode(PPC::ANDC, MVT::i32, T, Op), 0); return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, T, getI32Imm(1), - getI32Imm(31), getI32Imm(31)).Val; + getI32Imm(31), getI32Imm(31)); } } } else if (Imm == ~0U) { // setcc op, -1 @@ -842,13 +842,13 @@ return CurDAG->SelectNodeTo(N, PPC::ADDZE, MVT::i32, SDOperand(CurDAG->getTargetNode(PPC::LI, MVT::i32, getI32Imm(0)), 0), - Op.getValue(1)).Val; + Op.getValue(1)); case ISD::SETNE: { Op = SDOperand(CurDAG->getTargetNode(PPC::NOR, MVT::i32, Op, Op), 0); SDNode *AD = CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag, Op, getI32Imm(~0U)); return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, SDOperand(AD, 0), - Op, SDOperand(AD, 1)).Val; + Op, SDOperand(AD, 1)); } case ISD::SETLT: { SDOperand AD = SDOperand(CurDAG->getTargetNode(PPC::ADDI, MVT::i32, Op, @@ -856,14 +856,14 @@ SDOperand AN = SDOperand(CurDAG->getTargetNode(PPC::AND, MVT::i32, AD, Op), 0); return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, AN, getI32Imm(1), - getI32Imm(31), getI32Imm(31)).Val; + getI32Imm(31), getI32Imm(31)); } case ISD::SETGT: Op = SDOperand(CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, Op, getI32Imm(1), getI32Imm(31), getI32Imm(31)), 0); return CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Op, - getI32Imm(1)).Val; + getI32Imm(1)); } } } @@ -889,13 +889,13 @@ if (!Inv) { return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, IntCR, getI32Imm((32-(3-Idx)) & 31), - getI32Imm(31), getI32Imm(31)).Val; + getI32Imm(31), getI32Imm(31)); } else { SDOperand Tmp = SDOperand(CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, IntCR, getI32Imm((32-(3-Idx)) & 31), getI32Imm(31),getI32Imm(31)), 0); - return CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Tmp, getI32Imm(1)).Val; + return CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Tmp, getI32Imm(1)); } } @@ -921,7 +921,7 @@ unsigned Opc = Op.getValueType() == MVT::i32 ? PPC::ADDI : PPC::ADDI8; if (N->hasOneUse()) return CurDAG->SelectNodeTo(N, Opc, Op.getValueType(), TFI, - getSmallIPtrImm(0)).Val; + getSmallIPtrImm(0)); return CurDAG->getTargetNode(Opc, Op.getValueType(), TFI, getSmallIPtrImm(0)); } @@ -952,7 +952,7 @@ CurDAG->getTargetNode(PPC::SRAWI, MVT::i32, MVT::Flag, N0, getI32Imm(Log2_32(Imm))); return CurDAG->SelectNodeTo(N, PPC::ADDZE, MVT::i32, - SDOperand(Op, 0), SDOperand(Op, 1)).Val; + SDOperand(Op, 0), SDOperand(Op, 1)); } else if ((signed)Imm < 0 && isPowerOf2_32(-Imm)) { SDNode *Op = CurDAG->getTargetNode(PPC::SRAWI, MVT::i32, MVT::Flag, @@ -961,7 +961,7 @@ SDOperand(CurDAG->getTargetNode(PPC::ADDZE, MVT::i32, SDOperand(Op, 0), SDOperand(Op, 1)), 0); - return CurDAG->SelectNodeTo(N, PPC::NEG, MVT::i32, PT).Val; + return CurDAG->SelectNodeTo(N, PPC::NEG, MVT::i32, PT); } } @@ -992,7 +992,7 @@ } return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Val, getI32Imm(SH), getI32Imm(MB), - getI32Imm(ME)).Val; + getI32Imm(ME)); } // ISD::OR doesn't get all the bitfield insertion fun. // (and (or x, c1), c2) where isRunOfOnes(~(c1^c2)) is a bitfield insert @@ -1029,7 +1029,7 @@ return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, N->getOperand(0).getOperand(0), getI32Imm(SH), getI32Imm(MB), - getI32Imm(ME)).Val; + getI32Imm(ME)); } // Other cases are autogenerated. @@ -1043,7 +1043,7 @@ return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, N->getOperand(0).getOperand(0), getI32Imm(SH), getI32Imm(MB), - getI32Imm(ME)).Val; + getI32Imm(ME)); } // Other cases are autogenerated. @@ -1066,7 +1066,7 @@ N->getOperand(0), getI32Imm(~0U)); return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, SDOperand(Tmp, 0), N->getOperand(0), - SDOperand(Tmp, 1)).Val; + SDOperand(Tmp, 1)); } SDOperand CCReg = SelectCC(N->getOperand(0), N->getOperand(1), CC); @@ -1089,7 +1089,7 @@ AddToISelQueue(N->getOperand(3)); return CurDAG->SelectNodeTo(N, SelectCCOp, N->getValueType(0), CCReg, N->getOperand(2), N->getOperand(3), - getI32Imm(BROpc)).Val; + getI32Imm(BROpc)); } case ISD::BR_CC: { AddToISelQueue(N->getOperand(0)); @@ -1097,7 +1097,7 @@ SDOperand CondCode = SelectCC(N->getOperand(2), N->getOperand(3), CC); return CurDAG->SelectNodeTo(N, PPC::COND_BRANCH, MVT::Other, CondCode, getI32Imm(getBCCForSetCC(CC)), - N->getOperand(4), N->getOperand(0)).Val; + N->getOperand(4), N->getOperand(0)); } case ISD::BRIND: { // FIXME: Should custom lower this. @@ -1108,7 +1108,7 @@ unsigned Opc = Target.getValueType() == MVT::i32 ? PPC::MTCTR : PPC::MTCTR8; Chain = SDOperand(CurDAG->getTargetNode(Opc, MVT::Other, Target, Chain), 0); - return CurDAG->SelectNodeTo(N, PPC::BCTR, MVT::Other, Chain).Val; + return CurDAG->SelectNodeTo(N, PPC::BCTR, MVT::Other, Chain); } // FIXME: These are manually selected because tblgen isn't handling varargs // nodes correctly. From evan.cheng at apple.com Sat Aug 26 02:59:47 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 02:59:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Message-ID: <200608260759.k7Q7xliK021086@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcISelDAGToDAG.cpp updated: 1.106 -> 1.107 --- Log message: SelectNodeTo now returns a SDNode*. --- Diffs of the changes: (+2 -2) SparcISelDAGToDAG.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp diff -u llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.106 llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.107 --- llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.106 Sat Aug 26 00:34:22 2006 +++ llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Sat Aug 26 02:59:33 2006 @@ -1093,7 +1093,7 @@ // FIXME: Handle div by immediate. unsigned Opcode = N->getOpcode() == ISD::SDIV ? SP::SDIVrr : SP::UDIVrr; return CurDAG->SelectNodeTo(N, Opcode, MVT::i32, DivLHS, DivRHS, - TopPart).Val; + TopPart); } case ISD::MULHU: case ISD::MULHS: { @@ -1106,7 +1106,7 @@ SDNode *Mul = CurDAG->getTargetNode(Opcode, MVT::i32, MVT::Flag, MulLHS, MulRHS); // The high part is in the Y register. - return CurDAG->SelectNodeTo(N, SP::RDY, MVT::i32, SDOperand(Mul, 1)).Val; + return CurDAG->SelectNodeTo(N, SP::RDY, MVT::i32, SDOperand(Mul, 1)); return NULL; } } From evan.cheng at apple.com Sat Aug 26 03:00:24 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 26 Aug 2006 03:00:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Message-ID: <200608260800.k7Q80O0I021117@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelDAGToDAG.cpp updated: 1.95 -> 1.96 --- Log message: SelectNodeTo now returns a SDNode*. --- Diffs of the changes: (+1 -1) X86ISelDAGToDAG.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.95 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.96 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.95 Sat Aug 26 00:34:46 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Sat Aug 26 03:00:10 2006 @@ -658,7 +658,7 @@ } if (C.Val) - return CurDAG->SelectNodeTo(N.Val, X86::MOV32ri, MVT::i32, C).Val; + return CurDAG->SelectNodeTo(N.Val, X86::MOV32ri, MVT::i32, C); } // Other cases are handled by auto-generated code. From natebegeman at mac.com Sat Aug 26 10:46:52 2006 From: natebegeman at mac.com (Nate Begeman) Date: Sat, 26 Aug 2006 10:46:52 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachOWriter.h Message-ID: <200608261546.k7QFkq09005732@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachOWriter.h updated: 1.4 -> 1.5 --- Log message: Properly size the string table, and emit symbol table and string table entries in the correct order, fixing several fixmes. --- Diffs of the changes: (+36 -19) MachOWriter.h | 55 ++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 36 insertions(+), 19 deletions(-) Index: llvm/include/llvm/CodeGen/MachOWriter.h diff -u llvm/include/llvm/CodeGen/MachOWriter.h:1.4 llvm/include/llvm/CodeGen/MachOWriter.h:1.5 --- llvm/include/llvm/CodeGen/MachOWriter.h:1.4 Fri Aug 25 01:36:58 2006 +++ llvm/include/llvm/CodeGen/MachOWriter.h Sat Aug 26 10:46:34 2006 @@ -204,8 +204,6 @@ /// the file, and then emit during finalization. MachOHeader Header; - private: - /// MachOSegment - This struct contains the necessary information to /// emit the load commands for each section in the file. struct MachOSegment { @@ -353,6 +351,8 @@ reserved3(0) { } }; + private: + /// SectionList - This is the list of sections that we have emitted to the /// file. Once the file has been completely built, the segment load command /// SectionCommands are constructed from this info. @@ -472,11 +472,12 @@ /// turned into a real symbol table in the file. struct MachOSym { const GlobalValue *GV; // The global value this corresponds to. - uint32_t n_strx; // index into the string table - uint8_t n_type; // type flag - uint8_t n_sect; // section number or NO_SECT - int16_t n_desc; // see - uint64_t n_value; // value for this symbol (or stab offset) + std::string GVName; // The mangled name of the global value. + uint32_t n_strx; // index into the string table + uint8_t n_type; // type flag + uint8_t n_sect; // section number or NO_SECT + int16_t n_desc; // see + uint64_t n_value; // value for this symbol (or stab offset) // Constants for the n_sect field // see @@ -510,20 +511,40 @@ N_WEAK_DEF = 0x0080 // coalesced symbol is a weak definition }; - /// entrySize - This routine returns the size of a symbol table entry as - /// written to disk. - static unsigned entrySize() { return 12; } - - MachOSym(const GlobalValue *gv, uint8_t sect) : GV(gv), n_strx(0), - n_type(sect == NO_SECT ? N_UNDF : N_SECT), n_sect(sect), n_desc(0), - n_value(0) {} + MachOSym(const GlobalValue *gv, std::string name, uint8_t sect) : GV(gv), + GVName(name), n_strx(0), n_type(sect == NO_SECT ? N_UNDF : N_SECT), + n_sect(sect), n_desc(0), n_value(0) { + // FIXME: names aren't getting the proper global/local prefix + } + }; + + struct MachOSymCmp { + bool operator()(const MachOSym &LHS, const MachOSym &RHS) { + return LHS.GVName < RHS.GVName; + } }; + /// PartitionByLocal - Simple boolean predicate that returns true if Sym is + /// a local symbol rather than an external symbol. + static bool PartitionByLocal(const MachOSym &Sym); + + /// PartitionByDefined - Simple boolean predicate that returns true if Sym + /// is defined in this module. + static bool PartitionByDefined(const MachOWriter::MachOSym &Sym); + /// SymbolTable - This is the list of symbols we have emitted to the file. /// This actually gets rearranged before emission to the file (to put the /// local symbols first in the list). std::vector SymbolTable; + /// SymT - A buffer to hold the symbol table before we write it out at the + /// appropriate location in the file. + DataBuffer SymT; + + /// StrT - A buffer to hold the string table before we write it out at the + /// appropriate location in the file. + DataBuffer StrT; + /// PendingSyms - This is a list of externally defined symbols that we have /// been asked to emit, but have not seen a reference to. When a reference /// is seen, the symbol will move from this list to the SymbolTable. @@ -533,9 +554,6 @@ /// SymbolTable to aid in emitting the DYSYMTAB load command. std::vector DynamicSymbolTable; - /// StringTable - The table of strings referenced by SymbolTable entries - std::vector StringTable; - // align - Emit padding into the file until the current output position is // aligned to the specified power of two boundary. static void align(DataBuffer &Output, unsigned Boundary) { @@ -624,8 +642,7 @@ void EmitHeaderAndLoadCommands(); void EmitSections(); void EmitRelocations(); - void EmitSymbolTable(); - void EmitStringTable(); + void BufferSymbolAndStringTable(); }; } From natebegeman at mac.com Sat Aug 26 10:46:52 2006 From: natebegeman at mac.com (Nate Begeman) Date: Sat, 26 Aug 2006 10:46:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachOWriter.cpp Message-ID: <200608261546.k7QFkqAb005733@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachOWriter.cpp updated: 1.2 -> 1.3 --- Log message: Properly size the string table, and emit symbol table and string table entries in the correct order, fixing several fixmes. --- Diffs of the changes: (+82 -60) MachOWriter.cpp | 142 ++++++++++++++++++++++++++++++++------------------------ 1 files changed, 82 insertions(+), 60 deletions(-) Index: llvm/lib/CodeGen/MachOWriter.cpp diff -u llvm/lib/CodeGen/MachOWriter.cpp:1.2 llvm/lib/CodeGen/MachOWriter.cpp:1.3 --- llvm/lib/CodeGen/MachOWriter.cpp:1.2 Fri Aug 25 01:36:58 2006 +++ llvm/lib/CodeGen/MachOWriter.cpp Sat Aug 26 10:46:34 2006 @@ -30,6 +30,7 @@ #include "llvm/Target/TargetJITInfo.h" #include "llvm/Support/Mangler.h" #include "llvm/Support/MathExtras.h" +#include #include using namespace llvm; @@ -128,10 +129,11 @@ MOS->size += CurBufferPtr - BufferBegin; // Get a symbol for the function to add to the symbol table - MachOWriter::MachOSym FnSym(F.getFunction(), MOS->Index); + const GlobalValue *FuncV = F.getFunction(); + MachOWriter::MachOSym FnSym(FuncV, MOW.Mang->getValueName(FuncV), MOS->Index); // Figure out the binding (linkage) of the symbol. - switch (F.getFunction()->getLinkage()) { + switch (FuncV->getLinkage()) { default: // appending linkage is illegal for functions. assert(0 && "Unknown linkage type!"); @@ -159,7 +161,6 @@ // until the sections are all layed out, but we still need to // record them. Maybe emit TargetRelocations and then resolve // those at file writing time? - std::cerr << "whee!\n"; } } Relocations.clear(); @@ -191,7 +192,7 @@ unsigned Size = TM.getTargetData()->getTypeSize(Ty); unsigned Align = Log2_32(TM.getTargetData()->getTypeAlignment(Ty)); - MachOSym Sym(GV, Sec.Index); + MachOSym Sym(GV, Mang->getValueName(GV), Sec.Index); // Reserve space in the .bss section for this symbol while maintaining the // desired section alignment, which must be at least as much as required by // this symbol. @@ -219,7 +220,7 @@ const Type *Ty = GV->getType()->getElementType(); unsigned Size = TM.getTargetData()->getTypeSize(Ty); bool NoInit = !GV->hasInitializer(); - + // If this global has a zero initializer, it is part of the .bss or common // section. if (NoInit || GV->getInitializer()->isNullValue()) { @@ -227,7 +228,8 @@ // part of the common block if they are zero initialized and allowed to be // merged with other symbols. if (NoInit || GV->hasLinkOnceLinkage() || GV->hasWeakLinkage()) { - MachOWriter::MachOSym ExtOrCommonSym(GV, MachOSym::NO_SECT); + MachOWriter::MachOSym ExtOrCommonSym(GV, Mang->getValueName(GV), + MachOSym::NO_SECT); ExtOrCommonSym.n_type |= MachOSym::N_EXT; // For undefined (N_UNDF) external (N_EXT) types, n_value is the size in // bytes of the symbol. @@ -279,12 +281,18 @@ /// doFinalization - Now that the module has been completely processed, emit /// the Mach-O file to 'O'. bool MachOWriter::doFinalization(Module &M) { + // FIXME: we don't handle debug info yet, we should probably do that. + // Okay, the.text section has been completed, build the .data, .bss, and // "common" sections next. for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) EmitGlobal(I); + // Emit the symbol table to temporary buffers, so that we know the size of + // the string table when we write the load commands in the next phase. + BufferSymbolAndStringTable(); + // Emit the header and load commands. EmitHeaderAndLoadCommands(); @@ -296,12 +304,9 @@ // have different relocation types. EmitRelocations(); - // Emit the symbol table. - // FIXME: we don't handle debug info yet, we should probably do that. - EmitSymbolTable(); - - // Emit the string table for the sections we have. - EmitStringTable(); + // Write the symbol table and the string table to the end of the file. + O.write((char*)&SymT[0], SymT.size()); + O.write((char*)&StrT[0], StrT.size()); // We are done with the abstract symbols. SectionList.clear(); @@ -383,16 +388,11 @@ } // Step #6: Emit LC_SYMTAB/LC_DYSYMTAB load commands - // FIXME: We'll need to scan over the symbol table and possibly do the sort - // here so that we can set the proper indices in the dysymtab load command for - // the index and number of external symbols defined in this module. - // FIXME: We'll also need to scan over all the symbols so that we can - // calculate the size of the string table. // FIXME: add size of relocs SymTab.symoff = SEG.fileoff + SEG.filesize; SymTab.nsyms = SymbolTable.size(); - SymTab.stroff = SymTab.symoff + SymTab.nsyms * MachOSym::entrySize(); - SymTab.strsize = 10; + SymTab.stroff = SymTab.symoff + SymT.size(); + SymTab.strsize = StrT.size(); outword(FH, SymTab.cmd); outword(FH, SymTab.cmdsize); outword(FH, SymTab.symoff); @@ -401,6 +401,8 @@ outword(FH, SymTab.strsize); // FIXME: set DySymTab fields appropriately + // We should probably just update these in BufferSymbolAndStringTable since + // thats where we're partitioning up the different kinds of symbols. outword(FH, DySymTab.cmd); outword(FH, DySymTab.cmdsize); outword(FH, DySymTab.ilocalsym); @@ -440,54 +442,74 @@ // specific. } -/// EmitSymbolTable - Sort the symbols we encountered and assign them each a -/// string table index so that they appear in the correct order in the output -/// file. -void MachOWriter::EmitSymbolTable() { +/// PartitionByLocal - Simple boolean predicate that returns true if Sym is +/// a local symbol rather than an external symbol. +bool MachOWriter::PartitionByLocal(const MachOSym &Sym) { + // FIXME: Not totally sure if private extern counts as external + return (Sym.n_type & (MachOSym::N_EXT | MachOSym::N_PEXT)) == 0; +} + +/// PartitionByDefined - Simple boolean predicate that returns true if Sym is +/// defined in this module. +bool MachOWriter::PartitionByDefined(const MachOSym &Sym) { + // FIXME: Do N_ABS or N_INDR count as defined? + return (Sym.n_type & MachOSym::N_SECT) == MachOSym::N_SECT; +} + +/// BufferSymbolAndStringTable - Sort the symbols we encountered and assign them +/// each a string table index so that they appear in the correct order in the +/// output file. +void MachOWriter::BufferSymbolAndStringTable() { // The order of the symbol table is: - // local symbols - // defined external symbols (sorted by name) - // undefined external symbols (sorted by name) - DataBuffer ST; - - // FIXME: enforce the above ordering, presumably by sorting by name, - // then partitioning twice. - unsigned stringIndex; + // 1. local symbols + // 2. defined external symbols (sorted by name) + // 3. undefined external symbols (sorted by name) + + // Sort the symbols by name, so that when we partition the symbols by scope + // of definition, we won't have to sort by name within each partition. + std::sort(SymbolTable.begin(), SymbolTable.end(), MachOSymCmp()); + + // Parition the symbol table entries so that all local symbols come before + // all symbols with external linkage. { 1 | 2 3 } + std::partition(SymbolTable.begin(), SymbolTable.end(), PartitionByLocal); + + // Advance iterator to beginning of external symbols and partition so that + // all external symbols defined in this module come before all external + // symbols defined elsewhere. { 1 | 2 | 3 } for (std::vector::iterator I = SymbolTable.begin(), E = SymbolTable.end(); I != E; ++I) { - // FIXME: remove when we actually calculate these correctly - I->n_strx = 1; - StringTable.push_back(Mang->getValueName(I->GV)); - // Emit nlist to buffer - outword(ST, I->n_strx); - outbyte(ST, I->n_type); - outbyte(ST, I->n_sect); - outhalf(ST, I->n_desc); - outaddr(ST, I->n_value); + if (!PartitionByLocal(*I)) { + std::partition(I, E, PartitionByDefined); + break; + } } - O.write((char*)&ST[0], ST.size()); -} - -/// EmitStringTable - This method adds and emits a section for the Mach-O -/// string table. -void MachOWriter::EmitStringTable() { - // The order of the string table is: - // strings for external symbols - // strings for local symbols - // This is the symbol table, but backwards. This allows us to avoid a sorting - // the symbol table again; all we have to do is use a reverse iterator. - DataBuffer ST; - // Write out a leading zero byte when emitting string table, for n_strx == 0 // which means an empty string. - outbyte(ST, 0); + outbyte(StrT, 0); + + // The order of the string table is: + // 1. strings for external symbols + // 2. strings for local symbols + // Since this is the opposite order from the symbol table, which we have just + // sorted, we can walk the symbol table backwards to output the string table. + for (std::vector::reverse_iterator I = SymbolTable.rbegin(), + E = SymbolTable.rend(); I != E; ++I) { + if (I->GVName == "") { + I->n_strx = 0; + } else { + I->n_strx = StrT.size(); + outstring(StrT, I->GVName, I->GVName.length()+1); + } + } - for (std::vector::iterator I = StringTable.begin(), - E = StringTable.end(); I != E; ++I) { - // FIXME: do not arbitrarily cap symbols to 16 characters - // FIXME: do something more efficient than outstring - outstring(ST, *I, 16); + for (std::vector::iterator I = SymbolTable.begin(), + E = SymbolTable.end(); I != E; ++I) { + // Emit nlist to buffer + outword(SymT, I->n_strx); + outbyte(SymT, I->n_type); + outbyte(SymT, I->n_sect); + outhalf(SymT, I->n_desc); + outaddr(SymT, I->n_value); } - O.write((char*)&ST[0], ST.size()); } From lattner at cs.uiuc.edu Sat Aug 26 16:33:19 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 26 Aug 2006 16:33:19 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64TargetMachine.cpp IA64TargetMachine.h Message-ID: <200608262133.k7QLXJAR010893@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64TargetMachine.cpp updated: 1.17 -> 1.18 IA64TargetMachine.h updated: 1.11 -> 1.12 --- Log message: Fix target matching weights, so that ppc-darwin modules are codegen with the ppc target, not the itanium target, when run on an itanium machine. This should fix the CodeGen/PowerPC regtest failures on itanium. --- Diffs of the changes: (+7 -13) IA64TargetMachine.cpp | 19 +++++++------------ IA64TargetMachine.h | 1 - 2 files changed, 7 insertions(+), 13 deletions(-) Index: llvm/lib/Target/IA64/IA64TargetMachine.cpp diff -u llvm/lib/Target/IA64/IA64TargetMachine.cpp:1.17 llvm/lib/Target/IA64/IA64TargetMachine.cpp:1.18 --- llvm/lib/Target/IA64/IA64TargetMachine.cpp:1.17 Fri Jun 16 13:22:52 2006 +++ llvm/lib/Target/IA64/IA64TargetMachine.cpp Sat Aug 26 16:33:05 2006 @@ -44,14 +44,6 @@ RegisterTarget X("ia64", " IA-64 (Itanium)"); } -unsigned IA64TargetMachine::compileTimeMatchQuality() { -#if defined(__ia64__) || defined(__IA64__) - return 50; -#else - return 0; -#endif -} - unsigned IA64TargetMachine::getModuleMatchQuality(const Module &M) { // we match [iI][aA]*64 bool seenIA64=false; @@ -65,12 +57,15 @@ seenIA64=true; } - if(seenIA64) - return 50; // strong match + if (seenIA64) + return 20; // strong match } - return compileTimeMatchQuality()/2; - +#if defined(__ia64__) || defined(__IA64__) + return 5; +#else + return 0; +#endif } /// IA64TargetMachine ctor - Create an LP64 architecture model Index: llvm/lib/Target/IA64/IA64TargetMachine.h diff -u llvm/lib/Target/IA64/IA64TargetMachine.h:1.11 llvm/lib/Target/IA64/IA64TargetMachine.h:1.12 --- llvm/lib/Target/IA64/IA64TargetMachine.h:1.11 Fri May 12 18:26:11 2006 +++ llvm/lib/Target/IA64/IA64TargetMachine.h Sat Aug 26 16:33:05 2006 @@ -46,7 +46,6 @@ CodeGenFileType FileType, bool Fast); static unsigned getModuleMatchQuality(const Module &M); - static unsigned compileTimeMatchQuality(void); }; } // End llvm namespace From lattner at cs.uiuc.edu Sun Aug 27 02:12:09 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 02:12:09 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/MappedFile.h Message-ID: <200608270712.k7R7C90B022815@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: MappedFile.h updated: 1.12 -> 1.13 --- Log message: make optional pointer really optional --- Diffs of the changes: (+1 -1) MappedFile.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/System/MappedFile.h diff -u llvm/include/llvm/System/MappedFile.h:1.12 llvm/include/llvm/System/MappedFile.h:1.13 --- llvm/include/llvm/System/MappedFile.h:1.12 Fri Aug 25 16:37:17 2006 +++ llvm/include/llvm/System/MappedFile.h Sun Aug 27 02:11:54 2006 @@ -123,7 +123,7 @@ /// occurred. /// @brief Map the file into memory. void* map( - std::string* ErrMsg ///< Optional error string pointer + std::string* ErrMsg = 0///< Optional error string pointer ); /// This method causes the size of the file, and consequently the size From evan.cheng at apple.com Sun Aug 27 03:08:22 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 27 Aug 2006 03:08:22 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h Message-ID: <200608270808.k7R88MVu028470@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.126 -> 1.127 SelectionDAGNodes.h updated: 1.143 -> 1.144 --- Log message: Eliminate SelectNodeTo() and getTargetNode() variants which take more than 3 SDOperand operands. They are replaced by versions which take an array of SDOperand and the number of operands. --- Diffs of the changes: (+16 -142) SelectionDAG.h | 76 ++++-------------------------------------------- SelectionDAGNodes.h | 82 +++++----------------------------------------------- 2 files changed, 16 insertions(+), 142 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.126 llvm/include/llvm/CodeGen/SelectionDAG.h:1.127 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.126 Sat Aug 26 02:55:35 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Sun Aug 27 03:07:55 2006 @@ -311,34 +311,14 @@ SDOperand Op1, SDOperand Op2); SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, - SDOperand Op7); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, - SDOperand Op7, SDOperand Op8); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, + const SDOperand *Ops, unsigned NumOps); SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2); SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5); + /// getTargetNode - These are used for target selectors to create a new node /// with specified return type(s), target opcode, and operands. @@ -354,23 +334,6 @@ SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, - SDOperand Op7); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, - SDOperand Op7, SDOperand Op8); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, const SDOperand *Ops, unsigned NumOps); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1); @@ -379,39 +342,14 @@ SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5, - SDOperand Op6); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5, - SDOperand Op6, SDOperand Op7); + SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, + MVT::ValueType VT2, + const SDOperand *Ops, unsigned NumOps); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, SDOperand Op1, SDOperand Op2); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, MVT::ValueType VT3, - SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, MVT::ValueType VT3, - SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5, - SDOperand Op6); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, MVT::ValueType VT3, - SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5, - SDOperand Op6, SDOperand Op7); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, + MVT::ValueType VT2, MVT::ValueType VT3, const SDOperand *Ops, unsigned NumOps); /// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead. Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.143 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.144 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.143 Wed Aug 16 16:01:10 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Sun Aug 27 03:07:55 2006 @@ -945,80 +945,16 @@ Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this); Op2.Val->Uses.push_back(this); } - void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3) { + void setOperands(const SDOperand *Ops, unsigned NumOps) { assert(NumOperands == 0 && "Should not have operands yet!"); - OperandList = new SDOperand[4]; - OperandList[0] = Op0; - OperandList[1] = Op1; - OperandList[2] = Op2; - OperandList[3] = Op3; - NumOperands = 4; - Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this); - Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this); - } - void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4) { - assert(NumOperands == 0 && "Should not have operands yet!"); - OperandList = new SDOperand[5]; - OperandList[0] = Op0; - OperandList[1] = Op1; - OperandList[2] = Op2; - OperandList[3] = Op3; - OperandList[4] = Op4; - NumOperands = 5; - Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this); - Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this); - Op4.Val->Uses.push_back(this); - } - void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5) { - assert(NumOperands == 0 && "Should not have operands yet!"); - OperandList = new SDOperand[6]; - OperandList[0] = Op0; - OperandList[1] = Op1; - OperandList[2] = Op2; - OperandList[3] = Op3; - OperandList[4] = Op4; - OperandList[5] = Op5; - NumOperands = 6; - Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this); - Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this); - Op4.Val->Uses.push_back(this); Op5.Val->Uses.push_back(this); - } - void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6) { - assert(NumOperands == 0 && "Should not have operands yet!"); - OperandList = new SDOperand[7]; - OperandList[0] = Op0; - OperandList[1] = Op1; - OperandList[2] = Op2; - OperandList[3] = Op3; - OperandList[4] = Op4; - OperandList[5] = Op5; - OperandList[6] = Op6; - NumOperands = 7; - Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this); - Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this); - Op4.Val->Uses.push_back(this); Op5.Val->Uses.push_back(this); - Op6.Val->Uses.push_back(this); - } - void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, SDOperand Op7) { - assert(NumOperands == 0 && "Should not have operands yet!"); - OperandList = new SDOperand[8]; - OperandList[0] = Op0; - OperandList[1] = Op1; - OperandList[2] = Op2; - OperandList[3] = Op3; - OperandList[4] = Op4; - OperandList[5] = Op5; - OperandList[6] = Op6; - OperandList[7] = Op7; - NumOperands = 8; - Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this); - Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this); - Op4.Val->Uses.push_back(this); Op5.Val->Uses.push_back(this); - Op6.Val->Uses.push_back(this); Op7.Val->Uses.push_back(this); + NumOperands = NumOps; + OperandList = new SDOperand[NumOperands]; + + for (unsigned i = 0, e = NumOps; i != e; ++i) { + OperandList[i] = Ops[i]; + SDNode *N = OperandList[i].Val; + N->Uses.push_back(this); + } } void addUser(SDNode *User) { From evan.cheng at apple.com Sun Aug 27 03:09:08 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 27 Aug 2006 03:09:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200608270809.k7R898ms028495@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.334 -> 1.335 --- Log message: Eliminate SelectNodeTo() and getTargetNode() variants which take more than 3 SDOperand operands. They are replaced by versions which take an array of SDOperand and the number of operands. --- Diffs of the changes: (+12 -254) SelectionDAG.cpp | 266 ++----------------------------------------------------- 1 files changed, 12 insertions(+), 254 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.334 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.335 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.334 Sat Aug 26 02:56:00 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Sun Aug 27 03:08:54 2006 @@ -1908,93 +1908,13 @@ } SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT, SDOperand Op1, - SDOperand Op2, SDOperand Op3, - SDOperand Op4) { + MVT::ValueType VT, const SDOperand *Ops, + unsigned NumOps) { // If an identical node already exists, use it. SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); - ID.AddOperand(Op1); - ID.AddOperand(Op2); - ID.AddOperand(Op3); - ID.AddOperand(Op4); - void *IP = 0; - if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return ON; - - RemoveNodeFromCSEMaps(N); - N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs); - N->setOperands(Op1, Op2, Op3, Op4); - - CSEMap.InsertNode(N, IP); // Memoize the new node. - return N; -} - -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT, SDOperand Op1, - SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5) { - SDVTList VTs = getVTList(VT); - SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); - ID.AddOperand(Op1); - ID.AddOperand(Op2); - ID.AddOperand(Op3); - ID.AddOperand(Op4); - ID.AddOperand(Op5); - void *IP = 0; - if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return ON; - - RemoveNodeFromCSEMaps(N); - N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs); - N->setOperands(Op1, Op2, Op3, Op4, Op5); - - CSEMap.InsertNode(N, IP); // Memoize the new node. - return N; -} - -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT, SDOperand Op1, - SDOperand Op2, SDOperand Op3, SDOperand Op4, - SDOperand Op5, SDOperand Op6) { - SDVTList VTs = getVTList(VT); - SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); - ID.AddOperand(Op1); - ID.AddOperand(Op2); - ID.AddOperand(Op3); - ID.AddOperand(Op4); - ID.AddOperand(Op5); - ID.AddOperand(Op6); - void *IP = 0; - if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return ON; - - RemoveNodeFromCSEMaps(N); - N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs); - N->setOperands(Op1, Op2, Op3, Op4, Op5, Op6); - - CSEMap.InsertNode(N, IP); // Memoize the new node. - return N; -} - -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT, SDOperand Op1, - SDOperand Op2, SDOperand Op3,SDOperand Op4, - SDOperand Op5, SDOperand Op6, - SDOperand Op7) { - SDVTList VTs = getVTList(VT); - // If an identical node already exists, use it. - SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); - ID.AddOperand(Op1); - ID.AddOperand(Op2); - ID.AddOperand(Op3); - ID.AddOperand(Op4); - ID.AddOperand(Op5); - ID.AddOperand(Op6); - ID.AddOperand(Op7); + for (unsigned i = 0; i != NumOps; ++i) + ID.AddOperand(Ops[i]); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) return ON; @@ -2002,35 +1922,7 @@ RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); N->setValueTypes(VTs); - N->setOperands(Op1, Op2, Op3, Op4, Op5, Op6, Op7); - - CSEMap.InsertNode(N, IP); // Memoize the new node. - return N; -} -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT, SDOperand Op1, - SDOperand Op2, SDOperand Op3,SDOperand Op4, - SDOperand Op5, SDOperand Op6, - SDOperand Op7, SDOperand Op8) { - // If an identical node already exists, use it. - SDVTList VTs = getVTList(VT); - SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); - ID.AddOperand(Op1); - ID.AddOperand(Op2); - ID.AddOperand(Op3); - ID.AddOperand(Op4); - ID.AddOperand(Op5); - ID.AddOperand(Op6); - ID.AddOperand(Op7); - ID.AddOperand(Op8); - void *IP = 0; - if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return ON; - - RemoveNodeFromCSEMaps(N); - N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs); - N->setOperands(Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8); + N->setOperands(Ops, NumOps); CSEMap.InsertNode(N, IP); // Memoize the new node. return N; @@ -2075,55 +1967,6 @@ return N; } -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT1, MVT::ValueType VT2, - SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4) { - // If an identical node already exists, use it. - SDVTList VTs = getVTList(VT1, VT2); - SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); - ID.AddOperand(Op1); - ID.AddOperand(Op2); - ID.AddOperand(Op3); - ID.AddOperand(Op4); - void *IP = 0; - if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return ON; - - RemoveNodeFromCSEMaps(N); - N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs); - N->setOperands(Op1, Op2, Op3, Op4); - - CSEMap.InsertNode(N, IP); // Memoize the new node. - return N; -} - -SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT1, MVT::ValueType VT2, - SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, - SDOperand Op5) { - // If an identical node already exists, use it. - SDVTList VTs = getVTList(VT1, VT2); - SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); - ID.AddOperand(Op1); - ID.AddOperand(Op2); - ID.AddOperand(Op3); - ID.AddOperand(Op4); - ID.AddOperand(Op5); - void *IP = 0; - if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) - return ON; - - RemoveNodeFromCSEMaps(N); - N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs); - N->setOperands(Op1, Op2, Op3, Op4, Op5); - - CSEMap.InsertNode(N, IP); // Memoize the new node. - return N; -} /// getTargetNode - These are used for target selectors to create a new node /// with specified return type(s), target opcode, and operands. @@ -2147,37 +1990,6 @@ return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2, Op3).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4) { - return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2, Op3, Op4).Val; -} -SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5) { - return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2, Op3, Op4, Op5).Val; -} -SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, - SDOperand Op6) { - SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops, 6).Val; -} -SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, - SDOperand Op7) { - SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6, Op7 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops, 7).Val; -} -SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, - SDOperand Op7, SDOperand Op8) { - SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops, 8).Val; -} -SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT, const SDOperand *Ops, unsigned NumOps) { return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops, NumOps).Val; } @@ -2200,38 +2012,11 @@ SDOperand Ops[] = { Op1, Op2, Op3 }; return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 3).Val; } -SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, - SDOperand Op2, SDOperand Op3, - SDOperand Op4) { - const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); - SDOperand Ops[] = { Op1, Op2, Op3, Op4 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 4).Val; -} -SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, - SDOperand Op2, SDOperand Op3, SDOperand Op4, - SDOperand Op5) { - const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); - SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 5).Val; -} -SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, - SDOperand Op2, SDOperand Op3, SDOperand Op4, - SDOperand Op5, SDOperand Op6) { - const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); - SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 6).Val; -} -SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, - SDOperand Op2, SDOperand Op3, SDOperand Op4, - SDOperand Op5, SDOperand Op6, - SDOperand Op7) { +SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, + MVT::ValueType VT2, + const SDOperand *Ops, unsigned NumOps) { const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); - SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6, Op7 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 7).Val; + return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, NumOps).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, @@ -2240,38 +2025,11 @@ SDOperand Ops[] = { Op1, Op2 }; return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 2).Val; } -SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, MVT::ValueType VT3, - SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, - SDOperand Op5) { - const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); - SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 5).Val; -} -SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, MVT::ValueType VT3, - SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5, - SDOperand Op6) { - const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); - SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 6).Val; -} -SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, MVT::ValueType VT3, - SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5, - SDOperand Op6, SDOperand Op7) { - const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); - SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6, Op7 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 7).Val; -} SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, + MVT::ValueType VT2, MVT::ValueType VT3, const SDOperand *Ops, unsigned NumOps) { - const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); - return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, NumOps).Val; + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); + return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, NumOps).Val; } /// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead. From evan.cheng at apple.com Sun Aug 27 03:11:42 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 27 Aug 2006 03:11:42 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200608270811.k7R8Bg6I028574@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.251 -> 1.252 --- Log message: Do not emit getTargetNode() and SelectNodeTo() which takes more than 3 SDOperand arguments. Use the variants which take an array and number instead. --- Diffs of the changes: (+71 -42) DAGISelEmitter.cpp | 113 +++++++++++++++++++++++++++++++++-------------------- 1 files changed, 71 insertions(+), 42 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.251 llvm/utils/TableGen/DAGISelEmitter.cpp:1.252 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.251 Sat Aug 26 02:56:39 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Sun Aug 27 03:11:28 2006 @@ -2583,7 +2583,7 @@ "(N.getOperand(N.getNumOperands()-1).getValueType() == MVT::Flag);"); } if (HasVarOps) - emitCode("SmallVector Ops;"); + emitCode("SmallVector Ops" + utostr(OpcNo) + ";"); // How many results is this pattern expected to produce? unsigned PatResults = 0; @@ -2607,15 +2607,17 @@ if (NodeHasInFlag || HasImpInputs) EmitInFlagSelectCode(Pattern, "N", ChainEmitted, InFlagDecled, ResNodeDecled, true); - if (NodeHasOptInFlag) { + if (NodeHasOptInFlag || NodeHasInFlag || HasImpInputs) { if (!InFlagDecled) { emitCode("SDOperand InFlag(0, 0);"); InFlagDecled = true; } - emitCode("if (HasInFlag) {"); - emitCode(" InFlag = N.getOperand(N.getNumOperands()-1);"); - emitCode(" AddToISelQueue(InFlag);"); - emitCode("}"); + if (NodeHasOptInFlag) { + emitCode("if (HasInFlag) {"); + emitCode(" InFlag = N.getOperand(N.getNumOperands()-1);"); + emitCode(" AddToISelQueue(InFlag);"); + emitCode("}"); + } } unsigned NumResults = Inst.getNumResults(); @@ -2635,7 +2637,9 @@ else Code2 = NodeName + " = "; } + Code = "CurDAG->getTargetNode(Opc" + utostr(OpcNo); + unsigned OpsNo = OpcNo; emitOpcode(II.Namespace + "::" + II.TheDef->getName()); // Output order: results, chain, flags @@ -2650,12 +2654,10 @@ Code += ", MVT::Flag"; // Inputs. - for (unsigned i = 0, e = AllOps.size(); i != e; ++i) { - std::string OpName = AllOps[i]; - if (HasVarOps) - emitCode("Ops.push_back(" + OpName + ");"); - else - Code += ", " + OpName; + if (HasVarOps) { + for (unsigned i = 0, e = AllOps.size(); i != e; ++i) + emitCode("Ops" + utostr(OpsNo) + ".push_back(" + AllOps[i] + ");"); + AllOps.clear(); } if (HasVarOps) { @@ -2669,40 +2671,51 @@ emitCode("for (unsigned i = 2, e = N.getNumOperands(); " "i != e; ++i) {"); emitCode(" AddToISelQueue(N.getOperand(i));"); - emitCode(" Ops.push_back(N.getOperand(i));"); + emitCode(" Ops" + utostr(OpsNo) + ".push_back(N.getOperand(i));"); emitCode("}"); } if (NodeHasChain) { if (HasVarOps) - emitCode("Ops.push_back(" + ChainName + ");"); + emitCode("Ops" + utostr(OpsNo) + ".push_back(" + ChainName + ");"); else - Code += ", " + ChainName; + AllOps.push_back(ChainName); } - if (NodeHasInFlag || HasImpInputs) { - if (!InFlagDecled) { - emitCode("SDOperand InFlag(0, 0);"); - InFlagDecled = true; + + if (HasVarOps) { + if (NodeHasInFlag || HasImpInputs) + emitCode("Ops" + utostr(OpsNo) + ".push_back(InFlag);"); + else if (NodeHasOptInFlag) { + emitCode("if (HasInFlag)"); + emitCode(" Ops" + utostr(OpsNo) + ".push_back(InFlag);"); } - if (HasVarOps) { - emitCode("Ops.push_back(InFlag);"); - } else - Code += ", InFlag"; - } else if (NodeHasOptInFlag && HasVarOps) { - if (!InFlagDecled) { - emitCode("SDOperand InFlag(0, 0);"); - InFlagDecled = true; + Code += ", &Ops" + utostr(OpsNo) + "[0], Ops" + utostr(OpsNo) + + ".size()"; + } else if (NodeHasInFlag || NodeHasOptInFlag || HasImpInputs) + AllOps.push_back("InFlag"); + + unsigned NumOps = AllOps.size(); + if (NumOps) { + if (!NodeHasOptInFlag && NumOps < 4) { + for (unsigned i = 0; i != NumOps; ++i) + Code += ", " + AllOps[i]; + } else { + std::string OpsCode = "SDOperand Ops" + utostr(OpsNo) + "[] = { "; + for (unsigned i = 0; i != NumOps; ++i) { + OpsCode += AllOps[i]; + if (i != NumOps-1) + OpsCode += ", "; + } + emitCode(OpsCode + " };"); + Code += ", Ops" + utostr(OpsNo) + ", "; + if (NodeHasOptInFlag) { + Code += "HasInFlag ? "; + Code += utostr(NumOps) + " : " + utostr(NumOps-1); + } else + Code += utostr(NumOps); } - emitCode("if (HasInFlag)"); - emitCode(" Ops.push_back(InFlag);"); - } - - if (HasVarOps) - Code += ", &Ops[0], Ops.size()"; - else if (NodeHasOptInFlag) { - Code = "HasInFlag ? " + Code + ", InFlag) : " + Code; } - + if (!isRoot) Code += "), 0"; emitCode(Code2 + Code + ");"); @@ -2761,9 +2774,8 @@ emitCode("ReplaceUses(SDOperand(N.Val, " + utostr(PatResults) + "), SDOperand(" + ChainName + ".Val, " + ChainName + ".ResNo" + "));"); - } else { + } else RetSelected = true; - } // User does not expect the instruction would produce a chain! if ((!InputHasChain && NodeHasChain) && NodeHasOutFlag) { @@ -2792,10 +2804,27 @@ Code += ", VT" + utostr(VTNo); if (NodeHasOutFlag) Code += ", MVT::Flag"; - for (unsigned i = 0, e = AllOps.size(); i != e; ++i) - Code += ", " + AllOps[i]; - if (NodeHasInFlag || HasImpInputs) - Code += ", InFlag"; + + if (NodeHasInFlag || NodeHasOptInFlag || HasImpInputs) + AllOps.push_back("InFlag"); + + unsigned NumOps = AllOps.size(); + if (NumOps) { + if (!NodeHasOptInFlag && NumOps < 4) { + for (unsigned i = 0; i != NumOps; ++i) + Code += ", " + AllOps[i]; + } else { + std::string OpsCode = "SDOperand Ops" + utostr(OpcNo) + "[] = { "; + for (unsigned i = 0; i != NumOps; ++i) { + OpsCode += AllOps[i]; + if (i != NumOps-1) + OpsCode += ", "; + } + emitCode(OpsCode + " };"); + Code += ", Ops" + utostr(OpcNo) + ", "; + Code += utostr(NumOps); + } + } emitCode(Code + ");"); emitOpcode(II.Namespace + "::" + II.TheDef->getName()); if (N->getTypeNum(0) != MVT::isVoid) From evan.cheng at apple.com Sun Aug 27 03:12:42 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 27 Aug 2006 03:12:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Message-ID: <200608270812.k7R8CguL028607@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaISelDAGToDAG.cpp updated: 1.54 -> 1.55 --- Log message: Do not use getTargetNode() and SelectNodeTo() which takes more than 3 SDOperand arguments. Use the variants which take an array and number instead. --- Diffs of the changes: (+5 -4) AlphaISelDAGToDAG.cpp | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.54 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.55 --- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.54 Sat Aug 26 02:57:39 2006 +++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Sun Aug 27 03:12:27 2006 @@ -442,10 +442,11 @@ Opc = Alpha::STT; } else assert(0 && "Unknown operand"); - Chain = SDOperand(CurDAG->getTargetNode(Opc, MVT::Other, CallOperands[i], - getI64Imm((i - 6) * 8), - CurDAG->getCopyFromReg(Chain, Alpha::R30, MVT::i64), - Chain), 0); + + SDOperand Ops[] = { CallOperands[i], getI64Imm((i - 6) * 8), + CurDAG->getCopyFromReg(Chain, Alpha::R30, MVT::i64), + Chain }; + Chain = SDOperand(CurDAG->getTargetNode(Opc, MVT::Other, Ops, 4), 0); } for (int i = 0; i < std::min(6, count); ++i) { if (MVT::isInteger(TypeOperands[i])) { From evan.cheng at apple.com Sun Aug 27 03:13:05 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 27 Aug 2006 03:13:05 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp Message-ID: <200608270813.k7R8D55O028624@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64ISelDAGToDAG.cpp updated: 1.52 -> 1.53 --- Log message: Do not use getTargetNode() and SelectNodeTo() which takes more than 3 SDOperand arguments. Use the variants which take an array and number instead. --- Diffs of the changes: (+27 -15) IA64ISelDAGToDAG.cpp | 42 +++++++++++++++++++++++++++--------------- 1 files changed, 27 insertions(+), 15 deletions(-) Index: llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp diff -u llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.52 llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.53 --- llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.52 Sat Aug 26 02:57:56 2006 +++ llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp Sun Aug 27 03:12:51 2006 @@ -204,18 +204,22 @@ } SDOperand TmpE0, TmpY1, TmpE1, TmpY2; - + + SDOperand OpsE0[] = { TmpF4, TmpF5, F1, TmpPR }; TmpE0 = SDOperand(CurDAG->getTargetNode(IA64::CFNMAS1, MVT::f64, - TmpF4, TmpF5, F1, TmpPR), 0); + OpsE0, 4), 0); Chain = TmpE0.getValue(1); + SDOperand OpsY1[] = { TmpF5, TmpE0, TmpF5, TmpPR }; TmpY1 = SDOperand(CurDAG->getTargetNode(IA64::CFMAS1, MVT::f64, - TmpF5, TmpE0, TmpF5, TmpPR), 0); + OpsY1, 4), 0); Chain = TmpY1.getValue(1); + SDOperand OpsE1[] = { TmpE0, TmpE0, F0, TmpPR }; TmpE1 = SDOperand(CurDAG->getTargetNode(IA64::CFMAS1, MVT::f64, - TmpE0, TmpE0, F0, TmpPR), 0); + OpsE1, 4), 0); Chain = TmpE1.getValue(1); + SDOperand OpsY2[] = { TmpY1, TmpE1, TmpY1, TmpPR }; TmpY2 = SDOperand(CurDAG->getTargetNode(IA64::CFMAS1, MVT::f64, - TmpY1, TmpE1, TmpY1, TmpPR), 0); + OpsY2, 4), 0); Chain = TmpY2.getValue(1); if(isFP) { // if this is an FP divide, we finish up here and exit early @@ -223,45 +227,53 @@ assert(0 && "Sorry, try another FORTRAN compiler."); SDOperand TmpE2, TmpY3, TmpQ0, TmpR0; - + + SDOperand OpsE2[] = { TmpE1, TmpE1, F0, TmpPR }; TmpE2 = SDOperand(CurDAG->getTargetNode(IA64::CFMAS1, MVT::f64, - TmpE1, TmpE1, F0, TmpPR), 0); + OpsE2, 4), 0); Chain = TmpE2.getValue(1); + SDOperand OpsY3[] = { TmpY2, TmpE2, TmpY2, TmpPR }; TmpY3 = SDOperand(CurDAG->getTargetNode(IA64::CFMAS1, MVT::f64, - TmpY2, TmpE2, TmpY2, TmpPR), 0); + OpsY3, 4), 0); Chain = TmpY3.getValue(1); + SDOperand OpsQ0[] = { Tmp1, TmpY3, F0, TmpPR }; TmpQ0 = SDOperand(CurDAG->getTargetNode(IA64::CFMADS1, MVT::f64, // double prec! - Tmp1, TmpY3, F0, TmpPR), 0); + OpsQ0, 4), 0); Chain = TmpQ0.getValue(1); + SDOperand OpsR0[] = { Tmp2, TmpQ0, Tmp1, TmpPR }; TmpR0 = SDOperand(CurDAG->getTargetNode(IA64::CFNMADS1, MVT::f64, // double prec! - Tmp2, TmpQ0, Tmp1, TmpPR), 0); + OpsR0, 4), 0); Chain = TmpR0.getValue(1); // we want Result to have the same target register as the frcpa, so // we two-address hack it. See the comment "for this to work..." on // page 48 of Intel application note #245415 + SDOperand Ops[] = { TmpF5, TmpY3, TmpR0, TmpQ0, TmpPR }; Result = CurDAG->getTargetNode(IA64::TCFMADS0, MVT::f64, // d.p. s0 rndg! - TmpF5, TmpY3, TmpR0, TmpQ0, TmpPR); + Ops, 5); Chain = SDOperand(Result, 1); return Result; // XXX: early exit! } else { // this is *not* an FP divide, so there's a bit left to do: SDOperand TmpQ2, TmpR2, TmpQ3, TmpQ; - + + SDOperand OpsQ2[] = { TmpF3, TmpY2, F0, TmpPR }; TmpQ2 = SDOperand(CurDAG->getTargetNode(IA64::CFMAS1, MVT::f64, - TmpF3, TmpY2, F0, TmpPR), 0); + OpsQ2, 4), 0); Chain = TmpQ2.getValue(1); + SDOperand OpsR2[] = { TmpF4, TmpQ2, TmpF3, TmpPR }; TmpR2 = SDOperand(CurDAG->getTargetNode(IA64::CFNMAS1, MVT::f64, - TmpF4, TmpQ2, TmpF3, TmpPR), 0); + OpsR2, 4), 0); Chain = TmpR2.getValue(1); // we want TmpQ3 to have the same target register as the frcpa? maybe we // should two-address hack it. See the comment "for this to work..." on page // 48 of Intel application note #245415 + SDOperand OpsQ3[] = { TmpF5, TmpR2, TmpY2, TmpQ2, TmpPR }; TmpQ3 = SDOperand(CurDAG->getTargetNode(IA64::TCFMAS1, MVT::f64, - TmpF5, TmpR2, TmpY2, TmpQ2, TmpPR), 0); + OpsQ3, 5), 0); Chain = TmpQ3.getValue(1); // STORY: without these two-address instructions (TCFMAS1 and TCFMADS0) From evan.cheng at apple.com Sun Aug 27 03:13:59 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 27 Aug 2006 03:13:59 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Message-ID: <200608270813.k7R8DxuS028654@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.206 -> 1.207 --- Log message: Do not use getTargetNode() and SelectNodeTo() which takes more than 3 SDOperand arguments. Use the variants which take an array and number instead. --- Diffs of the changes: (+41 -43) PPCISelDAGToDAG.cpp | 84 +++++++++++++++++++++++++--------------------------- 1 files changed, 41 insertions(+), 43 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.206 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.207 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.206 Sat Aug 26 02:58:11 2006 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Sun Aug 27 03:13:45 2006 @@ -457,8 +457,9 @@ AddToISelQueue(Tmp3); AddToISelQueue(Op1); SH &= 31; - return CurDAG->getTargetNode(PPC::RLWIMI, MVT::i32, Tmp3, Op1, - getI32Imm(SH), getI32Imm(MB), getI32Imm(ME)); + SDOperand Ops[] = { Tmp3, Op1, getI32Imm(SH), getI32Imm(MB), + getI32Imm(ME) }; + return CurDAG->getTargetNode(PPC::RLWIMI, MVT::i32, Ops, 5); } } return 0; @@ -809,10 +810,11 @@ AddToISelQueue(Op); switch (CC) { default: break; - case ISD::SETEQ: + case ISD::SETEQ: { Op = SDOperand(CurDAG->getTargetNode(PPC::CNTLZW, MVT::i32, Op), 0); - return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Op, getI32Imm(27), - getI32Imm(5), getI32Imm(31)); + SDOperand Ops[] = { Op, getI32Imm(27), getI32Imm(5), getI32Imm(31) }; + return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4); + } case ISD::SETNE: { SDOperand AD = SDOperand(CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag, @@ -820,15 +822,16 @@ return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, AD, Op, AD.getValue(1)); } - case ISD::SETLT: - return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Op, getI32Imm(1), - getI32Imm(31), getI32Imm(31)); + case ISD::SETLT: { + SDOperand Ops[] = { Op, getI32Imm(1), getI32Imm(31), getI32Imm(31) }; + return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4); + } case ISD::SETGT: { SDOperand T = SDOperand(CurDAG->getTargetNode(PPC::NEG, MVT::i32, Op), 0); T = SDOperand(CurDAG->getTargetNode(PPC::ANDC, MVT::i32, T, Op), 0); - return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, T, getI32Imm(1), - getI32Imm(31), getI32Imm(31)); + SDOperand Ops[] = { T, getI32Imm(1), getI32Imm(31), getI32Imm(31) }; + return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4); } } } else if (Imm == ~0U) { // setcc op, -1 @@ -855,16 +858,16 @@ getI32Imm(1)), 0); SDOperand AN = SDOperand(CurDAG->getTargetNode(PPC::AND, MVT::i32, AD, Op), 0); - return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, AN, getI32Imm(1), - getI32Imm(31), getI32Imm(31)); + SDOperand Ops[] = { AN, getI32Imm(1), getI32Imm(31), getI32Imm(31) }; + return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4); } - case ISD::SETGT: - Op = SDOperand(CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, Op, - getI32Imm(1), getI32Imm(31), - getI32Imm(31)), 0); + case ISD::SETGT: { + SDOperand Ops[] = { Op, getI32Imm(1), getI32Imm(31), getI32Imm(31) }; + Op = SDOperand(CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, Ops, 4), 0); return CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Op, getI32Imm(1)); } + } } } @@ -886,15 +889,13 @@ else IntCR = SDOperand(CurDAG->getTargetNode(PPC::MFCR, MVT::i32, CCReg), 0); + SDOperand Ops[] = { IntCR, getI32Imm((32-(3-Idx)) & 31), + getI32Imm(31), getI32Imm(31) }; if (!Inv) { - return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, IntCR, - getI32Imm((32-(3-Idx)) & 31), - getI32Imm(31), getI32Imm(31)); + return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4); } else { SDOperand Tmp = - SDOperand(CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, IntCR, - getI32Imm((32-(3-Idx)) & 31), - getI32Imm(31),getI32Imm(31)), 0); + SDOperand(CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, Ops, 4), 0); return CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Tmp, getI32Imm(1)); } } @@ -990,9 +991,8 @@ isRunOfOnes(Imm, MB, ME); SH = 0; } - return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Val, - getI32Imm(SH), getI32Imm(MB), - getI32Imm(ME)); + SDOperand Ops[] = { Val, getI32Imm(SH), getI32Imm(MB), getI32Imm(ME) }; + return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4); } // ISD::OR doesn't get all the bitfield insertion fun. // (and (or x, c1), c2) where isRunOfOnes(~(c1^c2)) is a bitfield insert @@ -1004,10 +1004,10 @@ if (isRunOfOnes(Imm, MB, ME)) { AddToISelQueue(N->getOperand(0).getOperand(0)); AddToISelQueue(N->getOperand(0).getOperand(1)); - return CurDAG->getTargetNode(PPC::RLWIMI, MVT::i32, - N->getOperand(0).getOperand(0), - N->getOperand(0).getOperand(1), - getI32Imm(0), getI32Imm(MB),getI32Imm(ME)); + SDOperand Ops[] = { N->getOperand(0).getOperand(0), + N->getOperand(0).getOperand(1), + getI32Imm(0), getI32Imm(MB),getI32Imm(ME) }; + return CurDAG->getTargetNode(PPC::RLWIMI, MVT::i32, Ops, 5); } } @@ -1026,10 +1026,9 @@ if (isOpcWithIntImmediate(N->getOperand(0).Val, ISD::AND, Imm) && isRotateAndMask(N, Imm, true, SH, MB, ME)) { AddToISelQueue(N->getOperand(0).getOperand(0)); - return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, - N->getOperand(0).getOperand(0), - getI32Imm(SH), getI32Imm(MB), - getI32Imm(ME)); + SDOperand Ops[] = { N->getOperand(0).getOperand(0), + getI32Imm(SH), getI32Imm(MB), getI32Imm(ME) }; + return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4); } // Other cases are autogenerated. @@ -1040,10 +1039,9 @@ if (isOpcWithIntImmediate(N->getOperand(0).Val, ISD::AND, Imm) && isRotateAndMask(N, Imm, true, SH, MB, ME)) { AddToISelQueue(N->getOperand(0).getOperand(0)); - return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, - N->getOperand(0).getOperand(0), - getI32Imm(SH), getI32Imm(MB), - getI32Imm(ME)); + SDOperand Ops[] = { N->getOperand(0).getOperand(0), + getI32Imm(SH), getI32Imm(MB), getI32Imm(ME) }; + return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4); } // Other cases are autogenerated. @@ -1087,17 +1085,17 @@ AddToISelQueue(N->getOperand(2)); AddToISelQueue(N->getOperand(3)); - return CurDAG->SelectNodeTo(N, SelectCCOp, N->getValueType(0), CCReg, - N->getOperand(2), N->getOperand(3), - getI32Imm(BROpc)); + SDOperand Ops[] = { CCReg, N->getOperand(2), N->getOperand(3), + getI32Imm(BROpc) }; + return CurDAG->SelectNodeTo(N, SelectCCOp, N->getValueType(0), Ops, 4); } case ISD::BR_CC: { AddToISelQueue(N->getOperand(0)); ISD::CondCode CC = cast(N->getOperand(1))->get(); SDOperand CondCode = SelectCC(N->getOperand(2), N->getOperand(3), CC); - return CurDAG->SelectNodeTo(N, PPC::COND_BRANCH, MVT::Other, - CondCode, getI32Imm(getBCCForSetCC(CC)), - N->getOperand(4), N->getOperand(0)); + SDOperand Ops[] = { CondCode, getI32Imm(getBCCForSetCC(CC)), + N->getOperand(4), N->getOperand(0) }; + return CurDAG->SelectNodeTo(N, PPC::COND_BRANCH, MVT::Other, Ops, 4); } case ISD::BRIND: { // FIXME: Should custom lower this. From evan.cheng at apple.com Sun Aug 27 03:14:20 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 27 Aug 2006 03:14:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Message-ID: <200608270814.k7R8EKsA028671@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelDAGToDAG.cpp updated: 1.96 -> 1.97 --- Log message: Do not use getTargetNode() and SelectNodeTo() which takes more than 3 SDOperand arguments. Use the variants which take an array and number instead. --- Diffs of the changes: (+4 -4) X86ISelDAGToDAG.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.96 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.97 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.96 Sat Aug 26 03:00:10 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Sun Aug 27 03:14:06 2006 @@ -723,9 +723,9 @@ AddToISelQueue(Tmp1); AddToISelQueue(Tmp2); AddToISelQueue(Tmp3); + SDOperand Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, Chain, InFlag }; SDNode *CNode = - CurDAG->getTargetNode(MOpc, MVT::Other, MVT::Flag, Tmp0, Tmp1, - Tmp2, Tmp3, Chain, InFlag); + CurDAG->getTargetNode(MOpc, MVT::Other, MVT::Flag, Ops, 6); Chain = SDOperand(CNode, 0); InFlag = SDOperand(CNode, 1); } else { @@ -827,9 +827,9 @@ AddToISelQueue(Tmp1); AddToISelQueue(Tmp2); AddToISelQueue(Tmp3); + SDOperand Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, Chain, InFlag }; SDNode *CNode = - CurDAG->getTargetNode(MOpc, MVT::Other, MVT::Flag, Tmp0, Tmp1, - Tmp2, Tmp3, Chain, InFlag); + CurDAG->getTargetNode(MOpc, MVT::Other, MVT::Flag, Ops, 6); Chain = SDOperand(CNode, 0); InFlag = SDOperand(CNode, 1); } else { From lattner at cs.uiuc.edu Sun Aug 27 07:43:05 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 07:43:05 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Compiler.h Message-ID: <200608271243.k7RCh56b000948@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Compiler.h added (r1.1) --- Log message: New place to put compiler-specific functionality. This replaces Visibility.h, and provides macros that can be used to make explicit instantiations of template specializations, which is a gcc-specific feature. --- Diffs of the changes: (+40 -0) Compiler.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+) Index: llvm/include/llvm/Support/Compiler.h diff -c /dev/null llvm/include/llvm/Support/Compiler.h:1.1 *** /dev/null Sun Aug 27 07:42:56 2006 --- llvm/include/llvm/Support/Compiler.h Sun Aug 27 07:42:45 2006 *************** *** 0 **** --- 1,40 ---- + //===-- llvm/Support/Compiler.h - Compiler abstraction support --*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Chris Lattner and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines several macros, based on the current compiler. This allows + // use of compiler-specific features in a way that remains portable. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_SUPPORT_COMPILER_H + #define LLVM_SUPPORT_COMPILER_H + + // The VISIBILITY_HIDDEN macro, used for marking classes with the GCC-specific + // visibility("hidden") attribute. + #if __GNUC__ >= 4 + #define VISIBILITY_HIDDEN __attribute__ ((visibility("hidden"))) + #else + #define VISIBILITY_HIDDEN + #endif + + + // C++ doesn't support 'extern template' of template specializations. GCC does, + // but requires __extension__ before it. In the header, use this: + // EXTERN_TEMPLATE_INSTANTIATION(class foo); + // in the .cpp file, use this: + // TEMPLATE_INSTANTIATION(class foo); + #ifdef __GNUC__ + #define EXTERN_TEMPLATE_INSTANTIATION(X) __extension__ extern template X + #define TEMPLATE_INSTANTIATION(X) template X + #else + #define EXTERN_TEMPLATE_INSTANTIATION(X) + #define TEMPLATE_INSTANTIATION(X) + #endif + + #endif From lattner at cs.uiuc.edu Sun Aug 27 07:46:02 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 07:46:02 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/CommandLine.h Message-ID: <200608271246.k7RCk2JM001058@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: CommandLine.h updated: 1.55 -> 1.56 --- Log message: Add external definitions for commonly-used template specializations and add anchor methods to others. This eliminates the vtable/template method bloat in .o files that defining a cl::opt used to impose (~4K per .o file for one cp::opt). --- Diffs of the changes: (+37 -2) CommandLine.h | 39 +++++++++++++++++++++++++++++++++++++-- 1 files changed, 37 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Support/CommandLine.h diff -u llvm/include/llvm/Support/CommandLine.h:1.55 llvm/include/llvm/Support/CommandLine.h:1.56 --- llvm/include/llvm/Support/CommandLine.h:1.55 Tue Jul 18 18:59:33 2006 +++ llvm/include/llvm/Support/CommandLine.h Sun Aug 27 07:45:46 2006 @@ -22,6 +22,7 @@ #include "llvm/Support/type_traits.h" #include "llvm/Support/DataTypes.h" +#include "llvm/Support/Compiler.h" #include #include #include @@ -509,6 +510,9 @@ // getValueName - Overload in subclass to provide a better default value. virtual const char *getValueName() const { return "value"; } + + // An out-of-line virtual method to provide a 'home' for this class. + virtual void anchor(); }; // basic_parser - The real basic parser is just a template wrapper that provides @@ -519,7 +523,6 @@ typedef DataType parser_data_type; }; - //-------------------------------------------------- // parser // @@ -533,10 +536,15 @@ return ValueOptional; } - // getValueName - Do not print = at all + // getValueName - Do not print = at all. virtual const char *getValueName() const { return 0; } + + // An out-of-line virtual method to provide a 'home' for this class. + virtual void anchor(); }; +EXTERN_TEMPLATE_INSTANTIATION(class basic_parser); + //-------------------------------------------------- // parser @@ -549,8 +557,13 @@ // getValueName - Overload in subclass to provide a better default value. virtual const char *getValueName() const { return "int"; } + + // An out-of-line virtual method to provide a 'home' for this class. + virtual void anchor(); }; +EXTERN_TEMPLATE_INSTANTIATION(class basic_parser); + //-------------------------------------------------- // parser @@ -563,8 +576,12 @@ // getValueName - Overload in subclass to provide a better default value. virtual const char *getValueName() const { return "uint"; } + + // An out-of-line virtual method to provide a 'home' for this class. + virtual void anchor(); }; +EXTERN_TEMPLATE_INSTANTIATION(class basic_parser); //-------------------------------------------------- // parser @@ -577,8 +594,12 @@ // getValueName - Overload in subclass to provide a better default value. virtual const char *getValueName() const { return "number"; } + + // An out-of-line virtual method to provide a 'home' for this class. + virtual void anchor(); }; +EXTERN_TEMPLATE_INSTANTIATION(class basic_parser); //-------------------------------------------------- // parser @@ -591,8 +612,12 @@ // getValueName - Overload in subclass to provide a better default value. virtual const char *getValueName() const { return "number"; } + + // An out-of-line virtual method to provide a 'home' for this class. + virtual void anchor(); }; +EXTERN_TEMPLATE_INSTANTIATION(class basic_parser); //-------------------------------------------------- // parser @@ -609,8 +634,13 @@ // getValueName - Overload in subclass to provide a better default value. virtual const char *getValueName() const { return "string"; } + + // An out-of-line virtual method to provide a 'home' for this class. + virtual void anchor(); }; +EXTERN_TEMPLATE_INSTANTIATION(class basic_parser); + //===----------------------------------------------------------------------===// // applicator class - This class is used because we must use partial // specialization to handle literal string arguments specially (const char* does @@ -845,6 +875,11 @@ } }; +EXTERN_TEMPLATE_INSTANTIATION(class opt); +EXTERN_TEMPLATE_INSTANTIATION(class opt); +EXTERN_TEMPLATE_INSTANTIATION(class opt); +EXTERN_TEMPLATE_INSTANTIATION(class opt); + //===----------------------------------------------------------------------===// // list_storage class From lattner at cs.uiuc.edu Sun Aug 27 07:46:02 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 07:46:02 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/CommandLine.cpp Message-ID: <200608271246.k7RCk2pX001063@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: CommandLine.cpp updated: 1.73 -> 1.74 --- Log message: Add external definitions for commonly-used template specializations and add anchor methods to others. This eliminates the vtable/template method bloat in .o files that defining a cl::opt used to impose (~4K per .o file for one cp::opt). --- Diffs of the changes: (+28 -7) CommandLine.cpp | 35 ++++++++++++++++++++++++++++------- 1 files changed, 28 insertions(+), 7 deletions(-) Index: llvm/lib/Support/CommandLine.cpp diff -u llvm/lib/Support/CommandLine.cpp:1.73 llvm/lib/Support/CommandLine.cpp:1.74 --- llvm/lib/Support/CommandLine.cpp:1.73 Wed Aug 23 02:10:06 2006 +++ llvm/lib/Support/CommandLine.cpp Sun Aug 27 07:45:47 2006 @@ -28,11 +28,36 @@ #include #include using namespace llvm; - using namespace cl; +//===----------------------------------------------------------------------===// +// Template instantiations and anchors. +// +TEMPLATE_INSTANTIATION(class basic_parser); +TEMPLATE_INSTANTIATION(class basic_parser); +TEMPLATE_INSTANTIATION(class basic_parser); +TEMPLATE_INSTANTIATION(class basic_parser); +TEMPLATE_INSTANTIATION(class basic_parser); +TEMPLATE_INSTANTIATION(class basic_parser); + +TEMPLATE_INSTANTIATION(class opt); +TEMPLATE_INSTANTIATION(class opt); +TEMPLATE_INSTANTIATION(class opt); +TEMPLATE_INSTANTIATION(class opt); + +void Option::anchor() {} +void basic_parser_impl::anchor() {} +void parser::anchor() {} +void parser::anchor() {} +void parser::anchor() {} +void parser::anchor() {} +void parser::anchor() {} +void parser::anchor() {} + +//===----------------------------------------------------------------------===// + // Globals for name and overview of program -static std::string ProgramName ( "" ); +static std::string ProgramName = ""; static const char *ProgramOverview = 0; // This collects additional help to be printed. @@ -47,7 +72,7 @@ } //===----------------------------------------------------------------------===// -// Basic, shared command line option processing machinery... +// Basic, shared command line option processing machinery. // // Return the global command line option vector. Making it a function scoped @@ -596,10 +621,6 @@ // Option Base class implementation // -// Out of line virtual function to provide home for the class. -void Option::anchor() { -} - bool Option::error(std::string Message, const char *ArgName) { if (ArgName == 0) ArgName = ArgStr; if (ArgName[0] == 0) From lattner at cs.uiuc.edu Sun Aug 27 07:48:02 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 07:48:02 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Message-ID: <200608271248.k7RCm2wY001136@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveIntervalAnalysis.cpp updated: 1.169 -> 1.170 --- Log message: typo fix --- Diffs of the changes: (+4 -3) LiveIntervalAnalysis.cpp | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.169 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.170 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.169 Fri Aug 25 20:28:16 2006 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Sun Aug 27 07:47:48 2006 @@ -202,12 +202,13 @@ for (iterator I = begin(), E = end(); I != E; ++I) { LiveInterval &li = I->second; - if (MRegisterInfo::isVirtualRegister(li.reg)) - // If the live interval legnth is essentially zero, i.e. in every live + if (MRegisterInfo::isVirtualRegister(li.reg)) { + // If the live interval length is essentially zero, i.e. in every live // 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); + } } DEBUG(dump()); @@ -931,6 +932,6 @@ LiveInterval LiveIntervals::createInterval(unsigned reg) { float Weight = MRegisterInfo::isPhysicalRegister(reg) ? - (float)HUGE_VAL :0.0F; + (float)HUGE_VAL : 0.0F; return LiveInterval(reg, Weight); } From lattner at cs.uiuc.edu Sun Aug 27 07:54:25 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 07:54:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp PPCBranchSelector.cpp PPCCodeEmitter.cpp PPCISelDAGToDAG.cpp PPCMachOWriter.cpp Message-ID: <200608271254.k7RCsPft001403@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.191 -> 1.192 PPCBranchSelector.cpp updated: 1.27 -> 1.28 PPCCodeEmitter.cpp updated: 1.66 -> 1.67 PPCISelDAGToDAG.cpp updated: 1.207 -> 1.208 PPCMachOWriter.cpp updated: 1.1 -> 1.2 --- Log message: s|llvm/Support/Visibility.h|llvm/Support/Compiler.h| --- Diffs of the changes: (+5 -5) PPCAsmPrinter.cpp | 2 +- PPCBranchSelector.cpp | 2 +- PPCCodeEmitter.cpp | 2 +- PPCISelDAGToDAG.cpp | 2 +- PPCMachOWriter.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.191 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.192 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.191 Fri Aug 25 16:54:44 2006 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Sun Aug 27 07:54:01 2006 @@ -33,7 +33,7 @@ #include "llvm/Support/MathExtras.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetOptions.h" Index: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp diff -u llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.27 llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.28 --- llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.27 Fri Aug 25 18:29:06 2006 +++ llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Sun Aug 27 07:54:01 2006 @@ -19,7 +19,7 @@ #include "PPCInstrBuilder.h" #include "PPCInstrInfo.h" #include "llvm/CodeGen/MachineFunctionPass.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include using namespace llvm; Index: llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.66 llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.67 --- llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.66 Wed Aug 23 16:08:52 2006 +++ llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp Sun Aug 27 07:54:01 2006 @@ -22,7 +22,7 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/Passes.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/Target/TargetOptions.h" #include using namespace llvm; Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.207 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.208 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.207 Sun Aug 27 03:13:45 2006 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Sun Aug 27 07:54:01 2006 @@ -28,7 +28,7 @@ #include "llvm/Intrinsics.h" #include "llvm/Support/Debug.h" #include "llvm/Support/MathExtras.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include #include #include Index: llvm/lib/Target/PowerPC/PPCMachOWriter.cpp diff -u llvm/lib/Target/PowerPC/PPCMachOWriter.cpp:1.1 llvm/lib/Target/PowerPC/PPCMachOWriter.cpp:1.2 --- llvm/lib/Target/PowerPC/PPCMachOWriter.cpp:1.1 Wed Aug 23 16:08:52 2006 +++ llvm/lib/Target/PowerPC/PPCMachOWriter.cpp Sun Aug 27 07:54:01 2006 @@ -15,7 +15,7 @@ #include "PPCTargetMachine.h" #include "llvm/PassManager.h" #include "llvm/CodeGen/MachOWriter.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" using namespace llvm; namespace { From lattner at cs.uiuc.edu Sun Aug 27 07:54:27 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 07:54:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp LoopSimplify.cpp LowerAllocations.cpp LowerInvoke.cpp LowerSwitch.cpp Mem2Reg.cpp PromoteMemoryToRegister.cpp Message-ID: <200608271254.k7RCsRoP001429@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: BreakCriticalEdges.cpp updated: 1.30 -> 1.31 LoopSimplify.cpp updated: 1.72 -> 1.73 LowerAllocations.cpp updated: 1.59 -> 1.60 LowerInvoke.cpp updated: 1.37 -> 1.38 LowerSwitch.cpp updated: 1.22 -> 1.23 Mem2Reg.cpp updated: 1.18 -> 1.19 PromoteMemoryToRegister.cpp updated: 1.84 -> 1.85 --- Log message: s|llvm/Support/Visibility.h|llvm/Support/Compiler.h| --- Diffs of the changes: (+7 -7) BreakCriticalEdges.cpp | 2 +- LoopSimplify.cpp | 2 +- LowerAllocations.cpp | 2 +- LowerInvoke.cpp | 2 +- LowerSwitch.cpp | 2 +- Mem2Reg.cpp | 2 +- PromoteMemoryToRegister.cpp | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp diff -u llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.30 llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.31 --- llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.30 Wed Jun 28 18:17:24 2006 +++ llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp Sun Aug 27 07:54:02 2006 @@ -24,7 +24,7 @@ #include "llvm/Instructions.h" #include "llvm/Type.h" #include "llvm/Support/CFG.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/Statistic.h" using namespace llvm; Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.72 llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.73 --- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.72 Sat Aug 12 00:25:00 2006 +++ llvm/lib/Transforms/Utils/LoopSimplify.cpp Sun Aug 27 07:54:02 2006 @@ -41,7 +41,7 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Support/CFG.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/SetOperations.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/Statistic.h" Index: llvm/lib/Transforms/Utils/LowerAllocations.cpp diff -u llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.59 llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.60 --- llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.59 Wed Jun 28 18:17:24 2006 +++ llvm/lib/Transforms/Utils/LowerAllocations.cpp Sun Aug 27 07:54:02 2006 @@ -21,7 +21,7 @@ #include "llvm/Pass.h" #include "llvm/ADT/Statistic.h" #include "llvm/Target/TargetData.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" using namespace llvm; namespace { Index: llvm/lib/Transforms/Utils/LowerInvoke.cpp diff -u llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.37 llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.38 --- llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.37 Wed Jun 28 17:08:15 2006 +++ llvm/lib/Transforms/Utils/LowerInvoke.cpp Sun Aug 27 07:54:02 2006 @@ -44,7 +44,7 @@ #include "llvm/Transforms/Utils/Local.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include using namespace llvm; Index: llvm/lib/Transforms/Utils/LowerSwitch.cpp diff -u llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.22 llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.23 --- llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.22 Wed Jun 28 17:08:15 2006 +++ llvm/lib/Transforms/Utils/LowerSwitch.cpp Sun Aug 27 07:54:02 2006 @@ -20,7 +20,7 @@ #include "llvm/Instructions.h" #include "llvm/Pass.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/Statistic.h" #include #include Index: llvm/lib/Transforms/Utils/Mem2Reg.cpp diff -u llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.18 llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.19 --- llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.18 Wed Jun 28 17:08:15 2006 +++ llvm/lib/Transforms/Utils/Mem2Reg.cpp Sun Aug 27 07:54:02 2006 @@ -20,7 +20,7 @@ #include "llvm/Function.h" #include "llvm/Target/TargetData.h" #include "llvm/ADT/Statistic.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" using namespace llvm; namespace { Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.84 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.85 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.84 Wed Jun 28 18:17:24 2006 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sun Aug 27 07:54:02 2006 @@ -26,7 +26,7 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/Support/CFG.h" #include "llvm/Support/StableBasicBlockNumbering.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include using namespace llvm; From lattner at cs.uiuc.edu Sun Aug 27 07:54:26 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 07:54:26 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Visibility.h Message-ID: <200608271254.k7RCsQL5001406@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Visibility.h (r1.1) removed --- Log message: s|llvm/Support/Visibility.h|llvm/Support/Compiler.h| --- Diffs of the changes: (+0 -0) 0 files changed From lattner at cs.uiuc.edu Sun Aug 27 07:54:28 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 07:54:28 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp LegalizeDAG.cpp ScheduleDAGList.cpp ScheduleDAGRRList.cpp ScheduleDAGSimple.cpp SelectionDAGISel.cpp Message-ID: <200608271254.k7RCsSc4001445@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.182 -> 1.183 LegalizeDAG.cpp updated: 1.388 -> 1.389 ScheduleDAGList.cpp updated: 1.66 -> 1.67 ScheduleDAGRRList.cpp updated: 1.13 -> 1.14 ScheduleDAGSimple.cpp updated: 1.17 -> 1.18 SelectionDAGISel.cpp updated: 1.270 -> 1.271 --- Log message: s|llvm/Support/Visibility.h|llvm/Support/Compiler.h| --- Diffs of the changes: (+6 -6) DAGCombiner.cpp | 2 +- LegalizeDAG.cpp | 2 +- ScheduleDAGList.cpp | 2 +- ScheduleDAGRRList.cpp | 2 +- ScheduleDAGSimple.cpp | 2 +- SelectionDAGISel.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.182 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.183 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.182 Fri Aug 11 12:56:38 2006 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sun Aug 27 07:54:01 2006 @@ -35,7 +35,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/MathExtras.h" #include "llvm/Target/TargetLowering.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include #include #include Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.388 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.389 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.388 Mon Aug 21 15:24:53 2006 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Sun Aug 27 07:54:01 2006 @@ -21,7 +21,7 @@ #include "llvm/Constants.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/SmallVector.h" #include #include Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.66 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.67 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.66 Wed Aug 16 19:09:56 2006 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp Sun Aug 27 07:54:01 2006 @@ -28,7 +28,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/Statistic.h" #include #include Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.13 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.14 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.13 Wed Aug 16 19:09:56 2006 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Sun Aug 27 07:54:01 2006 @@ -24,7 +24,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/Statistic.h" #include #include Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.17 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.18 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.17 Thu Aug 3 15:51:06 2006 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp Sun Aug 27 07:54:01 2006 @@ -23,7 +23,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include #include using namespace llvm; Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.270 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.271 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.270 Wed Aug 16 17:57:46 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sun Aug 27 07:54:01 2006 @@ -42,7 +42,7 @@ #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include #include #include From lattner at cs.uiuc.edu Sun Aug 27 07:54:28 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 07:54:28 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp LoopStrengthReduce.cpp LowerGC.cpp ScalarReplAggregates.cpp Message-ID: <200608271254.k7RCsSFK001456@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.499 -> 1.500 LoopStrengthReduce.cpp updated: 1.87 -> 1.88 LowerGC.cpp updated: 1.11 -> 1.12 ScalarReplAggregates.cpp updated: 1.40 -> 1.41 --- Log message: s|llvm/Support/Visibility.h|llvm/Support/Compiler.h| --- Diffs of the changes: (+4 -4) InstructionCombining.cpp | 2 +- LoopStrengthReduce.cpp | 2 +- LowerGC.cpp | 2 +- ScalarReplAggregates.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.499 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.500 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.499 Tue Jul 11 13:31:26 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sun Aug 27 07:54:01 2006 @@ -48,7 +48,7 @@ #include "llvm/Support/InstVisitor.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/PatternMatch.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.87 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.88 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.87 Thu Aug 3 01:34:50 2006 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Sun Aug 27 07:54:01 2006 @@ -31,7 +31,7 @@ #include "llvm/Target/TargetData.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/Target/TargetLowering.h" #include #include Index: llvm/lib/Transforms/Scalar/LowerGC.cpp diff -u llvm/lib/Transforms/Scalar/LowerGC.cpp:1.11 llvm/lib/Transforms/Scalar/LowerGC.cpp:1.12 --- llvm/lib/Transforms/Scalar/LowerGC.cpp:1.11 Wed Jun 28 17:08:15 2006 +++ llvm/lib/Transforms/Scalar/LowerGC.cpp Sun Aug 27 07:54:01 2006 @@ -26,7 +26,7 @@ #include "llvm/Instructions.h" #include "llvm/Module.h" #include "llvm/Pass.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" using namespace llvm; namespace { Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.40 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.41 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.40 Wed Jun 28 18:17:24 2006 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Sun Aug 27 07:54:01 2006 @@ -31,7 +31,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/MathExtras.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringExtras.h" #include From lattner at cs.uiuc.edu Sun Aug 27 07:54:28 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 07:54:28 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp ScalarEvolution.cpp Message-ID: <200608271254.k7RCsSE3001463@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: BasicAliasAnalysis.cpp updated: 1.82 -> 1.83 ScalarEvolution.cpp updated: 1.49 -> 1.50 --- Log message: s|llvm/Support/Visibility.h|llvm/Support/Compiler.h| --- Diffs of the changes: (+2 -2) BasicAliasAnalysis.cpp | 2 +- ScalarEvolution.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.82 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.83 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.82 Wed Jun 28 18:17:23 2006 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Sun Aug 27 07:54:01 2006 @@ -23,7 +23,7 @@ #include "llvm/Pass.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/GetElementPtrTypeIterator.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include using namespace llvm; Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.49 llvm/lib/Analysis/ScalarEvolution.cpp:1.50 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.49 Wed Jun 28 18:17:23 2006 +++ llvm/lib/Analysis/ScalarEvolution.cpp Sun Aug 27 07:54:01 2006 @@ -72,7 +72,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/ConstantRange.h" #include "llvm/Support/InstIterator.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/Statistic.h" #include #include From lattner at cs.uiuc.edu Sun Aug 27 07:54:29 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 07:54:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp X86ELFWriter.cpp X86FloatingPoint.cpp X86ISelDAGToDAG.cpp Message-ID: <200608271254.k7RCsTo2001495@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.113 -> 1.114 X86ELFWriter.cpp updated: 1.5 -> 1.6 X86FloatingPoint.cpp updated: 1.52 -> 1.53 X86ISelDAGToDAG.cpp updated: 1.97 -> 1.98 --- Log message: s|llvm/Support/Visibility.h|llvm/Support/Compiler.h| --- Diffs of the changes: (+4 -4) X86CodeEmitter.cpp | 2 +- X86ELFWriter.cpp | 2 +- X86FloatingPoint.cpp | 2 +- X86ISelDAGToDAG.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.113 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.114 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.113 Fri Aug 25 19:47:03 2006 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Sun Aug 27 07:54:01 2006 @@ -22,7 +22,7 @@ #include "llvm/CodeGen/Passes.h" #include "llvm/Function.h" #include "llvm/ADT/Statistic.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/Target/TargetOptions.h" #include using namespace llvm; Index: llvm/lib/Target/X86/X86ELFWriter.cpp diff -u llvm/lib/Target/X86/X86ELFWriter.cpp:1.5 llvm/lib/Target/X86/X86ELFWriter.cpp:1.6 --- llvm/lib/Target/X86/X86ELFWriter.cpp:1.5 Tue Jul 25 15:40:54 2006 +++ llvm/lib/Target/X86/X86ELFWriter.cpp Sun Aug 27 07:54:01 2006 @@ -16,7 +16,7 @@ #include "X86TargetMachine.h" #include "llvm/PassManager.h" #include "llvm/CodeGen/ELFWriter.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" using namespace llvm; namespace { Index: llvm/lib/Target/X86/X86FloatingPoint.cpp diff -u llvm/lib/Target/X86/X86FloatingPoint.cpp:1.52 llvm/lib/Target/X86/X86FloatingPoint.cpp:1.53 --- llvm/lib/Target/X86/X86FloatingPoint.cpp:1.52 Wed Jul 19 14:33:08 2006 +++ llvm/lib/Target/X86/X86FloatingPoint.cpp Sun Aug 27 07:54:01 2006 @@ -38,7 +38,7 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.97 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.98 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.97 Sun Aug 27 03:14:06 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Sun Aug 27 07:54:01 2006 @@ -31,7 +31,7 @@ #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/Statistic.h" #include #include From lattner at cs.uiuc.edu Sun Aug 27 07:54:29 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 07:54:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineFunction.cpp PHIElimination.cpp PrologEpilogInserter.cpp RegAllocLinearScan.cpp RegAllocLocal.cpp RegAllocSimple.cpp TwoAddressInstructionPass.cpp UnreachableBlockElim.cpp VirtRegMap.cpp Message-ID: <200608271254.k7RCsTwN001484@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineFunction.cpp updated: 1.96 -> 1.97 PHIElimination.cpp updated: 1.44 -> 1.45 PrologEpilogInserter.cpp updated: 1.57 -> 1.58 RegAllocLinearScan.cpp updated: 1.127 -> 1.128 RegAllocLocal.cpp updated: 1.85 -> 1.86 RegAllocSimple.cpp updated: 1.72 -> 1.73 TwoAddressInstructionPass.cpp updated: 1.36 -> 1.37 UnreachableBlockElim.cpp updated: 1.7 -> 1.8 VirtRegMap.cpp updated: 1.71 -> 1.72 --- Log message: s|llvm/Support/Visibility.h|llvm/Support/Compiler.h| --- Diffs of the changes: (+9 -9) MachineFunction.cpp | 2 +- PHIElimination.cpp | 2 +- PrologEpilogInserter.cpp | 2 +- RegAllocLinearScan.cpp | 2 +- RegAllocLocal.cpp | 2 +- RegAllocSimple.cpp | 2 +- TwoAddressInstructionPass.cpp | 2 +- UnreachableBlockElim.cpp | 2 +- VirtRegMap.cpp | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) Index: llvm/lib/CodeGen/MachineFunction.cpp diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.96 llvm/lib/CodeGen/MachineFunction.cpp:1.97 --- llvm/lib/CodeGen/MachineFunction.cpp:1.96 Fri Jul 14 18:08:47 2006 +++ llvm/lib/CodeGen/MachineFunction.cpp Sun Aug 27 07:54:01 2006 @@ -27,7 +27,7 @@ #include "llvm/Instructions.h" #include "llvm/Support/LeakDetector.h" #include "llvm/Support/GraphWriter.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/Config/config.h" #include #include Index: llvm/lib/CodeGen/PHIElimination.cpp diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.44 llvm/lib/CodeGen/PHIElimination.cpp:1.45 --- llvm/lib/CodeGen/PHIElimination.cpp:1.44 Sat Aug 12 00:41:39 2006 +++ llvm/lib/CodeGen/PHIElimination.cpp Sun Aug 27 07:54:01 2006 @@ -23,7 +23,7 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/Statistic.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include #include using namespace llvm; Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp diff -u llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.57 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.58 --- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.57 Fri Aug 25 17:56:30 2006 +++ llvm/lib/CodeGen/PrologEpilogInserter.cpp Sun Aug 27 07:54:01 2006 @@ -24,7 +24,7 @@ #include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetInstrInfo.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" using namespace llvm; namespace { Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.127 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.128 --- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.127 Wed Aug 2 07:30:23 2006 +++ llvm/lib/CodeGen/RegAllocLinearScan.cpp Sun Aug 27 07:54:01 2006 @@ -27,7 +27,7 @@ #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include #include #include Index: llvm/lib/CodeGen/RegAllocLocal.cpp diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.85 llvm/lib/CodeGen/RegAllocLocal.cpp:1.86 --- llvm/lib/CodeGen/RegAllocLocal.cpp:1.85 Wed Aug 2 07:30:23 2006 +++ llvm/lib/CodeGen/RegAllocLocal.cpp Sun Aug 27 07:54:01 2006 @@ -24,7 +24,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/Statistic.h" #include Index: llvm/lib/CodeGen/RegAllocSimple.cpp diff -u llvm/lib/CodeGen/RegAllocSimple.cpp:1.72 llvm/lib/CodeGen/RegAllocSimple.cpp:1.73 --- llvm/lib/CodeGen/RegAllocSimple.cpp:1.72 Wed Aug 2 07:30:23 2006 +++ llvm/lib/CodeGen/RegAllocSimple.cpp Sun Aug 27 07:54:01 2006 @@ -24,7 +24,7 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.36 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.37 --- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.36 Thu Jul 20 12:28:38 2006 +++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Sun Aug 27 07:54:01 2006 @@ -38,7 +38,7 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include Index: llvm/lib/CodeGen/UnreachableBlockElim.cpp diff -u llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.7 llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.8 --- llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.7 Wed Jun 28 18:17:23 2006 +++ llvm/lib/CodeGen/UnreachableBlockElim.cpp Sun Aug 27 07:54:01 2006 @@ -27,7 +27,7 @@ #include "llvm/Pass.h" #include "llvm/Type.h" #include "llvm/Support/CFG.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/DepthFirstIterator.h" using namespace llvm; Index: llvm/lib/CodeGen/VirtRegMap.cpp diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.71 llvm/lib/CodeGen/VirtRegMap.cpp:1.72 --- llvm/lib/CodeGen/VirtRegMap.cpp:1.71 Thu Aug 24 17:43:55 2006 +++ llvm/lib/CodeGen/VirtRegMap.cpp Sun Aug 27 07:54:01 2006 @@ -26,7 +26,7 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include From lattner at cs.uiuc.edu Sun Aug 27 07:54:30 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 07:54:30 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/BasicBlock.cpp ConstantFolding.cpp Constants.cpp LeakDetector.cpp Type.cpp Verifier.cpp Message-ID: <200608271254.k7RCsU7X001510@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: BasicBlock.cpp updated: 1.72 -> 1.73 ConstantFolding.cpp updated: 1.89 -> 1.90 Constants.cpp updated: 1.158 -> 1.159 LeakDetector.cpp updated: 1.14 -> 1.15 Type.cpp updated: 1.143 -> 1.144 Verifier.cpp updated: 1.160 -> 1.161 --- Log message: s|llvm/Support/Visibility.h|llvm/Support/Compiler.h| --- Diffs of the changes: (+6 -6) BasicBlock.cpp | 2 +- ConstantFolding.cpp | 2 +- Constants.cpp | 2 +- LeakDetector.cpp | 2 +- Type.cpp | 2 +- Verifier.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/lib/VMCore/BasicBlock.cpp diff -u llvm/lib/VMCore/BasicBlock.cpp:1.72 llvm/lib/VMCore/BasicBlock.cpp:1.73 --- llvm/lib/VMCore/BasicBlock.cpp:1.72 Wed Jun 28 17:57:00 2006 +++ llvm/lib/VMCore/BasicBlock.cpp Sun Aug 27 07:54:02 2006 @@ -17,7 +17,7 @@ #include "llvm/Type.h" #include "llvm/Support/CFG.h" #include "llvm/Support/LeakDetector.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "SymbolTableListTraitsImpl.h" #include using namespace llvm; Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.89 llvm/lib/VMCore/ConstantFolding.cpp:1.90 --- llvm/lib/VMCore/ConstantFolding.cpp:1.89 Wed Jun 28 16:38:54 2006 +++ llvm/lib/VMCore/ConstantFolding.cpp Sun Aug 27 07:54:02 2006 @@ -25,7 +25,7 @@ #include "llvm/Function.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/MathExtras.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include #include using namespace llvm; Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.158 llvm/lib/VMCore/Constants.cpp:1.159 --- llvm/lib/VMCore/Constants.cpp:1.158 Mon Jul 17 12:38:29 2006 +++ llvm/lib/VMCore/Constants.cpp Sun Aug 27 07:54:02 2006 @@ -20,7 +20,7 @@ #include "llvm/Module.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/MathExtras.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include #include using namespace llvm; Index: llvm/lib/VMCore/LeakDetector.cpp diff -u llvm/lib/VMCore/LeakDetector.cpp:1.14 llvm/lib/VMCore/LeakDetector.cpp:1.15 --- llvm/lib/VMCore/LeakDetector.cpp:1.14 Wed Jun 28 17:57:00 2006 +++ llvm/lib/VMCore/LeakDetector.cpp Sun Aug 27 07:54:02 2006 @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/LeakDetector.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include "llvm/Value.h" #include #include Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.143 llvm/lib/VMCore/Type.cpp:1.144 --- llvm/lib/VMCore/Type.cpp:1.143 Wed Jul 26 04:59:01 2006 +++ llvm/lib/VMCore/Type.cpp Sun Aug 27 07:54:02 2006 @@ -20,7 +20,7 @@ #include "llvm/ADT/SCCIterator.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/MathExtras.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include #include using namespace llvm; Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.160 llvm/lib/VMCore/Verifier.cpp:1.161 --- llvm/lib/VMCore/Verifier.cpp:1.160 Wed Jul 26 11:18:00 2006 +++ llvm/lib/VMCore/Verifier.cpp Sun Aug 27 07:54:02 2006 @@ -57,7 +57,7 @@ #include "llvm/Support/InstVisitor.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/Support/Visibility.h" +#include "llvm/Support/Compiler.h" #include #include #include From lattner at cs.uiuc.edu Sun Aug 27 08:16:20 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 08:16:20 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Compiler.h Message-ID: <200608271316.k7RDGKYw001908@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Compiler.h updated: 1.1 -> 1.2 --- Log message: add directive to disable inlining --- Diffs of the changes: (+8 -0) Compiler.h | 8 ++++++++ 1 files changed, 8 insertions(+) Index: llvm/include/llvm/Support/Compiler.h diff -u llvm/include/llvm/Support/Compiler.h:1.1 llvm/include/llvm/Support/Compiler.h:1.2 --- llvm/include/llvm/Support/Compiler.h:1.1 Sun Aug 27 07:42:45 2006 +++ llvm/include/llvm/Support/Compiler.h Sun Aug 27 08:16:05 2006 @@ -37,4 +37,12 @@ #define TEMPLATE_INSTANTIATION(X) #endif +// DISABLE_INLINE - On compilers where we have a directive to do so, mark a +// method "not for inlining". +#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +#define DISABLE_INLINE __attribute__((noinline)) +#else +#define DISABLE_INLINE +#endif + #endif From lattner at cs.uiuc.edu Sun Aug 27 08:16:39 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 08:16:39 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200608271316.k7RDGdCG001922@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.252 -> 1.253 --- Log message: Use compiler.h instead of hand rolling our own macro --- Diffs of the changes: (+4 -9) DAGISelEmitter.cpp | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.252 llvm/utils/TableGen/DAGISelEmitter.cpp:1.253 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.252 Sun Aug 27 03:11:28 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Sun Aug 27 08:16:24 2006 @@ -3355,7 +3355,7 @@ CalleeCode += ") "; // Prevent emission routines from being inlined to reduce selection // routines stack frame sizes. - CalleeCode += "NOINLINE "; + CalleeCode += "DISABLE_INLINE "; CalleeCode += "{\n"; for (std::vector::const_reverse_iterator @@ -3565,12 +3565,7 @@ << "// *** instruction selector class. These functions are really " << "methods.\n\n"; - OS << "#if defined(__GNUC__) && \\\n"; - OS << " ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4)))\n"; - OS << "#define NOINLINE __attribute__((noinline))\n"; - OS << "#else\n"; - OS << "#define NOINLINE\n"; - OS << "#endif\n\n"; + OS << "#include \"llvm/Support/Compiler.h\"\n"; OS << "// Instruction selector priority queue:\n" << "std::vector ISelQueue;\n"; @@ -3603,7 +3598,7 @@ OS << " return ISelSelected[Id / 8] & (1 << (Id % 8));\n"; OS << "}\n\n"; - OS << "void AddToISelQueue(SDOperand N) NOINLINE {\n"; + OS << "void AddToISelQueue(SDOperand N) DISABLE_INLINE {\n"; OS << " int Id = N.Val->getNodeId();\n"; OS << " if (Id != -1 && !isQueued(Id)) {\n"; OS << " ISelQueue.push_back(N.Val);\n"; @@ -3624,7 +3619,7 @@ OS << " }\n"; OS << "}\n\n"; - OS << "void ReplaceUses(SDOperand F, SDOperand T) NOINLINE {\n"; + OS << "void ReplaceUses(SDOperand F, SDOperand T) DISABLE_INLINE {\n"; OS << " CurDAG->ReplaceAllUsesOfValueWith(F, T, ISelKilled);\n"; OS << " setSelected(F.Val->getNodeId());\n"; OS << " RemoveKilled();\n"; From lattner at cs.uiuc.edu Sun Aug 27 15:52:15 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 15:52:15 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/PowerPC/2006-01-18-InvalidBranchOpcodeAssert.ll Message-ID: <200608272052.k7RKqFUm009270@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/PowerPC: 2006-01-18-InvalidBranchOpcodeAssert.ll (r1.1) removed --- Log message: Move this test from Codegen/PowerPC to CodeGen/Generic. It fails on ia64, but that's not the ppc backend's fault. --- Diffs of the changes: (+0 -0) 0 files changed From lattner at cs.uiuc.edu Sun Aug 27 15:52:15 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 15:52:15 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/Generic/2006-01-18-InvalidBranchOpcodeAssert.ll Message-ID: <200608272052.k7RKqF8a009275@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/Generic: 2006-01-18-InvalidBranchOpcodeAssert.ll added (r1.1) --- Log message: Move this test from Codegen/PowerPC to CodeGen/Generic. It fails on ia64, but that's not the ppc backend's fault. --- Diffs of the changes: (+16 -0) 2006-01-18-InvalidBranchOpcodeAssert.ll | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) Index: llvm/test/Regression/CodeGen/Generic/2006-01-18-InvalidBranchOpcodeAssert.ll diff -c /dev/null llvm/test/Regression/CodeGen/Generic/2006-01-18-InvalidBranchOpcodeAssert.ll:1.1 *** /dev/null Sun Aug 27 15:52:10 2006 --- llvm/test/Regression/CodeGen/Generic/2006-01-18-InvalidBranchOpcodeAssert.ll Sun Aug 27 15:52:00 2006 *************** *** 0 **** --- 1,16 ---- + ; RUN: llvm-as < %s | llc + ; This crashed the PPC backend. + + void %test() { + %tmp125 = call bool %llvm.isunordered.f64( double 0.000000e+00, double 0.000000e+00 ) ; [#uses=1] + br bool %tmp125, label %bb154, label %cond_false133 + + cond_false133: ; preds = %entry + ret void + + bb154: ; preds = %entry + %tmp164 = seteq uint 0, 0 ; [#uses=0] + ret void + } + + declare bool %llvm.isunordered.f64(double, double) From lattner at cs.uiuc.edu Sun Aug 27 17:07:15 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:07:15 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/Makefile opt.cpp Message-ID: <200608272207.k7RM7FcB010505@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: Makefile updated: 1.57 -> 1.58 opt.cpp updated: 1.115 -> 1.116 --- Log message: Merge the 'analyze' mode code with the 'opt' mode code. Eliminate the 'autodetect .ll files' functionality. --- Diffs of the changes: (+26 -76) Makefile | 2 - opt.cpp | 100 +++++++++++++++------------------------------------------------ 2 files changed, 26 insertions(+), 76 deletions(-) Index: llvm/tools/opt/Makefile diff -u llvm/tools/opt/Makefile:1.57 llvm/tools/opt/Makefile:1.58 --- llvm/tools/opt/Makefile:1.57 Fri Aug 18 01:34:30 2006 +++ llvm/tools/opt/Makefile Sun Aug 27 17:07:01 2006 @@ -10,7 +10,7 @@ TOOLNAME = opt REQUIRES_EH := 1 -USEDLIBS = LLVMAsmParser.a LLVMBCReader.a LLVMBCWriter.a LLVMInstrumentation.a \ +USEDLIBS = LLVMBCReader.a LLVMBCWriter.a LLVMInstrumentation.a \ LLVMScalarOpts.a LLVMipo.a LLVMipa.a LLVMDataStructure \ LLVMTransforms.a LLVMTarget.a LLVMTransformUtils.a LLVMAnalysis.a \ LLVMCore.a LLVMSupport.a LLVMbzip2.a LLVMSystem.a Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.115 llvm/tools/opt/opt.cpp:1.116 --- llvm/tools/opt/opt.cpp:1.115 Mon Aug 21 00:34:03 2006 +++ llvm/tools/opt/opt.cpp Sun Aug 27 17:07:01 2006 @@ -13,7 +13,6 @@ //===----------------------------------------------------------------------===// #include "llvm/Module.h" -#include "llvm/Assembly/Parser.h" #include "llvm/PassManager.h" #include "llvm/Bytecode/Reader.h" #include "llvm/Bytecode/WriteBytecodePass.h" @@ -37,9 +36,8 @@ // The OptimizationList is automatically populated with registered Passes by the // PassNameParser. // -static cl::list > -OptimizationList(cl::desc("Optimizations available:")); +static cl::list +PassList(cl::desc("Optimizations available:")); // Other command line options... @@ -74,12 +72,6 @@ static cl::opt AnalyzeOnly("analyze", cl::desc("Only perform analysis, no optimization")); -// The AnalysesList is automatically populated with registered Passes by the -// PassNameParser. -static - cl::list > - AnalysesList(cl::desc("Analyses available:")); - static Timer BytecodeLoadTimer("Bytecode Loader"); // ---------- Define Printers for module and function passes ------------ @@ -166,57 +158,7 @@ " llvm .bc -> .bc modular optimizer and analysis printer \n"); sys::PrintStackTraceOnErrorSignal(); - if (AnalyzeOnly) { - Module *CurMod = 0; -#if 0 - TimeRegion RegionTimer(BytecodeLoadTimer); -#endif - CurMod = ParseBytecodeFile(InputFilename); - ParseError Err; - if (!CurMod && !(CurMod = ParseAssemblyFile(InputFilename,&Err))){ - std::cerr << argv[0] << ": " << Err.getMessage() << "\n"; - return 1; - } - - // Create a PassManager to hold and optimize the collection of passes we - // are about to build... - PassManager Passes; - - // Add an appropriate TargetData instance for this module... - Passes.add(new TargetData(CurMod)); - - // Make sure the input LLVM is well formed. - if (!NoVerify) - Passes.add(createVerifierPass()); - - // Create a new optimization pass for each one specified on the - // command line - for (unsigned i = 0; i < AnalysesList.size(); ++i) { - const PassInfo *Analysis = AnalysesList[i]; - - if (Analysis->getNormalCtor()) { - Pass *P = Analysis->getNormalCtor()(); - Passes.add(P); - - if (BasicBlockPass *BBP = dynamic_cast(P)) - Passes.add(new BasicBlockPassPrinter(Analysis)); - else if (FunctionPass *FP = dynamic_cast(P)) - Passes.add(new FunctionPassPrinter(Analysis)); - else - Passes.add(new ModulePassPrinter(Analysis)); - - } else - std::cerr << argv[0] << ": cannot create pass: " - << Analysis->getPassName() << "\n"; - } - - Passes.run(*CurMod); - - delete CurMod; - return 0; - } - - // Allocate a full target machine description only if necessary... + // Allocate a full target machine description only if necessary. // FIXME: The choice of target should be controllable on the command line. std::auto_ptr target; @@ -275,22 +217,30 @@ Passes.add(new TargetData(M.get())); // Create a new optimization pass for each one specified on the command line - for (unsigned i = 0; i < OptimizationList.size(); ++i) { - const PassInfo *Opt = OptimizationList[i]; - - if (Opt->getNormalCtor()) - Passes.add(Opt->getNormalCtor()()); - else if (Opt->getTargetCtor()) { -#if 0 - if (target.get() == NULL) - target.reset(allocateSparcTargetMachine()); // FIXME: target option -#endif + for (unsigned i = 0; i < PassList.size(); ++i) { + const PassInfo *PassInf = PassList[i]; + Pass *P = 0; + if (PassInf->getNormalCtor()) + P = PassInf->getNormalCtor()(); + else if (PassInf->getTargetCtor()) { assert(target.get() && "Could not allocate target machine!"); - Passes.add(Opt->getTargetCtor()(*target.get())); + P = PassInf->getTargetCtor()(*target.get()); } else - std::cerr << argv[0] << ": cannot create pass: " << Opt->getPassName() - << "\n"; - + std::cerr << argv[0] << ": cannot create pass: " + << PassInf->getPassName() << "\n"; + if (P) { + Passes.add(P); + + if (AnalyzeOnly) { + if (BasicBlockPass *BBP = dynamic_cast(P)) + Passes.add(new BasicBlockPassPrinter(PassInf)); + else if (FunctionPass *FP = dynamic_cast(P)) + Passes.add(new FunctionPassPrinter(PassInf)); + else + Passes.add(new ModulePassPrinter(PassInf)); + } + } + if (PrintEachXForm) Passes.add(new PrintModulePass(&std::cerr)); } From lattner at cs.uiuc.edu Sun Aug 27 17:07:57 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:07:57 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/Optimize.cpp Message-ID: <200608272207.k7RM7veG010561@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: Optimize.cpp updated: 1.12 -> 1.13 --- Log message: eliminate only use of FilteredPassNameParser --- Diffs of the changes: (+1 -2) Optimize.cpp | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/tools/llvm-ld/Optimize.cpp diff -u llvm/tools/llvm-ld/Optimize.cpp:1.12 llvm/tools/llvm-ld/Optimize.cpp:1.13 --- llvm/tools/llvm-ld/Optimize.cpp:1.12 Sun Aug 20 15:54:38 2006 +++ llvm/tools/llvm-ld/Optimize.cpp Sun Aug 27 17:07:43 2006 @@ -27,8 +27,7 @@ using namespace llvm; // Pass Name Options as generated by the PassNameParser -static cl::list > +static cl::list OptimizationList(cl::desc("Optimizations available:")); // Optimization Enumeration From lattner at cs.uiuc.edu Sun Aug 27 17:10:43 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:10:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/CommandLine.cpp Message-ID: <200608272210.k7RMAhwQ010689@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: CommandLine.cpp updated: 1.74 -> 1.75 --- Log message: Minor code cleanups --- Diffs of the changes: (+10 -11) CommandLine.cpp | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-) Index: llvm/lib/Support/CommandLine.cpp diff -u llvm/lib/Support/CommandLine.cpp:1.74 llvm/lib/Support/CommandLine.cpp:1.75 --- llvm/lib/Support/CommandLine.cpp:1.74 Sun Aug 27 07:45:47 2006 +++ llvm/lib/Support/CommandLine.cpp Sun Aug 27 17:10:29 2006 @@ -214,8 +214,8 @@ /// using strdup (), so it is the caller's responsibility to free () /// them later. /// -static void ParseCStringVector (std::vector &output, - const char *input) { +static void ParseCStringVector(std::vector &output, + const char *input) { // Characters which will be treated as token separators: static const char *delims = " \v\f\t\r\n"; @@ -265,26 +265,25 @@ assert(envVar && "Environment variable name missing"); // Get the environment variable they want us to parse options out of. - const char *envValue = getenv (envVar); + const char *envValue = getenv(envVar); if (!envValue) return; // Get program's "name", which we wouldn't know without the caller // telling us. - std::vector newArgv; - newArgv.push_back (strdup (progName)); + std::vector newArgv; + newArgv.push_back(strdup(progName)); // Parse the value of the environment variable into a "command line" // and hand it off to ParseCommandLineOptions(). - ParseCStringVector (newArgv, envValue); - int newArgc = newArgv.size (); - ParseCommandLineOptions (newArgc, &newArgv[0], Overview); + ParseCStringVector(newArgv, envValue); + int newArgc = newArgv.size(); + ParseCommandLineOptions(newArgc, &newArgv[0], Overview); // Free all the strdup()ed strings. - for (std::vector::iterator i = newArgv.begin (), e = newArgv.end (); - i != e; ++i) { + for (std::vector::iterator i = newArgv.begin(), e = newArgv.end(); + i != e; ++i) free (*i); - } } /// LookupOption - Lookup the option specified by the specified option on the From lattner at cs.uiuc.edu Sun Aug 27 17:11:21 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:11:21 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/PassNameParser.h Message-ID: <200608272211.k7RMBLSi010727@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: PassNameParser.h updated: 1.11 -> 1.12 --- Log message: Remove a dead class. --- Diffs of the changes: (+0 -17) PassNameParser.h | 17 ----------------- 1 files changed, 17 deletions(-) Index: llvm/include/llvm/Support/PassNameParser.h diff -u llvm/include/llvm/Support/PassNameParser.h:1.11 llvm/include/llvm/Support/PassNameParser.h:1.12 --- llvm/include/llvm/Support/PassNameParser.h:1.11 Thu Apr 21 15:44:59 2005 +++ llvm/include/llvm/Support/PassNameParser.h Sun Aug 27 17:11:07 2006 @@ -99,23 +99,6 @@ } }; - -//===----------------------------------------------------------------------===// -// FilteredPassNameParser class - Just like PassNameParser, but filter out -// passes that do not have a PassType that includes the flags specified as the -// template argument. -// -template -struct FilteredPassNameParser : public PassNameParser { - - // ignorablePassImpl - Can be overriden in subclasses to refine the list of - // which passes we want to include. - // - virtual bool ignorablePassImpl(const PassInfo *P) const { - return (P->getPassType() & Flags) == 0; - } -}; - } // End llvm namespace #endif From lattner at cs.uiuc.edu Sun Aug 27 17:12:20 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:12:20 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/OptimizerDriver.cpp Message-ID: <200608272212.k7RMCK5X010768@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: OptimizerDriver.cpp updated: 1.43 -> 1.44 --- Log message: analyze no longer exists, don't offer to run it :) --- Diffs of the changes: (+1 -12) OptimizerDriver.cpp | 13 +------------ 1 files changed, 1 insertion(+), 12 deletions(-) Index: llvm/tools/bugpoint/OptimizerDriver.cpp diff -u llvm/tools/bugpoint/OptimizerDriver.cpp:1.43 llvm/tools/bugpoint/OptimizerDriver.cpp:1.44 --- llvm/tools/bugpoint/OptimizerDriver.cpp:1.43 Wed Aug 23 15:34:57 2006 +++ llvm/tools/bugpoint/OptimizerDriver.cpp Sun Aug 27 17:12:06 2006 @@ -77,18 +77,7 @@ std::cout << "Emitted bytecode to '" << Filename << "'\n"; if (NoFlyer || PassesToRun.empty()) return; std::cout << "\n*** You can reproduce the problem with: "; - - unsigned PassType = PassesToRun[0]->getPassType(); - for (unsigned i = 1, e = PassesToRun.size(); i != e; ++i) - PassType &= PassesToRun[i]->getPassType(); - - if (PassType & PassInfo::Analysis) - std::cout << "analyze"; - else if (PassType & PassInfo::Optimization) - std::cout << "opt"; - else - std::cout << "bugpoint"; - std::cout << " " << Filename << " "; + std::cout << "opt " << Filename << " "; std::cout << getPassesString(PassesToRun) << "\n"; } From lattner at cs.uiuc.edu Sun Aug 27 17:22:11 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:22:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Pass.cpp Message-ID: <200608272222.k7RMMBI0010979@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Pass.cpp updated: 1.70 -> 1.71 --- Log message: We no longer care whether something is an opt vs analysis pass, only whether something is a pass vs an analysis group now. Simplify interfaces. --- Diffs of the changes: (+3 -3) Pass.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/VMCore/Pass.cpp diff -u llvm/lib/VMCore/Pass.cpp:1.70 llvm/lib/VMCore/Pass.cpp:1.71 --- llvm/lib/VMCore/Pass.cpp:1.70 Thu Jul 6 16:35:01 2006 +++ llvm/lib/VMCore/Pass.cpp Sun Aug 27 17:21:55 2006 @@ -136,7 +136,7 @@ } else { // Normal pass. Print argument information... // Print out arguments for registered passes that are _optimizations_ if (const PassInfo *PI = P->getPassInfo()) - if (PI->getPassType() & PassInfo::Optimization) + if (!PI->isAnalysisGroup()) std::cerr << " -" << PI->getPassArgument(); } } @@ -376,7 +376,7 @@ // RegisterAGBase::RegisterAGBase(const std::type_info &Interface, const std::type_info *Pass, bool isDefault) - : RegisterPassBase(Interface, PassInfo::AnalysisGroup), + : RegisterPassBase(Interface), ImplementationInfo(0), isDefaultImplementation(isDefault) { InterfaceInfo = const_cast(Pass::lookupPassInfo(Interface)); @@ -385,7 +385,7 @@ registerPass(); InterfaceInfo = &PIObj; } - assert(InterfaceInfo->getPassType() == PassInfo::AnalysisGroup && + assert(PIObj.isAnalysisGroup() && "Trying to join an analysis group that is a normal pass!"); if (Pass) { From lattner at cs.uiuc.edu Sun Aug 27 17:22:11 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:22:11 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/PassSupport.h Message-ID: <200608272222.k7RMMBnd010984@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: PassSupport.h updated: 1.26 -> 1.27 --- Log message: We no longer care whether something is an opt vs analysis pass, only whether something is a pass vs an analysis group now. Simplify interfaces. --- Diffs of the changes: (+28 -42) PassSupport.h | 70 +++++++++++++++++++++++----------------------------------- 1 files changed, 28 insertions(+), 42 deletions(-) Index: llvm/include/llvm/PassSupport.h diff -u llvm/include/llvm/PassSupport.h:1.26 llvm/include/llvm/PassSupport.h:1.27 --- llvm/include/llvm/PassSupport.h:1.26 Tue Aug 1 09:21:23 2006 +++ llvm/include/llvm/PassSupport.h Sun Aug 27 17:21:55 2006 @@ -38,28 +38,18 @@ const char *PassName; // Nice name for Pass const char *PassArgument; // Command Line argument to run this pass const std::type_info &TypeInfo; // type_info object for this Pass class - unsigned char PassType; // Set of enums values below... + bool IsAnalysisGroup; // True if an analysis group. std::vector ItfImpl;// Interfaces implemented by this pass Pass *(*NormalCtor)(); // No argument ctor Pass *(*TargetCtor)(TargetMachine&); // Ctor taking TargetMachine object... public: - /// PassType - Define symbolic constants that can be used to test to see if - /// this pass should be listed by analyze or opt. Passes can use none, one or - /// many of these flags or'd together. It is not legal to combine the - /// AnalysisGroup flag with others. - /// - enum { - Analysis = 1, Optimization = 2, AnalysisGroup = 4 - }; - /// PassInfo ctor - Do not call this directly, this should only be invoked /// through RegisterPass. PassInfo(const char *name, const char *arg, const std::type_info &ti, - unsigned char pt, Pass *(*normal)() = 0, - Pass *(*targetctor)(TargetMachine &) = 0) - : PassName(name), PassArgument(arg), TypeInfo(ti), PassType(pt), + Pass *(*normal)() = 0, Pass *(*targetctor)(TargetMachine &) = 0) + : PassName(name), PassArgument(arg), TypeInfo(ti), IsAnalysisGroup(false), NormalCtor(normal), TargetCtor(targetctor) { } @@ -78,11 +68,11 @@ /// const std::type_info &getTypeInfo() const { return TypeInfo; } - /// getPassType - Return the PassType of a pass. Note that this can be - /// several different types or'd together. This is _strictly_ for use by opt, - /// analyze and llc for deciding which passes to use as command line options. + /// isAnalysisGroup - Return true if this is an analysis group, not a normal + /// pass. /// - unsigned getPassType() const { return PassType; } + bool isAnalysisGroup() const { return IsAnalysisGroup; } + void SetIsAnalysisGroup() { IsAnalysisGroup = true; } /// getNormalCtor - Return a pointer to a function, that when called, creates /// an instance of the pass and returns it. This pointer may be null if there @@ -97,7 +87,7 @@ /// createPass() - Use this method to create an instance of this pass. Pass *createPass() const { - assert((PassType != AnalysisGroup || NormalCtor) && + assert((!isAnalysisGroup() || NormalCtor) && "No default implementation found for analysis group!"); assert(NormalCtor && "Cannot call createPass on PassInfo without default ctor!"); @@ -153,21 +143,21 @@ const PassInfo *getPassInfo() const { return &PIObj; } RegisterPassBase(const char *Name, const char *Arg, const std::type_info &TI, - unsigned char PT, Pass *(*Normal)() = 0, + Pass *(*Normal)() = 0, Pass *(*TargetCtor)(TargetMachine &) = 0) - : PIObj(Name, Arg, TI, PT, Normal, TargetCtor) { + : PIObj(Name, Arg, TI, Normal, TargetCtor) { registerPass(); } - RegisterPassBase(const std::type_info &TI, unsigned char PT) - : PIObj("", "", TI, PT, 0, 0) { + RegisterPassBase(const std::type_info &TI) + : PIObj("", "", TI, 0, 0) { // This ctor may only be used for analysis groups: it does not auto-register // the pass. - assert(PT == PassInfo::AnalysisGroup && "Not an AnalysisGroup!"); + PIObj.SetIsAnalysisGroup(); } ~RegisterPassBase() { // Intentionally non-virtual. // Analysis groups are registered/unregistered by their dtor. - if (PIObj.getPassType() != PassInfo::AnalysisGroup) + if (!PIObj.isAnalysisGroup()) unregisterPass(); } @@ -189,26 +179,24 @@ struct RegisterPass : public RegisterPassBase { // Register Pass using default constructor... - RegisterPass(const char *PassArg, const char *Name, unsigned char PassTy = 0) - : RegisterPassBase(Name, PassArg, typeid(PassName), PassTy, + RegisterPass(const char *PassArg, const char *Name) + : RegisterPassBase(Name, PassArg, typeid(PassName), callDefaultCtor) {} // Register Pass using default constructor explicitly... - RegisterPass(const char *PassArg, const char *Name, unsigned char PassTy, + RegisterPass(const char *PassArg, const char *Name, Pass *(*ctor)()) - : RegisterPassBase(Name, PassArg, typeid(PassName), PassTy, ctor) {} + : RegisterPassBase(Name, PassArg, typeid(PassName), ctor) {} // Register Pass using TargetMachine constructor... - RegisterPass(const char *PassArg, const char *Name, unsigned char PassTy, + RegisterPass(const char *PassArg, const char *Name, Pass *(*targetctor)(TargetMachine &)) - : RegisterPassBase(Name, PassArg, typeid(PassName), PassTy, - 0, targetctor) {} + : RegisterPassBase(Name, PassArg, typeid(PassName), 0, targetctor) {} // Generic constructor version that has an unknown ctor type... template - RegisterPass(const char *PassArg, const char *Name, unsigned char PassTy, - CtorType *Fn) - : RegisterPassBase(Name, PassArg, typeid(PassName), PassTy, 0) {} + RegisterPass(const char *PassArg, const char *Name, CtorType *Fn) + : RegisterPassBase(Name, PassArg, typeid(PassName), 0) {} }; /// RegisterOpt - Register something that is to show up in Opt, this is just a @@ -217,7 +205,7 @@ template struct RegisterOpt : public RegisterPassBase { RegisterOpt(const char *PassArg, const char *Name, bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), PassInfo::Optimization, + : RegisterPassBase(Name, PassArg, typeid(PassName), callDefaultCtor) { if (CFGOnly) setOnlyUsesCFG(); } @@ -226,8 +214,7 @@ /// RegisterOpt(const char *PassArg, const char *Name, Pass *(*ctor)(), bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), - PassInfo::Optimization, ctor) { + : RegisterPassBase(Name, PassArg, typeid(PassName), ctor) { if (CFGOnly) setOnlyUsesCFG(); } @@ -235,7 +222,7 @@ /// RegisterOpt(const char *PassArg, const char *Name, FunctionPass *(*ctor)(), bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), PassInfo::Optimization, + : RegisterPassBase(Name, PassArg, typeid(PassName), static_cast(ctor)) { if (CFGOnly) setOnlyUsesCFG(); } @@ -244,8 +231,7 @@ /// RegisterOpt(const char *PassArg, const char *Name, Pass *(*targetctor)(TargetMachine &), bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), - PassInfo::Optimization, 0, targetctor) { + : RegisterPassBase(Name, PassArg, typeid(PassName), 0, targetctor) { if (CFGOnly) setOnlyUsesCFG(); } @@ -254,7 +240,7 @@ RegisterOpt(const char *PassArg, const char *Name, FunctionPass *(*targetctor)(TargetMachine &), bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), PassInfo::Optimization, 0, + : RegisterPassBase(Name, PassArg, typeid(PassName), 0, static_cast(targetctor)) { if (CFGOnly) setOnlyUsesCFG(); } @@ -270,7 +256,7 @@ struct RegisterAnalysis : public RegisterPassBase { RegisterAnalysis(const char *PassArg, const char *Name, bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), PassInfo::Analysis, + : RegisterPassBase(Name, PassArg, typeid(PassName), callDefaultCtor) { if (CFGOnly) setOnlyUsesCFG(); } From lattner at cs.uiuc.edu Sun Aug 27 17:30:37 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:30:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/CFGPrinter.cpp InstCount.cpp IntervalPartition.cpp LoopInfo.cpp PostDominators.cpp ScalarEvolution.cpp Message-ID: <200608272230.k7RMUb1G011186@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: CFGPrinter.cpp updated: 1.16 -> 1.17 InstCount.cpp updated: 1.14 -> 1.15 IntervalPartition.cpp updated: 1.31 -> 1.32 LoopInfo.cpp updated: 1.76 -> 1.77 PostDominators.cpp updated: 1.57 -> 1.58 ScalarEvolution.cpp updated: 1.50 -> 1.51 --- Log message: Eliminate RegisterAnalysis. RegisterPass now does all that is necessary. --- Diffs of the changes: (+13 -13) CFGPrinter.cpp | 6 +++--- InstCount.cpp | 4 ++-- IntervalPartition.cpp | 2 +- LoopInfo.cpp | 2 +- PostDominators.cpp | 10 +++++----- ScalarEvolution.cpp | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) Index: llvm/lib/Analysis/CFGPrinter.cpp diff -u llvm/lib/Analysis/CFGPrinter.cpp:1.16 llvm/lib/Analysis/CFGPrinter.cpp:1.17 --- llvm/lib/Analysis/CFGPrinter.cpp:1.16 Tue Jun 27 11:49:46 2006 +++ llvm/lib/Analysis/CFGPrinter.cpp Sun Aug 27 17:30:17 2006 @@ -109,8 +109,8 @@ } }; - RegisterAnalysis P1("print-cfg", - "Print CFG of function to 'dot' file"); + RegisterPass P1("print-cfg", + "Print CFG of function to 'dot' file"); struct CFGOnlyPrinter : public CFGPrinter { virtual bool runOnFunction(Function &F) { @@ -127,7 +127,7 @@ } }; - RegisterAnalysis + RegisterPass P2("print-cfg-only", "Print CFG of function to 'dot' file (with no function bodies)"); } Index: llvm/lib/Analysis/InstCount.cpp diff -u llvm/lib/Analysis/InstCount.cpp:1.14 llvm/lib/Analysis/InstCount.cpp:1.15 --- llvm/lib/Analysis/InstCount.cpp:1.14 Sun Jan 22 17:19:18 2006 +++ llvm/lib/Analysis/InstCount.cpp Sun Aug 27 17:30:17 2006 @@ -55,8 +55,8 @@ }; - RegisterAnalysis X("instcount", - "Counts the various types of Instructions"); + RegisterPass X("instcount", + "Counts the various types of Instructions"); } FunctionPass *llvm::createInstCountPass() { return new InstCount(); } Index: llvm/lib/Analysis/IntervalPartition.cpp diff -u llvm/lib/Analysis/IntervalPartition.cpp:1.31 llvm/lib/Analysis/IntervalPartition.cpp:1.32 --- llvm/lib/Analysis/IntervalPartition.cpp:1.31 Tue Apr 26 09:48:28 2005 +++ llvm/lib/Analysis/IntervalPartition.cpp Sun Aug 27 17:30:17 2006 @@ -15,7 +15,7 @@ #include "llvm/Analysis/IntervalIterator.h" using namespace llvm; -static RegisterAnalysis +static RegisterPass X("intervals", "Interval Partition Construction", true); //===----------------------------------------------------------------------===// Index: llvm/lib/Analysis/LoopInfo.cpp diff -u llvm/lib/Analysis/LoopInfo.cpp:1.76 llvm/lib/Analysis/LoopInfo.cpp:1.77 --- llvm/lib/Analysis/LoopInfo.cpp:1.76 Sat Aug 12 00:02:03 2006 +++ llvm/lib/Analysis/LoopInfo.cpp Sun Aug 27 17:30:17 2006 @@ -25,7 +25,7 @@ #include using namespace llvm; -static RegisterAnalysis +static RegisterPass X("loops", "Natural Loop Construction", true); //===----------------------------------------------------------------------===// Index: llvm/lib/Analysis/PostDominators.cpp diff -u llvm/lib/Analysis/PostDominators.cpp:1.57 llvm/lib/Analysis/PostDominators.cpp:1.58 --- llvm/lib/Analysis/PostDominators.cpp:1.57 Wed Jun 7 17:00:26 2006 +++ llvm/lib/Analysis/PostDominators.cpp Sun Aug 27 17:30:17 2006 @@ -23,7 +23,7 @@ // ImmediatePostDominators Implementation //===----------------------------------------------------------------------===// -static RegisterAnalysis +static RegisterPass D("postidom", "Immediate Post-Dominators Construction", true); unsigned ImmediatePostDominators::DFSPass(BasicBlock *V, InfoRec &VInfo, @@ -145,7 +145,7 @@ // PostDominatorSet Implementation //===----------------------------------------------------------------------===// -static RegisterAnalysis +static RegisterPass B("postdomset", "Post-Dominator Set Construction", true); // Postdominator set construction. This converts the specified function to only @@ -212,7 +212,7 @@ // PostDominatorTree Implementation //===----------------------------------------------------------------------===// -static RegisterAnalysis +static RegisterPass F("postdomtree", "Post-Dominator Tree Construction", true); DominatorTreeBase::Node *PostDominatorTree::getNodeForBlock(BasicBlock *BB) { @@ -258,7 +258,7 @@ // PostETForest Implementation //===----------------------------------------------------------------------===// -static RegisterAnalysis +static RegisterPass G("postetforest", "Post-ET-Forest Construction", true); ETNode *PostETForest::getNodeForBlock(BasicBlock *BB) { @@ -322,7 +322,7 @@ // PostDominanceFrontier Implementation //===----------------------------------------------------------------------===// -static RegisterAnalysis +static RegisterPass H("postdomfrontier", "Post-Dominance Frontier Construction", true); const DominanceFrontier::DomSetType & Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.50 llvm/lib/Analysis/ScalarEvolution.cpp:1.51 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.50 Sun Aug 27 07:54:01 2006 +++ llvm/lib/Analysis/ScalarEvolution.cpp Sun Aug 27 17:30:17 2006 @@ -80,7 +80,7 @@ using namespace llvm; namespace { - RegisterAnalysis + RegisterPass R("scalar-evolution", "Scalar Evolution Analysis"); Statistic<> From lattner at cs.uiuc.edu Sun Aug 27 17:30:39 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:30:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Dominators.cpp Message-ID: <200608272230.k7RMUdIm011191@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Dominators.cpp updated: 1.72 -> 1.73 --- Log message: Eliminate RegisterAnalysis. RegisterPass now does all that is necessary. --- Diffs of the changes: (+5 -5) Dominators.cpp | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/VMCore/Dominators.cpp diff -u llvm/lib/VMCore/Dominators.cpp:1.72 llvm/lib/VMCore/Dominators.cpp:1.73 --- llvm/lib/VMCore/Dominators.cpp:1.72 Tue Aug 1 17:24:47 2006 +++ llvm/lib/VMCore/Dominators.cpp Sun Aug 27 17:30:17 2006 @@ -44,7 +44,7 @@ // //===----------------------------------------------------------------------===// -static RegisterAnalysis +static RegisterPass C("idom", "Immediate Dominators Construction", true); unsigned ImmediateDominators::DFSPass(BasicBlock *V, InfoRec &VInfo, @@ -243,7 +243,7 @@ // DominatorSet Implementation //===----------------------------------------------------------------------===// -static RegisterAnalysis +static RegisterPass B("domset", "Dominator Set Construction", true); // dominates - Return true if A dominates B. This performs the special checks @@ -343,7 +343,7 @@ // DominatorTree Implementation //===----------------------------------------------------------------------===// -static RegisterAnalysis +static RegisterPass E("domtree", "Dominator Tree Construction", true); // DominatorTreeBase::reset - Free all of the tree node memory. @@ -434,7 +434,7 @@ // DominanceFrontier Implementation //===----------------------------------------------------------------------===// -static RegisterAnalysis +static RegisterPass G("domfrontier", "Dominance Frontier Construction", true); const DominanceFrontier::DomSetType & @@ -813,7 +813,7 @@ // ETForest implementation //===----------------------------------------------------------------------===// -static RegisterAnalysis +static RegisterPass D("etforest", "ET Forest Construction", true); void ETForestBase::reset() { From lattner at cs.uiuc.edu Sun Aug 27 17:30:40 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:30:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp CallTargets.cpp CompleteBottomUp.cpp DataStructureStats.cpp EquivClassGraphs.cpp GraphChecker.cpp Local.cpp TopDownClosure.cpp Message-ID: <200608272230.k7RMUeq5011210@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: BottomUpClosure.cpp updated: 1.119 -> 1.120 CallTargets.cpp updated: 1.2 -> 1.3 CompleteBottomUp.cpp updated: 1.35 -> 1.36 DataStructureStats.cpp updated: 1.20 -> 1.21 EquivClassGraphs.cpp updated: 1.47 -> 1.48 GraphChecker.cpp updated: 1.20 -> 1.21 Local.cpp updated: 1.152 -> 1.153 TopDownClosure.cpp updated: 1.90 -> 1.91 --- Log message: Eliminate RegisterAnalysis. RegisterPass now does all that is necessary. --- Diffs of the changes: (+8 -8) BottomUpClosure.cpp | 2 +- CallTargets.cpp | 2 +- CompleteBottomUp.cpp | 2 +- DataStructureStats.cpp | 2 +- EquivClassGraphs.cpp | 2 +- GraphChecker.cpp | 2 +- Local.cpp | 2 +- TopDownClosure.cpp | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.119 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.120 --- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.119 Mon Jun 19 13:22:59 2006 +++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp Sun Aug 27 17:30:17 2006 @@ -37,7 +37,7 @@ UpdateGlobals("budatastructures-update-from-globals", cl::desc("Update local graph from global graph when processing function")); - RegisterAnalysis + RegisterPass X("budatastructure", "Bottom-up Data Structure Analysis"); } Index: llvm/lib/Analysis/DataStructure/CallTargets.cpp diff -u llvm/lib/Analysis/DataStructure/CallTargets.cpp:1.2 llvm/lib/Analysis/DataStructure/CallTargets.cpp:1.3 --- llvm/lib/Analysis/DataStructure/CallTargets.cpp:1.2 Fri Jun 16 09:33:53 2006 +++ llvm/lib/Analysis/DataStructure/CallTargets.cpp Sun Aug 27 17:30:17 2006 @@ -34,7 +34,7 @@ Statistic<> CompleteInd("calltarget", "Number of complete indirect calls"); Statistic<> CompleteEmpty("calltarget", "Number of complete empty calls"); - RegisterAnalysis X("calltarget", "Find Call Targets (uses DSA)"); + RegisterPass X("calltarget","Find Call Targets (uses DSA)"); } void CallTargetFinder::findIndTargets(Module &M) Index: llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp diff -u llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.35 llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.36 --- llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.35 Fri Jun 16 09:43:36 2006 +++ llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp Sun Aug 27 17:30:17 2006 @@ -25,7 +25,7 @@ using namespace llvm; namespace { - RegisterAnalysis + RegisterPass X("cbudatastructure", "'Complete' Bottom-up Data Structure Analysis"); Statistic<> NumCBUInlines("cbudatastructures", "Number of graphs inlined"); } Index: llvm/lib/Analysis/DataStructure/DataStructureStats.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructureStats.cpp:1.20 llvm/lib/Analysis/DataStructure/DataStructureStats.cpp:1.21 --- llvm/lib/Analysis/DataStructure/DataStructureStats.cpp:1.20 Sun Jan 22 17:19:18 2006 +++ llvm/lib/Analysis/DataStructure/DataStructureStats.cpp Sun Aug 27 17:30:17 2006 @@ -60,7 +60,7 @@ void print(std::ostream &O, const Module* = 0) const { } }; - static RegisterAnalysis Z("dsstats", "DS Graph Statistics"); + static RegisterPass Z("dsstats", "DS Graph Statistics"); } FunctionPass *llvm::createDataStructureStatsPass() { Index: llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp diff -u llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.47 llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.48 --- llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.47 Fri May 12 12:41:45 2006 +++ llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp Sun Aug 27 17:30:17 2006 @@ -30,7 +30,7 @@ using namespace llvm; namespace { - RegisterAnalysis X("eqdatastructure", + RegisterPass X("eqdatastructure", "Equivalence-class Bottom-up Data Structure Analysis"); Statistic<> NumEquivBUInlines("equivdatastructures", "Number of graphs inlined"); Index: llvm/lib/Analysis/DataStructure/GraphChecker.cpp diff -u llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.20 llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.21 --- llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.20 Tue Apr 25 14:33:41 2006 +++ llvm/lib/Analysis/DataStructure/GraphChecker.cpp Sun Aug 27 17:30:17 2006 @@ -74,7 +74,7 @@ void verify(const DSGraph &G); }; - RegisterAnalysis X("datastructure-gc", "DSA Graph Checking Pass"); + RegisterPass X("datastructure-gc", "DSA Graph Checking Pass"); } FunctionPass *llvm::createDataStructureGraphCheckerPass() { Index: llvm/lib/Analysis/DataStructure/Local.cpp diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.152 llvm/lib/Analysis/DataStructure/Local.cpp:1.153 --- llvm/lib/Analysis/DataStructure/Local.cpp:1.152 Tue Jun 27 20:16:06 2006 +++ llvm/lib/Analysis/DataStructure/Local.cpp Sun Aug 27 17:30:17 2006 @@ -33,7 +33,7 @@ using namespace llvm; -static RegisterAnalysis +static RegisterPass X("datastructure", "Local Data Structure Analysis"); static cl::opt Index: llvm/lib/Analysis/DataStructure/TopDownClosure.cpp diff -u llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.90 llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.91 --- llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.90 Sun Jan 22 17:19:18 2006 +++ llvm/lib/Analysis/DataStructure/TopDownClosure.cpp Sun Aug 27 17:30:17 2006 @@ -32,7 +32,7 @@ #endif namespace { - RegisterAnalysis // Register the pass + RegisterPass // Register the pass Y("tddatastructure", "Top-down Data Structure Analysis"); Statistic<> NumTDInlines("tddatastructures", "Number of graphs inlined"); From lattner at cs.uiuc.edu Sun Aug 27 17:30:40 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:30:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/FindUsedTypes.cpp Message-ID: <200608272230.k7RMUecR011213@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: FindUsedTypes.cpp updated: 1.36 -> 1.37 --- Log message: Eliminate RegisterAnalysis. RegisterPass now does all that is necessary. --- Diffs of the changes: (+1 -1) FindUsedTypes.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Analysis/IPA/FindUsedTypes.cpp diff -u llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.36 llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.37 --- llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.36 Wed Jun 7 17:00:26 2006 +++ llvm/lib/Analysis/IPA/FindUsedTypes.cpp Sun Aug 27 17:30:17 2006 @@ -21,7 +21,7 @@ #include "llvm/Support/InstIterator.h" using namespace llvm; -static RegisterAnalysis +static RegisterPass X("printusedtypes", "Find Used Types"); // IncorporateType - Incorporate one type and all of its subtypes into the From lattner at cs.uiuc.edu Sun Aug 27 17:30:40 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:30:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp LiveVariables.cpp Message-ID: <200608272230.k7RMUeV6011222@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveIntervalAnalysis.cpp updated: 1.170 -> 1.171 LiveVariables.cpp updated: 1.56 -> 1.57 --- Log message: Eliminate RegisterAnalysis. RegisterPass now does all that is necessary. --- Diffs of the changes: (+2 -2) LiveIntervalAnalysis.cpp | 2 +- LiveVariables.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.170 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.171 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.170 Sun Aug 27 07:47:48 2006 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Sun Aug 27 17:30:17 2006 @@ -38,7 +38,7 @@ using namespace llvm; namespace { - RegisterAnalysis X("liveintervals", "Live Interval Analysis"); + RegisterPass X("liveintervals", "Live Interval Analysis"); static Statistic<> numIntervals ("liveintervals", "Number of original intervals"); Index: llvm/lib/CodeGen/LiveVariables.cpp diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.56 llvm/lib/CodeGen/LiveVariables.cpp:1.57 --- llvm/lib/CodeGen/LiveVariables.cpp:1.56 Fri Jul 21 16:15:20 2006 +++ llvm/lib/CodeGen/LiveVariables.cpp Sun Aug 27 17:30:17 2006 @@ -38,7 +38,7 @@ #include using namespace llvm; -static RegisterAnalysis X("livevars", "Live Variable Analysis"); +static RegisterPass X("livevars", "Live Variable Analysis"); void LiveVariables::VarInfo::dump() const { std::cerr << "Register Defined by: "; From lattner at cs.uiuc.edu Sun Aug 27 17:30:41 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:30:41 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/AnalysisWrappers.cpp GraphPrinters.cpp PrintSCC.cpp Message-ID: <200608272230.k7RMUf5H011231@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: AnalysisWrappers.cpp updated: 1.18 -> 1.19 GraphPrinters.cpp updated: 1.11 -> 1.12 PrintSCC.cpp updated: 1.14 -> 1.15 --- Log message: Eliminate RegisterAnalysis. RegisterPass now does all that is necessary. --- Diffs of the changes: (+6 -6) AnalysisWrappers.cpp | 4 ++-- GraphPrinters.cpp | 4 ++-- PrintSCC.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/tools/opt/AnalysisWrappers.cpp diff -u llvm/tools/opt/AnalysisWrappers.cpp:1.18 llvm/tools/opt/AnalysisWrappers.cpp:1.19 --- llvm/tools/opt/AnalysisWrappers.cpp:1.18 Tue Apr 18 18:45:19 2006 +++ llvm/tools/opt/AnalysisWrappers.cpp Sun Aug 27 17:30:17 2006 @@ -61,7 +61,7 @@ } }; - RegisterAnalysis + RegisterPass P1("externalfnconstants", "Print external fn callsites passed constants"); struct CallGraphPrinter : public ModulePass { @@ -76,6 +76,6 @@ } }; - RegisterAnalysis + RegisterPass P2("callgraph", "Print a call graph"); } Index: llvm/tools/opt/GraphPrinters.cpp diff -u llvm/tools/opt/GraphPrinters.cpp:1.11 llvm/tools/opt/GraphPrinters.cpp:1.12 --- llvm/tools/opt/GraphPrinters.cpp:1.11 Wed May 24 12:04:04 2006 +++ llvm/tools/opt/GraphPrinters.cpp Sun Aug 27 17:30:17 2006 @@ -72,6 +72,6 @@ } }; - RegisterAnalysis P2("print-callgraph", - "Print Call Graph to 'dot' file"); + RegisterPass P2("print-callgraph", + "Print Call Graph to 'dot' file"); } Index: llvm/tools/opt/PrintSCC.cpp diff -u llvm/tools/opt/PrintSCC.cpp:1.14 llvm/tools/opt/PrintSCC.cpp:1.15 --- llvm/tools/opt/PrintSCC.cpp:1.14 Thu Apr 21 16:08:44 2005 +++ llvm/tools/opt/PrintSCC.cpp Sun Aug 27 17:30:17 2006 @@ -57,10 +57,10 @@ } }; - RegisterAnalysis + RegisterPass Y("cfgscc", "Print SCCs of each function CFG"); - RegisterAnalysis + RegisterPass Z("callscc", "Print SCCs of the Call Graph"); } From lattner at cs.uiuc.edu Sun Aug 27 17:30:41 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:30:41 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/PassSupport.h Message-ID: <200608272230.k7RMUfQS011233@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: PassSupport.h updated: 1.27 -> 1.28 --- Log message: Eliminate RegisterAnalysis. RegisterPass now does all that is necessary. --- Diffs of the changes: (+17 -24) PassSupport.h | 41 +++++++++++++++++------------------------ 1 files changed, 17 insertions(+), 24 deletions(-) Index: llvm/include/llvm/PassSupport.h diff -u llvm/include/llvm/PassSupport.h:1.27 llvm/include/llvm/PassSupport.h:1.28 --- llvm/include/llvm/PassSupport.h:1.27 Sun Aug 27 17:21:55 2006 +++ llvm/include/llvm/PassSupport.h Sun Aug 27 17:30:17 2006 @@ -179,24 +179,33 @@ struct RegisterPass : public RegisterPassBase { // Register Pass using default constructor... - RegisterPass(const char *PassArg, const char *Name) + RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false) : RegisterPassBase(Name, PassArg, typeid(PassName), - callDefaultCtor) {} + callDefaultCtor) { + if (CFGOnly) setOnlyUsesCFG(); + } // Register Pass using default constructor explicitly... RegisterPass(const char *PassArg, const char *Name, - Pass *(*ctor)()) - : RegisterPassBase(Name, PassArg, typeid(PassName), ctor) {} + Pass *(*ctor)(), bool CFGOnly = false) + : RegisterPassBase(Name, PassArg, typeid(PassName), ctor) { + if (CFGOnly) setOnlyUsesCFG(); + } // Register Pass using TargetMachine constructor... RegisterPass(const char *PassArg, const char *Name, - Pass *(*targetctor)(TargetMachine &)) - : RegisterPassBase(Name, PassArg, typeid(PassName), 0, targetctor) {} + Pass *(*targetctor)(TargetMachine &), bool CFGOnly = false) + : RegisterPassBase(Name, PassArg, typeid(PassName), 0, targetctor) { + if (CFGOnly) setOnlyUsesCFG(); + } // Generic constructor version that has an unknown ctor type... template - RegisterPass(const char *PassArg, const char *Name, CtorType *Fn) - : RegisterPassBase(Name, PassArg, typeid(PassName), 0) {} + RegisterPass(const char *PassArg, const char *Name, CtorType *Fn, + bool CFGOnly = false) + : RegisterPassBase(Name, PassArg, typeid(PassName), 0) { + if (CFGOnly) setOnlyUsesCFG(); + } }; /// RegisterOpt - Register something that is to show up in Opt, this is just a @@ -246,22 +255,6 @@ } }; -/// RegisterAnalysis - Register something that is to show up in Analysis, this -/// is just a shortcut for specifying RegisterPass... Analyses take a special -/// argument that, when set to true, tells the system that the analysis ONLY -/// depends on the shape of the CFG, so if a transformation preserves the CFG -/// that the analysis is not invalidated. -/// -template -struct RegisterAnalysis : public RegisterPassBase { - RegisterAnalysis(const char *PassArg, const char *Name, - bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), - callDefaultCtor) { - if (CFGOnly) setOnlyUsesCFG(); - } -}; - /// RegisterAnalysisGroup - Register a Pass as a member of an analysis _group_. /// Analysis groups are used to define an interface (which need not derive from From lattner at cs.uiuc.edu Sun Aug 27 17:31:26 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:31:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/CallTargets.cpp Message-ID: <200608272231.k7RMVQKN011274@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: CallTargets.cpp updated: 1.3 -> 1.4 --- Log message: Fit to 80 cols --- Diffs of the changes: (+6 -3) CallTargets.cpp | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/lib/Analysis/DataStructure/CallTargets.cpp diff -u llvm/lib/Analysis/DataStructure/CallTargets.cpp:1.3 llvm/lib/Analysis/DataStructure/CallTargets.cpp:1.4 --- llvm/lib/Analysis/DataStructure/CallTargets.cpp:1.3 Sun Aug 27 17:30:17 2006 +++ llvm/lib/Analysis/DataStructure/CallTargets.cpp Sun Aug 27 17:31:12 2006 @@ -58,8 +58,10 @@ } if (N->isComplete() && !IndMap[cs].size()) { ++CompleteEmpty; - std::cerr << "Call site empty: '" << cs.getInstruction()->getName() - << "' In '" << cs.getInstruction()->getParent()->getParent()->getName() + std::cerr << "Call site empty: '" + << cs.getInstruction()->getName() + << "' In '" + << cs.getInstruction()->getParent()->getParent()->getName() << "'\n"; } } else { @@ -74,7 +76,8 @@ { return; O << "[* = incomplete] CS: func list\n"; - for (std::map >::const_iterator ii = IndMap.begin(), + for (std::map >::const_iterator ii = + IndMap.begin(), ee = IndMap.end(); ii != ee; ++ii) { if (!ii->first.getCalledFunction()) { //only print indirect if (!isComplete(ii->first)) { From lattner at cs.uiuc.edu Sun Aug 27 17:40:40 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:40:40 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp Message-ID: <200608272240.k7RMeell011479@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: opt.cpp updated: 1.116 -> 1.117 --- Log message: -analyze mode shouldn't output a .bc file. --- Diffs of the changes: (+1 -2) opt.cpp | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.116 llvm/tools/opt/opt.cpp:1.117 --- llvm/tools/opt/opt.cpp:1.116 Sun Aug 27 17:07:01 2006 +++ llvm/tools/opt/opt.cpp Sun Aug 27 17:40:26 2006 @@ -30,7 +30,6 @@ #include #include #include - using namespace llvm; // The OptimizationList is automatically populated with registered Passes by the @@ -250,7 +249,7 @@ Passes.add(createVerifierPass()); // Write bytecode out to disk or cout as the last step... - if (!NoOutput) + if (!NoOutput && !AnalyzeOnly) Passes.add(new WriteBytecodePass(Out, Out != &std::cout)); // Now that we have all of the passes ready, run them. From lattner at cs.uiuc.edu Sun Aug 27 17:42:12 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:42:12 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll arraytest.ll badcases.ll basictest.ll fieldmerge.ll goodcases.ll indcalltest.ll misctests.ll physicalsubtype.ll recursion.ll simplest-test.ll simpletest.ll structpadding.ll Message-ID: <200608272242.k7RMgCEs011552@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/DSAnalysis: arraymerge.ll updated: 1.3 -> 1.4 arraytest.ll updated: 1.3 -> 1.4 badcases.ll updated: 1.3 -> 1.4 basictest.ll updated: 1.3 -> 1.4 fieldmerge.ll updated: 1.3 -> 1.4 goodcases.ll updated: 1.3 -> 1.4 indcalltest.ll updated: 1.3 -> 1.4 misctests.ll updated: 1.3 -> 1.4 physicalsubtype.ll updated: 1.3 -> 1.4 recursion.ll updated: 1.3 -> 1.4 simplest-test.ll updated: 1.3 -> 1.4 simpletest.ll updated: 1.3 -> 1.4 structpadding.ll updated: 1.3 -> 1.4 --- Log message: opt no longer reads .ll files. Run llvm-as explicitly. --- Diffs of the changes: (+13 -13) arraymerge.ll | 2 +- arraytest.ll | 2 +- badcases.ll | 2 +- basictest.ll | 2 +- fieldmerge.ll | 2 +- goodcases.ll | 2 +- indcalltest.ll | 2 +- misctests.ll | 2 +- physicalsubtype.ll | 2 +- recursion.ll | 2 +- simplest-test.ll | 2 +- simpletest.ll | 2 +- structpadding.ll | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) Index: llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll:1.3 llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll:1.4 --- llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll Sun Aug 27 17:41:58 2006 @@ -2,7 +2,7 @@ ; folded completely away if possible. This is a very common case, so it should ; be efficient. ; -; RUN: opt -analyze %s -tddatastructure +; RUN: llvm-as < %s | opt -analyze -tddatastructure ; implementation Index: llvm/test/Regression/Transforms/DSAnalysis/arraytest.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/arraytest.ll:1.3 llvm/test/Regression/Transforms/DSAnalysis/arraytest.ll:1.4 --- llvm/test/Regression/Transforms/DSAnalysis/arraytest.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Transforms/DSAnalysis/arraytest.ll Sun Aug 27 17:41:58 2006 @@ -1,5 +1,5 @@ ; -; RUN: opt -analyze %s -tddatastructure +; RUN: llvm-as < %s | opt -analyze -tddatastructure %crazy = type [2 x { [2 x sbyte], short } ] implementation Index: llvm/test/Regression/Transforms/DSAnalysis/badcases.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/badcases.ll:1.3 llvm/test/Regression/Transforms/DSAnalysis/badcases.ll:1.4 --- llvm/test/Regression/Transforms/DSAnalysis/badcases.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Transforms/DSAnalysis/badcases.ll Sun Aug 27 17:41:58 2006 @@ -1,6 +1,6 @@ ; This file contains a list of situations where node folding should happen... ; -; RUN: opt -analyze %s -tddatastructure +; RUN: llvm-as < %s | opt -analyze -tddatastructure implementation Index: llvm/test/Regression/Transforms/DSAnalysis/basictest.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/basictest.ll:1.3 llvm/test/Regression/Transforms/DSAnalysis/basictest.ll:1.4 --- llvm/test/Regression/Transforms/DSAnalysis/basictest.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Transforms/DSAnalysis/basictest.ll Sun Aug 27 17:41:58 2006 @@ -1,6 +1,6 @@ ; very simple test ; -; RUN: opt -analyze %s -tddatastructure +; RUN: llvm-as < %s | opt -analyze -tddatastructure implementation Index: llvm/test/Regression/Transforms/DSAnalysis/fieldmerge.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/fieldmerge.ll:1.3 llvm/test/Regression/Transforms/DSAnalysis/fieldmerge.ll:1.4 --- llvm/test/Regression/Transforms/DSAnalysis/fieldmerge.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Transforms/DSAnalysis/fieldmerge.ll Sun Aug 27 17:41:58 2006 @@ -1,5 +1,5 @@ ; -; RUN: opt -analyze %s -tddatastructure +; RUN: llvm-as < %s | opt -analyze -tddatastructure %str = type { int*, int* } Index: llvm/test/Regression/Transforms/DSAnalysis/goodcases.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/goodcases.ll:1.3 llvm/test/Regression/Transforms/DSAnalysis/goodcases.ll:1.4 --- llvm/test/Regression/Transforms/DSAnalysis/goodcases.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Transforms/DSAnalysis/goodcases.ll Sun Aug 27 17:41:58 2006 @@ -1,6 +1,6 @@ ; This file contains a list of cases where node folding should NOT happen ; -; RUN: opt -analyze %s -tddatastructure +; RUN: llvm-as < %s | opt -analyze -tddatastructure ; implementation Index: llvm/test/Regression/Transforms/DSAnalysis/indcalltest.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/indcalltest.ll:1.3 llvm/test/Regression/Transforms/DSAnalysis/indcalltest.ll:1.4 --- llvm/test/Regression/Transforms/DSAnalysis/indcalltest.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Transforms/DSAnalysis/indcalltest.ll Sun Aug 27 17:41:58 2006 @@ -1,5 +1,5 @@ ; -; RUN: opt -analyze %s -tddatastructure +; RUN: llvm-as < %s | opt -analyze -tddatastructure %G = global int 2 ; [#uses=1] %H = global int* null Index: llvm/test/Regression/Transforms/DSAnalysis/misctests.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/misctests.ll:1.3 llvm/test/Regression/Transforms/DSAnalysis/misctests.ll:1.4 --- llvm/test/Regression/Transforms/DSAnalysis/misctests.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Transforms/DSAnalysis/misctests.ll Sun Aug 27 17:41:58 2006 @@ -1,5 +1,5 @@ ; -; RUN: opt -analyze %s -tddatastructure +; RUN: llvm-as < %s | opt -analyze -tddatastructure int* %test1(int *%A) { %R = getelementptr int* %A, long 1 Index: llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll:1.3 llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll:1.4 --- llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll Sun Aug 27 17:41:58 2006 @@ -1,6 +1,6 @@ ; A test for "physical subtyping" used in some C programs... ; -; RUN: opt -analyze %s -tddatastructure +; RUN: llvm-as < %s | opt -analyze -tddatastructure ; %ST = type { int, int* } ; "Subtype" %DT = type { int, int*, int } ; "derived type" Index: llvm/test/Regression/Transforms/DSAnalysis/recursion.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/recursion.ll:1.3 llvm/test/Regression/Transforms/DSAnalysis/recursion.ll:1.4 --- llvm/test/Regression/Transforms/DSAnalysis/recursion.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Transforms/DSAnalysis/recursion.ll Sun Aug 27 17:41:58 2006 @@ -1,4 +1,4 @@ -; RUN: opt -analyze %s -tddatastructure +; RUN: llvm-as < %s | opt -analyze -tddatastructure implementation ; Functions: Index: llvm/test/Regression/Transforms/DSAnalysis/simplest-test.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/simplest-test.ll:1.3 llvm/test/Regression/Transforms/DSAnalysis/simplest-test.ll:1.4 --- llvm/test/Regression/Transforms/DSAnalysis/simplest-test.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Transforms/DSAnalysis/simplest-test.ll Sun Aug 27 17:41:58 2006 @@ -1,4 +1,4 @@ -; RUN: opt -analyze %s -tddatastructure +; RUN: llvm-as < %s | opt -analyze -tddatastructure void %foo(int* %X) { store int 4, int* %X Index: llvm/test/Regression/Transforms/DSAnalysis/simpletest.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/simpletest.ll:1.3 llvm/test/Regression/Transforms/DSAnalysis/simpletest.ll:1.4 --- llvm/test/Regression/Transforms/DSAnalysis/simpletest.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Transforms/DSAnalysis/simpletest.ll Sun Aug 27 17:41:58 2006 @@ -1,4 +1,4 @@ -; RUN: opt -analyze %s -tddatastructure +; RUN: llvm-as < %s | opt -analyze -tddatastructure implementation Index: llvm/test/Regression/Transforms/DSAnalysis/structpadding.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/structpadding.ll:1.3 llvm/test/Regression/Transforms/DSAnalysis/structpadding.ll:1.4 --- llvm/test/Regression/Transforms/DSAnalysis/structpadding.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Transforms/DSAnalysis/structpadding.ll Sun Aug 27 17:41:58 2006 @@ -1,4 +1,4 @@ -; RUN: opt -analyze %s -tddatastructure +; RUN: llvm-as < %s | opt -analyze -tddatastructure %str = type { int, int* } From lattner at cs.uiuc.edu Sun Aug 27 17:43:22 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:43:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Verifier.cpp Message-ID: <200608272243.k7RMhMZs011684@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.202 -> 1.203 Verifier.cpp updated: 1.161 -> 1.162 --- Log message: eliminate RegisterOpt. It does the same thing as RegisterPass. --- Diffs of the changes: (+3 -3) AsmWriter.cpp | 4 ++-- Verifier.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.202 llvm/lib/VMCore/AsmWriter.cpp:1.203 --- llvm/lib/VMCore/AsmWriter.cpp:1.202 Mon Aug 21 12:20:01 2006 +++ llvm/lib/VMCore/AsmWriter.cpp Sun Aug 27 17:42:52 2006 @@ -162,9 +162,9 @@ } // end namespace llvm -static RegisterOpt +static RegisterPass X("printm", "Print module to stderr"); -static RegisterOpt +static RegisterPass Y("print","Print function to stderr"); static void WriteAsOperandInternal(std::ostream &Out, const Value *V, Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.161 llvm/lib/VMCore/Verifier.cpp:1.162 --- llvm/lib/VMCore/Verifier.cpp:1.161 Sun Aug 27 07:54:02 2006 +++ llvm/lib/VMCore/Verifier.cpp Sun Aug 27 17:42:52 2006 @@ -239,7 +239,7 @@ } }; - RegisterOpt X("verify", "Module Verifier"); + RegisterPass X("verify", "Module Verifier"); } // End anonymous namespace From lattner at cs.uiuc.edu Sun Aug 27 17:43:26 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:43:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/Andersens.cpp CallGraph.cpp GlobalsModRef.cpp Message-ID: <200608272243.k7RMhQjK011782@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: Andersens.cpp updated: 1.30 -> 1.31 CallGraph.cpp updated: 1.55 -> 1.56 GlobalsModRef.cpp updated: 1.19 -> 1.20 --- Log message: eliminate RegisterOpt. It does the same thing as RegisterPass. --- Diffs of the changes: (+5 -5) Andersens.cpp | 4 ++-- CallGraph.cpp | 2 +- GlobalsModRef.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/Analysis/IPA/Andersens.cpp diff -u llvm/lib/Analysis/IPA/Andersens.cpp:1.30 llvm/lib/Analysis/IPA/Andersens.cpp:1.31 --- llvm/lib/Analysis/IPA/Andersens.cpp:1.30 Tue Jul 11 13:25:13 2006 +++ llvm/lib/Analysis/IPA/Andersens.cpp Sun Aug 27 17:42:51 2006 @@ -336,8 +336,8 @@ void visitInstruction(Instruction &I); }; - RegisterOpt X("anders-aa", - "Andersen's Interprocedural Alias Analysis"); + RegisterPass X("anders-aa", + "Andersen's Interprocedural Alias Analysis"); RegisterAnalysisGroup Y; } Index: llvm/lib/Analysis/IPA/CallGraph.cpp diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.55 llvm/lib/Analysis/IPA/CallGraph.cpp:1.56 --- llvm/lib/Analysis/IPA/CallGraph.cpp:1.55 Wed Jul 12 13:29:36 2006 +++ llvm/lib/Analysis/IPA/CallGraph.cpp Sun Aug 27 17:42:51 2006 @@ -182,7 +182,7 @@ }; RegisterAnalysisGroup X("Call Graph"); -RegisterOpt Y("basiccg", "Basic CallGraph Construction"); +RegisterPass Y("basiccg", "Basic CallGraph Construction"); RegisterAnalysisGroup Z; } //End anonymous namespace Index: llvm/lib/Analysis/IPA/GlobalsModRef.cpp diff -u llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.19 llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.20 --- llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.19 Wed Jul 12 13:29:36 2006 +++ llvm/lib/Analysis/IPA/GlobalsModRef.cpp Sun Aug 27 17:42:51 2006 @@ -135,8 +135,8 @@ std::vector &Writers); }; - RegisterOpt X("globalsmodref-aa", - "Simple mod/ref analysis for globals"); + RegisterPass X("globalsmodref-aa", + "Simple mod/ref analysis for globals"); RegisterAnalysisGroup Y; } From lattner at cs.uiuc.edu Sun Aug 27 17:43:26 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:43:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Hello/Hello.cpp Message-ID: <200608272243.k7RMhQOY011816@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Hello: Hello.cpp updated: 1.7 -> 1.8 --- Log message: eliminate RegisterOpt. It does the same thing as RegisterPass. --- Diffs of the changes: (+3 -2) Hello.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/Hello/Hello.cpp diff -u llvm/lib/Transforms/Hello/Hello.cpp:1.7 llvm/lib/Transforms/Hello/Hello.cpp:1.8 --- llvm/lib/Transforms/Hello/Hello.cpp:1.7 Mon Aug 7 18:17:24 2006 +++ llvm/lib/Transforms/Hello/Hello.cpp Sun Aug 27 17:42:52 2006 @@ -34,7 +34,7 @@ return false; } }; - RegisterOpt X("hello", "Hello World Pass"); + RegisterPass X("hello", "Hello World Pass"); // Hello2 - The second implementation with getAnalysisUsage implemented. struct Hello2 : public FunctionPass { @@ -52,5 +52,6 @@ AU.setPreservesAll(); }; }; - RegisterOpt Y("hello2", "Hello World Pass (with getAnalysisUsage implemented)"); + RegisterPass Y("hello2", + "Hello World Pass (with getAnalysisUsage implemented)"); } From lattner at cs.uiuc.edu Sun Aug 27 17:43:25 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:43:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysisCounter.cpp AliasAnalysisEvaluator.cpp AliasSetTracker.cpp BasicAliasAnalysis.cpp LoadValueNumbering.cpp ProfileInfo.cpp ProfileInfoLoaderPass.cpp ValueNumbering.cpp Message-ID: <200608272243.k7RMhPbW011754@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasAnalysisCounter.cpp updated: 1.13 -> 1.14 AliasAnalysisEvaluator.cpp updated: 1.27 -> 1.28 AliasSetTracker.cpp updated: 1.40 -> 1.41 BasicAliasAnalysis.cpp updated: 1.83 -> 1.84 LoadValueNumbering.cpp updated: 1.34 -> 1.35 ProfileInfo.cpp updated: 1.7 -> 1.8 ProfileInfoLoaderPass.cpp updated: 1.13 -> 1.14 ValueNumbering.cpp updated: 1.19 -> 1.20 --- Log message: eliminate RegisterOpt. It does the same thing as RegisterPass. --- Diffs of the changes: (+9 -9) AliasAnalysisCounter.cpp | 2 +- AliasAnalysisEvaluator.cpp | 2 +- AliasSetTracker.cpp | 2 +- BasicAliasAnalysis.cpp | 4 ++-- LoadValueNumbering.cpp | 2 +- ProfileInfo.cpp | 2 +- ProfileInfoLoaderPass.cpp | 2 +- ValueNumbering.cpp | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) Index: llvm/lib/Analysis/AliasAnalysisCounter.cpp diff -u llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.13 llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.14 --- llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.13 Thu Apr 21 16:04:58 2005 +++ llvm/lib/Analysis/AliasAnalysisCounter.cpp Sun Aug 27 17:42:51 2006 @@ -109,7 +109,7 @@ } }; - RegisterOpt + RegisterPass X("count-aa", "Count Alias Analysis Query Responses"); RegisterAnalysisGroup Y; } Index: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp diff -u llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.27 llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.28 --- llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.27 Thu Apr 21 16:04:58 2005 +++ llvm/lib/Analysis/AliasAnalysisEvaluator.cpp Sun Aug 27 17:42:51 2006 @@ -70,7 +70,7 @@ bool doFinalization(Module &M); }; - RegisterOpt + RegisterPass X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator"); } Index: llvm/lib/Analysis/AliasSetTracker.cpp diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.40 llvm/lib/Analysis/AliasSetTracker.cpp:1.41 --- llvm/lib/Analysis/AliasSetTracker.cpp:1.40 Tue Jun 27 18:56:13 2006 +++ llvm/lib/Analysis/AliasSetTracker.cpp Sun Aug 27 17:42:51 2006 @@ -568,5 +568,5 @@ return false; } }; - RegisterOpt X("print-alias-sets", "Alias Set Printer"); + RegisterPass X("print-alias-sets", "Alias Set Printer"); } Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.83 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.84 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.83 Sun Aug 27 07:54:01 2006 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Sun Aug 27 17:42:51 2006 @@ -72,7 +72,7 @@ }; // Register this pass... - RegisterOpt + RegisterPass U("no-aa", "No Alias Analysis (always returns 'may' alias)"); // Declare that we implement the AliasAnalysis interface @@ -117,7 +117,7 @@ }; // Register this pass... - RegisterOpt + RegisterPass X("basicaa", "Basic Alias Analysis (default AA impl)"); // Declare that we implement the AliasAnalysis interface Index: llvm/lib/Analysis/LoadValueNumbering.cpp diff -u llvm/lib/Analysis/LoadValueNumbering.cpp:1.34 llvm/lib/Analysis/LoadValueNumbering.cpp:1.35 --- llvm/lib/Analysis/LoadValueNumbering.cpp:1.34 Sun Jan 8 03:10:04 2006 +++ llvm/lib/Analysis/LoadValueNumbering.cpp Sun Aug 27 17:42:51 2006 @@ -81,7 +81,7 @@ }; // Register this pass... - RegisterOpt X("load-vn", "Load Value Numbering"); + RegisterPass X("load-vn", "Load Value Numbering"); // Declare that we implement the ValueNumbering interface RegisterAnalysisGroup Y; Index: llvm/lib/Analysis/ProfileInfo.cpp diff -u llvm/lib/Analysis/ProfileInfo.cpp:1.7 llvm/lib/Analysis/ProfileInfo.cpp:1.8 --- llvm/lib/Analysis/ProfileInfo.cpp:1.7 Thu Apr 21 16:04:58 2005 +++ llvm/lib/Analysis/ProfileInfo.cpp Sun Aug 27 17:42:51 2006 @@ -85,7 +85,7 @@ struct NoProfileInfo : public ImmutablePass, public ProfileInfo {}; // Register this pass... - RegisterOpt + RegisterPass X("no-profile", "No Profile Information"); // Declare that we implement the ProfileInfo interface Index: llvm/lib/Analysis/ProfileInfoLoaderPass.cpp diff -u llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.13 llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.14 --- llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.13 Mon Aug 21 12:20:01 2006 +++ llvm/lib/Analysis/ProfileInfoLoaderPass.cpp Sun Aug 27 17:42:51 2006 @@ -49,7 +49,7 @@ virtual bool runOnModule(Module &M); }; - RegisterOpt + RegisterPass X("profile-loader", "Load profile information from llvmprof.out"); RegisterAnalysisGroup Y; Index: llvm/lib/Analysis/ValueNumbering.cpp diff -u llvm/lib/Analysis/ValueNumbering.cpp:1.19 llvm/lib/Analysis/ValueNumbering.cpp:1.20 --- llvm/lib/Analysis/ValueNumbering.cpp:1.19 Wed Jun 7 17:00:26 2006 +++ llvm/lib/Analysis/ValueNumbering.cpp Sun Aug 27 17:42:51 2006 @@ -60,7 +60,7 @@ }; // Register this pass... - RegisterOpt + RegisterPass X("basicvn", "Basic Value Numbering (default GVN impl)"); // Declare that we implement the ValueNumbering interface From lattner at cs.uiuc.edu Sun Aug 27 17:43:25 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:43:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp LCSSA.cpp LoopSimplify.cpp LowerAllocations.cpp LowerInvoke.cpp LowerSelect.cpp LowerSwitch.cpp Mem2Reg.cpp UnifyFunctionExitNodes.cpp Message-ID: <200608272243.k7RMhPw3011710@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: BreakCriticalEdges.cpp updated: 1.31 -> 1.32 LCSSA.cpp updated: 1.27 -> 1.28 LoopSimplify.cpp updated: 1.73 -> 1.74 LowerAllocations.cpp updated: 1.60 -> 1.61 LowerInvoke.cpp updated: 1.38 -> 1.39 LowerSelect.cpp updated: 1.6 -> 1.7 LowerSwitch.cpp updated: 1.23 -> 1.24 Mem2Reg.cpp updated: 1.19 -> 1.20 UnifyFunctionExitNodes.cpp updated: 1.35 -> 1.36 --- Log message: eliminate RegisterOpt. It does the same thing as RegisterPass. --- Diffs of the changes: (+9 -9) BreakCriticalEdges.cpp | 2 +- LCSSA.cpp | 2 +- LoopSimplify.cpp | 2 +- LowerAllocations.cpp | 2 +- LowerInvoke.cpp | 2 +- LowerSelect.cpp | 2 +- LowerSwitch.cpp | 2 +- Mem2Reg.cpp | 2 +- UnifyFunctionExitNodes.cpp | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) Index: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp diff -u llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.31 llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.32 --- llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.31 Sun Aug 27 07:54:02 2006 +++ llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp Sun Aug 27 17:42:52 2006 @@ -47,7 +47,7 @@ } }; - RegisterOpt X("break-crit-edges", + RegisterPass X("break-crit-edges", "Break critical edges in CFG"); } Index: llvm/lib/Transforms/Utils/LCSSA.cpp diff -u llvm/lib/Transforms/Utils/LCSSA.cpp:1.27 llvm/lib/Transforms/Utils/LCSSA.cpp:1.28 --- llvm/lib/Transforms/Utils/LCSSA.cpp:1.27 Tue Aug 1 19:16:47 2006 +++ llvm/lib/Transforms/Utils/LCSSA.cpp Sun Aug 27 17:42:52 2006 @@ -80,7 +80,7 @@ } }; - RegisterOpt X("lcssa", "Loop-Closed SSA Form Pass"); + RegisterPass X("lcssa", "Loop-Closed SSA Form Pass"); } FunctionPass *llvm::createLCSSAPass() { return new LCSSA(); } Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.73 llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.74 --- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.73 Sun Aug 27 07:54:02 2006 +++ llvm/lib/Transforms/Utils/LoopSimplify.cpp Sun Aug 27 17:42:52 2006 @@ -89,7 +89,7 @@ std::vector &PredBlocks); }; - RegisterOpt + RegisterPass X("loopsimplify", "Canonicalize natural loops", true); } Index: llvm/lib/Transforms/Utils/LowerAllocations.cpp diff -u llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.60 llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.61 --- llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.60 Sun Aug 27 07:54:02 2006 +++ llvm/lib/Transforms/Utils/LowerAllocations.cpp Sun Aug 27 17:42:52 2006 @@ -65,7 +65,7 @@ bool runOnBasicBlock(BasicBlock &BB); }; - RegisterOpt + RegisterPass X("lowerallocs", "Lower allocations from instructions to calls"); } Index: llvm/lib/Transforms/Utils/LowerInvoke.cpp diff -u llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.38 llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.39 --- llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.38 Sun Aug 27 07:54:02 2006 +++ llvm/lib/Transforms/Utils/LowerInvoke.cpp Sun Aug 27 17:42:52 2006 @@ -94,7 +94,7 @@ unsigned JumpBufAlign; }; - RegisterOpt + RegisterPass X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators"); } Index: llvm/lib/Transforms/Utils/LowerSelect.cpp diff -u llvm/lib/Transforms/Utils/LowerSelect.cpp:1.6 llvm/lib/Transforms/Utils/LowerSelect.cpp:1.7 --- llvm/lib/Transforms/Utils/LowerSelect.cpp:1.6 Wed May 17 16:05:27 2006 +++ llvm/lib/Transforms/Utils/LowerSelect.cpp Sun Aug 27 17:42:52 2006 @@ -50,7 +50,7 @@ bool runOnFunction(Function &F); }; - RegisterOpt + RegisterPass X("lowerselect", "Lower select instructions to branches"); } Index: llvm/lib/Transforms/Utils/LowerSwitch.cpp diff -u llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.23 llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.24 --- llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.23 Sun Aug 27 07:54:02 2006 +++ llvm/lib/Transforms/Utils/LowerSwitch.cpp Sun Aug 27 17:42:52 2006 @@ -68,7 +68,7 @@ } }; - RegisterOpt + RegisterPass X("lowerswitch", "Lower SwitchInst's to branches"); } Index: llvm/lib/Transforms/Utils/Mem2Reg.cpp diff -u llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.19 llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.20 --- llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.19 Sun Aug 27 07:54:02 2006 +++ llvm/lib/Transforms/Utils/Mem2Reg.cpp Sun Aug 27 17:42:52 2006 @@ -48,7 +48,7 @@ } }; - RegisterOpt X("mem2reg", "Promote Memory to Register"); + RegisterPass X("mem2reg", "Promote Memory to Register"); } // end of anonymous namespace bool PromotePass::runOnFunction(Function &F) { Index: llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp diff -u llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.35 llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.36 --- llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.35 Fri Jun 2 13:40:06 2006 +++ llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp Sun Aug 27 17:42:52 2006 @@ -22,7 +22,7 @@ #include "llvm/Type.h" using namespace llvm; -static RegisterOpt +static RegisterPass X("mergereturn", "Unify function exit nodes"); int UnifyFunctionExitNodes::stub; From lattner at cs.uiuc.edu Sun Aug 27 17:43:25 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:43:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/UnreachableBlockElim.cpp Message-ID: <200608272243.k7RMhPZ4011757@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: UnreachableBlockElim.cpp updated: 1.8 -> 1.9 --- Log message: eliminate RegisterOpt. It does the same thing as RegisterPass. --- Diffs of the changes: (+1 -1) UnreachableBlockElim.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/UnreachableBlockElim.cpp diff -u llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.8 llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.9 --- llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.8 Sun Aug 27 07:54:01 2006 +++ llvm/lib/CodeGen/UnreachableBlockElim.cpp Sun Aug 27 17:42:51 2006 @@ -35,7 +35,7 @@ class VISIBILITY_HIDDEN UnreachableBlockElim : public FunctionPass { virtual bool runOnFunction(Function &F); }; - RegisterOpt + RegisterPass X("unreachableblockelim", "Remove unreachable blocks from the CFG"); } From lattner at cs.uiuc.edu Sun Aug 27 17:43:26 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:43:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/LevelRaise.cpp Message-ID: <200608272243.k7RMhQ16011821@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms: LevelRaise.cpp updated: 1.110 -> 1.111 --- Log message: eliminate RegisterOpt. It does the same thing as RegisterPass. --- Diffs of the changes: (+1 -1) LevelRaise.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/LevelRaise.cpp diff -u llvm/lib/Transforms/LevelRaise.cpp:1.110 llvm/lib/Transforms/LevelRaise.cpp:1.111 --- llvm/lib/Transforms/LevelRaise.cpp:1.110 Sun May 14 13:33:57 2006 +++ llvm/lib/Transforms/LevelRaise.cpp Sun Aug 27 17:42:51 2006 @@ -80,7 +80,7 @@ bool PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI); }; - RegisterOpt X("raise", "Raise Pointer References"); + RegisterPass X("raise", "Raise Pointer References"); } From lattner at cs.uiuc.edu Sun Aug 27 17:43:21 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:43:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp EdgeProfiling.cpp EmitFunctions.cpp RSProfiling.cpp TraceBasicBlocks.cpp TraceValues.cpp Message-ID: <200608272243.k7RMhLVk011674@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: BlockProfiling.cpp updated: 1.14 -> 1.15 EdgeProfiling.cpp updated: 1.6 -> 1.7 EmitFunctions.cpp updated: 1.24 -> 1.25 RSProfiling.cpp updated: 1.5 -> 1.6 TraceBasicBlocks.cpp updated: 1.14 -> 1.15 TraceValues.cpp updated: 1.75 -> 1.76 --- Log message: eliminate RegisterOpt. It does the same thing as RegisterPass. --- Diffs of the changes: (+12 -12) BlockProfiling.cpp | 6 +++--- EdgeProfiling.cpp | 4 ++-- EmitFunctions.cpp | 2 +- RSProfiling.cpp | 6 +++--- TraceBasicBlocks.cpp | 2 +- TraceValues.cpp | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) Index: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.14 llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.15 --- llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.14 Mon Nov 28 12:00:38 2005 +++ llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp Sun Aug 27 17:42:52 2006 @@ -35,7 +35,7 @@ bool runOnModule(Module &M); }; - RegisterOpt X("insert-function-profiling", + RegisterPass X("insert-function-profiling", "Insert instrumentation for function profiling"); RegisterAnalysisGroup XG; @@ -81,8 +81,8 @@ bool runOnModule(Module &M); }; - RegisterOpt Y("insert-block-profiling", - "Insert instrumentation for block profiling"); + RegisterPass Y("insert-block-profiling", + "Insert instrumentation for block profiling"); RegisterAnalysisGroup YG; } Index: llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.6 llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.7 --- llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.6 Thu Apr 21 18:40:46 2005 +++ llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp Sun Aug 27 17:42:52 2006 @@ -33,8 +33,8 @@ bool runOnModule(Module &M); }; - RegisterOpt X("insert-edge-profiling", - "Insert instrumentation for edge profiling"); + RegisterPass X("insert-edge-profiling", + "Insert instrumentation for edge profiling"); } ModulePass *llvm::createEdgeProfilerPass() { return new EdgeProfiler(); } Index: llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp diff -u llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp:1.24 llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp:1.25 --- llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp:1.24 Sat Apr 23 16:38:35 2005 +++ llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp Sun Aug 27 17:42:52 2006 @@ -40,7 +40,7 @@ bool runOnModule(Module &M); }; - RegisterOpt + RegisterPass X("emitfuncs", "Emit a function table for the reoptimizer"); } Index: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.5 llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.6 --- llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.5 Wed May 24 12:04:04 2006 +++ llvm/lib/Transforms/Instrumentation/RSProfiling.cpp Sun Aug 27 17:42:52 2006 @@ -87,7 +87,7 @@ }; static RegisterAnalysisGroup A("Profiling passes"); - static RegisterOpt NP("insert-null-profiling-rs", + static RegisterPass NP("insert-null-profiling-rs", "Measure profiling framework overhead"); static RegisterAnalysisGroup NPT; @@ -160,8 +160,8 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const; }; - RegisterOpt X("insert-rs-profiling-framework", - "Insert random sampling instrumentation framework"); + RegisterPass X("insert-rs-profiling-framework", + "Insert random sampling instrumentation framework"); } //Local utilities Index: llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp diff -u llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp:1.14 llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp:1.15 --- llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp:1.14 Sun Jan 22 16:53:01 2006 +++ llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp Sun Aug 27 17:42:52 2006 @@ -31,7 +31,7 @@ bool runOnModule(Module &M); }; - RegisterOpt X("trace-basic-blocks", + RegisterPass X("trace-basic-blocks", "Insert instrumentation for basic block tracing"); } Index: llvm/lib/Transforms/Instrumentation/TraceValues.cpp diff -u llvm/lib/Transforms/Instrumentation/TraceValues.cpp:1.75 llvm/lib/Transforms/Instrumentation/TraceValues.cpp:1.76 --- llvm/lib/Transforms/Instrumentation/TraceValues.cpp:1.75 Sat Oct 22 23:37:20 2005 +++ llvm/lib/Transforms/Instrumentation/TraceValues.cpp Sun Aug 27 17:42:52 2006 @@ -104,8 +104,8 @@ }; // Register the passes... - RegisterOpt X("tracem","Insert Function trace code only"); - RegisterOpt Y("trace","Insert BB and Function trace code"); + RegisterPass X("tracem","Insert Function trace code only"); + RegisterPass Y("trace","Insert BB and Function trace code"); } // end anonymous namespace /// Just trace functions From lattner at cs.uiuc.edu Sun Aug 27 17:43:25 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:43:25 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/ExtractFunction.cpp Message-ID: <200608272243.k7RMhPNs011715@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: ExtractFunction.cpp updated: 1.50 -> 1.51 --- Log message: eliminate RegisterOpt. It does the same thing as RegisterPass. --- Diffs of the changes: (+1 -1) ExtractFunction.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/bugpoint/ExtractFunction.cpp diff -u llvm/tools/bugpoint/ExtractFunction.cpp:1.50 llvm/tools/bugpoint/ExtractFunction.cpp:1.51 --- llvm/tools/bugpoint/ExtractFunction.cpp:1.50 Fri Jul 28 13:03:01 2006 +++ llvm/tools/bugpoint/ExtractFunction.cpp Sun Aug 27 17:42:52 2006 @@ -420,7 +420,7 @@ class BlockExtractorPass : public ModulePass { bool runOnModule(Module &M); }; - RegisterOpt + RegisterPass XX("extract-bbs", "Extract Basic Blocks From Module (for bugpoint use)"); } From lattner at cs.uiuc.edu Sun Aug 27 17:43:24 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:43:24 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/PassSupport.h Message-ID: <200608272243.k7RMhOgL011689@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: PassSupport.h updated: 1.28 -> 1.29 --- Log message: eliminate RegisterOpt. It does the same thing as RegisterPass. --- Diffs of the changes: (+0 -47) PassSupport.h | 47 ----------------------------------------------- 1 files changed, 47 deletions(-) Index: llvm/include/llvm/PassSupport.h diff -u llvm/include/llvm/PassSupport.h:1.28 llvm/include/llvm/PassSupport.h:1.29 --- llvm/include/llvm/PassSupport.h:1.28 Sun Aug 27 17:30:17 2006 +++ llvm/include/llvm/PassSupport.h Sun Aug 27 17:42:51 2006 @@ -208,53 +208,6 @@ } }; -/// RegisterOpt - Register something that is to show up in Opt, this is just a -/// shortcut for specifying RegisterPass... -/// -template -struct RegisterOpt : public RegisterPassBase { - RegisterOpt(const char *PassArg, const char *Name, bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), - callDefaultCtor) { - if (CFGOnly) setOnlyUsesCFG(); - } - - /// Register Pass using default constructor explicitly... - /// - RegisterOpt(const char *PassArg, const char *Name, Pass *(*ctor)(), - bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), ctor) { - if (CFGOnly) setOnlyUsesCFG(); - } - - /// Register FunctionPass using default constructor explicitly... - /// - RegisterOpt(const char *PassArg, const char *Name, FunctionPass *(*ctor)(), - bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), - static_cast(ctor)) { - if (CFGOnly) setOnlyUsesCFG(); - } - - /// Register Pass using TargetMachine constructor... - /// - RegisterOpt(const char *PassArg, const char *Name, - Pass *(*targetctor)(TargetMachine &), bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), 0, targetctor) { - if (CFGOnly) setOnlyUsesCFG(); - } - - /// Register FunctionPass using TargetMachine constructor... - /// - RegisterOpt(const char *PassArg, const char *Name, - FunctionPass *(*targetctor)(TargetMachine &), - bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), 0, - static_cast(targetctor)) { - if (CFGOnly) setOnlyUsesCFG(); - } -}; - /// RegisterAnalysisGroup - Register a Pass as a member of an analysis _group_. /// Analysis groups are used to define an interface (which need not derive from From lattner at cs.uiuc.edu Sun Aug 27 17:43:21 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:43:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructureAA.cpp DataStructureOpt.cpp Steensgaard.cpp Message-ID: <200608272243.k7RMhLtS011671@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructureAA.cpp updated: 1.38 -> 1.39 DataStructureOpt.cpp updated: 1.12 -> 1.13 Steensgaard.cpp updated: 1.62 -> 1.63 --- Log message: eliminate RegisterOpt. It does the same thing as RegisterPass. --- Diffs of the changes: (+4 -4) DataStructureAA.cpp | 2 +- DataStructureOpt.cpp | 2 +- Steensgaard.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Analysis/DataStructure/DataStructureAA.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.38 llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.39 --- llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.38 Thu Apr 21 16:07:28 2005 +++ llvm/lib/Analysis/DataStructure/DataStructureAA.cpp Sun Aug 27 17:42:51 2006 @@ -96,7 +96,7 @@ }; // Register the pass... - RegisterOpt X("ds-aa", "Data Structure Graph Based Alias Analysis"); + RegisterPass X("ds-aa", "Data Structure Graph Based Alias Analysis"); // Register as an implementation of AliasAnalysis RegisterAnalysisGroup Y; Index: llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp:1.12 llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp:1.13 --- llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp:1.12 Thu Apr 21 16:07:28 2005 +++ llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp Sun Aug 27 17:42:51 2006 @@ -47,7 +47,7 @@ bool OptimizeGlobals(Module &M); }; - RegisterOpt X("ds-opt", "DSA-based simple optimizations"); + RegisterPass X("ds-opt", "DSA-based simple optimizations"); } ModulePass *llvm::createDSOptPass() { return new DSOpt(); } Index: llvm/lib/Analysis/DataStructure/Steensgaard.cpp diff -u llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.62 llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.63 --- llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.62 Sun Jan 22 16:52:03 2006 +++ llvm/lib/Analysis/DataStructure/Steensgaard.cpp Sun Aug 27 17:42:51 2006 @@ -73,8 +73,8 @@ }; // Register the pass... - RegisterOpt X("steens-aa", - "Steensgaard's alias analysis (DSGraph based)"); + RegisterPass X("steens-aa", + "Steensgaard's alias analysis (DSGraph based)"); // Register as an implementation of AliasAnalysis RegisterAnalysisGroup Y; From lattner at cs.uiuc.edu Sun Aug 27 17:43:26 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:43:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp BasicBlockPlacement.cpp CondPropagate.cpp ConstantProp.cpp CorrelatedExprs.cpp DCE.cpp DeadStoreElimination.cpp GCSE.cpp IndVarSimplify.cpp InstructionCombining.cpp LICM.cpp LoopStrengthReduce.cpp LoopUnroll.cpp LoopUnswitch.cpp LowerGC.cpp LowerPacked.cpp Reassociate.cpp Reg2Mem.cpp SCCP.cpp ScalarReplAggregates.cpp SimplifyCFG.cpp TailDuplication.cpp TailRecursionElimination.cpp Message-ID: <200608272243.k7RMhQ2h011840@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ADCE.cpp updated: 1.97 -> 1.98 BasicBlockPlacement.cpp updated: 1.5 -> 1.6 CondPropagate.cpp updated: 1.5 -> 1.6 ConstantProp.cpp updated: 1.51 -> 1.52 CorrelatedExprs.cpp updated: 1.33 -> 1.34 DCE.cpp updated: 1.58 -> 1.59 DeadStoreElimination.cpp updated: 1.13 -> 1.14 GCSE.cpp updated: 1.47 -> 1.48 IndVarSimplify.cpp updated: 1.93 -> 1.94 InstructionCombining.cpp updated: 1.500 -> 1.501 LICM.cpp updated: 1.77 -> 1.78 LoopStrengthReduce.cpp updated: 1.88 -> 1.89 LoopUnroll.cpp updated: 1.25 -> 1.26 LoopUnswitch.cpp updated: 1.45 -> 1.46 LowerGC.cpp updated: 1.12 -> 1.13 LowerPacked.cpp updated: 1.8 -> 1.9 Reassociate.cpp updated: 1.61 -> 1.62 Reg2Mem.cpp updated: 1.6 -> 1.7 SCCP.cpp updated: 1.130 -> 1.131 ScalarReplAggregates.cpp updated: 1.41 -> 1.42 SimplifyCFG.cpp updated: 1.14 -> 1.15 TailDuplication.cpp updated: 1.29 -> 1.30 TailRecursionElimination.cpp updated: 1.22 -> 1.23 --- Log message: eliminate RegisterOpt. It does the same thing as RegisterPass. --- Diffs of the changes: (+27 -27) ADCE.cpp | 2 +- BasicBlockPlacement.cpp | 4 ++-- CondPropagate.cpp | 2 +- ConstantProp.cpp | 3 ++- CorrelatedExprs.cpp | 2 +- DCE.cpp | 4 ++-- DeadStoreElimination.cpp | 2 +- GCSE.cpp | 2 +- IndVarSimplify.cpp | 2 +- InstructionCombining.cpp | 2 +- LICM.cpp | 2 +- LoopStrengthReduce.cpp | 3 +-- LoopUnroll.cpp | 2 +- LoopUnswitch.cpp | 2 +- LowerGC.cpp | 2 +- LowerPacked.cpp | 2 +- Reassociate.cpp | 2 +- Reg2Mem.cpp | 2 +- SCCP.cpp | 4 ++-- ScalarReplAggregates.cpp | 2 +- SimplifyCFG.cpp | 2 +- TailDuplication.cpp | 2 +- TailRecursionElimination.cpp | 2 +- 23 files changed, 27 insertions(+), 27 deletions(-) Index: llvm/lib/Transforms/Scalar/ADCE.cpp diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.97 llvm/lib/Transforms/Scalar/ADCE.cpp:1.98 --- llvm/lib/Transforms/Scalar/ADCE.cpp:1.97 Fri Jun 2 14:11:46 2006 +++ llvm/lib/Transforms/Scalar/ADCE.cpp Sun Aug 27 17:42:52 2006 @@ -102,7 +102,7 @@ } }; - RegisterOpt X("adce", "Aggressive Dead Code Elimination"); + RegisterPass X("adce", "Aggressive Dead Code Elimination"); } // End of anonymous namespace FunctionPass *llvm::createAggressiveDCEPass() { return new ADCE(); } Index: llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp diff -u llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.5 llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.6 --- llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.5 Thu Apr 21 18:45:12 2005 +++ llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp Sun Aug 27 17:42:52 2006 @@ -68,8 +68,8 @@ void PlaceBlocks(BasicBlock *BB); }; - RegisterOpt X("block-placement", - "Profile Guided Basic Block Placement"); + RegisterPass X("block-placement", + "Profile Guided Basic Block Placement"); } FunctionPass *llvm::createBlockPlacementPass() { return new BlockPlacement(); } Index: llvm/lib/Transforms/Scalar/CondPropagate.cpp diff -u llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.5 llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.6 --- llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.5 Mon Aug 14 16:38:05 2006 +++ llvm/lib/Transforms/Scalar/CondPropagate.cpp Sun Aug 27 17:42:52 2006 @@ -46,7 +46,7 @@ void SimplifyPredecessors(SwitchInst *SI); void RevectorBlockTo(BasicBlock *FromBB, BasicBlock *ToBB); }; - RegisterOpt X("condprop", "Conditional Propagation"); + RegisterPass X("condprop", "Conditional Propagation"); } FunctionPass *llvm::createCondPropagationPass() { Index: llvm/lib/Transforms/Scalar/ConstantProp.cpp diff -u llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.51 llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.52 --- llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.51 Thu Apr 21 18:45:12 2005 +++ llvm/lib/Transforms/Scalar/ConstantProp.cpp Sun Aug 27 17:42:52 2006 @@ -39,7 +39,8 @@ } }; - RegisterOpt X("constprop","Simple constant propagation"); + RegisterPass X("constprop", + "Simple constant propagation"); } FunctionPass *llvm::createConstantPropagationPass() { Index: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp diff -u llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.33 llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.34 --- llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.33 Sun Mar 19 13:37:24 2006 +++ llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp Sun Aug 27 17:42:52 2006 @@ -286,7 +286,7 @@ bool SimplifyBasicBlock(BasicBlock &BB, const RegionInfo &RI); bool SimplifyInstruction(Instruction *Inst, const RegionInfo &RI); }; - RegisterOpt X("cee", "Correlated Expression Elimination"); + RegisterPass X("cee", "Correlated Expression Elimination"); } FunctionPass *llvm::createCorrelatedExpressionEliminationPass() { Index: llvm/lib/Transforms/Scalar/DCE.cpp diff -u llvm/lib/Transforms/Scalar/DCE.cpp:1.58 llvm/lib/Transforms/Scalar/DCE.cpp:1.59 --- llvm/lib/Transforms/Scalar/DCE.cpp:1.58 Sun May 8 13:45:26 2005 +++ llvm/lib/Transforms/Scalar/DCE.cpp Sun Aug 27 17:42:52 2006 @@ -50,7 +50,7 @@ } }; - RegisterOpt X("die", "Dead Instruction Elimination"); + RegisterPass X("die", "Dead Instruction Elimination"); } FunctionPass *llvm::createDeadInstEliminationPass() { @@ -71,7 +71,7 @@ } }; - RegisterOpt Y("dce", "Dead Code Elimination"); + RegisterPass Y("dce", "Dead Code Elimination"); } bool DCE::runOnFunction(Function &F) { Index: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp diff -u llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.13 llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.14 --- llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.13 Wed Nov 30 13:38:22 2005 +++ llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp Sun Aug 27 17:42:52 2006 @@ -54,7 +54,7 @@ AU.addPreserved(); } }; - RegisterOpt X("dse", "Dead Store Elimination"); + RegisterPass X("dse", "Dead Store Elimination"); } FunctionPass *llvm::createDeadStoreEliminationPass() { return new DSE(); } Index: llvm/lib/Transforms/Scalar/GCSE.cpp diff -u llvm/lib/Transforms/Scalar/GCSE.cpp:1.47 llvm/lib/Transforms/Scalar/GCSE.cpp:1.48 --- llvm/lib/Transforms/Scalar/GCSE.cpp:1.47 Tue Jan 10 23:10:20 2006 +++ llvm/lib/Transforms/Scalar/GCSE.cpp Sun Aug 27 17:42:52 2006 @@ -51,7 +51,7 @@ } }; - RegisterOpt X("gcse", "Global Common Subexpression Elimination"); + RegisterPass X("gcse", "Global Common Subexpression Elimination"); } // createGCSEPass - The public interface to this file... Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.93 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.94 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.93 Fri Aug 25 17:12:36 2006 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Sun Aug 27 17:42:52 2006 @@ -92,7 +92,7 @@ void DeleteTriviallyDeadInstructions(std::set &Insts); }; - RegisterOpt X("indvars", "Canonicalize Induction Variables"); + RegisterPass X("indvars", "Canonicalize Induction Variables"); } FunctionPass *llvm::createIndVarSimplifyPass() { Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.500 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.501 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.500 Sun Aug 27 07:54:01 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sun Aug 27 17:42:52 2006 @@ -264,7 +264,7 @@ Value *EvaluateInDifferentType(Value *V, const Type *Ty); }; - RegisterOpt X("instcombine", "Combine redundant instructions"); + RegisterPass X("instcombine", "Combine redundant instructions"); } // getComplexity: Assign a complexity or rank value to LLVM Values... Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.77 llvm/lib/Transforms/Scalar/LICM.cpp:1.78 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.77 Mon Jun 26 14:10:05 2006 +++ llvm/lib/Transforms/Scalar/LICM.cpp Sun Aug 27 17:42:52 2006 @@ -197,7 +197,7 @@ std::map &Val2AlMap); }; - RegisterOpt X("licm", "Loop Invariant Code Motion"); + RegisterPass X("licm", "Loop Invariant Code Motion"); } FunctionPass *llvm::createLICMPass() { return new LICM(); } Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.88 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.89 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.88 Sun Aug 27 07:54:01 2006 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Sun Aug 27 17:42:52 2006 @@ -194,8 +194,7 @@ Loop *L, bool isOnlyStride); void DeleteTriviallyDeadInstructions(std::set &Insts); }; - RegisterOpt X("loop-reduce", - "Loop Strength Reduction"); + RegisterPass X("loop-reduce", "Loop Strength Reduction"); } FunctionPass *llvm::createLoopStrengthReducePass(const TargetLowering *TLI) { Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.25 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.26 --- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.25 Fri Aug 25 17:13:55 2006 +++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp Sun Aug 27 17:42:52 2006 @@ -60,7 +60,7 @@ AU.addPreserved(); } }; - RegisterOpt X("loop-unroll", "Unroll loops"); + RegisterPass X("loop-unroll", "Unroll loops"); } FunctionPass *llvm::createLoopUnrollPass() { return new LoopUnroll(); } Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.45 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.46 --- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.45 Tue Jul 18 22:51:48 2006 +++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Sun Aug 27 17:42:52 2006 @@ -103,7 +103,7 @@ std::vector &Worklist); void RemoveLoopFromHierarchy(Loop *L); }; - RegisterOpt X("loop-unswitch", "Unswitch loops"); + RegisterPass X("loop-unswitch", "Unswitch loops"); } FunctionPass *llvm::createLoopUnswitchPass() { return new LoopUnswitch(); } Index: llvm/lib/Transforms/Scalar/LowerGC.cpp diff -u llvm/lib/Transforms/Scalar/LowerGC.cpp:1.12 llvm/lib/Transforms/Scalar/LowerGC.cpp:1.13 --- llvm/lib/Transforms/Scalar/LowerGC.cpp:1.12 Sun Aug 27 07:54:01 2006 +++ llvm/lib/Transforms/Scalar/LowerGC.cpp Sun Aug 27 17:42:52 2006 @@ -56,7 +56,7 @@ const StructType *getRootRecordType(unsigned NumRoots); }; - RegisterOpt + RegisterPass X("lowergc", "Lower GC intrinsics, for GCless code generators"); } Index: llvm/lib/Transforms/Scalar/LowerPacked.cpp diff -u llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.8 llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.9 --- llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.8 Tue Jan 17 14:06:55 2006 +++ llvm/lib/Transforms/Scalar/LowerPacked.cpp Sun Aug 27 17:42:52 2006 @@ -102,7 +102,7 @@ std::vector instrsToRemove; }; -RegisterOpt +RegisterPass X("lower-packed", "lowers packed operations to operations on smaller packed datatypes"); Index: llvm/lib/Transforms/Scalar/Reassociate.cpp diff -u llvm/lib/Transforms/Scalar/Reassociate.cpp:1.61 llvm/lib/Transforms/Scalar/Reassociate.cpp:1.62 --- llvm/lib/Transforms/Scalar/Reassociate.cpp:1.61 Thu Apr 27 23:14:49 2006 +++ llvm/lib/Transforms/Scalar/Reassociate.cpp Sun Aug 27 17:42:52 2006 @@ -90,7 +90,7 @@ void RemoveDeadBinaryOp(Value *V); }; - RegisterOpt X("reassociate", "Reassociate expressions"); + RegisterPass X("reassociate", "Reassociate expressions"); } // Public interface to the Reassociate pass Index: llvm/lib/Transforms/Scalar/Reg2Mem.cpp diff -u llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.6 llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.7 --- llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.6 Fri Nov 25 10:04:54 2005 +++ llvm/lib/Transforms/Scalar/Reg2Mem.cpp Sun Aug 27 17:42:52 2006 @@ -76,7 +76,7 @@ } }; - RegisterOpt X("reg2mem", "Demote all values to stack slots"); + RegisterPass X("reg2mem", "Demote all values to stack slots"); } // createDemoteRegisterToMemory - Provide an entry point to create this pass. Index: llvm/lib/Transforms/Scalar/SCCP.cpp diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.130 llvm/lib/Transforms/Scalar/SCCP.cpp:1.131 --- llvm/lib/Transforms/Scalar/SCCP.cpp:1.130 Fri Apr 7 20:19:12 2006 +++ llvm/lib/Transforms/Scalar/SCCP.cpp Sun Aug 27 17:42:52 2006 @@ -1075,7 +1075,7 @@ } }; - RegisterOpt X("sccp", "Sparse Conditional Constant Propagation"); + RegisterPass X("sccp", "Sparse Conditional Constant Propagation"); } // end anonymous namespace @@ -1183,7 +1183,7 @@ bool runOnModule(Module &M); }; - RegisterOpt + RegisterPass Y("ipsccp", "Interprocedural Sparse Conditional Constant Propagation"); } // end anonymous namespace Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.41 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.42 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.41 Sun Aug 27 07:54:01 2006 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Sun Aug 27 17:42:52 2006 @@ -70,7 +70,7 @@ void ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset); }; - RegisterOpt X("scalarrepl", "Scalar Replacement of Aggregates"); + RegisterPass X("scalarrepl", "Scalar Replacement of Aggregates"); } // Public interface to the ScalarReplAggregates pass Index: llvm/lib/Transforms/Scalar/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.14 llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.15 --- llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.14 Thu Apr 21 18:45:12 2005 +++ llvm/lib/Transforms/Scalar/SimplifyCFG.cpp Sun Aug 27 17:42:52 2006 @@ -35,7 +35,7 @@ struct CFGSimplifyPass : public FunctionPass { virtual bool runOnFunction(Function &F); }; - RegisterOpt X("simplifycfg", "Simplify the CFG"); + RegisterPass X("simplifycfg", "Simplify the CFG"); } // Public interface to the CFGSimplification pass Index: llvm/lib/Transforms/Scalar/TailDuplication.cpp diff -u llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.29 llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.30 --- llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.29 Sun Jan 22 17:32:06 2006 +++ llvm/lib/Transforms/Scalar/TailDuplication.cpp Sun Aug 27 17:42:52 2006 @@ -47,7 +47,7 @@ inline bool shouldEliminateUnconditionalBranch(TerminatorInst *TI); inline void eliminateUnconditionalBranch(BranchInst *BI); }; - RegisterOpt X("tailduplicate", "Tail Duplication"); + RegisterPass X("tailduplicate", "Tail Duplication"); } // Public interface to the Tail Duplication pass Index: llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp diff -u llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.22 llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.23 --- llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.22 Sat Nov 5 02:21:11 2005 +++ llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp Sun Aug 27 17:42:52 2006 @@ -75,7 +75,7 @@ bool CanMoveAboveCall(Instruction *I, CallInst *CI); Value *CanTransformAccumulatorRecursion(Instruction *I, CallInst *CI); }; - RegisterOpt X("tailcallelim", "Tail Call Elimination"); + RegisterPass X("tailcallelim", "Tail Call Elimination"); } // Public interface to the TailCallElimination pass From lattner at cs.uiuc.edu Sun Aug 27 17:43:25 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:43:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp ConstantMerge.cpp DeadArgumentElimination.cpp DeadTypeElimination.cpp FunctionResolution.cpp GlobalDCE.cpp GlobalOpt.cpp IPConstantPropagation.cpp IndMemRemoval.cpp InlineSimple.cpp Internalize.cpp LoopExtractor.cpp LowerSetJmp.cpp PruneEH.cpp RaiseAllocations.cpp SimplifyLibCalls.cpp StripSymbols.cpp Message-ID: <200608272243.k7RMhPhY011777@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ArgumentPromotion.cpp updated: 1.21 -> 1.22 ConstantMerge.cpp updated: 1.31 -> 1.32 DeadArgumentElimination.cpp updated: 1.27 -> 1.28 DeadTypeElimination.cpp updated: 1.55 -> 1.56 FunctionResolution.cpp updated: 1.59 -> 1.60 GlobalDCE.cpp updated: 1.37 -> 1.38 GlobalOpt.cpp updated: 1.62 -> 1.63 IPConstantPropagation.cpp updated: 1.18 -> 1.19 IndMemRemoval.cpp updated: 1.2 -> 1.3 InlineSimple.cpp updated: 1.72 -> 1.73 Internalize.cpp updated: 1.34 -> 1.35 LoopExtractor.cpp updated: 1.18 -> 1.19 LowerSetJmp.cpp updated: 1.28 -> 1.29 PruneEH.cpp updated: 1.23 -> 1.24 RaiseAllocations.cpp updated: 1.29 -> 1.30 SimplifyLibCalls.cpp updated: 1.67 -> 1.68 StripSymbols.cpp updated: 1.8 -> 1.9 --- Log message: eliminate RegisterOpt. It does the same thing as RegisterPass. --- Diffs of the changes: (+32 -28) ArgumentPromotion.cpp | 4 ++-- ConstantMerge.cpp | 2 +- DeadArgumentElimination.cpp | 2 +- DeadTypeElimination.cpp | 2 +- FunctionResolution.cpp | 8 +++++--- GlobalDCE.cpp | 2 +- GlobalOpt.cpp | 7 ++++--- IPConstantPropagation.cpp | 6 +++--- IndMemRemoval.cpp | 2 +- InlineSimple.cpp | 2 +- Internalize.cpp | 2 +- LoopExtractor.cpp | 6 +++--- LowerSetJmp.cpp | 2 +- PruneEH.cpp | 2 +- RaiseAllocations.cpp | 2 +- SimplifyLibCalls.cpp | 4 ++-- StripSymbols.cpp | 5 +++-- 17 files changed, 32 insertions(+), 28 deletions(-) Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp diff -u llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.21 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.22 --- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.21 Sun Jan 22 17:32:06 2006 +++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Sun Aug 27 17:42:52 2006 @@ -72,8 +72,8 @@ Function *DoPromotion(Function *F, std::vector &ArgsToPromote); }; - RegisterOpt X("argpromotion", - "Promote 'by reference' arguments to scalars"); + RegisterPass X("argpromotion", + "Promote 'by reference' arguments to scalars"); } ModulePass *llvm::createArgumentPromotionPass() { Index: llvm/lib/Transforms/IPO/ConstantMerge.cpp diff -u llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.31 llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.32 --- llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.31 Tue Mar 7 11:56:59 2006 +++ llvm/lib/Transforms/IPO/ConstantMerge.cpp Sun Aug 27 17:42:52 2006 @@ -33,7 +33,7 @@ bool runOnModule(Module &M); }; - RegisterOpt X("constmerge","Merge Duplicate Global Constants"); + RegisterPassX("constmerge","Merge Duplicate Global Constants"); } ModulePass *llvm::createConstantMergePass() { return new ConstantMerge(); } Index: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp diff -u llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.27 llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.28 --- llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.27 Tue Jun 27 16:05:04 2006 +++ llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp Sun Aug 27 17:42:52 2006 @@ -93,7 +93,7 @@ void RemoveDeadArgumentsFromFunction(Function *F); }; - RegisterOpt X("deadargelim", "Dead Argument Elimination"); + RegisterPass X("deadargelim", "Dead Argument Elimination"); /// DAH - DeadArgumentHacking pass - Same as dead argument elimination, but /// deletes arguments to functions which are external. This is only for use Index: llvm/lib/Transforms/IPO/DeadTypeElimination.cpp diff -u llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.55 llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.56 --- llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.55 Thu Apr 21 18:39:37 2005 +++ llvm/lib/Transforms/IPO/DeadTypeElimination.cpp Sun Aug 27 17:42:52 2006 @@ -36,7 +36,7 @@ AU.addRequired(); } }; - RegisterOpt X("deadtypeelim", "Dead Type Elimination"); + RegisterPass X("deadtypeelim", "Dead Type Elimination"); Statistic<> NumKilled("deadtypeelim", "Number of unused typenames removed from symtab"); } Index: llvm/lib/Transforms/IPO/FunctionResolution.cpp diff -u llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.59 llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.60 --- llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.59 Sun Jan 22 17:32:06 2006 +++ llvm/lib/Transforms/IPO/FunctionResolution.cpp Sun Aug 27 17:42:52 2006 @@ -43,7 +43,7 @@ bool runOnModule(Module &M); }; - RegisterOpt X("funcresolve", "Resolve Functions"); + RegisterPass X("funcresolve", "Resolve Functions"); } ModulePass *llvm::createFunctionResolvingPass() { @@ -314,7 +314,8 @@ Globals[F->getName()].push_back(F); } - for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ) { + for (Module::global_iterator I = M.global_begin(), E = M.global_end(); + I != E; ) { GlobalVariable *GV = I++; if (GV->use_empty() && GV->isExternal()) { M.getGlobalList().erase(GV); @@ -346,7 +347,8 @@ ++I; } - for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ) + for (Module::global_iterator I = M.global_begin(), E = M.global_end(); + I != E; ) if (I->isExternal() && I->use_empty()) { GlobalVariable *GV = I; ++I; Index: llvm/lib/Transforms/IPO/GlobalDCE.cpp diff -u llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.37 llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.38 --- llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.37 Thu Apr 21 18:39:37 2005 +++ llvm/lib/Transforms/IPO/GlobalDCE.cpp Sun Aug 27 17:42:52 2006 @@ -44,7 +44,7 @@ bool SafeToDestroyConstant(Constant* C); bool RemoveUnusedGlobalValue(GlobalValue &GV); }; - RegisterOpt X("globaldce", "Dead Global Elimination"); + RegisterPass X("globaldce", "Dead Global Elimination"); } ModulePass *llvm::createGlobalDCEPass() { return new GlobalDCE(); } Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.62 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.63 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.62 Fri Jul 7 16:37:01 2006 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Sun Aug 27 17:42:52 2006 @@ -60,10 +60,10 @@ bool OptimizeFunctions(Module &M); bool OptimizeGlobalVars(Module &M); bool OptimizeGlobalCtorsList(GlobalVariable *&GCL); - bool ProcessInternalGlobal(GlobalVariable *GV, Module::global_iterator &GVI); + bool ProcessInternalGlobal(GlobalVariable *GV,Module::global_iterator &GVI); }; - RegisterOpt X("globalopt", "Global Variable Optimizer"); + RegisterPass X("globalopt", "Global Variable Optimizer"); } ModulePass *llvm::createGlobalOptimizerPass() { return new GlobalOpt(); } @@ -800,7 +800,8 @@ // OptimizeOnceStoredGlobal - Try to optimize globals based on the knowledge // that only one value (besides its initializer) is ever stored to the global. static bool OptimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal, - Module::global_iterator &GVI, TargetData &TD) { + Module::global_iterator &GVI, + TargetData &TD) { if (CastInst *CI = dyn_cast(StoredOnceVal)) StoredOnceVal = CI->getOperand(0); else if (GetElementPtrInst *GEPI =dyn_cast(StoredOnceVal)){ Index: llvm/lib/Transforms/IPO/IPConstantPropagation.cpp diff -u llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.18 llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.19 --- llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.18 Thu Apr 21 18:39:37 2005 +++ llvm/lib/Transforms/IPO/IPConstantPropagation.cpp Sun Aug 27 17:42:52 2006 @@ -28,7 +28,7 @@ Statistic<> NumArgumentsProped("ipconstprop", "Number of args turned into constants"); Statistic<> NumReturnValProped("ipconstprop", - "Number of return values turned into constants"); + "Number of return values turned into constants"); /// IPCP - The interprocedural constant propagation pass /// @@ -38,7 +38,7 @@ bool PropagateConstantsIntoArguments(Function &F); bool PropagateConstantReturn(Function &F); }; - RegisterOpt X("ipconstprop", "Interprocedural constant propagation"); + RegisterPass X("ipconstprop", "Interprocedural constant propagation"); } ModulePass *llvm::createIPConstantPropagationPass() { return new IPCP(); } @@ -69,7 +69,7 @@ /// constant in for an argument, propagate that constant in as the argument. /// bool IPCP::PropagateConstantsIntoArguments(Function &F) { - if (F.arg_empty() || F.use_empty()) return false; // No arguments? Early exit. + if (F.arg_empty() || F.use_empty()) return false; // No arguments? Early exit. std::vector > ArgumentConstants; ArgumentConstants.resize(F.arg_size()); Index: llvm/lib/Transforms/IPO/IndMemRemoval.cpp diff -u llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.2 llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.3 --- llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.2 Thu Apr 13 08:43:31 2006 +++ llvm/lib/Transforms/IPO/IndMemRemoval.cpp Sun Aug 27 17:42:52 2006 @@ -38,7 +38,7 @@ IndMemRemPass(); virtual bool runOnModule(Module &M); }; - RegisterOpt X("indmemrem", "Indirect Malloc and Free Removal"); + RegisterPass X("indmemrem","Indirect Malloc and Free Removal"); } // end anonymous namespace Index: llvm/lib/Transforms/IPO/InlineSimple.cpp diff -u llvm/lib/Transforms/IPO/InlineSimple.cpp:1.72 llvm/lib/Transforms/IPO/InlineSimple.cpp:1.73 --- llvm/lib/Transforms/IPO/InlineSimple.cpp:1.72 Fri Jan 13 13:35:43 2006 +++ llvm/lib/Transforms/IPO/InlineSimple.cpp Sun Aug 27 17:42:52 2006 @@ -55,7 +55,7 @@ public: int getInlineCost(CallSite CS); }; - RegisterOpt X("inline", "Function Integration/Inlining"); + RegisterPass X("inline", "Function Integration/Inlining"); } ModulePass *llvm::createFunctionInliningPass() { return new SimpleInliner(); } Index: llvm/lib/Transforms/IPO/Internalize.cpp diff -u llvm/lib/Transforms/IPO/Internalize.cpp:1.34 llvm/lib/Transforms/IPO/Internalize.cpp:1.35 --- llvm/lib/Transforms/IPO/Internalize.cpp:1.34 Thu Jul 20 13:03:39 2006 +++ llvm/lib/Transforms/IPO/Internalize.cpp Sun Aug 27 17:42:52 2006 @@ -49,7 +49,7 @@ void LoadFile(const char *Filename); virtual bool runOnModule(Module &M); }; - RegisterOpt X("internalize", "Internalize Global Symbols"); + RegisterPass X("internalize", "Internalize Global Symbols"); } // end anonymous namespace InternalizePass::InternalizePass(bool InternalizeEverything) Index: llvm/lib/Transforms/IPO/LoopExtractor.cpp diff -u llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.18 llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.19 --- llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.18 Thu Apr 21 18:39:37 2005 +++ llvm/lib/Transforms/IPO/LoopExtractor.cpp Sun Aug 27 17:42:52 2006 @@ -46,7 +46,7 @@ } }; - RegisterOpt + RegisterPass X("loop-extract", "Extract loops into new functions"); /// SingleLoopExtractor - For bugpoint. @@ -54,7 +54,7 @@ SingleLoopExtractor() : LoopExtractor(1) {} }; - RegisterOpt + RegisterPass Y("loop-extract-single", "Extract at most one loop into a new function"); } // End anonymous namespace @@ -148,7 +148,7 @@ bool runOnModule(Module &M); }; - RegisterOpt + RegisterPass XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)"); } Index: llvm/lib/Transforms/IPO/LowerSetJmp.cpp diff -u llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.28 llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.29 --- llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.28 Sat Oct 22 23:37:20 2005 +++ llvm/lib/Transforms/IPO/LowerSetJmp.cpp Sun Aug 27 17:42:52 2006 @@ -120,7 +120,7 @@ bool doInitialization(Module& M); }; - RegisterOpt X("lowersetjmp", "Lower Set Jump"); + RegisterPass X("lowersetjmp", "Lower Set Jump"); } // end anonymous namespace // run - Run the transformation on the program. We grab the function Index: llvm/lib/Transforms/IPO/PruneEH.cpp diff -u llvm/lib/Transforms/IPO/PruneEH.cpp:1.23 llvm/lib/Transforms/IPO/PruneEH.cpp:1.24 --- llvm/lib/Transforms/IPO/PruneEH.cpp:1.23 Wed Jul 27 01:12:34 2005 +++ llvm/lib/Transforms/IPO/PruneEH.cpp Sun Aug 27 17:42:52 2006 @@ -46,7 +46,7 @@ bool SimplifyFunction(Function *F); void DeleteBasicBlock(BasicBlock *BB); }; - RegisterOpt X("prune-eh", "Remove unused exception handling info"); + RegisterPass X("prune-eh", "Remove unused exception handling info"); } ModulePass *llvm::createPruneEHPass() { return new PruneEH(); } Index: llvm/lib/Transforms/IPO/RaiseAllocations.cpp diff -u llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.29 llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.30 --- llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.29 Thu Apr 21 18:39:37 2005 +++ llvm/lib/Transforms/IPO/RaiseAllocations.cpp Sun Aug 27 17:42:52 2006 @@ -44,7 +44,7 @@ bool runOnModule(Module &M); }; - RegisterOpt + RegisterPass X("raiseallocs", "Raise allocations from calls to instructions"); } // end anonymous namespace Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.67 llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.68 --- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.67 Fri Jun 16 13:37:15 2006 +++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp Sun Aug 27 17:42:52 2006 @@ -366,8 +366,8 @@ }; // Register the pass -RegisterOpt -X("simplify-libcalls","Simplify well-known library calls"); +RegisterPass +X("simplify-libcalls", "Simplify well-known library calls"); } // anonymous namespace Index: llvm/lib/Transforms/IPO/StripSymbols.cpp diff -u llvm/lib/Transforms/IPO/StripSymbols.cpp:1.8 llvm/lib/Transforms/IPO/StripSymbols.cpp:1.9 --- llvm/lib/Transforms/IPO/StripSymbols.cpp:1.8 Thu Mar 23 12:11:33 2006 +++ llvm/lib/Transforms/IPO/StripSymbols.cpp Sun Aug 27 17:42:52 2006 @@ -43,7 +43,7 @@ AU.setPreservesAll(); } }; - RegisterOpt X("strip", "Strip all symbols from a module"); + RegisterPass X("strip", "Strip all symbols from a module"); } ModulePass *llvm::createStripSymbolsPass(bool OnlyDebugInfo) { @@ -75,7 +75,8 @@ // If we're not just stripping debug info, strip all symbols from the // functions and the names from any internal globals. if (!OnlyDebugInfo) { - for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) + for (Module::global_iterator I = M.global_begin(), E = M.global_end(); + I != E; ++I) if (I->hasInternalLinkage()) I->setName(""); // Internal symbols can't participate in linkage From lattner at cs.uiuc.edu Sun Aug 27 17:44:34 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:44:34 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Other/2002-01-31-CallGraph.ll 2002-01-31-PostDomSet-2.ll 2002-01-31-PostDomSet.ll 2002-08-02-DomSetProblem.ll 2003-02-19-LoopInfoNestingBug.ll 2004-08-20-PackedControlFlow.ll Message-ID: <200608272244.k7RMiYDj011898@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Other: 2002-01-31-CallGraph.ll updated: 1.2 -> 1.3 2002-01-31-PostDomSet-2.ll updated: 1.2 -> 1.3 2002-01-31-PostDomSet.ll updated: 1.3 -> 1.4 2002-08-02-DomSetProblem.ll updated: 1.2 -> 1.3 2003-02-19-LoopInfoNestingBug.ll updated: 1.3 -> 1.4 2004-08-20-PackedControlFlow.ll updated: 1.1 -> 1.2 --- Log message: Adjust tests now that opt doesn't read .ll files. --- Diffs of the changes: (+6 -6) 2002-01-31-CallGraph.ll | 2 +- 2002-01-31-PostDomSet-2.ll | 2 +- 2002-01-31-PostDomSet.ll | 2 +- 2002-08-02-DomSetProblem.ll | 2 +- 2003-02-19-LoopInfoNestingBug.ll | 2 +- 2004-08-20-PackedControlFlow.ll | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/test/Regression/Other/2002-01-31-CallGraph.ll diff -u llvm/test/Regression/Other/2002-01-31-CallGraph.ll:1.2 llvm/test/Regression/Other/2002-01-31-CallGraph.ll:1.3 --- llvm/test/Regression/Other/2002-01-31-CallGraph.ll:1.2 Mon Aug 21 23:37:51 2006 +++ llvm/test/Regression/Other/2002-01-31-CallGraph.ll Sun Aug 27 17:44:20 2006 @@ -1,6 +1,6 @@ ; Call graph construction crash: Not handling indirect calls right ; -; RUN: opt -analyze -callgraph %s +; RUN: llvm-as < %s | opt -analyze -callgraph ; %FunTy = type int(int) Index: llvm/test/Regression/Other/2002-01-31-PostDomSet-2.ll diff -u llvm/test/Regression/Other/2002-01-31-PostDomSet-2.ll:1.2 llvm/test/Regression/Other/2002-01-31-PostDomSet-2.ll:1.3 --- llvm/test/Regression/Other/2002-01-31-PostDomSet-2.ll:1.2 Mon Aug 21 23:37:51 2006 +++ llvm/test/Regression/Other/2002-01-31-PostDomSet-2.ll Sun Aug 27 17:44:20 2006 @@ -1,6 +1,6 @@ ; Crash in post dominator set construction. ; -; RUN: opt -analyze -postdomset %s +; RUN: llvm-as < %s | opt -analyze -postdomset ; implementation Index: llvm/test/Regression/Other/2002-01-31-PostDomSet.ll diff -u llvm/test/Regression/Other/2002-01-31-PostDomSet.ll:1.3 llvm/test/Regression/Other/2002-01-31-PostDomSet.ll:1.4 --- llvm/test/Regression/Other/2002-01-31-PostDomSet.ll:1.3 Mon Aug 21 23:37:51 2006 +++ llvm/test/Regression/Other/2002-01-31-PostDomSet.ll Sun Aug 27 17:44:20 2006 @@ -1,6 +1,6 @@ ; Crash in post dominator set construction. ; -; RUN: opt -analyze -postdomset %s +; RUN: llvm-as < %s | opt -analyze -postdomset ; implementation Index: llvm/test/Regression/Other/2002-08-02-DomSetProblem.ll diff -u llvm/test/Regression/Other/2002-08-02-DomSetProblem.ll:1.2 llvm/test/Regression/Other/2002-08-02-DomSetProblem.ll:1.3 --- llvm/test/Regression/Other/2002-08-02-DomSetProblem.ll:1.2 Mon Aug 21 23:37:51 2006 +++ llvm/test/Regression/Other/2002-08-02-DomSetProblem.ll Sun Aug 27 17:44:20 2006 @@ -2,7 +2,7 @@ ; blocks. These blocks should at least dominate themselves. This is ; fouling up the verify pass. ; -; RUN: opt -analyze -domset %s | grep BB +; RUN: llvm-as < %s | opt -analyze -domset | grep BB void %test() { ret void Index: llvm/test/Regression/Other/2003-02-19-LoopInfoNestingBug.ll diff -u llvm/test/Regression/Other/2003-02-19-LoopInfoNestingBug.ll:1.3 llvm/test/Regression/Other/2003-02-19-LoopInfoNestingBug.ll:1.4 --- llvm/test/Regression/Other/2003-02-19-LoopInfoNestingBug.ll:1.3 Mon Aug 21 23:37:51 2006 +++ llvm/test/Regression/Other/2003-02-19-LoopInfoNestingBug.ll Sun Aug 27 17:44:20 2006 @@ -2,7 +2,7 @@ ; figure out that loop "Inner" should be nested inside of leep "LoopHeader", ; and instead nests it just inside loop "Top" ; -; RUN: opt -analyze -loops %s | grep ' Loop Containing:[ ]*%Inner' +; RUN: llvm-as < %s | opt -analyze -loops | grep ' Loop Containing:[ ]*%Inner' ; implementation Index: llvm/test/Regression/Other/2004-08-20-PackedControlFlow.ll diff -u llvm/test/Regression/Other/2004-08-20-PackedControlFlow.ll:1.1 llvm/test/Regression/Other/2004-08-20-PackedControlFlow.ll:1.2 --- llvm/test/Regression/Other/2004-08-20-PackedControlFlow.ll:1.1 Fri Aug 20 03:34:27 2004 +++ llvm/test/Regression/Other/2004-08-20-PackedControlFlow.ll Sun Aug 27 17:44:20 2006 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llvm-dis | llvm-as +; RUN: llvm-as < %s | llvm-dis | llvm-as > /dev/null %v4f = type <4 x float> From lattner at cs.uiuc.edu Sun Aug 27 17:47:31 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:47:31 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll 2003-06-29-NodeCollapsing2.ll 2003-06-30-TopDownResolve.ll 2003-07-01-FieldCollapse.ll 2003-07-16-ConstantExprCollapse.ll 2003-11-02-NodeCollapsing.ll 2004-02-13-memcpy.ll 2005-03-22-IncompleteGlobal.ll 2006-04-25-ZeroArrayStructUse.ll FunctionPointerTable-const.ll GlobalsGraphFuncPtr.ll HardBUCase.ll PhysicalSubtyping.ll SCCSimpleExample.ll constant_globals.ll strcpy.ll Message-ID: <200608272247.k7RMlVDT012030@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/DSGraph: 2003-06-29-IncompleteTDPass.ll updated: 1.3 -> 1.4 2003-06-29-NodeCollapsing2.ll updated: 1.2 -> 1.3 2003-06-30-TopDownResolve.ll updated: 1.4 -> 1.5 2003-07-01-FieldCollapse.ll updated: 1.2 -> 1.3 2003-07-16-ConstantExprCollapse.ll updated: 1.3 -> 1.4 2003-11-02-NodeCollapsing.ll updated: 1.2 -> 1.3 2004-02-13-memcpy.ll updated: 1.5 -> 1.6 2005-03-22-IncompleteGlobal.ll updated: 1.3 -> 1.4 2006-04-25-ZeroArrayStructUse.ll updated: 1.2 -> 1.3 FunctionPointerTable-const.ll updated: 1.3 -> 1.4 GlobalsGraphFuncPtr.ll updated: 1.3 -> 1.4 HardBUCase.ll updated: 1.3 -> 1.4 PhysicalSubtyping.ll updated: 1.2 -> 1.3 SCCSimpleExample.ll updated: 1.2 -> 1.3 constant_globals.ll updated: 1.3 -> 1.4 strcpy.ll updated: 1.3 -> 1.4 --- Log message: Update tests now that opt no longer reads .ll files --- Diffs of the changes: (+19 -19) 2003-06-29-IncompleteTDPass.ll | 2 +- 2003-06-29-NodeCollapsing2.ll | 2 +- 2003-06-30-TopDownResolve.ll | 2 +- 2003-07-01-FieldCollapse.ll | 2 +- 2003-07-16-ConstantExprCollapse.ll | 2 +- 2003-11-02-NodeCollapsing.ll | 2 +- 2004-02-13-memcpy.ll | 4 ++-- 2005-03-22-IncompleteGlobal.ll | 4 ++-- 2006-04-25-ZeroArrayStructUse.ll | 2 +- FunctionPointerTable-const.ll | 4 ++-- GlobalsGraphFuncPtr.ll | 2 +- HardBUCase.ll | 2 +- PhysicalSubtyping.ll | 2 +- SCCSimpleExample.ll | 2 +- constant_globals.ll | 2 +- strcpy.ll | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) Index: llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll diff -u llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll:1.3 llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll:1.4 --- llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll Sun Aug 27 17:47:14 2006 @@ -1,4 +1,4 @@ -; RUN: opt -analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=Ptr:HR +; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=Ptr:HR Index: llvm/test/Regression/Analysis/DSGraph/2003-06-29-NodeCollapsing2.ll diff -u llvm/test/Regression/Analysis/DSGraph/2003-06-29-NodeCollapsing2.ll:1.2 llvm/test/Regression/Analysis/DSGraph/2003-06-29-NodeCollapsing2.ll:1.3 --- llvm/test/Regression/Analysis/DSGraph/2003-06-29-NodeCollapsing2.ll:1.2 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/2003-06-29-NodeCollapsing2.ll Sun Aug 27 17:47:14 2006 @@ -1,7 +1,7 @@ ; This is the same testcase as 2003-06-29-NodeCollapsing2.ll, but it uses the ; graph checker. ; -; RUN: opt -analyze %s -datastructure-gc -dsgc-abort-if-any-collapsed +; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-abort-if-any-collapsed ; %T = type { int} Index: llvm/test/Regression/Analysis/DSGraph/2003-06-30-TopDownResolve.ll diff -u llvm/test/Regression/Analysis/DSGraph/2003-06-30-TopDownResolve.ll:1.4 llvm/test/Regression/Analysis/DSGraph/2003-06-30-TopDownResolve.ll:1.5 --- llvm/test/Regression/Analysis/DSGraph/2003-06-30-TopDownResolve.ll:1.4 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/2003-06-30-TopDownResolve.ll Sun Aug 27 17:47:14 2006 @@ -1,4 +1,4 @@ -; RUN: opt -analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=X:GM +; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=X:GM %G = internal global int 5 Index: llvm/test/Regression/Analysis/DSGraph/2003-07-01-FieldCollapse.ll diff -u llvm/test/Regression/Analysis/DSGraph/2003-07-01-FieldCollapse.ll:1.2 llvm/test/Regression/Analysis/DSGraph/2003-07-01-FieldCollapse.ll:1.3 --- llvm/test/Regression/Analysis/DSGraph/2003-07-01-FieldCollapse.ll:1.2 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/2003-07-01-FieldCollapse.ll Sun Aug 27 17:47:14 2006 @@ -1,4 +1,4 @@ -; RUN: opt -analyze %s -datastructure-gc -dsgc-abort-if-any-collapsed +; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-abort-if-any-collapsed %X = internal global { int, short, short } { int 1, short 2, short 3 } Index: llvm/test/Regression/Analysis/DSGraph/2003-07-16-ConstantExprCollapse.ll diff -u llvm/test/Regression/Analysis/DSGraph/2003-07-16-ConstantExprCollapse.ll:1.3 llvm/test/Regression/Analysis/DSGraph/2003-07-16-ConstantExprCollapse.ll:1.4 --- llvm/test/Regression/Analysis/DSGraph/2003-07-16-ConstantExprCollapse.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/2003-07-16-ConstantExprCollapse.ll Sun Aug 27 17:47:14 2006 @@ -1,6 +1,6 @@ ; This should cause the global node to collapse!! ; XFAIL: * -; RUN: opt -analyze %s -datastructure-gc --dsgc-check-flags=test:GAU +; RUN: llvm-as < %s | opt -analyze -datastructure-gc --dsgc-check-flags=test:GAU %Tree = type { int, %Tree*, %Tree* } %T5 = external global %Tree Index: llvm/test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll diff -u llvm/test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll:1.2 llvm/test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll:1.3 --- llvm/test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll:1.2 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll Sun Aug 27 17:47:14 2006 @@ -1,7 +1,7 @@ ; This is the same testcase as 2003-06-29-NodeCollapsing2.ll, but it uses the ; graph checker. ; -; RUN: opt -analyze %s -datastructure-gc -dsgc-abort-if-any-collapsed +; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-abort-if-any-collapsed ; %S = type { double, int } Index: llvm/test/Regression/Analysis/DSGraph/2004-02-13-memcpy.ll diff -u llvm/test/Regression/Analysis/DSGraph/2004-02-13-memcpy.ll:1.5 llvm/test/Regression/Analysis/DSGraph/2004-02-13-memcpy.ll:1.6 --- llvm/test/Regression/Analysis/DSGraph/2004-02-13-memcpy.ll:1.5 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/2004-02-13-memcpy.ll Sun Aug 27 17:47:14 2006 @@ -1,5 +1,5 @@ -; RUN: opt -analyze %s -datastructure-gc -dsgc-check-flags=Xn:SMR -; RUN: opt -analyze %s -datastructure-gc -dsgc-check-flags=X:SMR +; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-check-flags=Xn:SMR && +; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-check-flags=X:SMR declare void %llvm.memcpy.i32(sbyte*, sbyte*, uint, uint) declare void %llvm.memmove.i32(sbyte*, sbyte*, uint, uint) Index: llvm/test/Regression/Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll diff -u llvm/test/Regression/Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll:1.3 llvm/test/Regression/Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll:1.4 --- llvm/test/Regression/Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll Sun Aug 27 17:47:14 2006 @@ -1,5 +1,5 @@ -; RUN: opt -analyze %s -datastructure-gc -dsgc-check-flags=G:GIM -dsgc-dspass=bu &&\ -; RUN: opt -analyze %s -datastructure-gc -dsgc-check-flags=G:GIM -dsgc-dspass=td +; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-check-flags=G:GIM -dsgc-dspass=bu &&\ +; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-check-flags=G:GIM -dsgc-dspass=td %S = type { double, int } Index: llvm/test/Regression/Analysis/DSGraph/2006-04-25-ZeroArrayStructUse.ll diff -u llvm/test/Regression/Analysis/DSGraph/2006-04-25-ZeroArrayStructUse.ll:1.2 llvm/test/Regression/Analysis/DSGraph/2006-04-25-ZeroArrayStructUse.ll:1.3 --- llvm/test/Regression/Analysis/DSGraph/2006-04-25-ZeroArrayStructUse.ll:1.2 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/2006-04-25-ZeroArrayStructUse.ll Sun Aug 27 17:47:14 2006 @@ -1,4 +1,4 @@ -; RUN: opt -analyze %s -datastructure-gc -dsgc-check-flags=x:IA +; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-check-flags=x:IA ; ModuleID = 'bug3.bc' target endian = little Index: llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll diff -u llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll:1.3 llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll:1.4 --- llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll Sun Aug 27 17:47:14 2006 @@ -1,7 +1,7 @@ ; FIXME: this should be SHM for bu, but change it for now since besides incompleteness ; this is working -; RUN: opt -analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=Y:SHIM && \ -; RUN: opt -analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=P1:SHM,P2:SHM +; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=Y:SHIM && \ +; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=P1:SHM,P2:SHM %G = internal constant [2 x int*(int*)*] [ int*(int*)* %callee1, int*(int*)* %callee2 Index: llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll diff -u llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll:1.3 llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll:1.4 --- llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll Sun Aug 27 17:47:14 2006 @@ -5,7 +5,7 @@ ; -- globals in GG pointed to by latter should be marked I, but not other nodes ; ; FIXME: KnownPtr should be just S. -; RUN: opt -analyze %s -datastructure-gc -dsgc-check-flags=KnownPtr:SI,UnknownPtr:SI -dsgc-dspass=bu +; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-check-flags=KnownPtr:SI,UnknownPtr:SI -dsgc-dspass=bu %Z = internal global int 0 %X = internal global int 0 Index: llvm/test/Regression/Analysis/DSGraph/HardBUCase.ll diff -u llvm/test/Regression/Analysis/DSGraph/HardBUCase.ll:1.3 llvm/test/Regression/Analysis/DSGraph/HardBUCase.ll:1.4 --- llvm/test/Regression/Analysis/DSGraph/HardBUCase.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/HardBUCase.ll Sun Aug 27 17:47:14 2006 @@ -1,4 +1,4 @@ -; RUN: opt -analyze %s -budatastructure -dont-print-ds +; RUN: llvm-as < %s | opt -analyze -budatastructure -dont-print-ds %MidFnTy = type void (\2*) Index: llvm/test/Regression/Analysis/DSGraph/PhysicalSubtyping.ll diff -u llvm/test/Regression/Analysis/DSGraph/PhysicalSubtyping.ll:1.2 llvm/test/Regression/Analysis/DSGraph/PhysicalSubtyping.ll:1.3 --- llvm/test/Regression/Analysis/DSGraph/PhysicalSubtyping.ll:1.2 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/PhysicalSubtyping.ll Sun Aug 27 17:47:14 2006 @@ -1,6 +1,6 @@ ; Test to check for support for "physical subtyping" ; -; RUN: opt -analyze %s -datastructure-gc -dsgc-abort-if-any-collapsed +; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-abort-if-any-collapsed ; %S = type { int } %T = type { int, float, double } Index: llvm/test/Regression/Analysis/DSGraph/SCCSimpleExample.ll diff -u llvm/test/Regression/Analysis/DSGraph/SCCSimpleExample.ll:1.2 llvm/test/Regression/Analysis/DSGraph/SCCSimpleExample.ll:1.3 --- llvm/test/Regression/Analysis/DSGraph/SCCSimpleExample.ll:1.2 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/SCCSimpleExample.ll Sun Aug 27 17:47:14 2006 @@ -1,5 +1,5 @@ -; RUN: opt -analyze %s -datastructure-gc --dsgc-abort-if-merged=Y,BVal +; RUN: llvm-as < %s | opt -analyze -datastructure-gc --dsgc-abort-if-merged=Y,BVal implementation Index: llvm/test/Regression/Analysis/DSGraph/constant_globals.ll diff -u llvm/test/Regression/Analysis/DSGraph/constant_globals.ll:1.3 llvm/test/Regression/Analysis/DSGraph/constant_globals.ll:1.4 --- llvm/test/Regression/Analysis/DSGraph/constant_globals.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/constant_globals.ll Sun Aug 27 17:47:14 2006 @@ -1,5 +1,5 @@ ; FIXME: A should just be SM -; RUN: opt -analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=A:SIM +; RUN: llvm-as < %s | opt -analyze -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=A:SIM ; Constant globals should not mark stuff incomplete. This should allow the ; bu pass to resolve the indirect call immediately in "test", allowing %A to ; be marked complete and the store to happen. Index: llvm/test/Regression/Analysis/DSGraph/strcpy.ll diff -u llvm/test/Regression/Analysis/DSGraph/strcpy.ll:1.3 llvm/test/Regression/Analysis/DSGraph/strcpy.ll:1.4 --- llvm/test/Regression/Analysis/DSGraph/strcpy.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/strcpy.ll Sun Aug 27 17:47:14 2006 @@ -3,7 +3,7 @@ ; has no defined way to check for this, so DSA can know that strcpy doesn't ; require merging the input arguments. -; RUN: opt -analyze %s -datastructure-gc --dsgc-abort-if-merged=A,B --dsgc-check-flags=A:ASM,B:ASR --dsgc-dspass=bu +; RUN: llvm-as < %s | opt -analyze -datastructure-gc --dsgc-abort-if-merged=A,B --dsgc-check-flags=A:ASM,B:ASR --dsgc-dspass=bu implementation From lattner at cs.uiuc.edu Sun Aug 27 17:47:30 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:47:30 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/LoopInfo/2003-05-15-NestingProblem.ll Message-ID: <200608272247.k7RMlUnd011995@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/LoopInfo: 2003-05-15-NestingProblem.ll updated: 1.3 -> 1.4 --- Log message: Update tests now that opt no longer reads .ll files --- Diffs of the changes: (+1 -1) 2003-05-15-NestingProblem.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/Analysis/LoopInfo/2003-05-15-NestingProblem.ll diff -u llvm/test/Regression/Analysis/LoopInfo/2003-05-15-NestingProblem.ll:1.3 llvm/test/Regression/Analysis/LoopInfo/2003-05-15-NestingProblem.ll:1.4 --- llvm/test/Regression/Analysis/LoopInfo/2003-05-15-NestingProblem.ll:1.3 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/LoopInfo/2003-05-15-NestingProblem.ll Sun Aug 27 17:47:14 2006 @@ -1,7 +1,7 @@ ; This testcase was incorrectly computing that the loopentry.7 loop was ; not a child of the loopentry.6 loop. ; -; RUN: opt -analyze %s -loops | grep "^ Loop Containing: %loopentry.7" +; RUN: llvm-as < %s | opt -analyze -loops | grep "^ Loop Containing: %loopentry.7" void %getAndMoveToFrontDecode() { ; No predecessors! br label %endif.2 From lattner at cs.uiuc.edu Sun Aug 27 17:47:31 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 17:47:31 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/Dominators/2003-05-12-UnreachableCode.ll Message-ID: <200608272247.k7RMlVo7012032@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/Dominators: 2003-05-12-UnreachableCode.ll updated: 1.2 -> 1.3 --- Log message: Update tests now that opt no longer reads .ll files --- Diffs of the changes: (+1 -1) 2003-05-12-UnreachableCode.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/Analysis/Dominators/2003-05-12-UnreachableCode.ll diff -u llvm/test/Regression/Analysis/Dominators/2003-05-12-UnreachableCode.ll:1.2 llvm/test/Regression/Analysis/Dominators/2003-05-12-UnreachableCode.ll:1.3 --- llvm/test/Regression/Analysis/Dominators/2003-05-12-UnreachableCode.ll:1.2 Fri Aug 18 01:34:30 2006 +++ llvm/test/Regression/Analysis/Dominators/2003-05-12-UnreachableCode.ll Sun Aug 27 17:47:14 2006 @@ -1,4 +1,4 @@ -; RUN: opt -analyze %s -domset -disable-verify +; RUN: llvm-as < %s | opt -analyze -domset -disable-verify ; int %re_match_2() { ENTRY: From lattner at cs.uiuc.edu Sun Aug 27 18:19:06 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 18:19:06 -0500 Subject: [llvm-commits] CVS: llvm/docs/WritingAnLLVMPass.html Message-ID: <200608272319.k7RNJ61C012693@zion.cs.uiuc.edu> Changes in directory llvm/docs: WritingAnLLVMPass.html updated: 1.47 -> 1.48 --- Log message: update doc: analyze is gone and passes should just use RegisterPass --- Diffs of the changes: (+20 -43) WritingAnLLVMPass.html | 63 +++++++++++++++---------------------------------- 1 files changed, 20 insertions(+), 43 deletions(-) Index: llvm/docs/WritingAnLLVMPass.html diff -u llvm/docs/WritingAnLLVMPass.html:1.47 llvm/docs/WritingAnLLVMPass.html:1.48 --- llvm/docs/WritingAnLLVMPass.html:1.47 Fri Aug 11 11:37:02 2006 +++ llvm/docs/WritingAnLLVMPass.html Sun Aug 27 18:18:52 2006 @@ -18,8 +18,7 @@
  • Pass classes and requirements
      @@ -194,7 +193,7 @@

      This makefile specifies that all of the .cpp files in the current directory are to be compiled and linked together into a Debug/lib/Hello.so shared object that can be dynamically loaded by -the opt or analyze tools via their -load options. +the opt or bugpoint tools via their -load options. If your operating system uses a suffix other than .so (such as windows or Mac OS/X), the appropriate extension will be used.

      @@ -271,15 +270,13 @@ function.

      -  RegisterOpt<Hello> X("hello", "Hello World Pass");
      +  RegisterPass<Hello> X("hello", "Hello World Pass");
       }  // end of anonymous namespace
       
      -

      Lastly, we register our class Hello, giving it a command line -argument "hello", and a name "Hello World Pass". There are -several different ways of registering your pass, -depending on what it is to be used for. For "optimizations" we use the -RegisterOpt template.

      +

      Lastly, we register our class Hello, +giving it a command line +argument "hello", and a name "Hello World Pass".

      As a whole, the .cpp file looks like:

      @@ -297,7 +294,7 @@ } }; - RegisterOpt<Hello> X("hello", "Hello World Pass"); + RegisterPass<Hello> X("hello", "Hello World Pass"); } @@ -312,14 +309,14 @@

      Now that you have a brand new shiny shared object file, we can use the opt command to run an LLVM program through your pass. Because you -registered your pass with the RegisterOpt template, you will be able to +registered your pass with the RegisterPass template, you will be able to use the opt tool to access it, once loaded.

      To test it, follow the example at the end of the -

      Passes can be registered in several different ways. Depending on the general -classification of the pass, you should use one of the following templates to -register the pass:

      - - - -

      Regardless of how you register your pass, you must specify at least two +

      As we saw above, passes are registered with the RegisterPass +template, which requires you to pass at least two parameters. The first parameter is the name of the pass that is to be used on the command line to specify that the pass should be added to a program (for -example opt or analyze). The second argument is the name of -the pass, which is to be used for the --help output of programs, as +example, with opt or bugpoint). The second argument is the +name of the pass, which is to be used for the --help output of +programs, as well as for debug output generated by the --debug-pass option.

      -

      If a pass is registered to be used by the analyze utility, you -should implement the virtual print method:

      +

      If you want your pass to be easily dumpable, you should +implement the virtual print method:

      @@ -892,7 +869,7 @@

      The print method must be implemented by "analyses" in order to print a human readable version of the analysis results. This is useful for debugging an analysis itself, as well as for other people to figure out how an analysis -works. The analyze tool uses this method to generate its output.

      +works. Use the opt -analyze argument to invoke this method.

      The ostream parameter specifies the stream to write the results on, and the Module parameter gives a pointer to the top level module of the @@ -1181,7 +1158,7 @@

       namespace {
         // Analysis Group implementations must be registered normally...
      -  RegisterOpt<FancyAA>
      +  RegisterPass<FancyAA>
         B("somefancyaa", "A more complex alias analysis implementation");
       
         // Declare that we implement the AliasAnalysis interface
      @@ -1199,7 +1176,7 @@
       
       namespace {
         // Analysis Group implementations must be registered normally...
      -  RegisterOpt<BasicAliasAnalysis>
      +  RegisterPass<BasicAliasAnalysis>
         D("basicaa", "Basic Alias Analysis (default AA impl)");
       
         // Declare that we implement the AliasAnalysis interface
      @@ -1734,7 +1711,7 @@
       
         Chris Lattner
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/11 16:37:02 $ + Last modified: $Date: 2006/08/27 23:18:52 $ From lattner at cs.uiuc.edu Sun Aug 27 19:08:39 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 19:08:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManagerT.h Message-ID: <200608280008.k7S08dkk013829@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: PassManagerT.h updated: 1.67 -> 1.68 --- Log message: Silence -Woverloaded-virtual warnings. --- Diffs of the changes: (+11 -1) PassManagerT.h | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/PassManagerT.h diff -u llvm/lib/VMCore/PassManagerT.h:1.67 llvm/lib/VMCore/PassManagerT.h:1.68 --- llvm/lib/VMCore/PassManagerT.h:1.67 Thu Jan 12 10:48:23 2006 +++ llvm/lib/VMCore/PassManagerT.h Sun Aug 27 19:08:25 2006 @@ -720,6 +720,10 @@ PassManagerT(BBPM->Parent) { } + virtual bool runPass(Module &M) { return false; } + + virtual bool runPass(BasicBlock &BB) { return BasicBlockPass::runPass(BB); } + // runPass - Specify how the pass should be run on the UnitType virtual bool runPass(BBTraits::PassClass *P, BasicBlock *M) { // TODO: init and finalize @@ -790,6 +794,9 @@ AU.setPreservesAll(); } + virtual bool runPass(Module &M) { return FunctionPass::runPass(M); } + virtual bool runPass(BasicBlock &BB) { return FunctionPass::runPass(BB); } + // runPass - Specify how the pass should be run on the UnitType virtual bool runPass(FTraits::PassClass *P, Function *F) { return P->runOnFunction(*F); @@ -831,7 +838,10 @@ // runOnModule - Implement the PassManager interface. virtual bool runOnModule(Module &M); - + + virtual bool runPass(Module &M) { return ModulePass::runPass(M); } + virtual bool runPass(BasicBlock &BB) { return ModulePass::runPass(BB); } + // runPass - Specify how the pass should be run on the UnitType virtual bool runPass(MTraits::PassClass *P, Module *M) { return P->runOnModule(*M); From lattner at cs.uiuc.edu Sun Aug 27 19:09:14 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 19:09:14 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Pass.h Message-ID: <200608280009.k7S09EtF013967@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Pass.h updated: 1.53 -> 1.54 --- Log message: Silence -Woverloaded-virtual warnings. --- Diffs of the changes: (+4 -1) Pass.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.53 llvm/include/llvm/Pass.h:1.54 --- llvm/include/llvm/Pass.h:1.53 Wed Jan 4 11:21:23 2006 +++ llvm/include/llvm/Pass.h Sun Aug 27 19:09:00 2006 @@ -290,7 +290,7 @@ /// bool run(Function &F); -private: +protected: template friend class PassManagerT; friend class ModulePassManager; friend class FunctionPassManagerT; @@ -354,6 +354,9 @@ template friend class PassManagerT; friend class FunctionPassManagerT; friend class BasicBlockPassManager; + virtual void addToPassManager(ModulePassManager *PM, AnalysisUsage &AU) { + FunctionPass::addToPassManager(PM, AU); + } virtual void addToPassManager(FunctionPassManagerT *PM, AnalysisUsage &AU); virtual void addToPassManager(BasicBlockPassManager *PM,AnalysisUsage &AU); }; From reid at x10sys.com Sun Aug 27 19:12:39 2006 From: reid at x10sys.com (Reid Spencer) Date: Sun, 27 Aug 2006 19:12:39 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/Record.h Message-ID: <200608280012.k7S0Cdow016841@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: Record.h updated: 1.57 -> 1.58 --- Log message: Add virtual methods to all subclasses so they are not overloaded. --- Diffs of the changes: (+7 -0) Record.h | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/utils/TableGen/Record.h diff -u llvm/utils/TableGen/Record.h:1.57 llvm/utils/TableGen/Record.h:1.58 --- llvm/utils/TableGen/Record.h:1.57 Fri Mar 31 15:53:49 2006 +++ llvm/utils/TableGen/Record.h Sun Aug 27 19:12:25 2006 @@ -122,6 +122,7 @@ virtual Init *convertValue(VarBitInit *VB) { return (Init*)VB; } virtual Init *convertValue( DefInit *DI) { return 0; } virtual Init *convertValue( DagInit *DI) { return 0; } + virtual Init *convertValue( BinOpInit *UI) { return 0; } virtual Init *convertValue( TypedInit *TI); virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);} virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);} @@ -163,6 +164,7 @@ virtual Init *convertValue(VarBitInit *VB) { return 0; } virtual Init *convertValue( DefInit *DI) { return 0; } virtual Init *convertValue( DagInit *DI) { return 0; } + virtual Init *convertValue( BinOpInit *UI) { return 0; } virtual Init *convertValue( TypedInit *TI); virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);} virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);} @@ -201,6 +203,7 @@ virtual Init *convertValue(VarBitInit *VB) { return 0; } virtual Init *convertValue( DefInit *DI) { return 0; } virtual Init *convertValue( DagInit *DI) { return 0; } + virtual Init *convertValue( BinOpInit *UI) { return 0; } virtual Init *convertValue( TypedInit *TI); virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);} virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);} @@ -280,6 +283,7 @@ virtual Init *convertValue(VarBitInit *VB) { return 0; } virtual Init *convertValue( DefInit *DI) { return 0; } virtual Init *convertValue( DagInit *DI) { return 0; } + virtual Init *convertValue( BinOpInit *UI) { return 0; } virtual Init *convertValue( TypedInit *TI); virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);} virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);} @@ -316,6 +320,7 @@ virtual Init *convertValue(VarBitInit *VB) { return 0; } virtual Init *convertValue( DefInit *DI) { return 0; } virtual Init *convertValue( DagInit *DI) { return 0; } + virtual Init *convertValue( BinOpInit *UI) { return 0; } virtual Init *convertValue( TypedInit *TI); virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);} virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);} @@ -349,6 +354,7 @@ virtual Init *convertValue( CodeInit *CI) { return 0; } virtual Init *convertValue(VarBitInit *VB) { return 0; } virtual Init *convertValue( DefInit *DI) { return 0; } + virtual Init *convertValue( BinOpInit *UI) { return 0; } virtual Init *convertValue( DagInit *CI) { return (Init*)CI; } virtual Init *convertValue( TypedInit *TI); virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);} @@ -389,6 +395,7 @@ virtual Init *convertValue( ListInit *LI) { return 0; } virtual Init *convertValue( CodeInit *CI) { return 0; } virtual Init *convertValue(VarBitInit *VB) { return 0; } + virtual Init *convertValue( BinOpInit *UI) { return 0; } virtual Init *convertValue( DefInit *DI); virtual Init *convertValue( DagInit *DI) { return 0; } virtual Init *convertValue( TypedInit *VI); From reid at x10sys.com Sun Aug 27 19:34:33 2006 From: reid at x10sys.com (Reid Spencer) Date: Sun, 27 Aug 2006 19:34:33 -0500 Subject: [llvm-commits] CVS: llvm/docs/CommandGuide/bugpoint.pod index.html opt.pod analyze.pod Message-ID: <200608280034.k7S0YX7G017362@zion.cs.uiuc.edu> Changes in directory llvm/docs/CommandGuide: bugpoint.pod updated: 1.8 -> 1.9 index.html updated: 1.28 -> 1.29 opt.pod updated: 1.3 -> 1.4 analyze.pod (r1.3) removed --- Log message: Excise references to the now defunct "analyze" tool. Merge descriptions where appropriate. --- Diffs of the changes: (+24 -23) bugpoint.pod | 2 +- index.html | 5 +---- opt.pod | 40 ++++++++++++++++++++++------------------ 3 files changed, 24 insertions(+), 23 deletions(-) Index: llvm/docs/CommandGuide/bugpoint.pod diff -u llvm/docs/CommandGuide/bugpoint.pod:1.8 llvm/docs/CommandGuide/bugpoint.pod:1.9 --- llvm/docs/CommandGuide/bugpoint.pod:1.8 Tue Aug 15 12:39:40 2006 +++ llvm/docs/CommandGuide/bugpoint.pod Sun Aug 27 19:34:19 2006 @@ -114,7 +114,7 @@ =head1 SEE ALSO -L, L +L =head1 AUTHOR Index: llvm/docs/CommandGuide/index.html diff -u llvm/docs/CommandGuide/index.html:1.28 llvm/docs/CommandGuide/index.html:1.29 --- llvm/docs/CommandGuide/index.html:1.28 Fri Jun 2 12:43:38 2006 +++ llvm/docs/CommandGuide/index.html Sun Aug 27 19:34:19 2006 @@ -51,9 +51,6 @@
    • llvm-link - link several bytecode files into one
    • -
    • analyze - - run LLVM analyses on a bytecode file and print the results
    • -
    • llvm-ar - archive bytecode files
    • @@ -159,7 +156,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/06/02 17:43:38 $ + Last modified: $Date: 2006/08/28 00:34:19 $ Index: llvm/docs/CommandGuide/opt.pod diff -u llvm/docs/CommandGuide/opt.pod:1.3 llvm/docs/CommandGuide/opt.pod:1.4 --- llvm/docs/CommandGuide/opt.pod:1.3 Mon Mar 13 23:42:07 2006 +++ llvm/docs/CommandGuide/opt.pod Sun Aug 27 19:34:19 2006 @@ -10,17 +10,25 @@ =head1 DESCRIPTION -The B command is the modular LLVM optimizer. It takes LLVM -bytecode as input, runs the specified optimizations on it, and then -outputs the optimized LLVM bytecode. - -The optimizations available via B depend upon what libraries -were linked into it as well as any additional libraries that have -been loaded with the B<-load> option. Use the B<-help> option to -determine what optimizations you can use. +The B command is the modular LLVM optimizer and analyzer. It takes LLVM +bytecode as input, runs the specified optimizations or analyses on it, and then +outputs the optimized LLVM bytecode or the analysis results. The function of +B depends on whether the B<-analyze> option is given. + +When B<-analyze> is specified, B performs various analyses of LLVM +bytecode. It will usually print the results on standard output, but in a few +cases, it will print output to standard error or generate a file with the +analysis output, which is usually done when the output is meant for another +program. + +While B<-analyze> is I given, B attempts to produce an optimized +bytecode file. The optimizations available via B depend upon what +libraries were linked into it as well as any additional libraries that have +been loaded with the B<-load> option. Use the B<-help> option to determine +what optimizations you can use. -If no filename is specified on the command line, B reads its -input from standard input. +If I is omitted from the command line or is I<->, B reads its +input from standard input. The input must be an LLVM bytecode file. If an output filename is not specified with the B<-o> option, B writes its output to the standard output. @@ -64,10 +72,10 @@ =item B<-load>=I -Load the dynamic object I. This object should register new -optimization passes. Once loaded, the object will add new command line -options to enable various optimizations. To see the new complete list -of optimizations, use the B<-help> and B<-load> options together: +Load the dynamic object I. This object should register new optimization +or analysis passes. Once loaded, the object will add new command line options to +enable various optimizations or analyses. To see the new complete list of +optimizations, use the B<-help> and B<-load> options together. For example: =over @@ -86,10 +94,6 @@ If B succeeds, it will exit with 0. Otherwise, if an error occurs, it will exit with a non-zero value. -=head1 SEE ALSO - -L - =head1 AUTHORS Maintained by the LLVM Team (L). From reid at x10sys.com Sun Aug 27 19:34:35 2006 From: reid at x10sys.com (Reid Spencer) Date: Sun, 27 Aug 2006 19:34:35 -0500 Subject: [llvm-commits] CVS: llvm/docs/Bugpoint.html GettingStarted.html HowToSubmitABug.html index.html Message-ID: <200608280034.k7S0YZ41017374@zion.cs.uiuc.edu> Changes in directory llvm/docs: Bugpoint.html updated: 1.8 -> 1.9 GettingStarted.html updated: 1.143 -> 1.144 HowToSubmitABug.html updated: 1.26 -> 1.27 index.html updated: 1.57 -> 1.58 --- Log message: Excise references to the now defunct "analyze" tool. Merge descriptions where appropriate. --- Diffs of the changes: (+15 -19) Bugpoint.html | 4 ++-- GettingStarted.html | 21 +++++++++------------ HowToSubmitABug.html | 6 +++--- index.html | 3 +-- 4 files changed, 15 insertions(+), 19 deletions(-) Index: llvm/docs/Bugpoint.html diff -u llvm/docs/Bugpoint.html:1.8 llvm/docs/Bugpoint.html:1.9 --- llvm/docs/Bugpoint.html:1.8 Tue Aug 15 12:38:36 2006 +++ llvm/docs/Bugpoint.html Sun Aug 27 19:34:18 2006 @@ -124,7 +124,7 @@ bugpoint deletes any individual LLVM instructions whose absence does not eliminate the failure. At the end, bugpoint should tell you what passes crash, give you a bytecode file, and give you instructions on how to -reproduce the failure with opt, analyze, or llc.

      +reproduce the failure with opt or llc.

      @@ -237,7 +237,7 @@ Chris Lattner
      LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/15 17:38:36 $ + Last modified: $Date: 2006/08/28 00:34:18 $ Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.143 llvm/docs/GettingStarted.html:1.144 --- llvm/docs/GettingStarted.html:1.143 Mon Aug 14 15:51:35 2006 +++ llvm/docs/GettingStarted.html Sun Aug 27 19:34:18 2006 @@ -81,7 +81,7 @@

      First, LLVM comes in two pieces. The first piece is the LLVM suite. This contains all of the tools, libraries, and header files needed to use the low level virtual machine. It contains an assembler, disassembler, bytecode -analyzer, and bytecode optimizer. It also contains a test suite that can be +analyzer and bytecode optimizer. It also contains a test suite that can be used to test the LLVM tools and the GCC front end.

      The second piece is the GCC front end. This component provides a version of @@ -1299,11 +1299,6 @@ information is in the Command Guide.

      -
      analyze
      -
      analyze is used to run a specific - analysis on an input LLVM bytecode file and print out the results. It is - primarily useful for debugging analyses, or familiarizing yourself with - what an analysis does.
      bugpoint
      bugpoint is used to debug @@ -1395,11 +1390,13 @@
      opt
      -
      opt reads LLVM bytecode, applies a - series of LLVM to LLVM transformations (which are specified on the command - line), and then outputs the resultant bytecode. The 'opt --help' - command is a good way to get a list of the program transformations - available in LLVM.
      +
      opt reads LLVM bytecode, applies a series of LLVM to LLVM + transformations (which are specified on the command line), and then outputs + the resultant bytecode. The 'opt --help' command is a good way to + get a list of the program transformations available in LLVM.
      +
      opt can also be used to run a specific analysis on an input + LLVM bytecode file and print out the results. It is primarily useful for + debugging analyses, or familiarizing yourself with what an analysis does.
      @@ -1677,7 +1674,7 @@ Chris Lattner
      Reid Spencer
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/14 20:51:35 $ + Last modified: $Date: 2006/08/28 00:34:18 $ Index: llvm/docs/HowToSubmitABug.html diff -u llvm/docs/HowToSubmitABug.html:1.26 llvm/docs/HowToSubmitABug.html:1.27 --- llvm/docs/HowToSubmitABug.html:1.26 Mon Mar 13 23:39:39 2006 +++ llvm/docs/HowToSubmitABug.html Sun Aug 27 19:34:18 2006 @@ -82,8 +82,8 @@

      More often than not, bugs in the compiler cause it to crash - often due to an -assertion failure of some sort. If you are running opt or -analyze directly, and something crashes, jump to the section on +assertion failure of some sort. If you are running opt +directly, and something crashes, jump to the section on bugs in LLVM passes. Otherwise, the most important piece of the puzzle is to figure out if it is the GCC-based front-end that is buggy or if it's one of the LLVM tools that has problems.

      @@ -352,7 +352,7 @@ Chris Lattner
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/03/14 05:39:39 $ + Last modified: $Date: 2006/08/28 00:34:18 $ Index: llvm/docs/index.html diff -u llvm/docs/index.html:1.57 llvm/docs/index.html:1.58 --- llvm/docs/index.html:1.57 Mon Aug 14 13:21:53 2006 +++ llvm/docs/index.html Sun Aug 27 19:34:18 2006 @@ -75,7 +75,6 @@ llc, lli, llvm-link, - analyze, llvm-nm, llvm-prof, llvmgcc, @@ -264,6 +263,6 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/14 18:21:53 $ + Last modified: $Date: 2006/08/28 00:34:18 $ From lattner at cs.uiuc.edu Sun Aug 27 19:42:46 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 19:42:46 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructureAA.cpp Steensgaard.cpp Message-ID: <200608280042.k7S0gkNh017585@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructureAA.cpp updated: 1.39 -> 1.40 Steensgaard.cpp updated: 1.63 -> 1.64 --- Log message: simplify AnalysisGroup registration, eliminating one typeid call. --- Diffs of the changes: (+2 -2) DataStructureAA.cpp | 2 +- Steensgaard.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Analysis/DataStructure/DataStructureAA.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.39 llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.40 --- llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.39 Sun Aug 27 17:42:51 2006 +++ llvm/lib/Analysis/DataStructure/DataStructureAA.cpp Sun Aug 27 19:42:29 2006 @@ -99,7 +99,7 @@ RegisterPass X("ds-aa", "Data Structure Graph Based Alias Analysis"); // Register as an implementation of AliasAnalysis - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } ModulePass *llvm::createDSAAPass() { return new DSAA(); } Index: llvm/lib/Analysis/DataStructure/Steensgaard.cpp diff -u llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.63 llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.64 --- llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.63 Sun Aug 27 17:42:51 2006 +++ llvm/lib/Analysis/DataStructure/Steensgaard.cpp Sun Aug 27 19:42:29 2006 @@ -77,7 +77,7 @@ "Steensgaard's alias analysis (DSGraph based)"); // Register as an implementation of AliasAnalysis - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } ModulePass *llvm::createSteensgaardPass() { return new Steens(); } From lattner at cs.uiuc.edu Sun Aug 27 19:42:50 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 19:42:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Mutex.cpp Message-ID: <200608280042.k7S0goFb017596@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Mutex.cpp updated: 1.8 -> 1.9 --- Log message: simplify AnalysisGroup registration, eliminating one typeid call. --- Diffs of the changes: (+1 -1) Mutex.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/System/Mutex.cpp diff -u llvm/lib/System/Mutex.cpp:1.8 llvm/lib/System/Mutex.cpp:1.9 --- llvm/lib/System/Mutex.cpp:1.8 Wed Jul 26 11:18:00 2006 +++ llvm/lib/System/Mutex.cpp Sun Aug 27 19:42:29 2006 @@ -53,7 +53,7 @@ // is configured into the LIBS variable. // Note: this line of code generates a warning if pthread_mutex_init is not // declared with weak linkage. It's safe to ignore the warning. -static const bool pthread_enabled = static_cast(pthread_mutex_init); +static const bool pthread_enabled = true; // Construct a Mutex using pthread calls Mutex::Mutex( bool recursive) From lattner at cs.uiuc.edu Sun Aug 27 19:42:49 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 19:42:49 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/PassSupport.h Message-ID: <200608280042.k7S0gnX7017591@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: PassSupport.h updated: 1.29 -> 1.30 --- Log message: simplify AnalysisGroup registration, eliminating one typeid call. --- Diffs of the changes: (+5 -13) PassSupport.h | 18 +++++------------- 1 files changed, 5 insertions(+), 13 deletions(-) Index: llvm/include/llvm/PassSupport.h diff -u llvm/include/llvm/PassSupport.h:1.29 llvm/include/llvm/PassSupport.h:1.30 --- llvm/include/llvm/PassSupport.h:1.29 Sun Aug 27 17:42:51 2006 +++ llvm/include/llvm/PassSupport.h Sun Aug 27 19:42:29 2006 @@ -241,23 +241,15 @@ ~RegisterAGBase(); }; - -template +template struct RegisterAnalysisGroup : public RegisterAGBase { - RegisterAnalysisGroup() : RegisterAGBase(typeid(Interface), - &typeid(DefaultImplementationPass), - Default) { + RegisterAnalysisGroup(RegisterPassBase &RPB) + : RegisterAGBase(typeid(Interface), &RPB.getPassInfo()->getTypeInfo(), + Default) { } -}; -/// Define a specialization of RegisterAnalysisGroup that is used to set the -/// name for the analysis group. -/// -template -struct RegisterAnalysisGroup : public RegisterAGBase { RegisterAnalysisGroup(const char *Name) - : RegisterAGBase(typeid(Interface)) { + : RegisterAGBase(typeid(Interface)) { setGroupName(Name); } }; From lattner at cs.uiuc.edu Sun Aug 27 19:42:50 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 19:42:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysisCounter.cpp BasicAliasAnalysis.cpp LoadValueNumbering.cpp ProfileInfo.cpp ProfileInfoLoaderPass.cpp ValueNumbering.cpp Message-ID: <200608280042.k7S0gonZ017611@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasAnalysisCounter.cpp updated: 1.14 -> 1.15 BasicAliasAnalysis.cpp updated: 1.84 -> 1.85 LoadValueNumbering.cpp updated: 1.35 -> 1.36 ProfileInfo.cpp updated: 1.8 -> 1.9 ProfileInfoLoaderPass.cpp updated: 1.14 -> 1.15 ValueNumbering.cpp updated: 1.20 -> 1.21 --- Log message: simplify AnalysisGroup registration, eliminating one typeid call. --- Diffs of the changes: (+7 -7) AliasAnalysisCounter.cpp | 2 +- BasicAliasAnalysis.cpp | 4 ++-- LoadValueNumbering.cpp | 2 +- ProfileInfo.cpp | 2 +- ProfileInfoLoaderPass.cpp | 2 +- ValueNumbering.cpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/lib/Analysis/AliasAnalysisCounter.cpp diff -u llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.14 llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.15 --- llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.14 Sun Aug 27 17:42:51 2006 +++ llvm/lib/Analysis/AliasAnalysisCounter.cpp Sun Aug 27 19:42:29 2006 @@ -111,7 +111,7 @@ RegisterPass X("count-aa", "Count Alias Analysis Query Responses"); - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } ModulePass *llvm::createAliasAnalysisCounterPass() { Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.84 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.85 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.84 Sun Aug 27 17:42:51 2006 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Sun Aug 27 19:42:29 2006 @@ -76,7 +76,7 @@ U("no-aa", "No Alias Analysis (always returns 'may' alias)"); // Declare that we implement the AliasAnalysis interface - RegisterAnalysisGroup V; + RegisterAnalysisGroup V(U); } // End of anonymous namespace ImmutablePass *llvm::createNoAAPass() { return new NoAA(); } @@ -121,7 +121,7 @@ X("basicaa", "Basic Alias Analysis (default AA impl)"); // Declare that we implement the AliasAnalysis interface - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } // End of anonymous namespace ImmutablePass *llvm::createBasicAliasAnalysisPass() { Index: llvm/lib/Analysis/LoadValueNumbering.cpp diff -u llvm/lib/Analysis/LoadValueNumbering.cpp:1.35 llvm/lib/Analysis/LoadValueNumbering.cpp:1.36 --- llvm/lib/Analysis/LoadValueNumbering.cpp:1.35 Sun Aug 27 17:42:51 2006 +++ llvm/lib/Analysis/LoadValueNumbering.cpp Sun Aug 27 19:42:29 2006 @@ -84,7 +84,7 @@ RegisterPass X("load-vn", "Load Value Numbering"); // Declare that we implement the ValueNumbering interface - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } FunctionPass *llvm::createLoadValueNumberingPass() { return new LoadVN(); } Index: llvm/lib/Analysis/ProfileInfo.cpp diff -u llvm/lib/Analysis/ProfileInfo.cpp:1.8 llvm/lib/Analysis/ProfileInfo.cpp:1.9 --- llvm/lib/Analysis/ProfileInfo.cpp:1.8 Sun Aug 27 17:42:51 2006 +++ llvm/lib/Analysis/ProfileInfo.cpp Sun Aug 27 19:42:29 2006 @@ -89,7 +89,7 @@ X("no-profile", "No Profile Information"); // Declare that we implement the ProfileInfo interface - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } // End of anonymous namespace ImmutablePass *llvm::createNoProfileInfoPass() { return new NoProfileInfo(); } Index: llvm/lib/Analysis/ProfileInfoLoaderPass.cpp diff -u llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.14 llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.15 --- llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.14 Sun Aug 27 17:42:51 2006 +++ llvm/lib/Analysis/ProfileInfoLoaderPass.cpp Sun Aug 27 19:42:29 2006 @@ -52,7 +52,7 @@ RegisterPass X("profile-loader", "Load profile information from llvmprof.out"); - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } // End of anonymous namespace ModulePass *llvm::createProfileLoaderPass() { return new LoaderPass(); } Index: llvm/lib/Analysis/ValueNumbering.cpp diff -u llvm/lib/Analysis/ValueNumbering.cpp:1.20 llvm/lib/Analysis/ValueNumbering.cpp:1.21 --- llvm/lib/Analysis/ValueNumbering.cpp:1.20 Sun Aug 27 17:42:51 2006 +++ llvm/lib/Analysis/ValueNumbering.cpp Sun Aug 27 19:42:29 2006 @@ -64,7 +64,7 @@ X("basicvn", "Basic Value Numbering (default GVN impl)"); // Declare that we implement the ValueNumbering interface - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); /// BVNImpl - Implement BasicVN in terms of a visitor class that /// handles the different types of instructions as appropriate. From lattner at cs.uiuc.edu Sun Aug 27 19:42:51 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 19:42:51 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/Andersens.cpp CallGraph.cpp GlobalsModRef.cpp Message-ID: <200608280042.k7S0gpKH017621@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: Andersens.cpp updated: 1.31 -> 1.32 CallGraph.cpp updated: 1.56 -> 1.57 GlobalsModRef.cpp updated: 1.20 -> 1.21 --- Log message: simplify AnalysisGroup registration, eliminating one typeid call. --- Diffs of the changes: (+3 -3) Andersens.cpp | 2 +- CallGraph.cpp | 2 +- GlobalsModRef.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Analysis/IPA/Andersens.cpp diff -u llvm/lib/Analysis/IPA/Andersens.cpp:1.31 llvm/lib/Analysis/IPA/Andersens.cpp:1.32 --- llvm/lib/Analysis/IPA/Andersens.cpp:1.31 Sun Aug 27 17:42:51 2006 +++ llvm/lib/Analysis/IPA/Andersens.cpp Sun Aug 27 19:42:29 2006 @@ -338,7 +338,7 @@ RegisterPass X("anders-aa", "Andersen's Interprocedural Alias Analysis"); - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } ModulePass *llvm::createAndersensPass() { return new Andersens(); } Index: llvm/lib/Analysis/IPA/CallGraph.cpp diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.56 llvm/lib/Analysis/IPA/CallGraph.cpp:1.57 --- llvm/lib/Analysis/IPA/CallGraph.cpp:1.56 Sun Aug 27 17:42:51 2006 +++ llvm/lib/Analysis/IPA/CallGraph.cpp Sun Aug 27 19:42:29 2006 @@ -183,7 +183,7 @@ RegisterAnalysisGroup X("Call Graph"); RegisterPass Y("basiccg", "Basic CallGraph Construction"); -RegisterAnalysisGroup Z; +RegisterAnalysisGroup Z(Y); } //End anonymous namespace Index: llvm/lib/Analysis/IPA/GlobalsModRef.cpp diff -u llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.20 llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.21 --- llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.20 Sun Aug 27 17:42:51 2006 +++ llvm/lib/Analysis/IPA/GlobalsModRef.cpp Sun Aug 27 19:42:29 2006 @@ -137,7 +137,7 @@ RegisterPass X("globalsmodref-aa", "Simple mod/ref analysis for globals"); - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } Pass *llvm::createGlobalsModRefPass() { return new GlobalsModRef(); } From lattner at cs.uiuc.edu Sun Aug 27 19:42:51 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 19:42:51 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp RSProfiling.cpp Message-ID: <200608280042.k7S0gpKf017624@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: BlockProfiling.cpp updated: 1.15 -> 1.16 RSProfiling.cpp updated: 1.6 -> 1.7 --- Log message: simplify AnalysisGroup registration, eliminating one typeid call. --- Diffs of the changes: (+3 -3) BlockProfiling.cpp | 4 ++-- RSProfiling.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.15 llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.16 --- llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.15 Sun Aug 27 17:42:52 2006 +++ llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp Sun Aug 27 19:42:29 2006 @@ -37,7 +37,7 @@ RegisterPass X("insert-function-profiling", "Insert instrumentation for function profiling"); - RegisterAnalysisGroup XG; + RegisterAnalysisGroup XG(X); } @@ -83,7 +83,7 @@ RegisterPass Y("insert-block-profiling", "Insert instrumentation for block profiling"); - RegisterAnalysisGroup YG; + RegisterAnalysisGroup YG(Y); } ModulePass *llvm::createBlockProfilerPass() { return new BlockProfiler(); } Index: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.6 llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.7 --- llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.6 Sun Aug 27 17:42:52 2006 +++ llvm/lib/Transforms/Instrumentation/RSProfiling.cpp Sun Aug 27 19:42:29 2006 @@ -89,7 +89,7 @@ static RegisterAnalysisGroup A("Profiling passes"); static RegisterPass NP("insert-null-profiling-rs", "Measure profiling framework overhead"); - static RegisterAnalysisGroup NPT; + static RegisterAnalysisGroup NPT(NP); /// Chooser - Something that chooses when to make a sample of the profiled code class Chooser { From lattner at cs.uiuc.edu Sun Aug 27 19:45:53 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 27 Aug 2006 19:45:53 -0500 Subject: [llvm-commits] CVS: llvm/docs/WritingAnLLVMPass.html Message-ID: <200608280045.k7S0jrxX020049@zion.cs.uiuc.edu> Changes in directory llvm/docs: WritingAnLLVMPass.html updated: 1.48 -> 1.49 --- Log message: Update to match changes in RegisterAnalysisGroup usage --- Diffs of the changes: (+3 -3) WritingAnLLVMPass.html | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/docs/WritingAnLLVMPass.html diff -u llvm/docs/WritingAnLLVMPass.html:1.48 llvm/docs/WritingAnLLVMPass.html:1.49 --- llvm/docs/WritingAnLLVMPass.html:1.48 Sun Aug 27 18:18:52 2006 +++ llvm/docs/WritingAnLLVMPass.html Sun Aug 27 19:45:38 2006 @@ -1162,7 +1162,7 @@ B("somefancyaa", "A more complex alias analysis implementation"); // Declare that we implement the AliasAnalysis interface - RegisterAnalysisGroup<AliasAnalysis, FancyAA> C; + RegisterAnalysisGroup<AliasAnalysis> C(B); }
      @@ -1180,7 +1180,7 @@ D("basicaa", "Basic Alias Analysis (default AA impl)"); // Declare that we implement the AliasAnalysis interface - RegisterAnalysisGroup<AliasAnalysis, BasicAliasAnalysis, true> E; + RegisterAnalysisGroup<AliasAnalysis, true> E(D); } @@ -1711,7 +1711,7 @@ Chris Lattner
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/27 23:18:52 $ + Last modified: $Date: 2006/08/28 00:45:38 $ From reid at x10sys.com Sun Aug 27 20:03:11 2006 From: reid at x10sys.com (Reid Spencer) Date: Sun, 27 Aug 2006 20:03:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Message-ID: <200608280103.k7S13BUc023072@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.203 -> 1.204 --- Log message: For PR387: http://llvm.org/PR387 : Close out this long standing bug by removing the remaining overloaded virtual functions in LLVM. The -Woverloaded-virtual option is now turned on. --- Diffs of the changes: (+1 -2) AsmWriter.cpp | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.203 llvm/lib/VMCore/AsmWriter.cpp:1.204 --- llvm/lib/VMCore/AsmWriter.cpp:1.203 Sun Aug 27 17:42:52 2006 +++ llvm/lib/VMCore/AsmWriter.cpp Sun Aug 27 20:02:49 2006 @@ -1081,8 +1081,7 @@ } } -/// printInstruction - This member is called for each Instruction in a function.. -/// +// This member is called for each Instruction in a function.. void AssemblyWriter::printInstruction(const Instruction &I) { if (AnnotationWriter) AnnotationWriter->emitInstructionAnnot(&I, Out); From reid at x10sys.com Sun Aug 27 20:03:12 2006 From: reid at x10sys.com (Reid Spencer) Date: Sun, 27 Aug 2006 20:03:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Steensgaard.cpp Message-ID: <200608280103.k7S13CXU023077@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Steensgaard.cpp updated: 1.64 -> 1.65 --- Log message: For PR387: http://llvm.org/PR387 : Close out this long standing bug by removing the remaining overloaded virtual functions in LLVM. The -Woverloaded-virtual option is now turned on. --- Diffs of the changes: (+8 -1) Steensgaard.cpp | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) Index: llvm/lib/Analysis/DataStructure/Steensgaard.cpp diff -u llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.64 llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.65 --- llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.64 Sun Aug 27 19:42:29 2006 +++ llvm/lib/Analysis/DataStructure/Steensgaard.cpp Sun Aug 27 20:02:49 2006 @@ -65,7 +65,8 @@ AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size); - ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size); + virtual ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size); + virtual ModRefResult getModRefInfo(CallSite CS1, CallSite CS2); private: void ResolveFunctionCall(Function *F, const DSCallSite &Call, @@ -266,3 +267,9 @@ return (ModRefResult)(Result & AliasAnalysis::getModRefInfo(CS, P, Size)); } + +AliasAnalysis::ModRefResult +Steens::getModRefInfo(CallSite CS1, CallSite CS2) +{ + return AliasAnalysis::getModRefInfo(CS1,CS2); +} From reid at x10sys.com Sun Aug 27 20:03:12 2006 From: reid at x10sys.com (Reid Spencer) Date: Sun, 27 Aug 2006 20:03:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp PPCISelLowering.h Message-ID: <200608280103.k7S13CYl023089@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.204 -> 1.205 PPCISelLowering.h updated: 1.51 -> 1.52 --- Log message: For PR387: http://llvm.org/PR387 : Close out this long standing bug by removing the remaining overloaded virtual functions in LLVM. The -Woverloaded-virtual option is now turned on. --- Diffs of the changes: (+5 -0) PPCISelLowering.cpp | 4 ++++ PPCISelLowering.h | 1 + 2 files changed, 5 insertions(+) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.204 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.205 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.204 Sat Aug 12 02:20:05 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Sun Aug 27 20:02:49 2006 @@ -2691,3 +2691,7 @@ // PPC allows a sign-extended 16-bit immediate field. return (V > -(1 << 16) && V < (1 << 16)-1); } + +bool PPCTargetLowering::isLegalAddressImmediate(llvm::GlobalValue* GV) const { + return TargetLowering::isLegalAddressImmediate(GV); +} Index: llvm/lib/Target/PowerPC/PPCISelLowering.h diff -u llvm/lib/Target/PowerPC/PPCISelLowering.h:1.51 llvm/lib/Target/PowerPC/PPCISelLowering.h:1.52 --- llvm/lib/Target/PowerPC/PPCISelLowering.h:1.51 Mon Jul 10 15:56:58 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.h Sun Aug 27 20:02:49 2006 @@ -199,6 +199,7 @@ /// isLegalAddressImmediate - Return true if the integer value can be used /// as the offset of the target addressing mode. virtual bool isLegalAddressImmediate(int64_t V) const; + virtual bool isLegalAddressImmediate(llvm::GlobalValue*) const; }; } From reid at x10sys.com Sun Aug 27 20:03:13 2006 From: reid at x10sys.com (Reid Spencer) Date: Sun, 27 Aug 2006 20:03:13 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200608280103.k7S13D9C023092@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.398 -> 1.399 --- Log message: For PR387: http://llvm.org/PR387 : Close out this long standing bug by removing the remaining overloaded virtual functions in LLVM. The -Woverloaded-virtual option is now turned on. --- Diffs of the changes: (+1 -1) Makefile.rules | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.398 llvm/Makefile.rules:1.399 --- llvm/Makefile.rules:1.398 Fri Aug 25 15:56:59 2006 +++ llvm/Makefile.rules Sun Aug 27 20:02:49 2006 @@ -254,7 +254,7 @@ C.Flags += -D_DEBUG endif -CXX.Flags += $(CXXFLAGS) +CXX.Flags += $(CXXFLAGS) -Woverloaded-virtual C.Flags += $(CFLAGS) CPP.BaseFlags += $(CPPFLAGS) LD.Flags += $(LDFLAGS) From reid at x10sys.com Sun Aug 27 20:03:13 2006 From: reid at x10sys.com (Reid Spencer) Date: Sun, 27 Aug 2006 20:03:13 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/GraphPrinters.cpp Message-ID: <200608280103.k7S13DsT023104@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: GraphPrinters.cpp updated: 1.12 -> 1.13 --- Log message: For PR387: http://llvm.org/PR387 : Close out this long standing bug by removing the remaining overloaded virtual functions in LLVM. The -Woverloaded-virtual option is now turned on. --- Diffs of the changes: (+1 -0) GraphPrinters.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/tools/opt/GraphPrinters.cpp diff -u llvm/tools/opt/GraphPrinters.cpp:1.12 llvm/tools/opt/GraphPrinters.cpp:1.13 --- llvm/tools/opt/GraphPrinters.cpp:1.12 Sun Aug 27 17:30:17 2006 +++ llvm/tools/opt/GraphPrinters.cpp Sun Aug 27 20:02:49 2006 @@ -65,6 +65,7 @@ } void print(std::ostream &OS) const {} + void print(std::ostream &OS, const llvm::Module*) const {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); From reid at x10sys.com Sun Aug 27 20:03:13 2006 From: reid at x10sys.com (Reid Spencer) Date: Sun, 27 Aug 2006 20:03:13 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Assembly/Writer.h Message-ID: <200608280103.k7S13DNI023097@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Assembly: Writer.h updated: 1.32 -> 1.33 --- Log message: For PR387: http://llvm.org/PR387 : Close out this long standing bug by removing the remaining overloaded virtual functions in LLVM. The -Woverloaded-virtual option is now turned on. --- Diffs of the changes: (+4 -0) Writer.h | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/include/llvm/Assembly/Writer.h diff -u llvm/include/llvm/Assembly/Writer.h:1.32 llvm/include/llvm/Assembly/Writer.h:1.33 --- llvm/include/llvm/Assembly/Writer.h:1.32 Thu Apr 21 22:27:03 2005 +++ llvm/include/llvm/Assembly/Writer.h Sun Aug 27 20:02:49 2006 @@ -43,6 +43,10 @@ std::ostream &WriteAsOperand(std::ostream&, const Type*, bool PrintTy = true, bool PrintName = true, const Module* Context = 0); +#ifndef NDEBUG +void dumpType(const Type* Ty); +void dumpValue(const Value* Val); +#endif } // End llvm namespace #endif From reid at x10sys.com Sun Aug 27 20:03:12 2006 From: reid at x10sys.com (Reid Spencer) Date: Sun, 27 Aug 2006 20:03:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/Andersens.cpp Message-ID: <200608280103.k7S13COm023082@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: Andersens.cpp updated: 1.32 -> 1.33 --- Log message: For PR387: http://llvm.org/PR387 : Close out this long standing bug by removing the remaining overloaded virtual functions in LLVM. The -Woverloaded-virtual option is now turned on. --- Diffs of the changes: (+7 -1) Andersens.cpp | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/lib/Analysis/IPA/Andersens.cpp diff -u llvm/lib/Analysis/IPA/Andersens.cpp:1.32 llvm/lib/Analysis/IPA/Andersens.cpp:1.33 --- llvm/lib/Analysis/IPA/Andersens.cpp:1.32 Sun Aug 27 19:42:29 2006 +++ llvm/lib/Analysis/IPA/Andersens.cpp Sun Aug 27 20:02:49 2006 @@ -236,7 +236,8 @@ // AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size); - ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size); + virtual ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size); + virtual ModRefResult getModRefInfo(CallSite CS1, CallSite CS2); void getMustAliases(Value *P, std::vector &RetVals); bool pointsToConstantMemory(const Value *P); @@ -387,6 +388,11 @@ return AliasAnalysis::getModRefInfo(CS, P, Size); } +AliasAnalysis::ModRefResult +Andersens::getModRefInfo(CallSite CS1, CallSite CS2) { + return AliasAnalysis::getModRefInfo(CS1,CS2); +} + /// getMustAlias - We can provide must alias information if we know that a /// pointer can only point to a specific function or the null pointer. /// Unfortunately we cannot determine must-alias information for global From reid at x10sys.com Sun Aug 27 20:08:59 2006 From: reid at x10sys.com (Reid Spencer) Date: Sun, 27 Aug 2006 20:08:59 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Assembly/Writer.h Message-ID: <200608280108.k7S18x91025501@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Assembly: Writer.h updated: 1.33 -> 1.34 --- Log message: Back out last revision which should not have been committed (yet). --- Diffs of the changes: (+0 -4) Writer.h | 4 ---- 1 files changed, 4 deletions(-) Index: llvm/include/llvm/Assembly/Writer.h diff -u llvm/include/llvm/Assembly/Writer.h:1.33 llvm/include/llvm/Assembly/Writer.h:1.34 --- llvm/include/llvm/Assembly/Writer.h:1.33 Sun Aug 27 20:02:49 2006 +++ llvm/include/llvm/Assembly/Writer.h Sun Aug 27 20:08:45 2006 @@ -43,10 +43,6 @@ std::ostream &WriteAsOperand(std::ostream&, const Type*, bool PrintTy = true, bool PrintName = true, const Module* Context = 0); -#ifndef NDEBUG -void dumpType(const Type* Ty); -void dumpValue(const Value* Val); -#endif } // End llvm namespace #endif From resistor at mac.com Sun Aug 27 21:10:00 2006 From: resistor at mac.com (Owen Anderson) Date: Sun, 27 Aug 2006 21:10:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnroll.cpp Message-ID: <200608280210.k7S2A0G9026360@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopUnroll.cpp updated: 1.26 -> 1.27 --- Log message: Make LoopUnroll fold excessive BasicBlocks. This results in a significant speedup of gccas on 252.eon --- Diffs of the changes: (+89 -9) LoopUnroll.cpp | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 89 insertions(+), 9 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.26 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.27 --- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.26 Sun Aug 27 17:42:52 2006 +++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp Sun Aug 27 21:09:46 2006 @@ -25,6 +25,7 @@ #include "llvm/Analysis/LoopInfo.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Transforms/Utils/Local.h" +#include "llvm/Support/CFG.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/ADT/Statistic.h" @@ -48,6 +49,7 @@ public: virtual bool runOnFunction(Function &F); bool visitLoop(Loop *L); + BasicBlock* FoldBlockIntoPredecessor(BasicBlock* BB); /// This transformation requires natural loop information & requires that /// loop preheaders be inserted into the CFG... @@ -118,6 +120,76 @@ } } +// FoldBlockIntoPredecessor - Folds a basic block into its predecessor if it +// only has one predecessor, and that predecessor only has one successor. +// Returns the new combined block. +BasicBlock* LoopUnroll::FoldBlockIntoPredecessor(BasicBlock* BB) { + // Merge basic blocks into their predecessor if there is only one distinct + // pred, and if there is only one distinct successor of the predecessor, and + // if there are no PHI nodes. + // + pred_iterator PI(pred_begin(BB)), PE(pred_end(BB)); + BasicBlock *OnlyPred = *PI++; + for (; PI != PE; ++PI) // Search all predecessors, see if they are all same + if (*PI != OnlyPred) { + OnlyPred = 0; // There are multiple different predecessors... + break; + } + + BasicBlock *OnlySucc = 0; + if (OnlyPred && OnlyPred != BB && // Don't break self loops + OnlyPred->getTerminator()->getOpcode() != Instruction::Invoke) { + // Check to see if there is only one distinct successor... + succ_iterator SI(succ_begin(OnlyPred)), SE(succ_end(OnlyPred)); + OnlySucc = BB; + for (; SI != SE; ++SI) + if (*SI != OnlySucc) { + OnlySucc = 0; // There are multiple distinct successors! + break; + } + } + + if (OnlySucc) { + DEBUG(std::cerr << "Merging: " << *BB << "into: " << *OnlyPred); + TerminatorInst *Term = OnlyPred->getTerminator(); + + // Resolve any PHI nodes at the start of the block. They are all + // guaranteed to have exactly one entry if they exist, unless there are + // multiple duplicate (but guaranteed to be equal) entries for the + // incoming edges. This occurs when there are multiple edges from + // OnlyPred to OnlySucc. + // + while (PHINode *PN = dyn_cast(&BB->front())) { + PN->replaceAllUsesWith(PN->getIncomingValue(0)); + BB->getInstList().pop_front(); // Delete the phi node... + } + + // Delete the unconditional branch from the predecessor... + OnlyPred->getInstList().pop_back(); + + // Move all definitions in the successor to the predecessor... + OnlyPred->getInstList().splice(OnlyPred->end(), BB->getInstList()); + + // Make all PHI nodes that referred to BB now refer to Pred as their + // source... + BB->replaceAllUsesWith(OnlyPred); + + std::string OldName = BB->getName(); + + // Erase basic block from the function... + LI->removeBlock(BB); + BB->eraseFromParent(); + + // Inherit predecessors name if it exists... + if (!OldName.empty() && !OnlyPred->hasName()) + OnlyPred->setName(OldName); + + return OnlyPred; + } + + return 0; +} + bool LoopUnroll::visitLoop(Loop *L) { bool Changed = false; @@ -247,13 +319,7 @@ RemapInstruction(I, LastValueMap); } - // Insert the branches that link the different iterations together - for (unsigned i = 0; i < Latches.size()-1; ++i) - new BranchInst(Headers[i+1], Latches[i]); - // Finally, add an unconditional branch to the block to continue into the exit - // block. - new BranchInst(LoopExit, Latches[Latches.size()-1]); // Update PHI nodes that reference the final latch block if (TripCount > 1) { @@ -281,14 +347,28 @@ PHINode *PN = OrigPHINode[i]; PN->replaceAllUsesWith(PN->getIncomingValueForBlock(Preheader)); Header->getInstList().erase(PN); - } - + } + + // Insert the branches that link the different iterations together + for (unsigned i = 0; i < Latches.size()-1; ++i) { + new BranchInst(Headers[i+1], Latches[i]); + if(BasicBlock* Fold = FoldBlockIntoPredecessor(Headers[i+1])) { + std::replace(Latches.begin(), Latches.end(), Headers[i+1], Fold); + std::replace(Headers.begin(), Headers.end(), Headers[i+1], Fold); + } + } + + // Finally, add an unconditional branch to the block to continue into the exit + // block. + new BranchInst(LoopExit, Latches[Latches.size()-1]); + FoldBlockIntoPredecessor(LoopExit); + // At this point, the code is well formed. We now do a quick sweep over the // inserted code, doing constant propagation and dead code elimination as we // go. const std::vector &NewLoopBlocks = L->getBlocks(); for (std::vector::const_iterator BB = NewLoopBlocks.begin(), - E = NewLoopBlocks.end(); BB != E; ++BB) + BBE = NewLoopBlocks.end(); BB != BBE; ++BB) for (BasicBlock::iterator I = (*BB)->begin(), E = (*BB)->end(); I != E; ) { Instruction *Inst = I++; From isanbard at gmail.com Sun Aug 27 21:26:46 2006 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 27 Aug 2006 21:26:46 -0500 Subject: [llvm-commits] CVS: llvm/docs/CodeGenerator.html Message-ID: <200608280226.k7S2Qk2C026717@zion.cs.uiuc.edu> Changes in directory llvm/docs: CodeGenerator.html updated: 1.30 -> 1.31 --- Log message: Added some preliminary text to the TargetJITInfo class section. Fixed some inconsistencies with format. Corrected some of the text. Put code inside of "code" div tags. --- Diffs of the changes: (+306 -304) CodeGenerator.html | 610 ++++++++++++++++++++++++++--------------------------- 1 files changed, 306 insertions(+), 304 deletions(-) Index: llvm/docs/CodeGenerator.html diff -u llvm/docs/CodeGenerator.html:1.30 llvm/docs/CodeGenerator.html:1.31 --- llvm/docs/CodeGenerator.html:1.30 Thu Apr 20 12:42:23 2006 +++ llvm/docs/CodeGenerator.html Sun Aug 27 21:26:32 2006 @@ -74,7 +74,8 @@
      -

      Written by Chris Lattner

      +

      Written by Chris Lattner & + Bill Wendling

      @@ -91,9 +92,10 @@

      The LLVM target-independent code generator is a framework that provides a suite of reusable components for translating the LLVM internal representation to -the machine code for a specified target -- either in assembly form (suitable for -a static compiler) or in binary machine code format (usable for a JIT compiler). -The LLVM target-independent code generator consists of five main components:

      +the machine code for a specified target—either in assembly form (suitable +for a static compiler) or in binary machine code format (usable for a JIT +compiler). The LLVM target-independent code generator consists of five main +components:

      1. Abstract target description interfaces which @@ -166,7 +168,7 @@ implement radically different code generators in the LLVM system that do not make use of any of the built-in components. Doing so is not recommended at all, but could be required for radically different targets that do not fit into the -LLVM machine description model: programmable FPGAs for example.

        +LLVM machine description model: FPGAs for example.

      @@ -228,23 +230,20 @@ -

      -The code generator is based on the assumption that the instruction selector will -use an optimal pattern matching selector to create high-quality sequences of +

      The code generator is based on the assumption that the instruction selector +will use an optimal pattern matching selector to create high-quality sequences of native instructions. Alternative code generator designs based on pattern -expansion and -aggressive iterative peephole optimization are much slower. This design -permits efficient compilation (important for JIT environments) and +expansion and aggressive iterative peephole optimization are much slower. This +design permits efficient compilation (important for JIT environments) and aggressive optimization (used when generating code offline) by allowing components of varying levels of sophistication to be used for any step of compilation.

      -

      -In addition to these stages, target implementations can insert arbitrary +

      In addition to these stages, target implementations can insert arbitrary target-specific passes into the flow. For example, the X86 target uses a special pass to handle the 80x87 floating point stack architecture. Other -targets with unusual requirements can be supported with custom passes as needed. -

      +targets with unusual requirements can be supported with custom passes as +needed.

      @@ -264,18 +263,17 @@ code generator uses the TableGen tool to describe big chunks of the target machine, which allows the use of domain-specific and target-specific abstractions to reduce the amount of -repetition. -

      +repetition.

      As LLVM continues to be developed and refined, we plan to move more and more -of the target description to be in .td form. Doing so gives us a +of the target description to the .td form. Doing so gives us a number of advantages. The most important is that it makes it easier to port -LLVM, because it reduces the amount of C++ code that has to be written and the +LLVM because it reduces the amount of C++ code that has to be written, and the surface area of the code generator that needs to be understood before someone -can get in an get something working. Second, it is also important to us because -it makes it easier to change things: in particular, if tables and other things -are all emitted by tblgen, we only need to change one place (tblgen) to update -all of the targets to a new interface.

      +can get something working. Second, it makes it easier to change things. In +particular, if tables and other things are all emitted by tblgen, we +only need a change in one place (tblgen) to update all of the targets +to a new interface.

      @@ -287,9 +285,9 @@
      -

      The LLVM target description classes (which are located in the +

      The LLVM target description classes (located in the include/llvm/Target directory) provide an abstract description of the -target machine; independent of any particular client. These classes are +target machine independent of any particular client. These classes are designed to capture the abstract properties of the target (such as the instructions and registers it has), and do not incorporate any particular pieces of code generation algorithms.

      @@ -349,14 +347,16 @@

      The TargetLowering class is used by SelectionDAG based instruction selectors primarily to describe how LLVM code should be lowered to SelectionDAG -operations. Among other things, this class indicates: -

      • an initial register class to use for various ValueTypes
      • +operations. Among other things, this class indicates:

        + +
          +
        • an initial register class to use for various ValueTypes
        • which operations are natively supported by the target machine
        • -
        • the return type of setcc operations
        • +
        • the return type of setcc operations
        • the type to use for shift amounts
        • various high-level characteristics, like whether it is profitable to turn division by a constant into a multiplication sequence
        • -

          +
      @@ -372,14 +372,14 @@ target and any interactions between the registers.

      Registers in the code generator are represented in the code generator by -unsigned numbers. Physical registers (those that actually exist in the target +unsigned integers. Physical registers (those that actually exist in the target description) are unique small numbers, and virtual registers are generally large. Note that register #0 is reserved as a flag value.

      Each register in the processor description has an associated -TargetRegisterDesc entry, which provides a textual name for the register -(used for assembly output and debugging dumps) and a set of aliases (used to -indicate that one register overlaps with another). +TargetRegisterDesc entry, which provides a textual name for the +register (used for assembly output and debugging dumps) and a set of aliases +(used to indicate whether one register overlaps with another).

      In addition to the per-register description, the MRegisterInfo class @@ -409,7 +409,8 @@ instruction the target supports. Descriptors define things like the mnemonic for the opcode, the number of operands, the list of implicit register uses and defs, whether the instruction has certain target-independent properties - (accesses memory, is commutable, etc), and holds any target-specific flags.

      + (accesses memory, is commutable, etc), and holds any target-specific + flags.

      @@ -421,7 +422,7 @@

      The TargetFrameInfo class is used to provide information about the stack frame layout of the target. It holds the direction of stack growth, the known stack alignment on entry to each function, and the offset to the - locals area. The offset to the local area is the offset from the stack + local area. The offset to the local area is the offset from the stack pointer on function entry to the first location where function data (local variables, spill locations) can be stored.

      @@ -432,13 +433,11 @@
      -

      The TargetSubtarget class is used to provide information about the specific chip set being targeted. A sub-target informs code generation of which instructions are supported, instruction latencies and instruction execution itinerary; i.e., which processing units are used, in what order, and - for how long. -

      + for how long.

      @@ -447,6 +446,14 @@ The TargetJITInfo class +
      +

      The TargetJITInfo class exposes an abstract interface used by the + Just-In-Time code generator to perform target-specific activities, such as + emitting stubs. If a TargetMachine supports JIT code generation, it + should provide one of these objects through the getJITInfo + method.

      +
      +
      Machine code description classes @@ -455,16 +462,16 @@
      -

      -At the high-level, LLVM code is translated to a machine specific representation -formed out of MachineFunction, -MachineBasicBlock, and At the high-level, LLVM code is translated to a machine specific +representation formed out of +MachineFunction, +MachineBasicBlock, and MachineInstr instances -(defined in include/llvm/CodeGen). This representation is completely target -agnostic, representing instructions in their most abstract form: an opcode and a -series of operands. This representation is designed to support both SSA -representation for machine code, as well as a register allocated, non-SSA form. -

      +(defined in include/llvm/CodeGen). This representation is completely +target agnostic, representing instructions in their most abstract form: an +opcode and a series of operands. This representation is designed to support +both an SSA representation for machine code, as well as a register allocated, +non-SSA form.

      @@ -480,17 +487,17 @@ representing machine instructions. In particular, it only keeps track of an opcode number and a set of operands.

      -

      The opcode number is a simple unsigned number that only has meaning to a +

      The opcode number is a simple unsigned integer that only has meaning to a specific backend. All of the instructions for a target should be defined in the *InstrInfo.td file for the target. The opcode enum values are auto-generated from this description. The MachineInstr class does not have any information about how to interpret the instruction (i.e., what the -semantics of the instruction are): for that you must refer to the +semantics of the instruction are); for that you must refer to the TargetInstrInfo class.

      The operands of a machine instruction can be of several different types: -they can be a register reference, constant integer, basic block reference, etc. -In addition, a machine operand should be marked as a def or a use of the value +a register reference, a constant integer, a basic block reference, etc. In +addition, a machine operand should be marked as a def or a use of the value (though only registers are allowed to be defs).

      By convention, the LLVM code generator orders instruction operands so that @@ -505,11 +512,13 @@ list has several advantages. In particular, the debugging printer will print the instruction like this:

      +
      -  %r3 = add %i1, %i2
      +%r3 = add %i1, %i2
       
      +
      -

      If the first operand is a def, and it is also easier to Also if the first operand is a def, it is easier to create instructions whose only def is the first operand.

      @@ -525,39 +534,44 @@

      Machine instructions are created by using the BuildMI functions, located in the include/llvm/CodeGen/MachineInstrBuilder.h file. The BuildMI functions make it easy to build arbitrary machine -instructions. Usage of the BuildMI functions look like this: -

      +instructions. Usage of the BuildMI functions look like this:

      +
      -  // Create a 'DestReg = mov 42' (rendered in X86 assembly as 'mov DestReg, 42')
      -  // instruction.  The '1' specifies how many operands will be added.
      -  MachineInstr *MI = BuildMI(X86::MOV32ri, 1, DestReg).addImm(42);
      -
      -  // Create the same instr, but insert it at the end of a basic block.
      -  MachineBasicBlock &MBB = ...
      -  BuildMI(MBB, X86::MOV32ri, 1, DestReg).addImm(42);
      -
      -  // Create the same instr, but insert it before a specified iterator point.
      -  MachineBasicBlock::iterator MBBI = ...
      -  BuildMI(MBB, MBBI, X86::MOV32ri, 1, DestReg).addImm(42);
      -
      -  // Create a 'cmp Reg, 0' instruction, no destination reg.
      -  MI = BuildMI(X86::CMP32ri, 2).addReg(Reg).addImm(0);
      -  // Create an 'sahf' instruction which takes no operands and stores nothing.
      -  MI = BuildMI(X86::SAHF, 0);
      +// Create a 'DestReg = mov 42' (rendered in X86 assembly as 'mov DestReg, 42')
      +// instruction.  The '1' specifies how many operands will be added.
      +MachineInstr *MI = BuildMI(X86::MOV32ri, 1, DestReg).addImm(42);
      +
      +// Create the same instr, but insert it at the end of a basic block.
      +MachineBasicBlock &MBB = ...
      +BuildMI(MBB, X86::MOV32ri, 1, DestReg).addImm(42);
      +
      +// Create the same instr, but insert it before a specified iterator point.
      +MachineBasicBlock::iterator MBBI = ...
      +BuildMI(MBB, MBBI, X86::MOV32ri, 1, DestReg).addImm(42);
      +
      +// Create a 'cmp Reg, 0' instruction, no destination reg.
      +MI = BuildMI(X86::CMP32ri, 2).addReg(Reg).addImm(0);
      +// Create an 'sahf' instruction which takes no operands and stores nothing.
      +MI = BuildMI(X86::SAHF, 0);
       
      -  // Create a self looping branch instruction.
      -  BuildMI(MBB, X86::JNE, 1).addMBB(&MBB);
      +// Create a self looping branch instruction.
      +BuildMI(MBB, X86::JNE, 1).addMBB(&MBB);
       
      +
      -

      -The key thing to remember with the BuildMI functions is that you have -to specify the number of operands that the machine instruction will take. This -allows for efficient memory allocation. You also need to specify if operands -default to be uses of values, not definitions. If you need to add a definition -operand (other than the optional destination register), you must explicitly -mark it as such. -

      +

      The key thing to remember with the BuildMI functions is that you +have to specify the number of operands that the machine instruction will take. +This allows for efficient memory allocation. You also need to specify if +operands default to be uses of values, not definitions. If you need to add a +definition operand (other than the optional destination register), you must +explicitly mark it as such:

      + +
      +
      +MI.addReg(Reg, MachineOperand::Def);
      +
      +
      @@ -579,48 +593,54 @@

      For example, consider this simple LLVM example:

      +
      -  int %test(int %X, int %Y) {
      -    %Z = div int %X, %Y
      -    ret int %Z
      -  }
      +int %test(int %X, int %Y) {
      +  %Z = div int %X, %Y
      +  ret int %Z
      +}
       
      +
      -

      The X86 instruction selector produces this machine code for the div -and ret (use +

      The X86 instruction selector produces this machine code for the div +and ret (use "llc X.bc -march=x86 -print-machineinstrs" to get this):

      +
      -        ;; Start of div
      -        %EAX = mov %reg1024           ;; Copy X (in reg1024) into EAX
      -        %reg1027 = sar %reg1024, 31
      -        %EDX = mov %reg1027           ;; Sign extend X into EDX
      -        idiv %reg1025                 ;; Divide by Y (in reg1025)
      -        %reg1026 = mov %EAX           ;; Read the result (Z) out of EAX
      -
      -        ;; Start of ret
      -        %EAX = mov %reg1026           ;; 32-bit return value goes in EAX
      -        ret
      +;; Start of div
      +%EAX = mov %reg1024           ;; Copy X (in reg1024) into EAX
      +%reg1027 = sar %reg1024, 31
      +%EDX = mov %reg1027           ;; Sign extend X into EDX
      +idiv %reg1025                 ;; Divide by Y (in reg1025)
      +%reg1026 = mov %EAX           ;; Read the result (Z) out of EAX
      +
      +;; Start of ret
      +%EAX = mov %reg1026           ;; 32-bit return value goes in EAX
      +ret
       
      +

      By the end of code generation, the register allocator has coalesced -the registers and deleted the resultant identity moves, producing the +the registers and deleted the resultant identity moves producing the following code:

      +
      -        ;; X is in EAX, Y is in ECX
      -        mov %EAX, %EDX
      -        sar %EDX, 31
      -        idiv %ECX
      -        ret 
      +;; X is in EAX, Y is in ECX
      +mov %EAX, %EDX
      +sar %EDX, 31
      +idiv %ECX
      +ret 
       
      +

      This approach is extremely general (if it can handle the X86 architecture, it can handle anything!) and allows all of the target specific knowledge about the instruction stream to be isolated in the instruction selector. Note that physical registers should have a short lifetime for good -code generation, and all physical registers are assumed dead on entry and -exit of basic blocks (before register allocation). Thus if you need a value +code generation, and all physical registers are assumed dead on entry to and +exit from basic blocks (before register allocation). Thus, if you need a value to be live across basic block boundaries, it must live in a virtual register.

      @@ -628,18 +648,18 @@

      MachineInstr's are initially selected in SSA-form, and are maintained in SSA-form until register allocation happens. For the most -part, this is trivially simple since LLVM is already in SSA form: LLVM PHI nodes +part, this is trivially simple since LLVM is already in SSA form; LLVM PHI nodes become machine code PHI nodes, and virtual registers are only allowed to have a single definition.

      -

      After register allocation, machine code is no longer in SSA-form, as there +

      After register allocation, machine code is no longer in SSA-form because there are no virtual registers left in the code.

      @@ -652,12 +672,12 @@

      The MachineBasicBlock class contains a list of machine instructions -(MachineInstr instances). It roughly corresponds to -the LLVM code input to the instruction selector, but there can be a one-to-many -mapping (i.e. one LLVM basic block can map to multiple machine basic blocks). -The MachineBasicBlock class has a "getBasicBlock" method, which returns -the LLVM basic block that it comes from. -

      +(MachineInstr instances). It roughly +corresponds to the LLVM code input to the instruction selector, but there can be +a one-to-many mapping (i.e. one LLVM basic block can map to multiple machine +basic blocks). The MachineBasicBlock class has a +"getBasicBlock" method, which returns the LLVM basic block that it +comes from.

      @@ -669,18 +689,16 @@

      The MachineFunction class contains a list of machine basic blocks -(MachineBasicBlock instances). It corresponds -one-to-one with the LLVM function input to the instruction selector. In -addition to a list of basic blocks, the MachineFunction contains a -the MachineConstantPool, MachineFrameInfo, MachineFunctionInfo, -SSARegMap, and a set of live in and live out registers for the function. See -MachineFunction.h for more information. -

      +(MachineBasicBlock instances). It +corresponds one-to-one with the LLVM function input to the instruction selector. +In addition to a list of basic blocks, the MachineFunction contains a +a MachineConstantPool, a MachineFrameInfo, a +MachineFunctionInfo, a SSARegMap, and a set of live in and +live out registers for the function. See +include/llvm/CodeGen/MachineFunction.h for more information.

      - -
      Target-independent code generation algorithms @@ -706,14 +724,14 @@ code generator into target-specific machine instructions. There are several well-known ways to do this in the literature. In LLVM there are two main forms: the SelectionDAG based instruction selector framework and an old-style 'simple' -instruction selector (which effectively peephole selects each LLVM instruction -into a series of machine instructions). We recommend that all targets use the +instruction selector, which effectively peephole selects each LLVM instruction +into a series of machine instructions. We recommend that all targets use the SelectionDAG infrastructure.

      Portions of the DAG instruction selector are generated from the target -description files (*.td) files. Eventually, we aim for the entire -instruction selector to be generated from these .td files.

      +description (*.td) files. Our goal is for the entire instruction +selector to be generated from these .td files.

      @@ -723,21 +741,18 @@
      -

      -The SelectionDAG provides an abstraction for code representation in a way that -is amenable to instruction selection using automatic techniques -(e.g. dynamic-programming based optimal pattern matching selectors), It is also -well suited to other phases of code generation; in particular, +

      The SelectionDAG provides an abstraction for code representation in a way +that is amenable to instruction selection using automatic techniques +(e.g. dynamic-programming based optimal pattern matching selectors). It is also +well-suited to other phases of code generation; in particular, instruction scheduling (SelectionDAG's are very close to scheduling DAGs post-selection). Additionally, the SelectionDAG provides a host representation where a large variety of very-low-level (but target-independent) optimizations may be -performed: ones which require extensive information about the instructions -efficiently supported by the target. -

      +performed; ones which require extensive information about the instructions +efficiently supported by the target.

      -

      -The SelectionDAG is a Directed-Acyclic-Graph whose nodes are instances of the +

      The SelectionDAG is a Directed-Acyclic-Graph whose nodes are instances of the SDNode class. The primary payload of the SDNode is its operation code (Opcode) that indicates what operation the node performs and the operands to the operation. @@ -750,38 +765,33 @@ values as well. Each node also has some number of operands, which are edges to the node defining the used value. Because nodes may define multiple values, edges are represented by instances of the SDOperand class, which is -a <SDNode, unsigned> pair, indicating the node and result -value being used, respectively. Each value produced by an SDNode has an -associated MVT::ValueType, indicating what type the value is. -

      - -

      -SelectionDAGs contain two different kinds of values: those that represent data -flow and those that represent control flow dependencies. Data values are simple -edges with an integer or floating point value type. Control edges are -represented as "chain" edges which are of type MVT::Other. These edges provide -an ordering between nodes that have side effects (such as -loads/stores/calls/return/etc). All nodes that have side effects should take a -token chain as input and produce a new one as output. By convention, token -chain inputs are always operand #0, and chain results are always the last +a <SDNode, unsigned> pair, indicating the node and result +value being used, respectively. Each value produced by an SDNode has +an associated MVT::ValueType indicating what type the value is.

      + +

      SelectionDAGs contain two different kinds of values: those that represent +data flow and those that represent control flow dependencies. Data values are +simple edges with an integer or floating point value type. Control edges are +represented as "chain" edges which are of type MVT::Other. These edges +provide an ordering between nodes that have side effects (such as +loads, stores, calls, returns, etc). All nodes that have side effects should +take a token chain as input and produce a new one as output. By convention, +token chain inputs are always operand #0, and chain results are always the last value produced by an operation.

      -

      -A SelectionDAG has designated "Entry" and "Root" nodes. The Entry node is -always a marker node with an Opcode of ISD::EntryToken. The Root node is the -final side-effecting node in the token chain. For example, in a single basic -block function, this would be the return node. -

      +

      A SelectionDAG has designated "Entry" and "Root" nodes. The Entry node is +always a marker node with an Opcode of ISD::EntryToken. The Root node +is the final side-effecting node in the token chain. For example, in a single +basic block function it would be the return node.

      + +

      One important concept for SelectionDAGs is the notion of a "legal" vs. +"illegal" DAG. A legal DAG for a target is one that only uses supported +operations and supported types. On a 32-bit PowerPC, for example, a DAG with +a value of type i1, i8, i16, or i64 would be illegal, as would a DAG that uses a +SREM or UREM operation. The +legalize phase is responsible for turning +an illegal DAG into a legal DAG.

      -

      -One important concept for SelectionDAGs is the notion of a "legal" vs. "illegal" -DAG. A legal DAG for a target is one that only uses supported operations and -supported types. On a 32-bit PowerPC, for example, a DAG with any values of i1, -i8, i16, -or i64 type would be illegal, as would a DAG that uses a SREM or UREM operation. -The legalize -phase is responsible for turning an illegal DAG into a legal DAG. -

      @@ -791,25 +801,23 @@
      -

      -SelectionDAG-based instruction selection consists of the following steps: -

      +

      SelectionDAG-based instruction selection consists of the following steps:

        -
      1. Build initial DAG - This stage performs - a simple translation from the input LLVM code to an illegal SelectionDAG. -
      2. +
      3. Build initial DAG - This stage + performs a simple translation from the input LLVM code to an illegal + SelectionDAG.
      4. Optimize SelectionDAG - This stage - performs simple optimizations on the SelectionDAG to simplify it and - recognize meta instructions (like rotates and div/rem pairs) for - targets that support these meta operations. This makes the resultant code - more efficient and the 'select instructions from DAG' phase (below) simpler. -
      5. + performs simple optimizations on the SelectionDAG to simplify it, and + recognize meta instructions (like rotates and div/rem + pairs) for targets that support these meta operations. This makes the + resultant code more efficient and the select + instructions from DAG phase (below) simpler.
      6. Legalize SelectionDAG - This stage - converts the illegal SelectionDAG to a legal SelectionDAG, by eliminating + converts the illegal SelectionDAG to a legal SelectionDAG by eliminating unsupported operations and data types.
      7. Optimize SelectionDAG (#2) - This - second run of the SelectionDAG optimized the newly legalized DAG, to + second run of the SelectionDAG optimizes the newly legalized DAG to eliminate inefficiencies introduced by legalization.
      8. Select instructions from DAG - Finally, the target instruction selector matches the DAG operations to target @@ -831,8 +839,8 @@ this, you probably need to configure your system to add support for it). The -view-sched-dags option views the SelectionDAG output from the Select phase and input to the Scheduler -phase. -

        +phase.

        +
      @@ -842,17 +850,15 @@
      -

      -The initial SelectionDAG is naively peephole expanded from the LLVM input by -the SelectionDAGLowering class in the SelectionDAGISel.cpp file. The -intent of this pass is to expose as much low-level, target-specific details -to the SelectionDAG as possible. This pass is mostly hard-coded (e.g. an LLVM -add turns into an SDNode add while a geteelementptr is expanded into the obvious -arithmetic). This pass requires target-specific hooks to lower calls and -returns, varargs, etc. For these features, the TargetLowering interface is -used. -

      +

      The initial SelectionDAG is naively peephole expanded from the LLVM input by +the SelectionDAGLowering class in the +lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp file. The intent of this +pass is to expose as much low-level, target-specific details to the SelectionDAG +as possible. This pass is mostly hard-coded (e.g. an LLVM add turns +into an SDNode add while a geteelementptr is expanded into the +obvious arithmetic). This pass requires target-specific hooks to lower calls, +returns, varargs, etc. For these features, the +TargetLowering interface is used.

      @@ -875,38 +881,35 @@ that all f32 values are promoted to f64 and that all i1/i8/i16 values are promoted to i32. The same target might require that all i64 values be expanded into i32 values. These changes can insert sign and zero - extensions as - needed to make sure that the final code has the same behavior as the - input.

      + extensions as needed to make sure that the final code has the same + behavior as the input.

      A target implementation tells the legalizer which types are supported (and which register class to use for them) by calling the - "addRegisterClass" method in its TargetLowering constructor.

      + addRegisterClass method in its TargetLowering constructor.

    • Eliminate operations that are not supported by the target.

      Targets often have weird constraints, such as not supporting every operation on every supported datatype (e.g. X86 does not support byte conditional moves and PowerPC does not support sign-extending loads from - a 16-bit memory location). Legalize takes care by open-coding + a 16-bit memory location). Legalize takes care of this by open-coding another sequence of operations to emulate the operation ("expansion"), by - promoting to a larger type that supports the operation - (promotion), or using a target-specific hook to implement the - legalization (custom).

      + promoting one type to a larger type that supports the operation + ("promotion"), or by using a target-specific hook to implement the + legalization ("custom").

      A target implementation tells the legalizer which operations are not supported (and which of the above three actions to take) by calling the - "setOperationAction" method in its TargetLowering constructor.

      + setOperationAction method in its TargetLowering + constructor.

    • -

      -Prior to the existance of the Legalize pass, we required that every -target selector supported and handled every +

      Prior to the existance of the Legalize pass, we required that every target +selector supported and handled every operator and type even if they are not natively supported. The introduction of -the Legalize phase allows all of the -cannonicalization patterns to be shared across targets, and makes it very -easy to optimize the cannonicalized code because it is still in the form of -a DAG. -

      +the Legalize phase allows all of the cannonicalization patterns to be shared +across targets, and makes it very easy to optimize the cannonicalized code +because it is still in the form of a DAG.

      @@ -918,27 +921,24 @@
      -

      -The SelectionDAG optimization phase is run twice for code generation: once +

      The SelectionDAG optimization phase is run twice for code generation: once immediately after the DAG is built and once after legalization. The first run of the pass allows the initial code to be cleaned up (e.g. performing optimizations that depend on knowing that the operators have restricted type inputs). The second run of the pass cleans up the messy code generated by the Legalize pass, which allows Legalize to be very simple (it can focus on making -code legal instead of focusing on generating good and legal code). -

      +code legal instead of focusing on generating good and legal code).

      -

      -One important class of optimizations performed is optimizing inserted sign and -zero extension instructions. We currently use ad-hoc techniques, but could move -to more rigorous techniques in the future. Here are some good -papers on the subject:

      +

      One important class of optimizations performed is optimizing inserted sign +and zero extension instructions. We currently use ad-hoc techniques, but could +move to more rigorous techniques in the future. Here are some good papers on +the subject:

      -"Widening -integer arithmetic"
      -Kevin Redwine and Norman Ramsey
      -International Conference on Compiler Construction (CC) 2004 + "Widening + integer arithmetic"
      + Kevin Redwine and Norman Ramsey
      + International Conference on Compiler Construction (CC) 2004

      @@ -960,40 +960,44 @@

      The Select phase is the bulk of the target-specific code for instruction -selection. This phase takes a legal SelectionDAG as input, -pattern matches the instructions supported by the target to this DAG, and -produces a new DAG of target code. For example, consider the following LLVM -fragment:

      +selection. This phase takes a legal SelectionDAG as input, pattern matches the +instructions supported by the target to this DAG, and produces a new DAG of +target code. For example, consider the following LLVM fragment:

      +
      -   %t1 = add float %W, %X
      -   %t2 = mul float %t1, %Y
      -   %t3 = add float %t2, %Z
      +%t1 = add float %W, %X
      +%t2 = mul float %t1, %Y
      +%t3 = add float %t2, %Z
       
      +
      -

      This LLVM code corresponds to a SelectionDAG that looks basically like this: -

      +

      This LLVM code corresponds to a SelectionDAG that looks basically like +this:

      +
      -  (fadd:f32 (fmul:f32 (fadd:f32 W, X), Y), Z)
      +(fadd:f32 (fmul:f32 (fadd:f32 W, X), Y), Z)
       
      +

      If a target supports floating point multiply-and-add (FMA) operations, one of the adds can be merged with the multiply. On the PowerPC, for example, the output of the instruction selector might look like this DAG:

      +
      -  (FMADDS (FADDS W, X), Y, Z)
      +(FMADDS (FADDS W, X), Y, Z)
       
      +
      -

      -The FMADDS instruction is a ternary instruction that multiplies its first two -operands and adds the third (as single-precision floating-point numbers). The -FADDS instruction is a simple binary single-precision add instruction. To -perform this pattern match, the PowerPC backend includes the following -instruction definitions: -

      +

      The FMADDS instruction is a ternary instruction that multiplies its +first two operands and adds the third (as single-precision floating-point +numbers). The FADDS instruction is a simple binary single-precision +add instruction. To perform this pattern match, the PowerPC backend includes +the following instruction definitions:

      +
       def FMADDS : AForm_1<59, 29,
                           (ops F4RC:$FRT, F4RC:$FRA, F4RC:$FRC, F4RC:$FRB),
      @@ -1005,6 +1009,7 @@
                           "fadds $FRT, $FRA, $FRB",
                           [(set F4RC:$FRT, (fadd F4RC:$FRA, F4RC:$FRB))]>;
       
      +

      The portion of the instruction definition in bold indicates the pattern used to match the instruction. The DAG operators (like fmul/fadd) @@ -1012,8 +1017,8 @@ "F4RC" is the register class of the input and result values.

      The TableGen DAG instruction selector generator reads the instruction -patterns in the .td and automatically builds parts of the pattern matching code -for your target. It has the following strengths:

      +patterns in the .td file and automatically builds parts of the pattern +matching code for your target. It has the following strengths:

      • At compiler-compiler time, it analyzes your instruction patterns and tells @@ -1021,7 +1026,8 @@
      • It can handle arbitrary constraints on operands for the pattern match. In particular, it is straight-forward to say things like "match any immediate that is a 13-bit sign-extended value". For examples, see the - immSExt16 and related tblgen classes in the PowerPC backend.
      • + immSExt16 and related tblgen classes in the PowerPC + backend.
      • It knows several important identities for the patterns defined. For example, it knows that addition is commutative, so it allows the FMADDS pattern above to match "(fadd X, (fmul Y, Z))" as @@ -1029,55 +1035,58 @@ to specially handle this case.
      • It has a full-featured type-inferencing system. In particular, you should rarely have to explicitly tell the system what type parts of your patterns - are. In the FMADDS case above, we didn't have to tell tblgen that all of - the nodes in the pattern are of type 'f32'. It was able to infer and - propagate this knowledge from the fact that F4RC has type 'f32'.
      • + are. In the FMADDS case above, we didn't have to tell + tblgen that all of the nodes in the pattern are of type 'f32'. It + was able to infer and propagate this knowledge from the fact that + F4RC has type 'f32'.
      • Targets can define their own (and rely on built-in) "pattern fragments". Pattern fragments are chunks of reusable patterns that get inlined into your - patterns during compiler-compiler time. For example, the integer "(not x)" - operation is actually defined as a pattern fragment that expands as - "(xor x, -1)", since the SelectionDAG does not have a native 'not' - operation. Targets can define their own short-hand fragments as they see - fit. See the definition of 'not' and 'ineg' for examples.
      • + patterns during compiler-compiler time. For example, the integer + "(not x)" operation is actually defined as a pattern fragment that + expands as "(xor x, -1)", since the SelectionDAG does not have a + native 'not' operation. Targets can define their own short-hand + fragments as they see fit. See the definition of 'not' and + 'ineg' for examples.
      • In addition to instructions, targets can specify arbitrary patterns that - map to one or more instructions, using the 'Pat' class. For example, + map to one or more instructions using the 'Pat' class. For example, the PowerPC has no way to load an arbitrary integer immediate into a register in one instruction. To tell tblgen how to do this, it defines: - +
        +
        +
        -    // Arbitrary immediate support.  Implement in terms of LIS/ORI.
        -    def : Pat<(i32 imm:$imm),
        -              (ORI (LIS (HI16 imm:$imm)), (LO16 imm:$imm))>;
        +// Arbitrary immediate support.  Implement in terms of LIS/ORI.
        +def : Pat<(i32 imm:$imm),
        +          (ORI (LIS (HI16 imm:$imm)), (LO16 imm:$imm))>;
             
        - +
        +
        If none of the single-instruction patterns for loading an immediate into a register match, this will be used. This rule says "match an arbitrary i32 - immediate, turning it into an ORI ('or a 16-bit immediate') and an LIS - ('load 16-bit immediate, where the immediate is shifted to the left 16 - bits') instruction". To make this work, the LO16/HI16 node transformations - are used to manipulate the input immediate (in this case, take the high or - low 16-bits of the immediate). -
      • + immediate, turning it into an ORI ('or a 16-bit immediate') and an + LIS ('load 16-bit immediate, where the immediate is shifted to the + left 16 bits') instruction". To make this work, the + LO16/HI16 node transformations are used to manipulate the + input immediate (in this case, take the high or low 16-bits of the + immediate).
      • While the system does automate a lot, it still allows you to write custom - C++ code to match special cases, in case there is something that is hard - to express.
      • + C++ code to match special cases if there is something that is hard to + express.
      -

      -While it has many strengths, the system currently has some limitations, -primarily because it is a work in progress and is not yet finished: -

      +

      While it has many strengths, the system currently has some limitations, +primarily because it is a work in progress and is not yet finished:

      • Overall, there is no way to define or match SelectionDAG nodes that define - multiple values (e.g. ADD_PARTS, LOAD, CALL, etc). This is the biggest - reason that you currently still have to write custom C++ code for - your instruction selector.
      • -
      • There is no great way to support match complex addressing modes yet. In the - future, we will extend pattern fragments to allow them to define multiple - values (e.g. the four operands of the X86 addressing - mode). In addition, we'll extend fragments so that a fragment can match - multiple different patterns.
      • + multiple values (e.g. ADD_PARTS, LOAD, CALL, + etc). This is the biggest reason that you currently still have to + write custom C++ code for your instruction selector. +
      • There is no great way to support matching complex addressing modes yet. In + the future, we will extend pattern fragments to allow them to define + multiple values (e.g. the four operands of the X86 + addressing mode). In addition, we'll extend fragments so that a + fragment can match multiple different patterns.
      • We don't automatically infer flags like isStore/isLoad yet.
      • We don't automatically generate the set of supported registers and operations for the Legalizer yet.
      • @@ -1102,9 +1111,8 @@ phase and assigns an order. The scheduler can pick an order depending on various constraints of the machines (i.e. order for minimal register pressure or try to cover instruction latencies). Once an order is established, the DAG is -converted to a list of MachineInstrs and the -Selection DAG is destroyed. -

        +converted to a list of MachineInstrs and +the SelectionDAG is destroyed.

        Note that this phase is logically separate from the instruction selection phase, but is tied to it closely in the code because it operates on @@ -1121,7 +1129,7 @@

        1. Optional function-at-a-time selection.
        2. -
        3. Auto-generate entire selector from .td file.
        4. +
        5. Auto-generate entire selector from .td file.
        @@ -1151,25 +1159,19 @@ - - +

        To Be Written

        - -
        - -
        - - +

        To Be Written

        -

        For the JIT or .o file writer

        +

        For the JIT or .o file writer

        @@ -1177,6 +1179,7 @@ +

        To Be Written

        @@ -1194,8 +1197,7 @@
        -

        -The X86 code generator lives in the lib/Target/X86 directory. This +

        The X86 code generator lives in the lib/Target/X86 directory. This code generator currently targets a generic P6-like processor. As such, it produces a few P6-and-above instructions (like conditional moves), but it does not make use of newer features like MMX or SSE. In the future, the X86 backend @@ -1210,11 +1212,10 @@

        -

        -The following are the known target triples that are supported by the X86 -backend. This is not an exhaustive list, but it would be useful to add those -that people test. -

        + +

        The following are the known target triples that are supported by the X86 +backend. This is not an exhaustive list, and it would be useful to add those +that people test.

        • i686-pc-linux-gnu - Linux
        • @@ -1237,13 +1238,15 @@ forming memory addresses of the following expression directly in integer instructions (which use ModR/M addressing):

          +
          -   Base+[1,2,4,8]*IndexReg+Disp32
          +Base + [1,2,4,8] * IndexReg + Disp32
           
          +

          In order to represent this, LLVM tracks no less than 4 operands for each -memory operand of this form. This means that the "load" form of 'mov' has the -following MachineOperands in this order:

          +memory operand of this form. This means that the "load" form of 'mov' +has the following MachineOperands in this order:

           Index:        0     |    1        2       3           4
          @@ -1252,7 +1255,7 @@
           

          Stores, and all other instructions, treat the four memory operands in the -same way, in the same order.

          +same way and in the same order.

        @@ -1263,8 +1266,7 @@
        -

        -An instruction name consists of the base name, a default operand size, and a +

        An instruction name consists of the base name, a default operand size, and a a character per operand with an optional special size. For example:

        @@ -1286,7 +1288,7 @@ Chris Lattner
        The LLVM Compiler Infrastructure
        - Last modified: $Date: 2006/04/20 17:42:23 $ + Last modified: $Date: 2006/08/28 02:26:32 $ From isanbard at gmail.com Sun Aug 27 21:57:55 2006 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 27 Aug 2006 21:57:55 -0500 Subject: [llvm-commits] CVS: llvm/docs/CodeGenerator.html Message-ID: <200608280257.k7S2vt6C027307@zion.cs.uiuc.edu> Changes in directory llvm/docs: CodeGenerator.html updated: 1.31 -> 1.32 --- Log message: Messed up and put a "To be written" in a section that was written. --- Diffs of the changes: (+1 -2) CodeGenerator.html | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/docs/CodeGenerator.html diff -u llvm/docs/CodeGenerator.html:1.31 llvm/docs/CodeGenerator.html:1.32 --- llvm/docs/CodeGenerator.html:1.31 Sun Aug 27 21:26:32 2006 +++ llvm/docs/CodeGenerator.html Sun Aug 27 21:57:41 2006 @@ -1179,7 +1179,6 @@

        -

        To Be Written

        @@ -1288,7 +1287,7 @@ Chris Lattner
        The LLVM Compiler Infrastructure
        - Last modified: $Date: 2006/08/28 02:26:32 $ + Last modified: $Date: 2006/08/28 02:57:41 $ From isanbard at gmail.com Sun Aug 27 22:04:19 2006 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 27 Aug 2006 22:04:19 -0500 Subject: [llvm-commits] CVS: llvm/docs/CodeGenerator.html Message-ID: <200608280304.k7S34JHI027516@zion.cs.uiuc.edu> Changes in directory llvm/docs: CodeGenerator.html updated: 1.32 -> 1.33 --- Log message: Spell naively with the i-Umlaut... --- Diffs of the changes: (+3 -3) CodeGenerator.html | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/docs/CodeGenerator.html diff -u llvm/docs/CodeGenerator.html:1.32 llvm/docs/CodeGenerator.html:1.33 --- llvm/docs/CodeGenerator.html:1.32 Sun Aug 27 21:57:41 2006 +++ llvm/docs/CodeGenerator.html Sun Aug 27 22:04:05 2006 @@ -850,8 +850,8 @@
        -

        The initial SelectionDAG is naively peephole expanded from the LLVM input by -the SelectionDAGLowering class in the +

        The initial SelectionDAG is naïvely peephole expanded from the LLVM +input by the SelectionDAGLowering class in the lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp file. The intent of this pass is to expose as much low-level, target-specific details to the SelectionDAG as possible. This pass is mostly hard-coded (e.g. an LLVM add turns @@ -1287,7 +1287,7 @@ Chris Lattner
        The LLVM Compiler Infrastructure
        - Last modified: $Date: 2006/08/28 02:57:41 $ + Last modified: $Date: 2006/08/28 03:04:05 $