From resistor at mac.com Mon May 12 03:15:28 2008 From: resistor at mac.com (Owen Anderson) Date: Mon, 12 May 2008 08:15:28 -0000 Subject: [llvm-commits] [llvm] r50963 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp Message-ID: <200805120815.m4C8FS7p031980@zion.cs.uiuc.edu> Author: resistor Date: Mon May 12 03:15:27 2008 New Revision: 50963 URL: http://llvm.org/viewvc/llvm-project?rev=50963&view=rev Log: Move the various analyses used by GVN into static variables so we don't have to keep passing them around or refetching them. Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=50963&r1=50962&r2=50963&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Mon May 12 03:15:27 2008 @@ -42,6 +42,10 @@ // ValueTable Class //===----------------------------------------------------------------------===// +static DominatorTree* DT; +static AliasAnalysis* AA; +static MemoryDependenceAnalysis* MD; + /// This class holds the mapping between values and value numbers. It is used /// as an efficient mechanism to determine the expression-wise equivalence of /// two values. @@ -129,8 +133,6 @@ private: DenseMap valueNumbering; DenseMap expressionNumbering; - AliasAnalysis* AA; - MemoryDependenceAnalysis* MD; uint32_t nextValueNumber; @@ -154,8 +156,6 @@ void clear(); void erase(Value* v); unsigned size(); - void setAliasAnalysis(AliasAnalysis* A) { AA = A; } - void setMemDep(MemoryDependenceAnalysis* M) { MD = M; } }; } @@ -734,7 +734,6 @@ } Value* GVN::CollapsePhi(PHINode* p) { - DominatorTree &DT = getAnalysis(); Value* constVal = p->hasConstantValue(); if (!constVal) return 0; @@ -743,7 +742,7 @@ if (!inst) return constVal; - if (DT.dominates(inst, p)) + if (DT->dominates(inst, p)) if (isSafeReplacement(p, inst)) return inst; return 0; @@ -794,8 +793,7 @@ PN->addIncoming(val, *PI); } - AliasAnalysis& AA = getAnalysis(); - AA.copyValue(orig, PN); + AA->copyValue(orig, PN); // Attempt to collapse PHI nodes that are trivially redundant Value* v = CollapsePhi(PN); @@ -804,10 +802,8 @@ phiMap[orig->getPointerOperand()].insert(PN); return PN; } - - MemoryDependenceAnalysis& MD = getAnalysis(); - MD.removeInstruction(PN); + MD->removeInstruction(PN); PN->replaceAllUsesWith(v); for (DenseMap::iterator I = Phis.begin(), @@ -825,11 +821,9 @@ /// non-local by performing PHI construction. bool GVN::processNonLocalLoad(LoadInst* L, SmallVectorImpl &toErase) { - MemoryDependenceAnalysis& MD = getAnalysis(); - // Find the non-local dependencies of the load DenseMap deps; - MD.getNonLocalDependency(L, deps); + MD->getNonLocalDependency(L, deps); DenseMap repl; @@ -860,7 +854,7 @@ for (SmallPtrSet::iterator I = p.begin(), E = p.end(); I != E; ++I) { if ((*I)->getParent() == L->getParent()) { - MD.removeInstruction(L); + MD->removeInstruction(L); L->replaceAllUsesWith(*I); toErase.push_back(L); NumGVNLoad++; @@ -874,7 +868,7 @@ SmallPtrSet visited; Value* v = GetValueForBlock(L->getParent(), L, repl, true); - MD.removeInstruction(L); + MD->removeInstruction(L); L->replaceAllUsesWith(v); toErase.push_back(L); NumGVNLoad++; @@ -895,9 +889,8 @@ LoadInst*& last = lastLoad[pointer]; // ... to a pointer that has been loaded from before... - MemoryDependenceAnalysis& MD = getAnalysis(); bool removedNonLocal = false; - Instruction* dep = MD.getDependency(L); + Instruction* dep = MD->getDependency(L); if (dep == MemoryDependenceAnalysis::NonLocal && L->getParent() != &L->getParent()->getParent()->getEntryBlock()) { removedNonLocal = processNonLocalLoad(L, toErase); @@ -920,7 +913,7 @@ if (StoreInst* S = dyn_cast(dep)) { if (S->getPointerOperand() == pointer) { // Remove it! - MD.removeInstruction(L); + MD->removeInstruction(L); L->replaceAllUsesWith(S->getOperand(0)); toErase.push_back(L); @@ -937,7 +930,7 @@ break; } else if (dep == last) { // Remove it! - MD.removeInstruction(L); + MD->removeInstruction(L); L->replaceAllUsesWith(last); toErase.push_back(L); @@ -946,7 +939,7 @@ break; } else { - dep = MD.getDependency(L, dep); + dep = MD->getDependency(L, dep); } } @@ -968,7 +961,7 @@ // If this load depends directly on an allocation, there isn't // anything stored there; therefore, we can optimize this load // to undef. - MD.removeInstruction(L); + MD->removeInstruction(L); L->replaceAllUsesWith(UndefValue::get(L->getType())); toErase.push_back(L); @@ -1016,8 +1009,7 @@ Value* repl = find_leader(currAvail, num); // Remove it! - MemoryDependenceAnalysis& MD = getAnalysis(); - MD.removeInstruction(I); + MD->removeInstruction(I); VN.erase(I); I->replaceAllUsesWith(repl); @@ -1035,8 +1027,9 @@ // function. // bool GVN::runOnFunction(Function& F) { - VN.setAliasAnalysis(&getAnalysis()); - VN.setMemDep(&getAnalysis()); + DT = &getAnalysis(); + AA = &getAnalysis(); + MD = &getAnalysis(); bool changed = false; bool shouldContinue = true; @@ -1059,15 +1052,13 @@ bool changed_function = false; - DominatorTree &DT = getAnalysis(); - SmallVector toErase; DenseMap lastSeenLoad; DenseMap numChildrenVisited; // Top-down walk of the dominator tree - for (df_iterator DI = df_begin(DT.getRootNode()), - E = df_end(DT.getRootNode()); DI != E; ++DI) { + for (df_iterator DI = df_begin(DT->getRootNode()), + E = df_end(DT->getRootNode()); DI != E; ++DI) { // Get the set to update for this block ValueNumberedSet& currAvail = availableOut[DI->getBlock()]; From baldrick at free.fr Mon May 12 07:57:21 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 12 May 2008 12:57:21 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r50964 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200805121257.m4CCvLFN009037@zion.cs.uiuc.edu> Author: baldrick Date: Mon May 12 07:57:19 2008 New Revision: 50964 URL: http://llvm.org/viewvc/llvm-project?rev=50964&view=rev Log: Since the order that basic blocks are output is not related to the cfg in general, it is possible to encounter a use of a gimple temporary before it is defined even though the definition dominates all uses. Handle this rare case by demoting the temporary to an ordinary variable. This fixes PR2264. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=50964&r1=50963&r2=50964&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon May 12 07:57:19 2008 @@ -2164,8 +2164,16 @@ Value *TreeToLLVM::EmitLoadOfLValue(tree exp, const MemRef *DestLoc) { // If this is a gimple temporary, don't emit a load, just use the result. if (isGimpleTemporary(exp)) { - assert(DECL_LLVM_SET_P(exp) && "Definition not found before use!"); - return DECL_LLVM(exp); + if (DECL_LLVM_SET_P(exp)) + return DECL_LLVM(exp); + // Since basic blocks are output in no particular order, it is perfectly + // possible to encounter a use of a gimple temporary before encountering + // its definition, which is what has happened here. This happens rarely + // in practice, so there's no point in trying to do anything clever: just + // demote to an ordinary variable and create an alloca to hold its value. + DECL_GIMPLE_FORMAL_TEMP_P(exp) = 0; + EmitAutomaticVariableDecl(exp); + // Fall through. } else if (TREE_CODE(exp) == VAR_DECL && DECL_REGISTER(exp) && TREE_STATIC(exp)) { // If this is a register variable, EmitLV can't handle it (there is no From baldrick at free.fr Mon May 12 08:01:19 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 12 May 2008 13:01:19 -0000 Subject: [llvm-commits] [llvm] r50965 - /llvm/trunk/test/CFrontend/2008-05-12-TempUsedBeforeDef.c Message-ID: <200805121301.m4CD1KrP009152@zion.cs.uiuc.edu> Author: baldrick Date: Mon May 12 08:01:19 2008 New Revision: 50965 URL: http://llvm.org/viewvc/llvm-project?rev=50965&view=rev Log: Testcase for PR2264. Added: llvm/trunk/test/CFrontend/2008-05-12-TempUsedBeforeDef.c Added: llvm/trunk/test/CFrontend/2008-05-12-TempUsedBeforeDef.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2008-05-12-TempUsedBeforeDef.c?rev=50965&view=auto ============================================================================== --- llvm/trunk/test/CFrontend/2008-05-12-TempUsedBeforeDef.c (added) +++ llvm/trunk/test/CFrontend/2008-05-12-TempUsedBeforeDef.c Mon May 12 08:01:19 2008 @@ -0,0 +1,10 @@ +// RUN: %llvmgcc -S -o /dev/null %s +// PR2264. +unsigned foo = 8L; +unsigned bar = 0L; +volatile unsigned char baz = 6L; +int test() { + char qux = 1L; + for (; baz >= -29; baz--) + bork(bar && foo, qux); +} From criswell at cs.uiuc.edu Mon May 12 10:46:22 2008 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 12 May 2008 10:46:22 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/2008-03-TR-UIDependAnalysis.html 2008-03-TR-UIDependAnalysis.pdf Message-ID: <200805121546.m4CFkMqu030933@maute.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2008-03-TR-UIDependAnalysis.html added (r1.1) 2008-03-TR-UIDependAnalysis.pdf added (r1.1) --- Log message: Added tech report using LLVM from Sun Microsystems. Permission given by Cristina Cifuentes. --- Diffs of the changes: (+56 -0) 2008-03-TR-UIDependAnalysis.html | 56 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 56 insertions(+) Index: llvm-www/pubs/2008-03-TR-UIDependAnalysis.html diff -c /dev/null llvm-www/pubs/2008-03-TR-UIDependAnalysis.html:1.1 *** /dev/null Mon May 12 10:45:39 2008 --- llvm-www/pubs/2008-03-TR-UIDependAnalysis.html Mon May 12 10:45:28 2008 *************** *** 0 **** --- 1,56 ---- + + + + + + User-Input Dependence Analysis via Graph Reachability + + + +
+ User-Input Dependence Analysis via Graph Reachability +
+ + +

Abstract:

+
+

+ Security vulnerabilities are software bugs that are exploited by an attacker. Systems software is at high risk of exploitation: attackers commonly exploit security vulnerabilities to gain control over a system, remotely, over the internet. Bug-checking tools have been used with fair success in recent years to automatically find bugs in software. However, for finding software bugs that can cause security vulnerabilities, a bug checking tool must determine whether the software bug can be controlled by user-input. +

+ +

+ In this paper we introduce a static program analysis for computing user-input dependencies. This analysis is used as a pre-processing filter to our static bug checking tool, currently under development, to identify bugs that can be exploited as security vulnerabilities. Runtime speed and scalability of the user-input dependence analysis is of key importance if the analysis is used for large commercial systems software. +

+ +

+ Our user-input dependency analysis takes both data and control dependencies into account. We extend Static Single Assignment (SSA) form by augmenting phi-nodes with control dependencies of its arguments. A formal definition of user-input dependency is expressed in a dataflow analysis framework as a Meet-Over-all-Paths (MOP) solution. We reduce the equation system to a sparse equation system exploiting the properties of SSA. The sparse equation system is solved as a reachability problem that results in a fast algorithm for computing user-input dependencies. We have implemented a call-insensitive and a call-sensitive version of the analysis. The paper compares their efficiency for various systems codes. +

+
+ +

Bibtex:

+
+ @techreport{SunTR171:2008,
+     author = "Bernard Scholz and Chenyi Zhang and Cristina Cifuentes",
+     title = "{User-Input Dependence Analysis via Graph Reachability}",
+     number = "TR-2008-171",
+     month = "March",
+     year = "2008",
+     url = "http://research.sun.com/techrep/2008/abstract-171.html"
+ }
+ 
+ +

Download:

+ + + + From criswell at cs.uiuc.edu Mon May 12 10:52:39 2008 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 12 May 2008 10:52:39 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/index.html Message-ID: <200805121552.m4CFqdgS031105@maute.cs.uiuc.edu> Changes in directory llvm-www/pubs: index.html updated: 1.74 -> 1.75 --- Log message: Added Sun Microsystems Tech Report TR-2008-171. --- Diffs of the changes: (+5 -0) index.html | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm-www/pubs/index.html diff -u llvm-www/pubs/index.html:1.74 llvm-www/pubs/index.html:1.75 --- llvm-www/pubs/index.html:1.74 Mon May 5 09:50:51 2008 +++ llvm-www/pubs/index.html Mon May 12 10:51:57 2008 @@ -18,6 +18,11 @@ Y. Hwang, S. Abdi, and D. Gajski
Proc. of Design Automation and Test in Europe (DATE'08), Munich, Germany, March 2008 +
  • "User-Input Dependence Analysis via Graph Reachability"
    +Bernard Scholz, Chenyi Zhang, and Cristina Cifuentes +
    +Technical Report #TR-2008-171, Sun Microsystems, March 2008
  • +
  • "Impeding Malware Analysis Using Conditional Code Obfuscation"
    Monirul Sharif, Andrea Lanzi, Jonathon Giffin and Wenke Lee
    From gohman at apple.com Mon May 12 11:07:20 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 12 May 2008 16:07:20 -0000 Subject: [llvm-commits] [llvm] r50967 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200805121607.m4CG7KGD014626@zion.cs.uiuc.edu> Author: djg Date: Mon May 12 11:07:15 2008 New Revision: 50967 URL: http://llvm.org/viewvc/llvm-project?rev=50967&view=rev Log: Fix a missing break in the ISD::FLT_ROUNDS_ handling. Patch by giuma! Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=50967&r1=50966&r2=50967&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon May 12 11:07:15 2008 @@ -3999,6 +3999,7 @@ Result = DAG.getConstant(1, VT); break; } + break; } case ISD::TRAP: { MVT::ValueType VT = Node->getValueType(0); From gohman at apple.com Mon May 12 11:17:19 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 12 May 2008 16:17:19 -0000 Subject: [llvm-commits] [llvm] r50969 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200805121617.m4CGHK6Q015070@zion.cs.uiuc.edu> Author: djg Date: Mon May 12 11:17:19 2008 New Revision: 50969 URL: http://llvm.org/viewvc/llvm-project?rev=50969&view=rev Log: Fix a compile error on compilers that still want a return value in a non-void function that calls abort. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=50969&r1=50968&r2=50969&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon May 12 11:17:19 2008 @@ -4987,6 +4987,7 @@ assert(0 && "VAArgInst is not yet implemented for x86-64!"); abort(); + return SDOperand(); } SDOperand X86TargetLowering::LowerVACOPY(SDOperand Op, SelectionDAG &DAG) { From foldr at codedgers.com Mon May 12 11:31:42 2008 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Mon, 12 May 2008 16:31:42 -0000 Subject: [llvm-commits] [llvm] r50971 - in /llvm/trunk/tools/llvmc2: CompilationGraph.cpp Error.h llvmc.cpp Message-ID: <200805121631.m4CGVhVL015490@zion.cs.uiuc.edu> Author: foldr Date: Mon May 12 11:31:42 2008 New Revision: 50971 URL: http://llvm.org/viewvc/llvm-project?rev=50971&view=rev Log: Fix some error messages; Make LLVMC pass through the exit code of a failed tool. Added: llvm/trunk/tools/llvmc2/Error.h Modified: llvm/trunk/tools/llvmc2/CompilationGraph.cpp llvm/trunk/tools/llvmc2/llvmc.cpp Modified: llvm/trunk/tools/llvmc2/CompilationGraph.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/CompilationGraph.cpp?rev=50971&r1=50970&r2=50971&view=diff ============================================================================== --- llvm/trunk/tools/llvmc2/CompilationGraph.cpp (original) +++ llvm/trunk/tools/llvmc2/CompilationGraph.cpp Mon May 12 11:31:42 2008 @@ -11,6 +11,7 @@ // //===----------------------------------------------------------------------===// +#include "Error.h" #include "CompilationGraph.h" #include "llvm/ADT/STLExtras.h" @@ -90,7 +91,7 @@ const std::string& CompilationGraph::getLanguage(const sys::Path& File) const { LanguageMap::const_iterator Lang = ExtsToLangs.find(File.getSuffix()); if (Lang == ExtsToLangs.end()) - throw std::runtime_error("Unknown suffix: " + File.getSuffix() + '!'); + throw std::runtime_error("Unknown suffix: " + File.getSuffix()); return Lang->second; } @@ -101,7 +102,7 @@ tools_map_type::const_iterator I = ToolsMap.find(LangName); if (I == ToolsMap.end()) throw std::runtime_error("No tool corresponding to the language " - + LangName + "found!"); + + LangName + "found"); return I->second; } @@ -176,8 +177,8 @@ Out = MakeTempFile(TempDir, In.getBasename(), CurTool->OutputSuffix()); } - if (CurTool->GenerateAction(In, Out).Execute() != 0) - throw std::runtime_error("Tool returned error code!"); + if (int ret = CurTool->GenerateAction(In, Out).Execute()) + throw error_code(ret); if (Last) return; @@ -205,8 +206,8 @@ // Find the toolchain for the input language. const tools_vector_type& TV = getToolsVector(InLanguage); if (TV.empty()) - throw std::runtime_error("No toolchain corresponding to language" - + InLanguage + " found!"); + throw std::runtime_error("No toolchain corresponding to language " + + InLanguage + " found"); return &getNode(ChooseEdge(TV, InLangs)->ToolName()); } @@ -342,8 +343,8 @@ Out = MakeTempFile(TempDir, "tmp", JT->OutputSuffix()); } - if (JT->GenerateAction(Out).Execute() != 0) - throw std::runtime_error("Tool returned error code!"); + if (int ret = JT->GenerateAction(Out).Execute()) + throw error_code(ret); if (!IsLast) { const Node* NextNode = @@ -397,7 +398,7 @@ O.close(); } else { - throw std::runtime_error(""); + throw std::runtime_error("Error opening file for writing"); } } Added: llvm/trunk/tools/llvmc2/Error.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/Error.h?rev=50971&view=auto ============================================================================== --- llvm/trunk/tools/llvmc2/Error.h (added) +++ llvm/trunk/tools/llvmc2/Error.h Mon May 12 11:31:42 2008 @@ -0,0 +1,33 @@ +//===--- Error.h - The LLVM Compiler Driver ---------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open +// Source License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Exception classes for LLVMC. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_TOOLS_LLVMC2_ERROR_H +#define LLVM_TOOLS_LLVMC2_ERROR_H + +#include + +namespace llvmc { + + class error_code: public std::runtime_error { + int Code_; + public: + error_code (int c) + : std::runtime_error("Tool returned error code"), Code_(c) + {} + + int code() const { return Code_; } + }; + +} + +#endif //LLVM_TOOLS_LLVMC2_ERROR_H Modified: llvm/trunk/tools/llvmc2/llvmc.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/llvmc.cpp?rev=50971&r1=50970&r2=50971&view=diff ============================================================================== --- llvm/trunk/tools/llvmc2/llvmc.cpp (original) +++ llvm/trunk/tools/llvmc2/llvmc.cpp Mon May 12 11:31:42 2008 @@ -15,6 +15,7 @@ //===----------------------------------------------------------------------===// #include "CompilationGraph.h" +#include "Error.h" #include "Tool.h" #include "llvm/System/Path.h" @@ -92,6 +93,9 @@ return BuildTargets(graph); } + catch(llvmc::error_code& ec) { + return ec.code(); + } catch(const std::exception& ex) { std::cerr << ex.what() << '\n'; } From foldr at codedgers.com Mon May 12 11:32:24 2008 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Mon, 12 May 2008 16:32:24 -0000 Subject: [llvm-commits] [llvm] r50972 - /llvm/trunk/tools/llvmc2/Makefile Message-ID: <200805121632.m4CGWOdV015516@zion.cs.uiuc.edu> Author: foldr Date: Mon May 12 11:32:24 2008 New Revision: 50972 URL: http://llvm.org/viewvc/llvm-project?rev=50972&view=rev Log: Make it possible to choose between different compilation graph definitions at compile-time. Modified: llvm/trunk/tools/llvmc2/Makefile Modified: llvm/trunk/tools/llvmc2/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/Makefile?rev=50972&r1=50971&r2=50972&view=diff ============================================================================== --- llvm/trunk/tools/llvmc2/Makefile (original) +++ llvm/trunk/tools/llvmc2/Makefile Mon May 12 11:32:24 2008 @@ -14,7 +14,8 @@ include $(LEVEL)/Makefile.common -TOOLS_SOURCE=Graph.td Tools.td Common.td +GRAPH = Graph.td +TOOLS_SOURCE=$(GRAPH) Tools.td Common.td # TOFIX: integrate this part into Makefile.rules? # The degree of horrorshowness in that file is too much for me atm. From foldr at codedgers.com Mon May 12 11:33:06 2008 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Mon, 12 May 2008 16:33:06 -0000 Subject: [llvm-commits] [llvm] r50973 - in /llvm/trunk: test/LLVMC/wall.c tools/llvmc2/Tools.td utils/TableGen/LLVMCConfigurationEmitter.cpp Message-ID: <200805121633.m4CGX6gV015546@zion.cs.uiuc.edu> Author: foldr Date: Mon May 12 11:33:06 2008 New Revision: 50973 URL: http://llvm.org/viewvc/llvm-project?rev=50973&view=rev Log: Filter option names to escape symbols not allowed as C++ identifiers. Makes it possible to use options with names like "Wa,". Also fixes the -Wall option handling as a side-effect. Added: llvm/trunk/test/LLVMC/wall.c Modified: llvm/trunk/tools/llvmc2/Tools.td llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Added: llvm/trunk/test/LLVMC/wall.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/wall.c?rev=50973&view=auto ============================================================================== --- llvm/trunk/test/LLVMC/wall.c (added) +++ llvm/trunk/test/LLVMC/wall.c Mon May 12 11:33:06 2008 @@ -0,0 +1,12 @@ +/* + * Check that -Wall works as intended + * RUN: llvmc2 -Wall %s -o %t + * RUN: ./%t | grep hello + */ + +#include + +int main() { + printf("hello\n"); + return 0; +} Modified: llvm/trunk/tools/llvmc2/Tools.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/Tools.td?rev=50973&r1=50972&r2=50973&view=diff ============================================================================== --- llvm/trunk/tools/llvmc2/Tools.td (original) +++ llvm/trunk/tools/llvmc2/Tools.td Mon May 12 11:33:06 2008 @@ -71,7 +71,7 @@ (cmd_line "llvm-gcc -c -x assembler $INFILE -o $OUTFILE"), (switch_option "c", (stop_compilation), (help "Compile and assemble, but do not link")), - (prefix_list_option "Wa", (unpack_values), (help "pass options to assembler")) + (prefix_list_option "Wa,", (unpack_values), (help "pass options to assembler")) ]>; // Default linker @@ -83,7 +83,7 @@ (join), (prefix_list_option "L", (forward), (help "add a directory to link path")), (prefix_list_option "l", (forward), (help "search a library when linking")), - (prefix_list_option "Wl", (unpack_values), (help "pass options to linker")) + (prefix_list_option "Wl,", (unpack_values), (help "pass options to linker")) ]>; // Alternative linker for C++ @@ -97,7 +97,7 @@ (help "Choose linker (possible values: gcc, g++)")), (prefix_list_option "L", (forward)), (prefix_list_option "l", (forward)), - (prefix_list_option "Wl", (unpack_values)) + (prefix_list_option "Wl,", (unpack_values)) ]>; // Language map Modified: llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp?rev=50973&r1=50972&r2=50973&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Mon May 12 11:33:06 2008 @@ -135,19 +135,36 @@ } } + // Escape commas and other symbols not allowed in the C++ variable + // names. Makes it possible to use options with names like "Wa," + // (useful for prefix options). + std::string EscapeVariableName(const std::string& Var) const { + std::string ret; + for (unsigned i = 0; i != Var.size(); ++i) { + if (Var[i] == ',') { + ret += "_comma_"; + } + else { + ret.push_back(Var[i]); + } + } + return ret; + } + std::string GenVariableName() const { + const std::string& EscapedName = EscapeVariableName(Name); switch (Type) { case OptionType::Switch: - return "AutoGeneratedSwitch" + Name; + return "AutoGeneratedSwitch" + EscapedName; case OptionType::Prefix: - return "AutoGeneratedPrefix" + Name; + return "AutoGeneratedPrefix" + EscapedName; case OptionType::PrefixList: - return "AutoGeneratedPrefixList" + Name; + return "AutoGeneratedPrefixList" + EscapedName; case OptionType::Parameter: - return "AutoGeneratedParameter" + Name; + return "AutoGeneratedParameter" + EscapedName; case OptionType::ParameterList: default: - return "AutoGeneratedParameterList" + Name; + return "AutoGeneratedParameterList" + EscapedName; } } From gohman at apple.com Mon May 12 11:34:30 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 12 May 2008 16:34:30 -0000 Subject: [llvm-commits] [llvm] r50974 - in /llvm/trunk/lib/VMCore: AsmWriter.cpp Instructions.cpp Message-ID: <200805121634.m4CGYVNd015599@zion.cs.uiuc.edu> Author: djg Date: Mon May 12 11:34:30 2008 New Revision: 50974 URL: http://llvm.org/viewvc/llvm-project?rev=50974&view=rev Log: Update comments. Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp llvm/trunk/lib/VMCore/Instructions.cpp Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=50974&r1=50973&r2=50974&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Mon May 12 11:34:30 2008 @@ -539,7 +539,7 @@ Out << "zeroinitializer"; } else if (const ConstantArray *CA = dyn_cast(CV)) { // As a special case, print the array as a string if it is an array of - // ubytes or an array of sbytes with positive values. + // i8 with ConstantInt values. // const Type *ETy = CA->getType()->getElementType(); if (CA->isString()) { Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=50974&r1=50973&r2=50974&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Mon May 12 11:34:30 2008 @@ -1605,10 +1605,9 @@ /// changed in order to effect the cast. Essentially, it identifies cases where /// no code gen is necessary for the cast, hence the name no-op cast. For /// example, the following are all no-op casts: -/// # bitcast uint %X, int -/// # bitcast uint* %x, sbyte* -/// # bitcast vector< 2 x int > %x, vector< 4 x short> -/// # ptrtoint uint* %x, uint ; on 32-bit plaforms only +/// # bitcast i32* %x to i8* +/// # bitcast <2 x i32> %x to <4 x i16> +/// # ptrtoint i32* %x to i32 ; on 32-bit plaforms only /// @brief Determine if a cast is a no-op. bool CastInst::isNoopCast(const Type *IntPtrTy) const { switch (getOpcode()) { From gohman at apple.com Mon May 12 11:38:14 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 12 May 2008 16:38:14 -0000 Subject: [llvm-commits] [llvm] r50975 - /llvm/trunk/lib/Support/APFloat.cpp Message-ID: <200805121638.m4CGcGnb015713@zion.cs.uiuc.edu> Author: djg Date: Mon May 12 11:38:14 2008 New Revision: 50975 URL: http://llvm.org/viewvc/llvm-project?rev=50975&view=rev Log: Make firstEightPowers const. Modified: llvm/trunk/lib/Support/APFloat.cpp Modified: llvm/trunk/lib/Support/APFloat.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=50975&r1=50974&r2=50975&view=diff ============================================================================== --- llvm/trunk/lib/Support/APFloat.cpp (original) +++ llvm/trunk/lib/Support/APFloat.cpp Mon May 12 11:38:14 2008 @@ -438,8 +438,8 @@ static unsigned int powerOf5(integerPart *dst, unsigned int power) { - static integerPart firstEightPowers[] = { 1, 5, 25, 125, 625, 3125, - 15625, 78125 }; + static const integerPart firstEightPowers[] = { 1, 5, 25, 125, 625, 3125, + 15625, 78125 }; static integerPart pow5s[maxPowerOfFiveParts * 2 + 5] = { 78125 * 5 }; static unsigned int partsCount[16] = { 1 }; From clattner at apple.com Mon May 12 11:52:09 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 12 May 2008 09:52:09 -0700 Subject: [llvm-commits] [llvm] r50963 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp In-Reply-To: <200805120815.m4C8FS7p031980@zion.cs.uiuc.edu> References: <200805120815.m4C8FS7p031980@zion.cs.uiuc.edu> Message-ID: <9A210D89-A7F7-4BAA-85C9-E67407480BCC@apple.com> On May 12, 2008, at 1:15 AM, Owen Anderson wrote: > Author: resistor > Date: Mon May 12 03:15:27 2008 > New Revision: 50963 > > URL: http://llvm.org/viewvc/llvm-project?rev=50963&view=rev > Log: > Move the various analyses used by GVN into static variables so we > don't have to keep passing them around or refetching them. Hi Owen, Instance variables are ok, but not globals. Global variables mean that two instances of GVN can't be active at the same time. -Chris From criswell at cs.uiuc.edu Mon May 12 12:03:06 2008 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 12 May 2008 12:03:06 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/2008-03-TR-UIDependAnalysis.pdf Message-ID: <200805121703.m4CH36ud032616@maute.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2008-03-TR-UIDependAnalysis.pdf updated: 1.1 -> 1.2 --- Log message: Fixing corruption. --- Diffs of the changes: (+0 -0) 2008-03-TR-UIDependAnalysis.pdf | 0 1 files changed Index: llvm-www/pubs/2008-03-TR-UIDependAnalysis.pdf From tonic at nondot.org Mon May 12 12:55:40 2008 From: tonic at nondot.org (Tanya Lattner) Date: Mon, 12 May 2008 17:55:40 -0000 Subject: [llvm-commits] [llvm] r50981 - in /llvm/branches/release_23: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll Message-ID: <200805121755.m4CHteaC018498@zion.cs.uiuc.edu> Author: tbrethou Date: Mon May 12 12:55:39 2008 New Revision: 50981 URL: http://llvm.org/viewvc/llvm-project?rev=50981&view=rev Log: Merge from mainline. When transforming a vector_shuffle to a load, the base address must not be an undef. Added: llvm/branches/release_23/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll - copied unchanged from r50940, llvm/trunk/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll Modified: llvm/branches/release_23/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/branches/release_23/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_23/lib/Target/X86/X86ISelLowering.cpp?rev=50981&r1=50980&r2=50981&view=diff ============================================================================== --- llvm/branches/release_23/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/branches/release_23/lib/Target/X86/X86ISelLowering.cpp Mon May 12 12:55:39 2008 @@ -6283,6 +6283,8 @@ return false; if (!Base) { Base = Elt.Val; + if (Base->getOpcode() == ISD::UNDEF) + return false; continue; } if (Elt.getOpcode() == ISD::UNDEF) From tonic at nondot.org Mon May 12 13:23:39 2008 From: tonic at nondot.org (Tanya Lattner) Date: Mon, 12 May 2008 18:23:39 -0000 Subject: [llvm-commits] [llvm] r50982 - /llvm/branches/release_23/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200805121823.m4CINeLE019442@zion.cs.uiuc.edu> Author: tbrethou Date: Mon May 12 13:23:35 2008 New Revision: 50982 URL: http://llvm.org/viewvc/llvm-project?rev=50982&view=rev Log: Merge from mainline. Fix a compile error on compilers that still want a return value in a non-void function that calls abort. Modified: llvm/branches/release_23/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/branches/release_23/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_23/lib/Target/X86/X86ISelLowering.cpp?rev=50982&r1=50981&r2=50982&view=diff ============================================================================== --- llvm/branches/release_23/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/branches/release_23/lib/Target/X86/X86ISelLowering.cpp Mon May 12 13:23:35 2008 @@ -4987,6 +4987,7 @@ assert(0 && "VAArgInst is not yet implemented for x86-64!"); abort(); + return SDOperand(); } SDOperand X86TargetLowering::LowerVACOPY(SDOperand Op, SelectionDAG &DAG) { From tonic at nondot.org Mon May 12 13:49:39 2008 From: tonic at nondot.org (Tanya Lattner) Date: Mon, 12 May 2008 18:49:39 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r50984 - /llvm-gcc-4.2/branches/release_23/gcc/llvm-convert.cpp Message-ID: <200805121849.m4CIndZk020461@zion.cs.uiuc.edu> Author: tbrethou Date: Mon May 12 13:49:37 2008 New Revision: 50984 URL: http://llvm.org/viewvc/llvm-project?rev=50984&view=rev Log: Merge from mainline. Since the order that basic blocks are output is not related to the cfg in general, it is possible to encounter a use of a gimple temporary before it is defined even though the definition dominates all uses. Handle this rare case by demoting the temporary to an ordinary variable. This fixes PR2264. Modified: llvm-gcc-4.2/branches/release_23/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/branches/release_23/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/release_23/gcc/llvm-convert.cpp?rev=50984&r1=50983&r2=50984&view=diff ============================================================================== --- llvm-gcc-4.2/branches/release_23/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/branches/release_23/gcc/llvm-convert.cpp Mon May 12 13:49:37 2008 @@ -2164,8 +2164,16 @@ Value *TreeToLLVM::EmitLoadOfLValue(tree exp, const MemRef *DestLoc) { // If this is a gimple temporary, don't emit a load, just use the result. if (isGimpleTemporary(exp)) { - assert(DECL_LLVM_SET_P(exp) && "Definition not found before use!"); - return DECL_LLVM(exp); + if (DECL_LLVM_SET_P(exp)) + return DECL_LLVM(exp); + // Since basic blocks are output in no particular order, it is perfectly + // possible to encounter a use of a gimple temporary before encountering + // its definition, which is what has happened here. This happens rarely + // in practice, so there's no point in trying to do anything clever: just + // demote to an ordinary variable and create an alloca to hold its value. + DECL_GIMPLE_FORMAL_TEMP_P(exp) = 0; + EmitAutomaticVariableDecl(exp); + // Fall through. } else if (TREE_CODE(exp) == VAR_DECL && DECL_REGISTER(exp) && TREE_STATIC(exp)) { // If this is a register variable, EmitLV can't handle it (there is no From natebegeman at mac.com Mon May 12 14:01:58 2008 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 12 May 2008 19:01:58 -0000 Subject: [llvm-commits] [llvm] r50985 - in /llvm/trunk: docs/ include/llvm/ include/llvm/Support/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Bitcode/Writer/ lib/VMCore/ Message-ID: <200805121902.m4CJ22Nt020896@zion.cs.uiuc.edu> Author: sampo Date: Mon May 12 14:01:56 2008 New Revision: 50985 URL: http://llvm.org/viewvc/llvm-project?rev=50985&view=rev Log: Add two new instructions to the llvm IR, vicmp and vfcmp. see updated LangRef for details. CodeGen support coming in a follow up patch Modified: llvm/trunk/docs/LangRef.html llvm/trunk/include/llvm/Constants.h llvm/trunk/include/llvm/DerivedTypes.h llvm/trunk/include/llvm/InstrTypes.h llvm/trunk/include/llvm/Instruction.def llvm/trunk/include/llvm/Instructions.h llvm/trunk/include/llvm/Support/InstVisitor.h llvm/trunk/lib/AsmParser/LLLexer.cpp llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.y llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp llvm/trunk/lib/VMCore/AsmWriter.cpp llvm/trunk/lib/VMCore/Constants.cpp llvm/trunk/lib/VMCore/Instruction.cpp llvm/trunk/lib/VMCore/Instructions.cpp Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Mon May 12 14:01:56 2008 @@ -140,6 +140,8 @@
    1. 'icmp' Instruction
    2. 'fcmp' Instruction
    3. +
    4. 'vicmp' Instruction
    5. +
    6. 'vfcmp' Instruction
    7. 'phi' Instruction
    8. 'select' Instruction
    9. 'call' Instruction
    10. @@ -1680,6 +1682,12 @@
      fcmp COND ( VAL1, VAL2 )
      Performs the fcmp operation on constants.
      +
      vicmp COND ( VAL1, VAL2 )
      +
      Performs the vicmp operation on constants.
      + +
      vfcmp COND ( VAL1, VAL2 )
      +
      Performs the vfcmp operation on constants.
      +
      extractelement ( VAL, IDX )
      Perform the extractelement @@ -3672,9 +3680,9 @@ floating point typed. They must have identical types.

      Semantics:
      -

      The 'fcmp' compares var1 and var2 according to -the condition code given as cond. The comparison performed always -yields a i1 result, as follows: +

      The 'fcmp' instruction compares var1 and var2 +according to the condition code given as cond. The comparison performed +always yields a i1 result, as follows:

      1. false: always yields false, regardless of operands.
      2. oeq: yields true if both operands are not a QNAN and @@ -3715,6 +3723,106 @@ + +
        +
        Syntax:
        +
          <result> = vicmp <cond> <ty> <var1>, <var2>   ; yields {ty}:result
        +
        +
        Overview:
        +

        The 'vicmp' instruction returns an integer vector value based on +element-wise comparison of its two integer vector operands.

        +
        Arguments:
        +

        The 'vicmp' instruction takes three operands. The first operand is +the condition code indicating the kind of comparison to perform. It is not +a value, just a keyword. The possible condition code are: +

          +
        1. eq: equal
        2. +
        3. ne: not equal
        4. +
        5. ugt: unsigned greater than
        6. +
        7. uge: unsigned greater or equal
        8. +
        9. ult: unsigned less than
        10. +
        11. ule: unsigned less or equal
        12. +
        13. sgt: signed greater than
        14. +
        15. sge: signed greater or equal
        16. +
        17. slt: signed less than
        18. +
        19. sle: signed less or equal
        20. +
        +

        The remaining two arguments must be vector of +integer typed. They must also be identical types.

        +
        Semantics:
        +

        The 'vicmp' instruction compares var1 and var2 +according to the condition code given as cond. The comparison yields a +vector of integer result, of +identical type as the values being compared. The most significant bit in each +element is 1 if the element-wise comparison evaluates to true, and is 0 +otherwise. All other bits of the result are undefined. The condition codes +are evaluated identically to the 'icmp' +instruction. + +

        Example:
        +
        +  <result> = vicmp eq <2 x i32> < i32 4, i32 0 >, < i32 5, i32 0 >   ; yields: result=<2 x i32> < i32 0, i32 -1 >
        +  <result> = vicmp ult <2 x i8> < i8 1, i8 2 >, < i8 2, i8 2>        ; yields: result=<2 x i8> < i8 -1, i8 0 >
        +
        +
        + + + +
        +
        Syntax:
        +
          <result> = vfcmp <cond> <ty> <var1>, <var2>
        +
        Overview:
        +

        The 'vfcmp' instruction returns an integer vector value based on +element-wise comparison of its two floating point vector operands. The output +elements have the same width as the input elements.

        +
        Arguments:
        +

        The 'vfcmp' instruction takes three operands. The first operand is +the condition code indicating the kind of comparison to perform. It is not +a value, just a keyword. The possible condition code are: +

          +
        1. false: no comparison, always returns false
        2. +
        3. oeq: ordered and equal
        4. +
        5. ogt: ordered and greater than
        6. +
        7. oge: ordered and greater than or equal
        8. +
        9. olt: ordered and less than
        10. +
        11. ole: ordered and less than or equal
        12. +
        13. one: ordered and not equal
        14. +
        15. ord: ordered (no nans)
        16. +
        17. ueq: unordered or equal
        18. +
        19. ugt: unordered or greater than
        20. +
        21. uge: unordered or greater than or equal
        22. +
        23. ult: unordered or less than
        24. +
        25. ule: unordered or less than or equal
        26. +
        27. une: unordered or not equal
        28. +
        29. uno: unordered (either nans)
        30. +
        31. true: no comparison, always returns true
        32. +
        +

        The remaining two arguments must be vector of +floating point typed. They must also be identical +types.

        +
        Semantics:
        +

        The 'vfcmp' instruction compares var1 and var2 +according to the condition code given as cond. The comparison yields a +vector of integer result, with +an identical number of elements as the values being compared, and each element +having identical with to the width of the floating point elements. The most +significant bit in each element is 1 if the element-wise comparison evaluates to +true, and is 0 otherwise. All other bits of the result are undefined. The +condition codes are evaluated identically to the +'fcmp' instruction. + +

        Example:
        +
        +  <result> = vfcmp oeq <2 x float> < float 4, float 0 >, < float 5, float 0 >       ; yields: result=<2 x i32> < i32 0, i32 -1 >
        +  <result> = vfcmp ult <2 x double> < double 1, double 2 >, < double 2, double 2>   ; yields: result=<2 x i64> < i64 -1, i64 0 >
        +
        +
        + +
        Modified: llvm/trunk/include/llvm/Constants.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Constants.h?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/include/llvm/Constants.h (original) +++ llvm/trunk/include/llvm/Constants.h Mon May 12 14:01:56 2008 @@ -689,6 +689,8 @@ static Constant *getXor(Constant *C1, Constant *C2); static Constant *getICmp(unsigned short pred, Constant *LHS, Constant *RHS); static Constant *getFCmp(unsigned short pred, Constant *LHS, Constant *RHS); + static Constant *getVICmp(unsigned short pred, Constant *LHS, Constant *RHS); + static Constant *getVFCmp(unsigned short pred, Constant *LHS, Constant *RHS); static Constant *getShl(Constant *C1, Constant *C2); static Constant *getLShr(Constant *C1, Constant *C2); static Constant *getAShr(Constant *C1, Constant *C2); Modified: llvm/trunk/include/llvm/DerivedTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DerivedTypes.h?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/include/llvm/DerivedTypes.h (original) +++ llvm/trunk/include/llvm/DerivedTypes.h Mon May 12 14:01:56 2008 @@ -349,6 +349,16 @@ /// static VectorType *get(const Type *ElementType, unsigned NumElements); + /// VectorType::getInteger - This static method gets a VectorType with the + /// same number of elements as the input type, and the element type is an + /// integer type of the same width as the input element type. + /// + static VectorType *getInteger(const VectorType *VTy) { + unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits(); + const Type *EltTy = IntegerType::get(EltBits); + return VectorType::get(EltTy, VTy->getNumElements()); + } + /// @brief Return the number of elements in the Vector type. inline unsigned getNumElements() const { return NumElements; } Modified: llvm/trunk/include/llvm/InstrTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InstrTypes.h?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/include/llvm/InstrTypes.h (original) +++ llvm/trunk/include/llvm/InstrTypes.h Mon May 12 14:01:56 2008 @@ -498,13 +498,55 @@ void *operator new(size_t, unsigned); // DO NOT IMPLEMENT CmpInst(); // do not implement protected: - CmpInst(Instruction::OtherOps op, unsigned short pred, Value *LHS, Value *RHS, - const std::string &Name = "", Instruction *InsertBefore = 0); + CmpInst(const Type *ty, Instruction::OtherOps op, unsigned short pred, + Value *LHS, Value *RHS, const std::string &Name = "", + Instruction *InsertBefore = 0); - CmpInst(Instruction::OtherOps op, unsigned short pred, Value *LHS, Value *RHS, - const std::string &Name, BasicBlock *InsertAtEnd); + CmpInst(const Type *ty, Instruction::OtherOps op, unsigned short pred, + Value *LHS, Value *RHS, const std::string &Name, + BasicBlock *InsertAtEnd); public: + /// This enumeration lists the possible predicates for CmpInst subclasses. + /// Values in the range 0-31 are reserved for FCmpInst, while values in the + /// range 32-64 are reserved for ICmpInst. This is necessary to ensure the + /// predicate values are not overlapping between the classes. + enum Predicate { + // Opcode U L G E Intuitive operation + FCMP_FALSE = 0, /// 0 0 0 0 Always false (always folded) + FCMP_OEQ = 1, /// 0 0 0 1 True if ordered and equal + FCMP_OGT = 2, /// 0 0 1 0 True if ordered and greater than + FCMP_OGE = 3, /// 0 0 1 1 True if ordered and greater than or equal + FCMP_OLT = 4, /// 0 1 0 0 True if ordered and less than + FCMP_OLE = 5, /// 0 1 0 1 True if ordered and less than or equal + FCMP_ONE = 6, /// 0 1 1 0 True if ordered and operands are unequal + FCMP_ORD = 7, /// 0 1 1 1 True if ordered (no nans) + FCMP_UNO = 8, /// 1 0 0 0 True if unordered: isnan(X) | isnan(Y) + FCMP_UEQ = 9, /// 1 0 0 1 True if unordered or equal + FCMP_UGT = 10, /// 1 0 1 0 True if unordered or greater than + FCMP_UGE = 11, /// 1 0 1 1 True if unordered, greater than, or equal + FCMP_ULT = 12, /// 1 1 0 0 True if unordered or less than + FCMP_ULE = 13, /// 1 1 0 1 True if unordered, less than, or equal + FCMP_UNE = 14, /// 1 1 1 0 True if unordered or not equal + FCMP_TRUE = 15, /// 1 1 1 1 Always true (always folded) + FIRST_FCMP_PREDICATE = FCMP_FALSE, + LAST_FCMP_PREDICATE = FCMP_TRUE, + BAD_FCMP_PREDICATE = FCMP_TRUE + 1, + ICMP_EQ = 32, /// equal + ICMP_NE = 33, /// not equal + ICMP_UGT = 34, /// unsigned greater than + ICMP_UGE = 35, /// unsigned greater or equal + ICMP_ULT = 36, /// unsigned less than + ICMP_ULE = 37, /// unsigned less or equal + ICMP_SGT = 38, /// signed greater than + ICMP_SGE = 39, /// signed greater or equal + ICMP_SLT = 40, /// signed less than + ICMP_SLE = 41, /// signed less or equal + FIRST_ICMP_PREDICATE = ICMP_EQ, + LAST_ICMP_PREDICATE = ICMP_SLE, + BAD_ICMP_PREDICATE = ICMP_SLE + 1 + }; + // allocate space for exactly two operands void *operator new(size_t s) { return User::operator new(s, 2); @@ -576,7 +618,9 @@ static inline bool classof(const CmpInst *) { return true; } static inline bool classof(const Instruction *I) { return I->getOpcode() == Instruction::ICmp || - I->getOpcode() == Instruction::FCmp; + I->getOpcode() == Instruction::FCmp || + I->getOpcode() == Instruction::VICmp || + I->getOpcode() == Instruction::VFCmp; } static inline bool classof(const Value *V) { return isa(V) && classof(cast(V)); Modified: llvm/trunk/include/llvm/Instruction.def URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instruction.def?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instruction.def (original) +++ llvm/trunk/include/llvm/Instruction.def Mon May 12 14:01:56 2008 @@ -166,7 +166,10 @@ HANDLE_OTHER_INST(50, ShuffleVector, ShuffleVectorInst) // shuffle two vectors. HANDLE_OTHER_INST(51, GetResult, GetResultInst) // Extract individual value //from aggregate result - LAST_OTHER_INST(51) +HANDLE_OTHER_INST(52, VICmp , VICmpInst ) // Vec Int comparison instruction. +HANDLE_OTHER_INST(53, VFCmp , VFCmpInst ) // Vec FP point comparison instr. + + LAST_OTHER_INST(53) #undef FIRST_TERM_INST #undef HANDLE_TERM_INST Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Mon May 12 14:01:56 2008 @@ -610,31 +610,11 @@ //===----------------------------------------------------------------------===// /// This instruction compares its operands according to the predicate given -/// to the constructor. It only operates on integers, pointers, or packed -/// vectors of integrals. The two operands must be the same type. +/// to the constructor. It only operates on integers or pointers. The operands +/// must be identical types. /// @brief Represent an integer comparison operator. class ICmpInst: public CmpInst { public: - /// This enumeration lists the possible predicates for the ICmpInst. The - /// values in the range 0-31 are reserved for FCmpInst while values in the - /// range 32-64 are reserved for ICmpInst. This is necessary to ensure the - /// predicate values are not overlapping between the classes. - enum Predicate { - ICMP_EQ = 32, ///< equal - ICMP_NE = 33, ///< not equal - ICMP_UGT = 34, ///< unsigned greater than - ICMP_UGE = 35, ///< unsigned greater or equal - ICMP_ULT = 36, ///< unsigned less than - ICMP_ULE = 37, ///< unsigned less or equal - ICMP_SGT = 38, ///< signed greater than - ICMP_SGE = 39, ///< signed greater or equal - ICMP_SLT = 40, ///< signed less than - ICMP_SLE = 41, ///< signed less or equal - FIRST_ICMP_PREDICATE = ICMP_EQ, - LAST_ICMP_PREDICATE = ICMP_SLE, - BAD_ICMP_PREDICATE = ICMP_SLE + 1 - }; - /// @brief Constructor with insert-before-instruction semantics. ICmpInst( Predicate pred, ///< The predicate to use for the comparison @@ -642,7 +622,18 @@ Value *RHS, ///< The right-hand-side of the expression const std::string &Name = "", ///< Name of the instruction Instruction *InsertBefore = 0 ///< Where to insert - ) : CmpInst(Instruction::ICmp, pred, LHS, RHS, Name, InsertBefore) { + ) : CmpInst(Type::Int1Ty, Instruction::ICmp, pred, LHS, RHS, Name, + InsertBefore) { + assert(pred >= CmpInst::FIRST_ICMP_PREDICATE && + pred <= CmpInst::LAST_ICMP_PREDICATE && + "Invalid ICmp predicate value"); + const Type* Op0Ty = getOperand(0)->getType(); + const Type* Op1Ty = getOperand(1)->getType(); + assert(Op0Ty == Op1Ty && + "Both operands to ICmp instruction are not of the same type!"); + // Check that the operands are the right type + assert((Op0Ty->isInteger() || isa(Op0Ty)) && + "Invalid operand types for ICmp instruction"); } /// @brief Constructor with insert-at-block-end semantics. @@ -652,7 +643,18 @@ Value *RHS, ///< The right-hand-side of the expression const std::string &Name, ///< Name of the instruction BasicBlock *InsertAtEnd ///< Block to insert into. - ) : CmpInst(Instruction::ICmp, pred, LHS, RHS, Name, InsertAtEnd) { + ) : CmpInst(Type::Int1Ty, Instruction::ICmp, pred, LHS, RHS, Name, + InsertAtEnd) { + assert(pred >= CmpInst::FIRST_ICMP_PREDICATE && + pred <= CmpInst::LAST_ICMP_PREDICATE && + "Invalid ICmp predicate value"); + const Type* Op0Ty = getOperand(0)->getType(); + const Type* Op1Ty = getOperand(1)->getType(); + assert(Op0Ty == Op1Ty && + "Both operands to ICmp instruction are not of the same type!"); + // Check that the operands are the right type + assert((Op0Ty->isInteger() || isa(Op0Ty)) && + "Invalid operand types for ICmp instruction"); } /// @brief Return the predicate for this instruction. @@ -783,31 +785,6 @@ /// @brief Represents a floating point comparison operator. class FCmpInst: public CmpInst { public: - /// This enumeration lists the possible predicates for the FCmpInst. Values - /// in the range 0-31 are reserved for FCmpInst. - enum Predicate { - // Opcode U L G E Intuitive operation - FCMP_FALSE = 0, ///< 0 0 0 0 Always false (always folded) - FCMP_OEQ = 1, ///< 0 0 0 1 True if ordered and equal - FCMP_OGT = 2, ///< 0 0 1 0 True if ordered and greater than - FCMP_OGE = 3, ///< 0 0 1 1 True if ordered and greater than or equal - FCMP_OLT = 4, ///< 0 1 0 0 True if ordered and less than - FCMP_OLE = 5, ///< 0 1 0 1 True if ordered and less than or equal - FCMP_ONE = 6, ///< 0 1 1 0 True if ordered and operands are unequal - FCMP_ORD = 7, ///< 0 1 1 1 True if ordered (no nans) - FCMP_UNO = 8, ///< 1 0 0 0 True if unordered: isnan(X) | isnan(Y) - FCMP_UEQ = 9, ///< 1 0 0 1 True if unordered or equal - FCMP_UGT =10, ///< 1 0 1 0 True if unordered or greater than - FCMP_UGE =11, ///< 1 0 1 1 True if unordered, greater than, or equal - FCMP_ULT =12, ///< 1 1 0 0 True if unordered or less than - FCMP_ULE =13, ///< 1 1 0 1 True if unordered, less than, or equal - FCMP_UNE =14, ///< 1 1 1 0 True if unordered or not equal - FCMP_TRUE =15, ///< 1 1 1 1 Always true (always folded) - FIRST_FCMP_PREDICATE = FCMP_FALSE, - LAST_FCMP_PREDICATE = FCMP_TRUE, - BAD_FCMP_PREDICATE = FCMP_TRUE + 1 - }; - /// @brief Constructor with insert-before-instruction semantics. FCmpInst( Predicate pred, ///< The predicate to use for the comparison @@ -815,7 +792,17 @@ Value *RHS, ///< The right-hand-side of the expression const std::string &Name = "", ///< Name of the instruction Instruction *InsertBefore = 0 ///< Where to insert - ) : CmpInst(Instruction::FCmp, pred, LHS, RHS, Name, InsertBefore) { + ) : CmpInst(Type::Int1Ty, Instruction::FCmp, pred, LHS, RHS, Name, + InsertBefore) { + assert(pred <= FCmpInst::LAST_FCMP_PREDICATE && + "Invalid FCmp predicate value"); + const Type* Op0Ty = getOperand(0)->getType(); + const Type* Op1Ty = getOperand(1)->getType(); + assert(Op0Ty == Op1Ty && + "Both operands to FCmp instruction are not of the same type!"); + // Check that the operands are the right type + assert(Op0Ty->isFloatingPoint() && + "Invalid operand types for FCmp instruction"); } /// @brief Constructor with insert-at-block-end semantics. @@ -825,7 +812,17 @@ Value *RHS, ///< The right-hand-side of the expression const std::string &Name, ///< Name of the instruction BasicBlock *InsertAtEnd ///< Block to insert into. - ) : CmpInst(Instruction::FCmp, pred, LHS, RHS, Name, InsertAtEnd) { + ) : CmpInst(Type::Int1Ty, Instruction::FCmp, pred, LHS, RHS, Name, + InsertAtEnd) { + assert(pred <= FCmpInst::LAST_FCMP_PREDICATE && + "Invalid FCmp predicate value"); + const Type* Op0Ty = getOperand(0)->getType(); + const Type* Op1Ty = getOperand(1)->getType(); + assert(Op0Ty == Op1Ty && + "Both operands to FCmp instruction are not of the same type!"); + // Check that the operands are the right type + assert(Op0Ty->isFloatingPoint() && + "Invalid operand types for FCmp instruction"); } /// @brief Return the predicate for this instruction. @@ -898,6 +895,100 @@ }; //===----------------------------------------------------------------------===// +// VICmpInst Class +//===----------------------------------------------------------------------===// + +/// This instruction compares its operands according to the predicate given +/// to the constructor. It only operates on vectors of integers. +/// The operands must be identical types. +/// @brief Represents a vector integer comparison operator. +class VICmpInst: public CmpInst { +public: + /// @brief Constructor with insert-before-instruction semantics. + VICmpInst( + Predicate pred, ///< The predicate to use for the comparison + Value *LHS, ///< The left-hand-side of the expression + Value *RHS, ///< The right-hand-side of the expression + const std::string &Name = "", ///< Name of the instruction + Instruction *InsertBefore = 0 ///< Where to insert + ) : CmpInst(LHS->getType(), Instruction::VICmp, pred, LHS, RHS, Name, + InsertBefore) { + } + + /// @brief Constructor with insert-at-block-end semantics. + VICmpInst( + Predicate pred, ///< The predicate to use for the comparison + Value *LHS, ///< The left-hand-side of the expression + Value *RHS, ///< The right-hand-side of the expression + const std::string &Name, ///< Name of the instruction + BasicBlock *InsertAtEnd ///< Block to insert into. + ) : CmpInst(LHS->getType(), Instruction::VICmp, pred, LHS, RHS, Name, + InsertAtEnd) { + } + + /// @brief Return the predicate for this instruction. + Predicate getPredicate() const { return Predicate(SubclassData); } + + virtual VICmpInst *clone() const; + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const VICmpInst *) { return true; } + static inline bool classof(const Instruction *I) { + return I->getOpcode() == Instruction::VICmp; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } +}; + +//===----------------------------------------------------------------------===// +// VFCmpInst Class +//===----------------------------------------------------------------------===// + +/// This instruction compares its operands according to the predicate given +/// to the constructor. It only operates on vectors of floating point values. +/// The operands must be identical types. +/// @brief Represents a vector floating point comparison operator. +class VFCmpInst: public CmpInst { +public: + /// @brief Constructor with insert-before-instruction semantics. + VFCmpInst( + Predicate pred, ///< The predicate to use for the comparison + Value *LHS, ///< The left-hand-side of the expression + Value *RHS, ///< The right-hand-side of the expression + const std::string &Name = "", ///< Name of the instruction + Instruction *InsertBefore = 0 ///< Where to insert + ) : CmpInst(VectorType::getInteger(cast(LHS->getType())), + Instruction::VFCmp, pred, LHS, RHS, Name, InsertBefore) { + } + + /// @brief Constructor with insert-at-block-end semantics. + VFCmpInst( + Predicate pred, ///< The predicate to use for the comparison + Value *LHS, ///< The left-hand-side of the expression + Value *RHS, ///< The right-hand-side of the expression + const std::string &Name, ///< Name of the instruction + BasicBlock *InsertAtEnd ///< Block to insert into. + ) : CmpInst(VectorType::getInteger(cast(LHS->getType())), + Instruction::VFCmp, pred, LHS, RHS, Name, InsertAtEnd) { + } + + /// @brief Return the predicate for this instruction. + Predicate getPredicate() const { return Predicate(SubclassData); } + + virtual VFCmpInst *clone() const; + + /// @brief Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const VFCmpInst *) { return true; } + static inline bool classof(const Instruction *I) { + return I->getOpcode() == Instruction::VFCmp; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } +}; + +//===----------------------------------------------------------------------===// // CallInst Class //===----------------------------------------------------------------------===// /// CallInst - This class represents a function call, abstracting a target @@ -1908,8 +1999,6 @@ // InvokeInst Class //===----------------------------------------------------------------------===// -//===--------------------------------------------------------------------------- - /// InvokeInst - Invoke instruction. The SubclassData field is used to hold the /// calling convention of the call. /// Modified: llvm/trunk/include/llvm/Support/InstVisitor.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/InstVisitor.h?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/InstVisitor.h (original) +++ llvm/trunk/include/llvm/Support/InstVisitor.h Mon May 12 14:01:56 2008 @@ -169,6 +169,8 @@ RetTy visitUnreachableInst(UnreachableInst &I) { DELEGATE(TerminatorInst);} RetTy visitICmpInst(ICmpInst &I) { DELEGATE(CmpInst);} RetTy visitFCmpInst(FCmpInst &I) { DELEGATE(CmpInst);} + RetTy visitVICmpInst(VICmpInst &I) { DELEGATE(CmpInst);} + RetTy visitVFCmpInst(VFCmpInst &I) { DELEGATE(CmpInst);} RetTy visitMallocInst(MallocInst &I) { DELEGATE(AllocationInst);} RetTy visitAllocaInst(AllocaInst &I) { DELEGATE(AllocationInst);} RetTy visitFreeInst(FreeInst &I) { DELEGATE(Instruction); } Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLLexer.cpp (original) +++ llvm/trunk/lib/AsmParser/LLLexer.cpp Mon May 12 14:01:56 2008 @@ -566,6 +566,8 @@ INSTKEYWORD("xor", BinaryOpVal, Xor, XOR); INSTKEYWORD("icmp", OtherOpVal, ICmp, ICMP); INSTKEYWORD("fcmp", OtherOpVal, FCmp, FCMP); + INSTKEYWORD("vicmp", OtherOpVal, VICmp, VICMP); + INSTKEYWORD("vfcmp", OtherOpVal, VFCmp, VFCMP); INSTKEYWORD("phi", OtherOpVal, PHI, PHI_TOK); INSTKEYWORD("call", OtherOpVal, Call, CALL); Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Mon May 12 14:01:56 2008 @@ -162,66 +162,68 @@ ASHR = 343, ICMP = 344, FCMP = 345, - EQ = 346, - NE = 347, - SLT = 348, - SGT = 349, - SLE = 350, - SGE = 351, - ULT = 352, - UGT = 353, - ULE = 354, - UGE = 355, - OEQ = 356, - ONE = 357, - OLT = 358, - OGT = 359, - OLE = 360, - OGE = 361, - ORD = 362, - UNO = 363, - UEQ = 364, - UNE = 365, - MALLOC = 366, - ALLOCA = 367, - FREE = 368, - LOAD = 369, - STORE = 370, - GETELEMENTPTR = 371, - TRUNC = 372, - ZEXT = 373, - SEXT = 374, - FPTRUNC = 375, - FPEXT = 376, - BITCAST = 377, - UITOFP = 378, - SITOFP = 379, - FPTOUI = 380, - FPTOSI = 381, - INTTOPTR = 382, - PTRTOINT = 383, - PHI_TOK = 384, - SELECT = 385, - VAARG = 386, - EXTRACTELEMENT = 387, - INSERTELEMENT = 388, - SHUFFLEVECTOR = 389, - GETRESULT = 390, - SIGNEXT = 391, - ZEROEXT = 392, - NORETURN = 393, - INREG = 394, - SRET = 395, - NOUNWIND = 396, - NOALIAS = 397, - BYVAL = 398, - NEST = 399, - READNONE = 400, - READONLY = 401, - GC = 402, - DEFAULT = 403, - HIDDEN = 404, - PROTECTED = 405 + VICMP = 346, + VFCMP = 347, + EQ = 348, + NE = 349, + SLT = 350, + SGT = 351, + SLE = 352, + SGE = 353, + ULT = 354, + UGT = 355, + ULE = 356, + UGE = 357, + OEQ = 358, + ONE = 359, + OLT = 360, + OGT = 361, + OLE = 362, + OGE = 363, + ORD = 364, + UNO = 365, + UEQ = 366, + UNE = 367, + MALLOC = 368, + ALLOCA = 369, + FREE = 370, + LOAD = 371, + STORE = 372, + GETELEMENTPTR = 373, + TRUNC = 374, + ZEXT = 375, + SEXT = 376, + FPTRUNC = 377, + FPEXT = 378, + BITCAST = 379, + UITOFP = 380, + SITOFP = 381, + FPTOUI = 382, + FPTOSI = 383, + INTTOPTR = 384, + PTRTOINT = 385, + PHI_TOK = 386, + SELECT = 387, + VAARG = 388, + EXTRACTELEMENT = 389, + INSERTELEMENT = 390, + SHUFFLEVECTOR = 391, + GETRESULT = 392, + SIGNEXT = 393, + ZEROEXT = 394, + NORETURN = 395, + INREG = 396, + SRET = 397, + NOUNWIND = 398, + NOALIAS = 399, + BYVAL = 400, + NEST = 401, + READNONE = 402, + READONLY = 403, + GC = 404, + DEFAULT = 405, + HIDDEN = 406, + PROTECTED = 407 }; #endif /* Tokens. */ @@ -313,72 +315,74 @@ #define ASHR 343 #define ICMP 344 #define FCMP 345 -#define EQ 346 -#define NE 347 -#define SLT 348 -#define SGT 349 -#define SLE 350 -#define SGE 351 -#define ULT 352 -#define UGT 353 -#define ULE 354 -#define UGE 355 -#define OEQ 356 -#define ONE 357 -#define OLT 358 -#define OGT 359 -#define OLE 360 -#define OGE 361 -#define ORD 362 -#define UNO 363 -#define UEQ 364 -#define UNE 365 -#define MALLOC 366 -#define ALLOCA 367 -#define FREE 368 -#define LOAD 369 -#define STORE 370 -#define GETELEMENTPTR 371 -#define TRUNC 372 -#define ZEXT 373 -#define SEXT 374 -#define FPTRUNC 375 -#define FPEXT 376 -#define BITCAST 377 -#define UITOFP 378 -#define SITOFP 379 -#define FPTOUI 380 -#define FPTOSI 381 -#define INTTOPTR 382 -#define PTRTOINT 383 -#define PHI_TOK 384 -#define SELECT 385 -#define VAARG 386 -#define EXTRACTELEMENT 387 -#define INSERTELEMENT 388 -#define SHUFFLEVECTOR 389 -#define GETRESULT 390 -#define SIGNEXT 391 -#define ZEROEXT 392 -#define NORETURN 393 -#define INREG 394 -#define SRET 395 -#define NOUNWIND 396 -#define NOALIAS 397 -#define BYVAL 398 -#define NEST 399 -#define READNONE 400 -#define READONLY 401 -#define GC 402 -#define DEFAULT 403 -#define HIDDEN 404 -#define PROTECTED 405 +#define VICMP 346 +#define VFCMP 347 +#define EQ 348 +#define NE 349 +#define SLT 350 +#define SGT 351 +#define SLE 352 +#define SGE 353 +#define ULT 354 +#define UGT 355 +#define ULE 356 +#define UGE 357 +#define OEQ 358 +#define ONE 359 +#define OLT 360 +#define OGT 361 +#define OLE 362 +#define OGE 363 +#define ORD 364 +#define UNO 365 +#define UEQ 366 +#define UNE 367 +#define MALLOC 368 +#define ALLOCA 369 +#define FREE 370 +#define LOAD 371 +#define STORE 372 +#define GETELEMENTPTR 373 +#define TRUNC 374 +#define ZEXT 375 +#define SEXT 376 +#define FPTRUNC 377 +#define FPEXT 378 +#define BITCAST 379 +#define UITOFP 380 +#define SITOFP 381 +#define FPTOUI 382 +#define FPTOSI 383 +#define INTTOPTR 384 +#define PTRTOINT 385 +#define PHI_TOK 386 +#define SELECT 387 +#define VAARG 388 +#define EXTRACTELEMENT 389 +#define INSERTELEMENT 390 +#define SHUFFLEVECTOR 391 +#define GETRESULT 392 +#define SIGNEXT 393 +#define ZEROEXT 394 +#define NORETURN 395 +#define INREG 396 +#define SRET 397 +#define NOUNWIND 398 +#define NOALIAS 399 +#define BYVAL 400 +#define NEST 401 +#define READNONE 402 +#define READONLY 403 +#define GC 404 +#define DEFAULT 405 +#define HIDDEN 406 +#define PROTECTED 407 /* Copy the first part of user declarations. */ -#line 14 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 14 "/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1334,7 +1338,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 949 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 949 "/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1382,7 +1386,7 @@ llvm::FCmpInst::Predicate FPredicate; } /* Line 193 of yacc.c. */ -#line 1386 "llvmAsmParser.tab.c" +#line 1390 "llvmAsmParser.tab.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -1395,7 +1399,7 @@ /* Line 216 of yacc.c. */ -#line 1399 "llvmAsmParser.tab.c" +#line 1403 "llvmAsmParser.tab.c" #ifdef short # undef short @@ -1610,20 +1614,20 @@ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 43 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1978 +#define YYLAST 2035 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 165 +#define YYNTOKENS 167 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 85 /* YYNRULES -- Number of rules. */ -#define YYNRULES 322 +#define YYNRULES 326 /* YYNRULES -- Number of states. */ -#define YYNSTATES 629 +#define YYNSTATES 655 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 405 +#define YYMAXUTOK 407 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -1635,15 +1639,15 @@ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 151, 152, 155, 2, 154, 2, 2, 2, 2, 2, + 153, 154, 157, 2, 156, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 160, 153, 161, 2, 2, 2, 2, 2, 2, 2, + 162, 155, 163, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 157, 156, 159, 2, 2, 2, 2, 2, 164, + 2, 159, 158, 161, 2, 2, 2, 2, 2, 166, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 158, 2, 2, 162, 2, 163, 2, 2, 2, 2, + 160, 2, 2, 164, 2, 165, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -1671,7 +1675,7 @@ 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150 + 145, 146, 147, 148, 149, 150, 151, 152 }; #if YYDEBUG @@ -1698,127 +1702,130 @@ 350, 352, 354, 358, 360, 364, 366, 367, 369, 373, 378, 382, 386, 391, 396, 400, 407, 413, 416, 419, 422, 425, 428, 431, 434, 437, 440, 443, 446, 449, - 456, 462, 471, 478, 485, 493, 501, 508, 517, 526, - 530, 532, 534, 536, 538, 539, 542, 549, 551, 552, - 554, 557, 558, 562, 563, 567, 571, 575, 579, 580, - 589, 590, 600, 601, 611, 617, 620, 624, 626, 630, - 634, 638, 642, 644, 645, 651, 655, 657, 661, 663, - 664, 675, 677, 679, 684, 686, 688, 691, 695, 696, - 698, 700, 702, 704, 706, 708, 710, 712, 714, 718, - 720, 726, 728, 730, 732, 734, 736, 738, 741, 743, - 747, 750, 753, 757, 760, 761, 763, 766, 769, 773, - 783, 793, 802, 817, 819, 821, 828, 834, 837, 844, - 852, 857, 862, 869, 876, 877, 878, 882, 885, 887, - 893, 899, 906, 913, 918, 925, 930, 935, 942, 949, - 952, 961, 963, 965, 966, 970, 977, 981, 988, 991, - 997, 1005, 1011 + 456, 462, 471, 478, 485, 493, 501, 509, 517, 524, + 533, 542, 546, 548, 550, 552, 554, 555, 558, 565, + 567, 568, 570, 573, 574, 578, 579, 583, 587, 591, + 595, 596, 605, 606, 616, 617, 627, 633, 636, 640, + 642, 646, 650, 654, 658, 660, 661, 667, 671, 673, + 677, 679, 680, 691, 693, 695, 700, 702, 704, 707, + 711, 712, 714, 716, 718, 720, 722, 724, 726, 728, + 730, 734, 736, 742, 744, 746, 748, 750, 752, 754, + 757, 759, 763, 766, 769, 773, 776, 777, 779, 782, + 785, 789, 799, 809, 818, 833, 835, 837, 844, 850, + 853, 860, 868, 873, 878, 885, 892, 893, 894, 898, + 901, 903, 909, 915, 922, 929, 936, 943, 948, 955, + 960, 965, 972, 979, 982, 991, 993, 995, 996, 1000, + 1007, 1011, 1018, 1021, 1027, 1035, 1041 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 211, 0, -1, 74, -1, 75, -1, 76, -1, 77, + 213, 0, -1, 74, -1, 75, -1, 76, -1, 77, -1, 78, -1, 79, -1, 80, -1, 81, -1, 82, -1, 86, -1, 87, -1, 88, -1, 83, -1, 84, - -1, 85, -1, 117, -1, 118, -1, 119, -1, 120, - -1, 121, -1, 122, -1, 123, -1, 124, -1, 125, - -1, 126, -1, 127, -1, 128, -1, 91, -1, 92, - -1, 93, -1, 94, -1, 95, -1, 96, -1, 97, - -1, 98, -1, 99, -1, 100, -1, 101, -1, 102, - -1, 103, -1, 104, -1, 105, -1, 106, -1, 107, - -1, 108, -1, 109, -1, 110, -1, 97, -1, 98, - -1, 99, -1, 100, -1, 26, -1, 27, -1, 11, + -1, 85, -1, 119, -1, 120, -1, 121, -1, 122, + -1, 123, -1, 124, -1, 125, -1, 126, -1, 127, + -1, 128, -1, 129, -1, 130, -1, 93, -1, 94, + -1, 95, -1, 96, -1, 97, -1, 98, -1, 99, + -1, 100, -1, 101, -1, 102, -1, 103, -1, 104, + -1, 105, -1, 106, -1, 107, -1, 108, -1, 109, + -1, 110, -1, 111, -1, 112, -1, 99, -1, 100, + -1, 101, -1, 102, -1, 26, -1, 27, -1, 11, -1, 12, -1, 13, -1, 16, -1, 15, -1, 14, - -1, 19, -1, 22, -1, 24, -1, 173, -1, -1, - 54, 151, 4, 152, -1, -1, 173, 153, -1, -1, - 20, -1, 23, -1, 179, -1, -1, 177, 153, -1, + -1, 19, -1, 22, -1, 24, -1, 175, -1, -1, + 54, 153, 4, 154, -1, -1, 175, 155, -1, -1, + 20, -1, 23, -1, 181, -1, -1, 179, 155, -1, 42, -1, 44, -1, 43, -1, 45, -1, 47, -1, - 46, -1, 48, -1, 50, -1, -1, 148, -1, 149, - -1, 150, -1, -1, 46, -1, 48, -1, -1, 42, + 46, -1, 48, -1, 50, -1, -1, 150, -1, 151, + -1, 152, -1, -1, 46, -1, 48, -1, -1, 42, -1, 43, -1, 44, -1, 47, -1, -1, 44, -1, 42, -1, -1, 62, -1, 63, -1, 64, -1, 65, - -1, 66, -1, 61, 4, -1, 137, -1, 118, -1, - 136, -1, 119, -1, 139, -1, 140, -1, 142, -1, - 143, -1, 144, -1, 53, 4, -1, -1, 188, 187, - -1, 138, -1, 141, -1, 137, -1, 136, -1, 145, - -1, 146, -1, -1, 190, 189, -1, -1, 147, 22, - -1, -1, 53, 4, -1, -1, 154, 53, 4, -1, - 34, 22, -1, -1, 194, -1, -1, 154, 197, 196, - -1, 194, -1, 53, 4, -1, 11, -1, 12, -1, + -1, 66, -1, 61, 4, -1, 139, -1, 120, -1, + 138, -1, 121, -1, 141, -1, 142, -1, 144, -1, + 145, -1, 146, -1, 53, 4, -1, -1, 190, 189, + -1, 140, -1, 143, -1, 139, -1, 138, -1, 147, + -1, 148, -1, -1, 192, 191, -1, -1, 149, 22, + -1, -1, 53, 4, -1, -1, 156, 53, 4, -1, + 34, 22, -1, -1, 196, -1, -1, 156, 199, 198, + -1, 196, -1, 53, 4, -1, 11, -1, 12, -1, 13, -1, 16, -1, 15, -1, 14, -1, 17, -1, - 49, -1, 198, -1, 199, 175, 155, -1, 233, -1, - 156, 4, -1, 199, 151, 203, 152, 190, -1, 10, - 151, 203, 152, 190, -1, 157, 4, 158, 199, 159, - -1, 160, 4, 158, 199, 161, -1, 162, 204, 163, - -1, 162, 163, -1, 160, 162, 204, 163, 161, -1, - 160, 162, 163, 161, -1, 199, 188, -1, 199, -1, - 10, -1, 200, -1, 202, 154, 200, -1, 202, -1, - 202, 154, 39, -1, 39, -1, -1, 199, -1, 204, - 154, 199, -1, 199, 157, 207, 159, -1, 199, 157, - 159, -1, 199, 164, 22, -1, 199, 160, 207, 161, - -1, 199, 162, 207, 163, -1, 199, 162, 163, -1, - 199, 160, 162, 207, 163, 161, -1, 199, 160, 162, - 163, 161, -1, 199, 40, -1, 199, 41, -1, 199, - 233, -1, 199, 206, -1, 199, 25, -1, 171, 3, - -1, 171, 5, -1, 171, 4, -1, 171, 6, -1, - 11, 26, -1, 11, 27, -1, 172, 9, -1, 168, - 151, 205, 38, 199, 152, -1, 116, 151, 205, 245, - 152, -1, 130, 151, 205, 154, 205, 154, 205, 152, - -1, 166, 151, 205, 154, 205, 152, -1, 167, 151, - 205, 154, 205, 152, -1, 89, 169, 151, 205, 154, - 205, 152, -1, 90, 170, 151, 205, 154, 205, 152, - -1, 132, 151, 205, 154, 205, 152, -1, 133, 151, - 205, 154, 205, 154, 205, 152, -1, 134, 151, 205, - 154, 205, 154, 205, 152, -1, 207, 154, 205, -1, - 205, -1, 32, -1, 33, -1, 37, -1, -1, 201, - 233, -1, 122, 151, 210, 38, 199, 152, -1, 212, - -1, -1, 213, -1, 212, 213, -1, -1, 31, 214, - 229, -1, -1, 30, 215, 230, -1, 59, 58, 219, - -1, 176, 18, 199, -1, 176, 18, 10, -1, -1, - 178, 182, 209, 208, 205, 175, 216, 196, -1, -1, - 178, 180, 182, 209, 208, 205, 175, 217, 196, -1, - -1, 178, 181, 182, 209, 208, 199, 175, 218, 196, - -1, 178, 182, 35, 185, 210, -1, 51, 220, -1, - 55, 153, 221, -1, 22, -1, 52, 153, 22, -1, - 67, 153, 22, -1, 157, 222, 159, -1, 222, 154, - 22, -1, 22, -1, -1, 223, 154, 199, 188, 174, - -1, 199, 188, 174, -1, 223, -1, 223, 154, 39, - -1, 39, -1, -1, 186, 201, 177, 151, 224, 152, - 190, 195, 192, 191, -1, 28, -1, 162, -1, 184, - 182, 225, 226, -1, 29, -1, 163, -1, 237, 228, - -1, 183, 182, 225, -1, -1, 60, -1, 3, -1, - 4, -1, 9, -1, 26, -1, 27, -1, 40, -1, - 41, -1, 25, -1, 160, 207, 161, -1, 206, -1, - 58, 231, 22, 154, 22, -1, 7, -1, 8, -1, - 173, -1, 177, -1, 233, -1, 232, -1, 199, 234, - -1, 235, -1, 236, 154, 235, -1, 237, 238, -1, - 227, 238, -1, 239, 176, 240, -1, 239, 242, -1, - -1, 21, -1, 68, 236, -1, 68, 10, -1, 69, - 17, 234, -1, 69, 11, 234, 154, 17, 234, 154, - 17, 234, -1, 70, 171, 234, 154, 17, 234, 157, - 241, 159, -1, 70, 171, 234, 154, 17, 234, 157, - 159, -1, 71, 186, 201, 234, 151, 244, 152, 190, - 38, 17, 234, 72, 17, 234, -1, 72, -1, 73, - -1, 241, 171, 232, 154, 17, 234, -1, 171, 232, - 154, 17, 234, -1, 176, 247, -1, 199, 157, 234, - 154, 234, 159, -1, 243, 154, 157, 234, 154, 234, - 159, -1, 199, 188, 234, 188, -1, 17, 188, 234, - 188, -1, 244, 154, 199, 188, 234, 188, -1, 244, - 154, 17, 188, 234, 188, -1, -1, -1, 245, 154, - 235, -1, 57, 56, -1, 56, -1, 166, 199, 234, - 154, 234, -1, 167, 199, 234, 154, 234, -1, 89, - 169, 199, 234, 154, 234, -1, 90, 170, 199, 234, - 154, 234, -1, 168, 235, 38, 199, -1, 130, 235, - 154, 235, 154, 235, -1, 131, 235, 154, 199, -1, - 132, 235, 154, 235, -1, 133, 235, 154, 235, 154, - 235, -1, 134, 235, 154, 235, 154, 235, -1, 129, - 243, -1, 246, 186, 201, 234, 151, 244, 152, 190, - -1, 249, -1, 36, -1, -1, 111, 199, 193, -1, - 111, 199, 154, 11, 234, 193, -1, 112, 199, 193, - -1, 112, 199, 154, 11, 234, 193, -1, 113, 235, - -1, 248, 114, 199, 234, 193, -1, 248, 115, 235, - 154, 199, 234, 193, -1, 135, 199, 234, 154, 4, - -1, 116, 199, 234, 245, -1 + 49, -1, 200, -1, 201, 177, 157, -1, 235, -1, + 158, 4, -1, 201, 153, 205, 154, 192, -1, 10, + 153, 205, 154, 192, -1, 159, 4, 160, 201, 161, + -1, 162, 4, 160, 201, 163, -1, 164, 206, 165, + -1, 164, 165, -1, 162, 164, 206, 165, 163, -1, + 162, 164, 165, 163, -1, 201, 190, -1, 201, -1, + 10, -1, 202, -1, 204, 156, 202, -1, 204, -1, + 204, 156, 39, -1, 39, -1, -1, 201, -1, 206, + 156, 201, -1, 201, 159, 209, 161, -1, 201, 159, + 161, -1, 201, 166, 22, -1, 201, 162, 209, 163, + -1, 201, 164, 209, 165, -1, 201, 164, 165, -1, + 201, 162, 164, 209, 165, 163, -1, 201, 162, 164, + 165, 163, -1, 201, 40, -1, 201, 41, -1, 201, + 235, -1, 201, 208, -1, 201, 25, -1, 173, 3, + -1, 173, 5, -1, 173, 4, -1, 173, 6, -1, + 11, 26, -1, 11, 27, -1, 174, 9, -1, 170, + 153, 207, 38, 201, 154, -1, 118, 153, 207, 247, + 154, -1, 132, 153, 207, 156, 207, 156, 207, 154, + -1, 168, 153, 207, 156, 207, 154, -1, 169, 153, + 207, 156, 207, 154, -1, 89, 171, 153, 207, 156, + 207, 154, -1, 90, 172, 153, 207, 156, 207, 154, + -1, 91, 171, 153, 207, 156, 207, 154, -1, 92, + 172, 153, 207, 156, 207, 154, -1, 134, 153, 207, + 156, 207, 154, -1, 135, 153, 207, 156, 207, 156, + 207, 154, -1, 136, 153, 207, 156, 207, 156, 207, + 154, -1, 209, 156, 207, -1, 207, -1, 32, -1, + 33, -1, 37, -1, -1, 203, 235, -1, 124, 153, + 212, 38, 201, 154, -1, 214, -1, -1, 215, -1, + 214, 215, -1, -1, 31, 216, 231, -1, -1, 30, + 217, 232, -1, 59, 58, 221, -1, 178, 18, 201, + -1, 178, 18, 10, -1, -1, 180, 184, 211, 210, + 207, 177, 218, 198, -1, -1, 180, 182, 184, 211, + 210, 207, 177, 219, 198, -1, -1, 180, 183, 184, + 211, 210, 201, 177, 220, 198, -1, 180, 184, 35, + 187, 212, -1, 51, 222, -1, 55, 155, 223, -1, + 22, -1, 52, 155, 22, -1, 67, 155, 22, -1, + 159, 224, 161, -1, 224, 156, 22, -1, 22, -1, + -1, 225, 156, 201, 190, 176, -1, 201, 190, 176, + -1, 225, -1, 225, 156, 39, -1, 39, -1, -1, + 188, 203, 179, 153, 226, 154, 192, 197, 194, 193, + -1, 28, -1, 164, -1, 186, 184, 227, 228, -1, + 29, -1, 165, -1, 239, 230, -1, 185, 184, 227, + -1, -1, 60, -1, 3, -1, 4, -1, 9, -1, + 26, -1, 27, -1, 40, -1, 41, -1, 25, -1, + 162, 209, 163, -1, 208, -1, 58, 233, 22, 156, + 22, -1, 7, -1, 8, -1, 175, -1, 179, -1, + 235, -1, 234, -1, 201, 236, -1, 237, -1, 238, + 156, 237, -1, 239, 240, -1, 229, 240, -1, 241, + 178, 242, -1, 241, 244, -1, -1, 21, -1, 68, + 238, -1, 68, 10, -1, 69, 17, 236, -1, 69, + 11, 236, 156, 17, 236, 156, 17, 236, -1, 70, + 173, 236, 156, 17, 236, 159, 243, 161, -1, 70, + 173, 236, 156, 17, 236, 159, 161, -1, 71, 188, + 203, 236, 153, 246, 154, 192, 38, 17, 236, 72, + 17, 236, -1, 72, -1, 73, -1, 243, 173, 234, + 156, 17, 236, -1, 173, 234, 156, 17, 236, -1, + 178, 249, -1, 201, 159, 236, 156, 236, 161, -1, + 245, 156, 159, 236, 156, 236, 161, -1, 201, 190, + 236, 190, -1, 17, 190, 236, 190, -1, 246, 156, + 201, 190, 236, 190, -1, 246, 156, 17, 190, 236, + 190, -1, -1, -1, 247, 156, 237, -1, 57, 56, + -1, 56, -1, 168, 201, 236, 156, 236, -1, 169, + 201, 236, 156, 236, -1, 89, 171, 201, 236, 156, + 236, -1, 90, 172, 201, 236, 156, 236, -1, 91, + 171, 201, 236, 156, 236, -1, 92, 172, 201, 236, + 156, 236, -1, 170, 237, 38, 201, -1, 132, 237, + 156, 237, 156, 237, -1, 133, 237, 156, 201, -1, + 134, 237, 156, 237, -1, 135, 237, 156, 237, 156, + 237, -1, 136, 237, 156, 237, 156, 237, -1, 131, + 245, -1, 248, 188, 203, 236, 153, 246, 154, 192, + -1, 251, -1, 36, -1, -1, 113, 201, 195, -1, + 113, 201, 156, 11, 236, 195, -1, 114, 201, 195, + -1, 114, 201, 156, 11, 236, 195, -1, 115, 237, + -1, 250, 116, 201, 236, 195, -1, 250, 117, 237, + 156, 201, 236, 195, -1, 137, 201, 236, 156, 4, + -1, 118, 201, 236, 247, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -1843,20 +1850,20 @@ 1464, 1469, 1474, 1481, 1482, 1489, 1496, 1504, 1510, 1522, 1550, 1566, 1593, 1621, 1647, 1667, 1693, 1713, 1725, 1732, 1798, 1808, 1818, 1824, 1834, 1840, 1850, 1855, 1860, 1873, - 1885, 1907, 1915, 1921, 1932, 1937, 1942, 1948, 1954, 1963, - 1967, 1975, 1975, 1978, 1978, 1981, 1993, 2014, 2019, 2027, - 2028, 2032, 2032, 2036, 2036, 2039, 2042, 2066, 2078, 2077, - 2089, 2088, 2098, 2097, 2108, 2148, 2151, 2157, 2167, 2171, - 2176, 2178, 2183, 2188, 2197, 2207, 2218, 2222, 2231, 2240, - 2245, 2374, 2374, 2376, 2385, 2385, 2387, 2392, 2404, 2408, - 2413, 2417, 2421, 2425, 2429, 2433, 2437, 2441, 2445, 2470, - 2474, 2484, 2488, 2492, 2497, 2504, 2504, 2510, 2519, 2524, - 2529, 2533, 2542, 2551, 2560, 2564, 2572, 2579, 2583, 2588, - 2598, 2617, 2626, 2711, 2715, 2722, 2733, 2746, 2756, 2767, - 2777, 2788, 2796, 2806, 2813, 2816, 2817, 2824, 2828, 2833, - 2849, 2866, 2880, 2894, 2906, 2914, 2921, 2927, 2933, 2939, - 2954, 3044, 3049, 3053, 3060, 3067, 3075, 3082, 3090, 3098, - 3112, 3129, 3137 + 1885, 1907, 1915, 1921, 1932, 1937, 1942, 1947, 1952, 1958, + 1964, 1973, 1977, 1985, 1985, 1988, 1988, 1991, 2003, 2024, + 2029, 2037, 2038, 2042, 2042, 2046, 2046, 2049, 2052, 2076, + 2088, 2087, 2099, 2098, 2108, 2107, 2118, 2158, 2161, 2167, + 2177, 2181, 2186, 2188, 2193, 2198, 2207, 2217, 2228, 2232, + 2241, 2250, 2255, 2384, 2384, 2386, 2395, 2395, 2397, 2402, + 2414, 2418, 2423, 2427, 2431, 2435, 2439, 2443, 2447, 2451, + 2455, 2480, 2484, 2494, 2498, 2502, 2507, 2514, 2514, 2520, + 2529, 2534, 2539, 2543, 2552, 2561, 2570, 2574, 2582, 2589, + 2593, 2598, 2608, 2627, 2636, 2721, 2725, 2732, 2743, 2756, + 2766, 2777, 2787, 2798, 2806, 2816, 2823, 2826, 2827, 2834, + 2838, 2843, 2859, 2876, 2890, 2904, 2918, 2932, 2944, 2952, + 2959, 2965, 2971, 2977, 2992, 3082, 3087, 3091, 3098, 3105, + 3113, 3120, 3128, 3136, 3150, 3167, 3175 }; #endif @@ -1879,24 +1886,25 @@ "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM", - "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "EQ", "NE", - "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE", - "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE", "MALLOC", - "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", "ZEXT", - "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP", "SITOFP", "FPTOUI", - "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK", "SELECT", "VAARG", - "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "GETRESULT", - "SIGNEXT", "ZEROEXT", "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", - "BYVAL", "NEST", "READNONE", "READONLY", "GC", "DEFAULT", "HIDDEN", - "PROTECTED", "'('", "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'", - "']'", "'<'", "'>'", "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", - "LogicalOps", "CastOps", "IPredicates", "FPredicates", "IntType", - "FPType", "LocalName", "OptLocalName", "OptAddrSpace", "OptLocalAssign", - "GlobalName", "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage", - "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage", - "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr", - "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign", - "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes", + "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "VICMP", + "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE", + "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", + "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", + "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP", + "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK", + "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", + "GETRESULT", "SIGNEXT", "ZEROEXT", "NORETURN", "INREG", "SRET", + "NOUNWIND", "NOALIAS", "BYVAL", "NEST", "READNONE", "READONLY", "GC", + "DEFAULT", "HIDDEN", "PROTECTED", "'('", "')'", "'='", "','", "'*'", + "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'", "'c'", + "$accept", "ArithmeticOps", "LogicalOps", "CastOps", "IPredicates", + "FPredicates", "IntType", "FPType", "LocalName", "OptLocalName", + "OptAddrSpace", "OptLocalAssign", "GlobalName", "OptGlobalAssign", + "GlobalAssign", "GVInternalLinkage", "GVExternalLinkage", + "GVVisibilityStyle", "FunctionDeclareLinkage", "FunctionDefineLinkage", + "AliasLinkage", "OptCallingConv", "ParamAttr", "OptParamAttrs", + "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign", "OptCAlign", + "SectionString", "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType", "ThreadLocal", "AliaseeRef", "Module", @@ -1931,47 +1939,47 @@ 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 40, 41, 61, 44, 42, 92, 91, 120, 93, - 60, 62, 123, 125, 99 + 405, 406, 407, 40, 41, 61, 44, 42, 92, 91, + 120, 93, 60, 62, 123, 125, 99 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 165, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 167, 167, 167, 167, 167, 167, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 170, - 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, - 170, 170, 170, 170, 170, 171, 172, 172, 172, 172, - 172, 173, 173, 173, 174, 174, 175, 175, 176, 176, - 177, 177, 178, 178, 179, 180, 180, 180, 180, 180, - 181, 181, 181, 182, 182, 182, 182, 183, 183, 183, - 184, 184, 184, 184, 184, 185, 185, 185, 186, 186, - 186, 186, 186, 186, 186, 187, 187, 187, 187, 187, - 187, 187, 187, 187, 187, 188, 188, 189, 189, 189, - 189, 189, 189, 190, 190, 191, 191, 192, 192, 193, - 193, 194, 195, 195, 196, 196, 197, 197, 198, 198, - 198, 198, 198, 198, 198, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 200, 201, - 201, 202, 202, 203, 203, 203, 203, 204, 204, 205, - 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, - 205, 205, 205, 205, 205, 205, 205, 205, 205, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 207, - 207, 208, 208, 209, 209, 210, 210, 211, 211, 212, - 212, 214, 213, 215, 213, 213, 213, 213, 216, 213, - 217, 213, 218, 213, 213, 213, 213, 219, 220, 220, - 221, 222, 222, 222, 223, 223, 224, 224, 224, 224, - 225, 226, 226, 227, 228, 228, 229, 230, 231, 231, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 233, 233, 233, 233, 234, 234, 235, 236, 236, - 237, 237, 238, 239, 239, 239, 240, 240, 240, 240, - 240, 240, 240, 240, 240, 241, 241, 242, 243, 243, - 244, 244, 244, 244, 244, 245, 245, 246, 246, 247, - 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, - 247, 247, 248, 248, 249, 249, 249, 249, 249, 249, - 249, 249, 249 + 0, 167, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 169, 169, 169, 169, 169, 169, 170, 170, 170, + 170, 170, 170, 170, 170, 170, 170, 170, 170, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 173, 174, 174, 174, 174, + 174, 175, 175, 175, 176, 176, 177, 177, 178, 178, + 179, 179, 180, 180, 181, 182, 182, 182, 182, 182, + 183, 183, 183, 184, 184, 184, 184, 185, 185, 185, + 186, 186, 186, 186, 186, 187, 187, 187, 188, 188, + 188, 188, 188, 188, 188, 189, 189, 189, 189, 189, + 189, 189, 189, 189, 189, 190, 190, 191, 191, 191, + 191, 191, 191, 192, 192, 193, 193, 194, 194, 195, + 195, 196, 197, 197, 198, 198, 199, 199, 200, 200, + 200, 200, 200, 200, 200, 201, 201, 201, 201, 201, + 201, 201, 201, 201, 201, 201, 201, 201, 202, 203, + 203, 204, 204, 205, 205, 205, 205, 206, 206, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 209, 209, 210, 210, 211, 211, 212, 212, 213, + 213, 214, 214, 216, 215, 217, 215, 215, 215, 215, + 218, 215, 219, 215, 220, 215, 215, 215, 215, 221, + 222, 222, 223, 224, 224, 224, 225, 225, 226, 226, + 226, 226, 227, 228, 228, 229, 230, 230, 231, 232, + 233, 233, 234, 234, 234, 234, 234, 234, 234, 234, + 234, 234, 234, 235, 235, 235, 235, 236, 236, 237, + 238, 238, 239, 239, 240, 241, 241, 241, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 243, 243, 244, + 245, 245, 246, 246, 246, 246, 246, 247, 247, 248, + 248, 249, 249, 249, 249, 249, 249, 249, 249, 249, + 249, 249, 249, 249, 249, 249, 250, 250, 251, 251, + 251, 251, 251, 251, 251, 251, 251 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -1996,20 +2004,20 @@ 1, 1, 3, 1, 3, 1, 0, 1, 3, 4, 3, 3, 4, 4, 3, 6, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, - 5, 8, 6, 6, 7, 7, 6, 8, 8, 3, - 1, 1, 1, 1, 0, 2, 6, 1, 0, 1, - 2, 0, 3, 0, 3, 3, 3, 3, 0, 8, - 0, 9, 0, 9, 5, 2, 3, 1, 3, 3, - 3, 3, 1, 0, 5, 3, 1, 3, 1, 0, - 10, 1, 1, 4, 1, 1, 2, 3, 0, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, - 5, 1, 1, 1, 1, 1, 1, 2, 1, 3, - 2, 2, 3, 2, 0, 1, 2, 2, 3, 9, - 9, 8, 14, 1, 1, 6, 5, 2, 6, 7, - 4, 4, 6, 6, 0, 0, 3, 2, 1, 5, - 5, 6, 6, 4, 6, 4, 4, 6, 6, 2, - 8, 1, 1, 0, 3, 6, 3, 6, 2, 5, - 7, 5, 4 + 5, 8, 6, 6, 7, 7, 7, 7, 6, 8, + 8, 3, 1, 1, 1, 1, 0, 2, 6, 1, + 0, 1, 2, 0, 3, 0, 3, 3, 3, 3, + 0, 8, 0, 9, 0, 9, 5, 2, 3, 1, + 3, 3, 3, 3, 1, 0, 5, 3, 1, 3, + 1, 0, 10, 1, 1, 4, 1, 1, 2, 3, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 1, 5, 1, 1, 1, 1, 1, 1, 2, + 1, 3, 2, 2, 3, 2, 0, 1, 2, 2, + 3, 9, 9, 8, 14, 1, 1, 6, 5, 2, + 6, 7, 4, 4, 6, 6, 0, 0, 3, 2, + 1, 5, 5, 6, 6, 6, 6, 4, 6, 4, + 4, 6, 6, 2, 8, 1, 1, 0, 3, 6, + 3, 6, 2, 5, 7, 5, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -2017,576 +2025,594 @@ means the default is an error. */ static const yytype_uint16 yydefact[] = { - 73, 61, 70, 62, 71, 63, 213, 211, 0, 0, - 0, 0, 0, 0, 83, 72, 0, 73, 209, 87, - 90, 0, 0, 225, 0, 0, 68, 0, 74, 75, + 73, 61, 70, 62, 71, 63, 215, 213, 0, 0, + 0, 0, 0, 0, 83, 72, 0, 73, 211, 87, + 90, 0, 0, 227, 0, 0, 68, 0, 74, 75, 77, 76, 78, 80, 79, 81, 82, 84, 85, 86, - 83, 83, 204, 1, 210, 88, 89, 83, 214, 91, - 92, 93, 94, 83, 274, 212, 274, 0, 0, 233, - 226, 227, 215, 261, 262, 217, 138, 139, 140, 143, - 142, 141, 144, 145, 0, 0, 0, 0, 263, 264, - 146, 216, 148, 204, 204, 95, 203, 0, 98, 98, - 275, 271, 69, 244, 245, 246, 270, 228, 229, 232, + 83, 83, 206, 1, 212, 88, 89, 83, 216, 91, + 92, 93, 94, 83, 276, 214, 276, 0, 0, 235, + 228, 229, 217, 263, 264, 219, 138, 139, 140, 143, + 142, 141, 144, 145, 0, 0, 0, 0, 265, 266, + 146, 218, 148, 206, 206, 95, 205, 0, 98, 98, + 277, 273, 69, 246, 247, 248, 272, 230, 231, 234, 0, 166, 149, 0, 0, 0, 0, 155, 167, 0, - 0, 166, 0, 0, 0, 97, 96, 0, 201, 202, - 0, 0, 99, 100, 101, 102, 103, 0, 247, 0, - 313, 273, 0, 230, 165, 115, 161, 163, 0, 0, + 0, 166, 0, 0, 0, 97, 96, 0, 203, 204, + 0, 0, 99, 100, 101, 102, 103, 0, 249, 0, + 317, 275, 0, 232, 165, 115, 161, 163, 0, 0, 0, 0, 0, 0, 154, 0, 0, 147, 0, 0, - 160, 0, 159, 0, 224, 138, 139, 140, 143, 142, - 141, 0, 0, 67, 67, 104, 0, 241, 242, 243, - 312, 298, 0, 0, 0, 0, 98, 283, 284, 2, + 160, 0, 159, 0, 226, 138, 139, 140, 143, 142, + 141, 0, 0, 67, 67, 104, 0, 243, 244, 245, + 316, 300, 0, 0, 0, 0, 98, 285, 286, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 15, 16, 11, 12, 13, 0, 0, 0, 0, 0, 0, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 272, 98, 287, 0, 311, 231, 158, 0, - 123, 67, 67, 157, 0, 168, 0, 123, 67, 67, - 0, 205, 186, 187, 182, 184, 183, 185, 188, 181, - 177, 178, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 180, 179, 218, 0, - 297, 277, 67, 268, 276, 0, 0, 55, 0, 0, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 0, 53, 54, 49, 50, 51, 52, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 0, 129, 129, - 318, 67, 67, 309, 0, 0, 0, 0, 0, 67, - 67, 67, 0, 0, 0, 0, 0, 106, 108, 107, - 105, 109, 110, 111, 112, 113, 116, 164, 162, 151, - 152, 153, 156, 66, 150, 220, 222, 0, 0, 0, - 0, 0, 0, 0, 0, 170, 200, 0, 0, 0, - 174, 0, 171, 0, 0, 0, 134, 239, 250, 251, - 252, 257, 253, 254, 255, 256, 248, 0, 259, 266, - 265, 267, 0, 0, 278, 0, 0, 67, 67, 0, - 314, 0, 316, 295, 0, 0, 0, 0, 0, 0, + 0, 0, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 274, 98, 289, 0, 315, 233, + 158, 0, 123, 67, 67, 157, 0, 168, 0, 123, + 67, 67, 0, 207, 186, 187, 182, 184, 183, 185, + 188, 181, 177, 178, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 180, 179, 220, 0, 299, 279, 67, 270, 278, 0, + 0, 55, 0, 0, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 0, 53, 54, 49, 50, 51, + 52, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 0, 0, 0, 129, 129, 322, 67, 67, 313, + 0, 0, 0, 0, 0, 67, 67, 67, 0, 0, + 0, 0, 0, 106, 108, 107, 105, 109, 110, 111, + 112, 113, 116, 164, 162, 151, 152, 153, 156, 66, + 150, 222, 224, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 170, 202, 0, 0, 0, 174, 0, + 171, 0, 0, 0, 134, 241, 252, 253, 254, 259, + 255, 256, 257, 258, 250, 0, 261, 268, 267, 269, + 0, 0, 280, 0, 0, 67, 67, 67, 67, 0, + 318, 0, 320, 297, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 114, 120, 119, 117, 118, 121, 122, 124, 134, 134, 0, 0, - 0, 295, 0, 0, 0, 0, 0, 169, 155, 167, - 0, 172, 173, 0, 0, 0, 0, 219, 238, 115, - 236, 0, 249, 0, 0, 269, 0, 0, 0, 0, - 0, 0, 0, 0, 322, 0, 0, 0, 305, 306, - 0, 0, 0, 0, 0, 303, 0, 129, 0, 221, - 223, 67, 0, 0, 0, 0, 0, 0, 0, 199, - 176, 0, 0, 0, 0, 0, 0, 136, 134, 65, - 0, 123, 0, 258, 0, 0, 294, 0, 0, 129, - 130, 129, 0, 0, 0, 0, 0, 0, 321, 299, - 300, 294, 0, 319, 67, 206, 0, 0, 190, 0, + 0, 0, 0, 297, 0, 0, 0, 0, 0, 169, + 155, 167, 0, 172, 173, 0, 0, 0, 0, 221, + 240, 115, 238, 0, 251, 0, 0, 271, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 326, 0, + 0, 0, 309, 310, 0, 0, 0, 0, 0, 307, + 0, 129, 0, 223, 225, 67, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 201, 176, 0, 0, 0, + 0, 0, 0, 136, 134, 65, 0, 123, 0, 260, + 0, 0, 296, 0, 0, 0, 0, 129, 130, 129, + 0, 0, 0, 0, 0, 0, 325, 301, 302, 296, + 0, 323, 67, 208, 0, 0, 0, 0, 190, 0, 0, 0, 0, 175, 0, 0, 67, 131, 137, 135, - 64, 235, 237, 115, 132, 0, 0, 0, 115, 115, - 0, 301, 302, 315, 317, 296, 0, 0, 304, 307, - 308, 0, 129, 0, 0, 0, 196, 0, 0, 192, - 193, 189, 65, 133, 127, 260, 0, 0, 0, 0, - 123, 0, 288, 0, 123, 320, 194, 195, 0, 0, - 0, 234, 0, 125, 0, 281, 0, 0, 106, 108, - 115, 115, 0, 115, 115, 289, 310, 191, 197, 198, - 128, 0, 240, 279, 0, 280, 0, 291, 290, 0, - 0, 0, 126, 0, 0, 0, 115, 115, 0, 0, - 0, 293, 292, 286, 0, 0, 285, 0, 282 + 64, 237, 239, 115, 132, 0, 0, 0, 115, 115, + 0, 303, 304, 305, 306, 319, 321, 298, 0, 0, + 308, 311, 312, 0, 129, 0, 0, 0, 0, 0, + 198, 0, 0, 192, 193, 189, 65, 133, 127, 262, + 0, 0, 0, 0, 123, 0, 290, 0, 123, 324, + 194, 195, 196, 197, 0, 0, 0, 236, 0, 125, + 0, 283, 0, 0, 106, 108, 115, 115, 0, 115, + 115, 291, 314, 191, 199, 200, 128, 0, 242, 281, + 0, 282, 0, 293, 292, 0, 0, 0, 126, 0, + 0, 0, 115, 115, 0, 0, 0, 295, 294, 288, + 0, 0, 287, 0, 284 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 263, 264, 265, 290, 307, 161, 162, 78, 531, + -1, 267, 268, 269, 294, 311, 161, 162, 78, 551, 112, 12, 79, 14, 15, 40, 41, 42, 47, 53, - 117, 127, 336, 228, 415, 339, 602, 583, 390, 487, - 564, 437, 488, 80, 163, 136, 153, 137, 138, 109, - 356, 378, 357, 120, 87, 154, 16, 17, 18, 20, - 19, 366, 416, 417, 62, 23, 60, 100, 440, 441, - 128, 169, 54, 95, 55, 48, 443, 379, 82, 381, - 273, 274, 56, 91, 92, 222, 587, 131, 313, 540, - 454, 223, 224, 225, 226 + 117, 127, 342, 230, 425, 345, 628, 609, 400, 503, + 588, 449, 504, 80, 163, 136, 153, 137, 138, 109, + 364, 386, 365, 120, 87, 154, 16, 17, 18, 20, + 19, 374, 426, 427, 62, 23, 60, 100, 452, 453, + 128, 169, 54, 95, 55, 48, 455, 387, 82, 389, + 277, 278, 56, 91, 92, 224, 613, 131, 319, 560, + 468, 225, 226, 227, 228 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -561 +#define YYPACT_NINF -572 static const yytype_int16 yypact[] = { - 284, -561, -561, -561, -561, -561, -561, -561, -34, -121, - 14, -63, 101, -22, 17, -561, 127, 883, -561, 22, - 162, 10, 23, -561, 12, 158, -561, 1464, -561, -561, - -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, - -46, -46, 176, -561, -561, -561, -561, -46, -561, -561, - -561, -561, -561, -46, 200, -561, -10, 209, 219, 234, - -561, -561, -561, -561, -561, 124, -561, -561, -561, -561, - -561, -561, -561, -561, 272, 275, 2, 126, -561, -561, - -561, 28, -561, 243, 243, 196, -561, 165, 33, 33, - -561, -561, 215, -561, -561, -561, -561, -561, -561, -561, - -73, 1059, -561, 129, 132, 506, 124, -561, 28, -111, - 134, 1059, 137, 165, 165, -561, -561, 1014, -561, -561, - 1504, 292, -561, -561, -561, -561, -561, 1562, -561, -6, - 1843, -561, 278, -561, -561, 28, -561, 147, 153, 1620, - 1620, 148, -110, 1620, -561, 309, 164, -561, 1504, 1620, - 124, 166, 28, 388, -561, 342, 310, 311, 314, 316, - 317, 156, 322, 1115, 279, -561, 16, -561, -561, -561, - -561, -561, 281, 1660, 20, 327, 33, -561, -561, -561, - -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, - -561, -561, -561, -561, 511, 787, 1620, 1620, 1620, 1620, - -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, - -561, -561, 1620, 1620, 1620, 1620, 1620, 1620, 1620, 1620, - 1620, 1620, -561, 33, -561, -60, -561, -561, 434, 1345, - -561, -7, -33, -561, 181, 28, 192, -561, 279, -16, - 1014, -561, -561, -561, -561, -561, -561, -561, -561, -561, - -561, -561, 511, 787, 198, 199, 201, 203, 204, 1385, - 1678, 609, 329, 207, 208, 210, -561, -561, -561, 211, - -561, 124, 702, -561, 206, 841, 841, -561, 841, 1562, - -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, - 1620, -561, -561, -561, -561, -561, -561, -561, -561, -561, - -561, -561, -561, -561, -561, -561, -561, 1620, 100, 114, - -561, 702, -31, 222, 225, 227, 228, 235, 239, 702, - 702, 702, 325, 1562, 1620, 1620, 360, -561, -561, -561, - -561, -561, -561, -561, -561, -561, -561, -561, -561, -96, - -561, -561, -561, -561, -96, -561, 137, 361, 247, 252, - 1504, 1504, 1504, 1504, 1504, -561, -561, -54, 788, -88, - -561, -85, -561, 1504, 1504, 1504, 250, 1406, -561, -561, - -561, -561, -561, -561, -561, -561, 345, 1504, -561, -561, - -561, -561, 1620, 255, -561, 259, 841, 702, 702, 4, - -561, 5, -561, -561, 841, 249, 1620, 1620, 1620, 1620, - 1620, 261, 262, 263, 1620, 841, 702, 266, -561, -561, - -561, -561, -561, -561, -561, -561, 250, 250, 1620, 1504, - 1504, -561, 269, 274, 276, 277, 1504, -561, 265, 969, - -83, -561, -561, 282, 283, 391, -5, -561, -561, 28, - 285, 289, -561, 413, -78, -561, 426, 427, 294, 293, - 295, 841, 442, 841, 296, 299, 841, 300, 28, -561, - 301, 302, 444, 841, 841, 28, 306, 305, 1620, -561, - -561, -45, 307, 308, 94, 1504, 1504, 1504, 1504, -561, - -561, 312, 1504, 1504, 1620, 438, 463, -561, 250, 1746, - 1446, -561, 315, -561, 841, 841, 1718, 841, 841, 305, - -561, 305, 1620, 841, 318, 1620, 1620, 1620, -561, -561, - -561, 1718, 415, -561, 702, -561, 1504, 1504, -561, 320, - 323, 324, 328, -561, 331, 332, -30, -561, -561, -561, - -561, -561, -561, 28, 81, 455, 334, 333, 123, 28, - 95, -561, -561, -561, -561, -561, 335, 841, -561, -561, - -561, 98, 305, 339, 343, 1504, -561, 1504, 1504, -561, - -561, -561, 1746, -561, 433, -561, 479, -4, 560, 560, - -561, 1736, -561, 341, -561, -561, -561, -561, 346, 349, - 351, -561, 500, 358, 841, -561, 1255, -1, 355, 356, - -561, -561, 87, 123, 28, -561, -96, -561, -561, -561, - -561, 489, -561, -561, 370, -561, 1255, 434, 434, 495, - 560, 560, -561, 498, 373, 841, -561, -561, 841, 514, - 460, 434, 434, -561, 841, 516, -561, 841, -561 + 445, -572, -572, -572, -572, -572, -572, -572, -2, -122, + 19, -58, 90, -40, 26, -572, 112, 855, -572, 52, + 217, -28, 4, -572, 12, 146, -572, 1594, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + 70, 70, 125, -572, -572, -572, -572, 70, -572, -572, + -572, -572, -572, 70, 166, -572, -8, 176, 185, 201, + -572, -572, -572, -572, -572, 80, -572, -572, -572, -572, + -572, -572, -572, -572, 232, 241, 2, 227, -572, -572, + -572, -1, -572, 211, 211, 137, -572, 118, 258, 258, + -572, -572, 87, -572, -572, -572, -572, -572, -572, -572, + -57, 1357, -572, 105, 139, 1020, 80, -572, -1, -107, + 109, 1357, 145, 118, 118, -572, -572, 1400, -572, -572, + 1634, 302, -572, -572, -572, -572, -572, 1677, -572, -16, + 1856, -572, 290, -572, -572, -1, -572, 159, 177, 1695, + 1695, 179, -102, 1695, -572, 331, 189, -572, 1634, 1695, + 80, 186, -1, 247, -572, 226, 335, 338, 339, 342, + 344, 269, 345, 1123, 303, -572, 24, -572, -572, -572, + -572, -572, 300, 1752, 76, 347, 258, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, 314, 845, 314, 845, 1695, 1695, + 1695, 1695, -572, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, 1695, 1695, 1695, 1695, 1695, 1695, + 1695, 1695, 1695, 1695, -572, 258, -572, 97, -572, -572, + 172, 1418, -572, -43, -31, -572, 196, -1, 206, -572, + 303, -12, 1400, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, 314, 845, 314, 845, 208, 216, + 219, 220, 223, 1473, 1795, 1063, 348, 224, 225, 234, + -572, -572, -572, 237, -572, 80, 843, -572, 238, 524, + 524, -572, 524, 1677, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, 1695, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + -572, 1695, 1695, 1695, 27, 29, -572, 843, -23, 248, + 249, 263, 264, 265, 266, 843, 843, 843, 341, 1677, + 1695, 1695, 389, -572, -572, -572, -572, -572, -572, -572, + -572, -572, -572, -572, -572, 198, -572, -572, -572, -572, + 198, -572, 145, 359, 250, 270, 271, 272, 1634, 1634, + 1634, 1634, 1634, -572, -572, -30, 1314, -104, -572, -101, + -572, 1634, 1634, 1634, 275, 1518, -572, -572, -572, -572, + -572, -572, -572, -572, 366, 1634, -572, -572, -572, -572, + 1695, 276, -572, 277, 524, 843, 843, 843, 843, 25, + -572, 35, -572, -572, 524, 278, 1695, 1695, 1695, 1695, + 1695, 280, 282, 283, 1695, 524, 843, 287, -572, -572, + -572, -572, -572, -572, -572, -572, 275, 275, 1695, 1634, + 1634, 1634, 1634, -572, 291, 292, 293, 294, 1634, -572, + 288, 975, -99, -572, -572, 296, 297, 408, 9, -572, + -572, -1, 299, 304, -572, 435, -96, -572, 442, 443, + 308, 306, 310, 325, 326, 524, 479, 524, 328, 329, + 524, 334, -1, -572, 336, 337, 487, 524, 524, -1, + 349, 350, 1695, -572, -572, -20, 351, 352, 353, 354, + 102, 1634, 1634, 1634, 1634, -572, -572, 356, 1634, 1634, + 1695, 489, 497, -572, 275, 571, 1576, -572, 357, -572, + 524, 524, 1853, 524, 524, 524, 524, 350, -572, 350, + 1695, 524, 358, 1695, 1695, 1695, -572, -572, -572, 1853, + 459, -572, 843, -572, 1634, 1634, 1634, 1634, -572, 360, + 369, 364, 368, -572, 371, 376, -15, -572, -572, -572, + -572, -572, -572, -1, 6, 512, 380, 378, 71, -1, + 171, -572, -572, -572, -572, -572, -572, -572, 379, 524, + -572, -572, -572, 174, 350, 385, 387, 388, 391, 1634, + -572, 1634, 1634, -572, -572, -572, 571, -572, 499, -572, + 536, -6, 699, 699, -572, 1871, -572, 393, -572, -572, + -572, -572, -572, -572, 401, 407, 409, -572, 558, 418, + 524, -572, 1265, -3, 415, 417, -572, -572, -19, 71, + -1, -572, 198, -572, -572, -572, -572, 549, -572, -572, + 416, -572, 1265, 172, 172, 556, 699, 699, -572, 557, + 419, 524, -572, -572, 524, 559, 507, 172, 172, -572, + 524, 563, -572, 524, -572 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -561, 406, 407, 408, 298, 303, -173, -561, 0, -15, - -150, 454, 8, -561, -561, -561, -561, 189, -561, -561, - -561, -149, -561, -409, -561, -234, -561, -561, -289, 24, - -561, -404, -561, -561, -26, 330, -122, -561, 443, 452, - -92, -159, -226, 102, 183, 321, -561, -561, 548, -561, - -561, -561, -561, -561, -561, -561, -561, -561, -561, -561, - 477, -561, -561, -561, -561, -561, -561, -560, -76, 46, - -105, -561, -561, 519, -561, -561, -561, -561, -561, 61, - 160, -561, -561, -561, -561 + -572, 451, 453, 454, -174, -152, -173, -572, 0, 1, + -146, 493, 3, -572, -572, -572, -572, 49, -572, -572, + -572, -139, -572, -416, -572, -223, -572, -572, -311, 34, + -572, -397, -572, -572, -26, 361, -120, -572, 478, 486, + -64, -153, -250, 164, 207, 355, -572, -572, 577, -572, + -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, + 528, -572, -572, -572, -572, -572, -572, -571, -115, 162, + -191, -572, -572, 540, -572, -572, -572, -572, -572, 89, + 187, -572, -572, -572, -572 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -209 +#define YYTABLE_NINF -211 static const yytype_int16 yytable[] = { - 11, 81, 278, 344, 266, 166, 104, 277, 13, 110, - 277, 90, 469, 470, 268, 451, 453, 11, 21, 93, - 392, 110, 167, 110, 110, 13, 604, 279, 164, 485, - 489, 275, 24, 22, 359, 361, 2, 276, 110, 4, - 409, 410, 411, 143, 143, 412, 614, 110, 486, 413, - 414, 108, 144, 234, 324, 325, 238, 452, 452, 29, - 30, 31, 32, 33, 34, 35, 426, 36, 45, 426, - 46, 426, 25, 431, 323, 135, 426, 241, 432, 108, - 481, 132, 110, 493, 529, 135, 133, 267, 345, 346, - 26, 152, 11, 310, 121, 122, 123, 124, 125, 126, - 426, 152, 37, 38, 39, 427, 111, 515, 314, 315, - 316, 317, 318, 231, 232, 485, 322, 235, 111, 27, - 111, 111, 561, 239, 562, 609, 394, 43, 341, 568, - 569, 28, 430, 63, 64, 111, 106, 66, 67, 68, - 69, 70, 71, 72, 111, 1, 2, 272, 3, 4, - 5, 444, 340, 94, 110, 585, 168, 386, 605, 244, - 245, 246, 247, 57, 105, 37, 38, 39, 110, 59, - 308, 309, 272, 311, 269, 73, 58, -144, 513, 111, - 61, 607, 608, -67, 610, 611, 312, 272, 272, 272, - 272, 272, 319, 320, 321, 272, 380, 118, 119, 380, - 380, 405, 380, 135, 49, 50, 51, 621, 622, 52, - 543, 85, 544, 86, 152, 148, 149, 409, 410, 411, - 407, 90, 412, 409, 410, 411, 413, 414, 412, 83, - 84, 97, 413, 414, 1, 380, 88, 3, 115, 5, - 116, 98, 89, 380, 380, 380, 518, 570, 502, 571, - 574, 111, 571, 152, 389, -67, 99, 534, 421, 422, - 423, 424, 425, 575, 387, 111, 113, 114, 391, -67, - 266, 433, 434, 435, -144, 101, 102, 445, -144, 103, - 86, 388, 74, 75, -208, 145, 76, 139, 77, 107, - 140, 457, 147, 459, 460, 461, 165, 152, 406, 272, - 227, 229, -69, 1, 2, 230, 3, 4, 5, 233, - 380, 380, 380, 236, 6, 7, 237, 240, 380, -56, - -57, 383, 384, -60, 385, -59, -58, 472, 473, 380, - 380, 248, 429, 110, 479, 8, 592, 270, 277, 9, - 596, 439, 342, 10, 343, -55, -55, -55, -55, 350, - 351, 362, 352, 267, 353, 354, 272, 393, 363, 364, - 382, 365, 367, 404, 408, 401, 402, 403, 242, 243, - 272, 458, 272, 272, 272, 380, 395, 380, 465, 396, - 380, 397, 398, 519, 520, 521, 522, 380, 380, 399, - 524, 525, 471, 400, 586, 63, 64, 545, 419, 418, - 548, 549, 550, 420, 436, 442, 456, 1, 2, 446, - 3, 4, 5, 447, 606, 462, 463, 464, 380, 380, - 468, 380, 380, 475, 553, 554, 480, 380, 476, 484, - 477, 478, 448, 449, 450, 492, 482, 483, 380, 490, - 455, 491, 514, 494, 495, 496, 500, 497, 508, 498, - 502, 466, 467, 503, 505, 506, 507, 511, 526, 512, - 527, 516, 517, 578, 533, 579, 580, 528, 452, 535, - 539, 380, 547, 523, 555, 556, 272, 565, 557, 272, - 272, 272, 558, 559, 560, 539, 582, 326, 566, 530, - 567, 576, 380, 380, 572, 577, 584, 499, 597, 501, - 595, 598, 504, 599, 600, 601, -18, -19, 380, 509, - 510, 612, 615, 63, 64, 618, 106, 66, 67, 68, - 69, 70, 71, 72, 613, 1, 2, 619, 3, 4, - 5, 624, 625, 627, 380, 380, 219, 220, 221, 380, - 536, 537, 380, 541, 542, 594, 130, 581, 380, 546, - 348, 380, 327, 328, 146, 73, 349, 142, 563, 338, - 552, 347, 530, 368, 369, 44, 129, 63, 64, 370, - 329, 330, 551, 331, 332, 96, 333, 334, 335, 1, - 2, 474, 3, 4, 5, 371, 372, 373, 0, 0, - 0, 0, 0, 573, 0, 0, 0, 0, 0, 0, - 374, 375, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 0, 326, 590, 591, 63, 64, 376, 106, - 155, 156, 157, 158, 159, 160, 72, 0, 1, 2, - 603, 3, 4, 5, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 252, - 253, 0, 0, 0, 0, 0, 616, 617, 73, 0, - 0, 620, 74, 75, 623, 0, 76, 0, 77, 141, - 626, 0, 0, 628, 0, 0, 254, 200, 588, 589, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 0, - 255, 0, 256, 257, 258, 0, 329, 330, 0, 331, - 332, 0, 333, 334, 335, 368, 369, 0, 0, 63, - 64, 370, 0, 0, 0, 0, 0, 0, 0, 0, - 377, 1, 2, 0, 3, 4, 5, 371, 372, 373, + 11, 81, 282, 13, 402, 281, 104, 166, 281, 316, + 270, 110, 167, 90, 367, 369, 350, 11, 272, 635, + 13, 93, 312, 110, 320, 321, 322, 323, 324, 483, + 484, 110, 328, 24, 110, 505, 465, 283, 243, 110, + 501, 630, 110, 501, 2, 313, 467, 4, 271, 143, + 21, 108, 438, 110, 143, 438, 164, 438, 144, 443, + 438, 640, 502, 236, 444, 22, 497, 509, 29, 30, + 31, 32, 33, 34, 35, 135, 36, 25, 466, 108, + 354, 110, 356, 110, 240, 135, 329, 279, 466, 83, + 84, 152, 11, 280, 351, 352, 88, 26, 45, 132, + 46, 152, 89, 355, 133, 357, 1, 549, 27, 3, + 111, 5, 43, 233, 234, 28, 442, 237, 346, 419, + 420, 421, 111, 241, 422, -144, 438, 57, 423, 424, + 111, 439, 347, 111, 533, 456, 404, 586, 111, 585, + 417, 111, 592, 593, 419, 420, 421, 276, 168, 422, + 118, 119, 111, 423, 424, 611, -67, 94, 631, 58, + 85, 388, 86, 394, 388, 388, 105, 388, 61, 273, + 531, 59, 314, 315, 276, 317, 37, 38, 39, 115, + 111, 116, 111, 399, -67, 401, -67, 90, 318, 276, + 276, 276, 276, 276, 325, 326, 327, 276, 97, 457, + 633, 634, 388, 636, 637, 135, 565, 98, 566, 415, + 388, 388, 388, 330, 331, 471, 152, 473, 474, 475, + 37, 38, 39, 99, -144, 332, 647, 648, -144, -55, + -55, -55, -55, 101, 63, 64, 102, 106, 66, 67, + 68, 69, 70, 71, 72, 103, 1, 2, 86, 3, + 4, 5, 244, 245, 63, 64, 538, 152, 520, 49, + 50, 51, 145, 599, 52, 139, 1, 2, 395, 3, + 4, 5, 246, 247, 248, 249, 73, 148, 149, 388, + 388, 388, 388, 388, 554, 396, 397, 398, 270, 388, + 113, 114, 333, 334, 433, 434, 435, 436, 437, 140, + 388, 388, 147, 152, 416, 276, 165, 445, 446, 447, + 335, 336, 229, 337, 338, 231, 339, 340, 341, 121, + 122, 123, 124, 125, 126, 594, 271, 595, 598, 567, + 595, 232, 570, 571, 572, 238, 419, 420, 421, 242, + 441, 422, 235, 239, -56, 423, 424, -57, -60, 451, + 388, -59, 388, -58, 250, 388, 274, 110, 281, 348, + 349, 358, 388, 388, 276, 486, 487, 488, 489, 359, + 370, 618, 360, 361, 495, 622, 362, 371, 372, 414, + 276, 472, 276, 276, 276, 74, 75, 373, 479, 76, + 375, 77, 107, 418, 390, 388, 388, 428, 388, 388, + 388, 388, 485, 429, 405, 406, 388, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 388, 612, 407, + 408, 409, 410, 430, 431, 432, 454, 539, 540, 541, + 542, 448, 458, 459, 544, 545, 476, 470, 477, 478, + 632, 391, 392, 482, 393, -210, 500, 491, 492, 493, + 494, 496, 498, 499, 388, 506, 532, 508, 507, 510, + 511, 512, 513, -69, 1, 2, 514, 3, 4, 5, + 575, 576, 577, 578, 546, 6, 7, 388, 388, 403, + 553, 515, 516, 518, 520, 521, 559, 411, 412, 413, + 523, 526, 524, 525, 276, 388, 8, 276, 276, 276, + 9, 548, 529, 559, 10, 550, 530, 534, 535, 536, + 537, 547, 466, 555, 569, 604, 579, 605, 606, 543, + 581, 388, 388, 580, 582, 583, 388, 376, 377, 388, + 584, 63, 64, 378, 589, 388, 590, 591, 388, 600, + 596, 601, 602, 1, 2, 603, 3, 4, 5, 379, + 380, 381, 608, 610, 621, 623, 460, 461, 462, 463, + 464, 624, 626, 625, 382, 383, 469, 627, -18, 620, + -19, 638, 639, 641, 644, 645, 650, 480, 481, 651, + 653, 221, 384, 222, 223, 130, 550, 607, 587, 146, + 1, 142, 344, 3, 44, 5, 96, 353, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 254, 255, 256, 257, 129, 573, 0, + 490, 0, 0, 0, 332, 0, 0, 517, 0, 519, + 0, 0, 522, 0, 0, 0, 0, 0, 0, 527, + 528, 0, 258, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 0, 259, 0, 260, 261, + 262, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 556, 557, 0, 561, 562, 563, 564, 0, + 0, 0, 0, 568, 0, 0, 385, 0, 0, 0, + 0, 333, 334, 0, 574, 0, 0, 0, 0, 0, + 0, 0, 376, 377, 0, 0, 63, 64, 378, 335, + 336, 0, 337, 338, 0, 339, 340, 341, 1, 2, + 0, 3, 4, 5, 379, 380, 381, 0, 0, 0, + 0, 597, 0, 0, 0, 0, 0, 0, 0, 382, + 383, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 332, 0, 616, 617, 0, 384, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 374, 375, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 110, 0, 0, 0, - 376, 0, 0, 0, 0, 74, 75, 0, 0, 76, - 0, 77, 360, 0, 0, 0, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 252, 253, 0, 0, 63, 64, 0, 106, 155, - 156, 157, 158, 159, 160, 72, 0, 1, 2, 0, - 3, 4, 5, 291, 292, 0, 0, 0, 254, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 0, 255, 0, 256, 257, 258, 73, 0, 0, - 0, 0, 0, 0, 368, 369, 0, 0, 63, 64, - 370, 0, 0, 111, 0, 0, 0, 0, 0, 0, - 1, 2, 377, 3, 4, 5, 371, 372, 373, 0, + 0, 0, 629, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 254, 255, + 256, 257, 0, 0, 0, 0, 0, 0, 642, 643, + 0, 0, 0, 646, 0, 0, 649, 0, 0, 0, + 0, 0, 652, 0, 0, 654, 0, 258, 202, 614, + 615, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 0, 259, 0, 260, 261, 262, 0, 335, 336, 0, + 337, 338, 0, 339, 340, 341, 376, 377, 0, 0, + 63, 64, 378, 0, 0, -209, 0, 0, 0, 0, + 0, 385, 1, 2, 0, 3, 4, 5, 379, 380, + 381, 295, 296, -69, 1, 2, 0, 3, 4, 5, + 0, 0, 0, 382, 383, 6, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 110, 0, 0, + 0, 384, 0, 0, 0, 0, 8, 0, 0, 0, + 9, 0, 0, 0, 10, 0, 0, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 254, 255, 256, 257, 0, 0, 0, 0, + 0, 0, 0, 0, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 0, 0, + 0, 258, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 0, 259, 0, 260, 261, 262, + 0, 0, 63, 64, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 2, 111, 3, 4, 5, + 251, 0, 0, 0, 0, 385, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 252, 253, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 63, 64, 110, + 106, 66, 67, 68, 69, 70, 71, 72, 0, 1, + 2, 0, 3, 4, 5, 0, 0, 0, 0, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 254, 255, 256, 257, 0, 73, + 63, 64, 0, 106, 155, 156, 157, 158, 159, 160, + 72, 0, 1, 2, 0, 3, 4, 5, 0, 0, + 0, 0, 0, 258, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 0, 259, 0, 260, + 261, 262, 73, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 111, 0, + 63, 64, -67, 0, 263, 0, 0, 264, 0, 265, + 0, 266, 1, 2, 0, 3, 4, 5, 251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 374, 375, -207, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 0, 376, - 0, -69, 1, 2, 0, 3, 4, 5, 0, 0, - 0, 0, 0, 6, 7, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 252, 253, 0, 0, 8, 0, 0, 0, 9, 0, - 0, 0, 10, 0, 74, 75, 0, 0, 76, 0, - 77, 428, 0, 0, 0, 0, 0, 254, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 0, 255, 0, 256, 257, 258, 63, 64, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, - 0, 3, 4, 5, 249, 0, 0, 0, 0, 0, - 0, 377, 0, 0, 0, 0, 0, 0, 0, 250, - 251, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 63, 64, 110, 150, 66, 67, 68, 69, 70, - 71, 72, 0, 1, 2, 0, 3, 4, 5, 0, - 0, 0, 0, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 252, 253, - 0, 0, 0, 73, 0, 0, 63, 64, 0, 106, - 66, 67, 68, 69, 70, 71, 72, 0, 1, 2, - 0, 3, 4, 5, 0, 254, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 134, 255, - 0, 256, 257, 258, 0, 0, 0, 0, 73, 0, + 0, 0, 0, 252, 253, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 110, 74, 75, + 0, 0, 76, 0, 77, 141, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 254, 255, 256, 257, 0, 0, 0, 0, + 0, 74, 75, 0, 0, 76, 0, 77, 368, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 111, 0, 63, 64, -67, 0, 259, 0, 0, 260, - 0, 261, 0, 262, 1, 2, 151, 3, 4, 5, - 249, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 250, 251, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 110, - 74, 75, 0, 0, 76, 0, 77, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 252, 253, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 74, 75, 0, 0, 76, - 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 254, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 0, 255, 0, 256, 257, 258, - 0, 0, 0, 0, 0, 0, 0, 0, 368, 369, - 0, 0, 0, 0, 370, 0, 111, 0, 0, 0, - 0, 0, 259, 0, 0, 260, 0, 261, 0, 262, - 371, 372, 373, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 374, 375, 0, 0, 0, + 0, 258, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 0, 259, 0, 260, 261, 262, + 0, 0, 0, 0, 0, 0, 0, 0, 376, 377, + 0, 0, 0, 0, 378, 0, 111, 0, 0, 0, + 0, 0, 263, 0, 0, 264, 0, 265, 0, 266, + 379, 380, 381, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 382, 383, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 376, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 179, + 0, 63, 64, 384, 106, 155, 156, 157, 158, 159, + 160, 72, 0, 1, 2, 0, 3, 4, 5, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 252, 253, 0, 0, 0, 0, - 0, 0, 63, 64, 0, 106, 66, 67, 68, 69, - 70, 71, 72, 0, 1, 2, 0, 3, 4, 5, - 0, 254, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 337, 255, 0, 256, 257, 258, - 0, 0, 63, 64, 73, 106, 155, 156, 157, 158, - 159, 160, 72, 0, 1, 2, 0, 3, 4, 5, - 0, 0, 0, 63, 64, 377, 106, 66, 67, 68, - 69, 70, 71, 72, 0, 1, 2, 0, 3, 4, - 5, 0, 0, 0, 73, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 438, 0, 0, 0, 0, - 0, 0, 0, 63, 64, 73, 106, 66, 67, 68, + 190, 191, 192, 193, 254, 255, 256, 257, 0, 0, + 0, 0, 0, 73, 63, 64, 0, 106, 66, 67, + 68, 69, 70, 71, 72, 0, 1, 2, 0, 3, + 4, 5, 0, 258, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 134, 259, 0, 260, + 261, 262, 0, 0, 0, 0, 73, 63, 64, 0, + 150, 66, 67, 68, 69, 70, 71, 72, 0, 1, + 2, 0, 3, 4, 5, 63, 64, 385, 106, 66, + 67, 68, 69, 70, 71, 72, 0, 1, 2, 0, + 3, 4, 5, 0, 0, 0, 0, 0, 0, 73, + 0, 0, 0, 0, 0, 0, 0, 343, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 73, 0, 0, + 0, 0, 74, 75, 0, 0, 76, 0, 77, 440, + 63, 64, 0, 106, 155, 156, 157, 158, 159, 160, + 72, 0, 1, 2, 0, 3, 4, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 74, 75, 0, 0, 76, + 0, 77, 73, 0, 151, 63, 64, 0, 106, 66, + 67, 68, 69, 70, 71, 72, 0, 1, 2, 0, + 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 450, 74, 75, + 0, 0, 76, 0, 77, 0, 0, 73, 0, 0, + 0, 0, 0, 0, 0, 0, 74, 75, 0, 0, + 76, 0, 77, 63, 64, 0, 106, 66, 67, 68, 69, 70, 71, 72, 0, 1, 2, 0, 3, 4, 5, 63, 64, 0, 65, 66, 67, 68, 69, 70, - 71, 72, 0, 1, 2, 532, 3, 4, 5, 0, + 71, 72, 0, 1, 2, 552, 3, 4, 5, 0, 0, 0, 0, 0, 0, 73, 0, 0, 0, 0, - 0, 74, 75, 0, 0, 76, 0, 77, 0, 0, + 0, 74, 75, 0, 363, 76, 0, 77, 0, 0, 0, 63, 64, 73, 106, 155, 156, 157, 158, 159, 160, 72, 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 74, 75, 0, 355, 76, 0, 77, 0, 0, - 0, 0, 0, 73, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 74, 75, 0, 0, + 76, 0, 77, 73, 63, 64, 0, 150, 66, 67, + 68, 69, 70, 71, 72, 0, 1, 2, 0, 3, + 4, 5, 63, 64, 0, 106, 66, 67, 68, 69, + 70, 71, 72, 0, 1, 2, 0, 3, 4, 5, + 0, 0, 0, 0, 0, 0, 73, 0, 0, 0, + 0, 0, 0, 0, 74, 75, 0, 0, 76, 0, + 77, 0, 0, 0, 73, 0, 0, 0, 0, 0, 0, 0, 74, 75, 0, 0, 76, 0, 77, 63, - 64, 0, 150, 66, 67, 68, 69, 70, 71, 72, + 64, 0, 275, 66, 67, 68, 69, 70, 71, 72, 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 75, 0, 0, 76, 0, 77, 0, - 0, 73, 0, 0, 0, 0, 0, 0, 0, 0, - 74, 75, 0, 0, 76, 0, 77, 63, 64, 0, - 106, 66, 67, 68, 69, 70, 71, 72, 0, 1, - 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 74, 75, 0, 0, 76, 0, 77, 63, 64, 73, - 271, 66, 67, 68, 69, 70, 71, 72, 0, 1, - 2, 0, 3, 4, 5, 63, 64, 0, 106, 155, - 156, 157, 158, 159, 160, 72, 0, 1, 2, 0, - 3, 4, 5, 0, 0, 0, 0, 0, 0, 73, - 0, 0, 0, 0, 0, 0, 0, 0, 74, 75, - 0, 0, 76, 0, 77, 63, 64, 73, 106, 66, - 67, 68, 69, 70, 71, 538, 0, 1, 2, 0, - 3, 4, 5, 63, 64, 0, 106, 66, 67, 68, - 69, 70, 71, 593, 0, 1, 2, 0, 3, 4, - 5, 0, 0, 0, 0, 1, 0, 73, 3, 0, - 5, 0, 0, 0, 0, 0, 74, 75, 0, 0, - 76, 0, 77, 0, 0, 73, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 326, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 74, 75, 0, 0, - 76, 0, 77, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 74, 75, 0, 0, 76, 0, - 358, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 73, 63, 64, 0, 106, 155, 156, 157, 158, + 159, 160, 72, 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 327, 328, 0, 0, 0, 0, - 0, 0, 0, 0, 74, 75, 0, 0, 76, 170, - 77, 0, 329, 330, 0, 331, 332, 0, 333, 334, - 335, 0, 74, 75, 0, 0, 76, 0, 77, 171, - 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 74, 75, 0, 0, 76, + 0, 77, 0, 0, 73, 0, 0, 0, 0, 0, + 0, 0, 0, 74, 75, 0, 0, 76, 0, 77, + 63, 64, 0, 106, 66, 67, 68, 69, 70, 71, + 558, 0, 1, 2, 0, 3, 4, 5, 63, 64, + 0, 106, 66, 67, 68, 69, 70, 71, 619, 0, + 1, 2, 170, 3, 4, 5, 0, 0, 0, 0, + 0, 0, 73, 0, 0, 0, 0, 0, 0, 0, + 74, 75, 171, 172, 76, 0, 77, 0, 0, 0, + 73, 0, 0, 0, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 0, + 0, 0, 0, 74, 75, 0, 0, 76, 0, 366, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 198, + 199, 200, 0, 0, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 196, 197, 198, 0, 0, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218 + 0, 74, 75, 0, 0, 76, 0, 77, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, + 75, 0, 0, 76, 0, 77 }; static const yytype_int16 yycheck[] = { - 0, 27, 175, 237, 163, 127, 4, 11, 0, 54, - 11, 21, 416, 417, 164, 11, 11, 17, 52, 29, - 309, 54, 28, 54, 54, 17, 586, 176, 120, 34, - 439, 11, 153, 67, 260, 261, 20, 17, 54, 23, - 136, 137, 138, 154, 154, 141, 606, 54, 53, 145, - 146, 77, 163, 163, 114, 115, 148, 53, 53, 42, - 43, 44, 45, 46, 47, 48, 154, 50, 46, 154, - 48, 154, 58, 161, 223, 101, 154, 153, 163, 105, - 163, 154, 54, 161, 488, 111, 159, 163, 238, 239, - 153, 117, 92, 198, 61, 62, 63, 64, 65, 66, - 154, 127, 148, 149, 150, 159, 151, 152, 213, 214, - 215, 216, 217, 139, 140, 34, 221, 143, 151, 18, - 151, 151, 152, 149, 533, 38, 157, 0, 161, 538, - 539, 153, 358, 7, 8, 151, 10, 11, 12, 13, - 14, 15, 16, 17, 151, 19, 20, 173, 22, 23, - 24, 377, 159, 163, 54, 159, 162, 279, 159, 3, - 4, 5, 6, 153, 162, 148, 149, 150, 54, 157, - 196, 197, 198, 199, 166, 49, 153, 54, 467, 151, - 22, 590, 591, 155, 593, 594, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 272, 32, 33, 275, - 276, 323, 278, 229, 42, 43, 44, 616, 617, 47, - 499, 35, 501, 37, 240, 113, 114, 136, 137, 138, - 325, 21, 141, 136, 137, 138, 145, 146, 141, 40, - 41, 22, 145, 146, 19, 311, 47, 22, 42, 24, - 44, 22, 53, 319, 320, 321, 152, 152, 154, 154, - 152, 151, 154, 279, 154, 155, 22, 491, 350, 351, - 352, 353, 354, 552, 290, 151, 83, 84, 154, 155, - 429, 363, 364, 365, 151, 151, 4, 382, 155, 4, - 37, 307, 156, 157, 0, 151, 160, 158, 162, 163, - 158, 396, 155, 398, 399, 400, 4, 323, 324, 325, - 22, 154, 18, 19, 20, 152, 22, 23, 24, 161, - 386, 387, 388, 4, 30, 31, 152, 151, 394, 9, - 9, 275, 276, 9, 278, 9, 9, 419, 420, 405, - 406, 9, 358, 54, 426, 51, 570, 56, 11, 55, - 574, 367, 161, 59, 152, 3, 4, 5, 6, 151, - 151, 22, 151, 429, 151, 151, 382, 311, 151, 151, - 154, 151, 151, 38, 4, 319, 320, 321, 26, 27, - 396, 397, 398, 399, 400, 451, 154, 453, 404, 154, - 456, 154, 154, 475, 476, 477, 478, 463, 464, 154, - 482, 483, 418, 154, 567, 7, 8, 502, 151, 38, - 505, 506, 507, 151, 154, 60, 157, 19, 20, 154, - 22, 23, 24, 154, 587, 154, 154, 154, 494, 495, - 154, 497, 498, 154, 516, 517, 161, 503, 154, 38, - 154, 154, 386, 387, 388, 22, 154, 154, 514, 154, - 394, 152, 468, 17, 17, 151, 4, 154, 4, 154, - 154, 405, 406, 154, 154, 154, 154, 151, 484, 154, - 22, 154, 154, 555, 490, 557, 558, 4, 53, 154, - 496, 547, 154, 161, 154, 152, 502, 22, 154, 505, - 506, 507, 154, 152, 152, 511, 53, 53, 154, 489, - 157, 152, 568, 569, 159, 152, 17, 451, 152, 453, - 159, 152, 456, 152, 4, 147, 151, 151, 584, 463, - 464, 22, 17, 7, 8, 17, 10, 11, 12, 13, - 14, 15, 16, 17, 154, 19, 20, 154, 22, 23, - 24, 17, 72, 17, 610, 611, 130, 130, 130, 615, - 494, 495, 618, 497, 498, 571, 92, 562, 624, 503, - 252, 627, 118, 119, 111, 49, 253, 105, 534, 229, - 514, 240, 562, 3, 4, 17, 89, 7, 8, 9, - 136, 137, 511, 139, 140, 56, 142, 143, 144, 19, - 20, 421, 22, 23, 24, 25, 26, 27, -1, -1, - -1, -1, -1, 547, -1, -1, -1, -1, -1, -1, - 40, 41, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, -1, 53, 568, 569, 7, 8, 58, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - 584, 22, 23, 24, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, -1, -1, -1, -1, -1, 610, 611, 49, -1, - -1, 615, 156, 157, 618, -1, 160, -1, 162, 163, - 624, -1, -1, 627, -1, -1, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, -1, - 130, -1, 132, 133, 134, -1, 136, 137, -1, 139, - 140, -1, 142, 143, 144, 3, 4, -1, -1, 7, - 8, 9, -1, -1, -1, -1, -1, -1, -1, -1, - 160, 19, 20, -1, 22, 23, 24, 25, 26, 27, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 40, 41, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 54, -1, -1, -1, - 58, -1, -1, -1, -1, 156, 157, -1, -1, 160, - -1, 162, 163, -1, -1, -1, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, -1, -1, 7, 8, -1, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, 26, 27, -1, -1, -1, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, -1, 130, -1, 132, 133, 134, 49, -1, -1, - -1, -1, -1, -1, 3, 4, -1, -1, 7, 8, - 9, -1, -1, 151, -1, -1, -1, -1, -1, -1, - 19, 20, 160, 22, 23, 24, 25, 26, 27, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 40, 41, 0, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, -1, 58, - -1, 18, 19, 20, -1, 22, 23, 24, -1, -1, - -1, -1, -1, 30, 31, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, -1, -1, 51, -1, -1, -1, 55, -1, - -1, -1, 59, -1, 156, 157, -1, -1, 160, -1, - 162, 163, -1, -1, -1, -1, -1, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - -1, 130, -1, 132, 133, 134, 7, 8, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 19, 20, - -1, 22, 23, 24, 25, -1, -1, -1, -1, -1, - -1, 160, -1, -1, -1, -1, -1, -1, -1, 40, + 0, 27, 175, 0, 315, 11, 4, 127, 11, 200, + 163, 54, 28, 21, 264, 265, 239, 17, 164, 38, + 17, 29, 196, 54, 215, 216, 217, 218, 219, 426, + 427, 54, 223, 155, 54, 451, 11, 176, 153, 54, + 34, 612, 54, 34, 20, 197, 11, 23, 163, 156, + 52, 77, 156, 54, 156, 156, 120, 156, 165, 163, + 156, 632, 53, 165, 165, 67, 165, 163, 42, 43, + 44, 45, 46, 47, 48, 101, 50, 58, 53, 105, + 254, 54, 256, 54, 148, 111, 225, 11, 53, 40, + 41, 117, 92, 17, 240, 241, 47, 155, 46, 156, + 48, 127, 53, 255, 161, 257, 19, 504, 18, 22, + 153, 24, 0, 139, 140, 155, 366, 143, 161, 138, + 139, 140, 153, 149, 143, 54, 156, 155, 147, 148, + 153, 161, 163, 153, 154, 385, 159, 553, 153, 154, + 331, 153, 558, 559, 138, 139, 140, 173, 164, 143, + 32, 33, 153, 147, 148, 161, 157, 165, 161, 155, + 35, 276, 37, 283, 279, 280, 164, 282, 22, 166, + 481, 159, 198, 199, 200, 201, 150, 151, 152, 42, + 153, 44, 153, 156, 157, 156, 157, 21, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 22, 390, + 616, 617, 317, 619, 620, 231, 517, 22, 519, 329, + 325, 326, 327, 116, 117, 406, 242, 408, 409, 410, + 150, 151, 152, 22, 153, 53, 642, 643, 157, 3, + 4, 5, 6, 153, 7, 8, 4, 10, 11, 12, + 13, 14, 15, 16, 17, 4, 19, 20, 37, 22, + 23, 24, 26, 27, 7, 8, 154, 283, 156, 42, + 43, 44, 153, 574, 47, 160, 19, 20, 294, 22, + 23, 24, 3, 4, 5, 6, 49, 113, 114, 394, + 395, 396, 397, 398, 507, 311, 312, 313, 441, 404, + 83, 84, 120, 121, 358, 359, 360, 361, 362, 160, + 415, 416, 157, 329, 330, 331, 4, 371, 372, 373, + 138, 139, 22, 141, 142, 156, 144, 145, 146, 61, + 62, 63, 64, 65, 66, 154, 441, 156, 154, 520, + 156, 154, 523, 524, 525, 4, 138, 139, 140, 153, + 366, 143, 163, 154, 9, 147, 148, 9, 9, 375, + 465, 9, 467, 9, 9, 470, 56, 54, 11, 163, + 154, 153, 477, 478, 390, 429, 430, 431, 432, 153, + 22, 594, 153, 153, 438, 598, 153, 153, 153, 38, + 406, 407, 408, 409, 410, 158, 159, 153, 414, 162, + 153, 164, 165, 4, 156, 510, 511, 38, 513, 514, + 515, 516, 428, 153, 156, 156, 521, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 532, 591, 156, + 156, 156, 156, 153, 153, 153, 60, 491, 492, 493, + 494, 156, 156, 156, 498, 499, 156, 159, 156, 156, + 613, 279, 280, 156, 282, 0, 38, 156, 156, 156, + 156, 163, 156, 156, 569, 156, 482, 22, 154, 17, + 17, 153, 156, 18, 19, 20, 156, 22, 23, 24, + 534, 535, 536, 537, 500, 30, 31, 592, 593, 317, + 506, 156, 156, 4, 156, 156, 512, 325, 326, 327, + 156, 4, 156, 156, 520, 610, 51, 523, 524, 525, + 55, 4, 153, 529, 59, 505, 156, 156, 156, 156, + 156, 22, 53, 156, 156, 579, 156, 581, 582, 163, + 156, 636, 637, 154, 156, 154, 641, 3, 4, 644, + 154, 7, 8, 9, 22, 650, 156, 159, 653, 154, + 161, 154, 154, 19, 20, 154, 22, 23, 24, 25, + 26, 27, 53, 17, 161, 154, 394, 395, 396, 397, + 398, 154, 4, 154, 40, 41, 404, 149, 153, 595, + 153, 22, 156, 17, 17, 156, 17, 415, 416, 72, + 17, 130, 58, 130, 130, 92, 586, 586, 554, 111, + 19, 105, 231, 22, 17, 24, 56, 242, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 89, 529, -1, + 433, -1, -1, -1, 53, -1, -1, 465, -1, 467, + -1, -1, 470, -1, -1, -1, -1, -1, -1, 477, + 478, -1, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, -1, 132, -1, 134, 135, + 136, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 510, 511, -1, 513, 514, 515, 516, -1, + -1, -1, -1, 521, -1, -1, 162, -1, -1, -1, + -1, 120, 121, -1, 532, -1, -1, -1, -1, -1, + -1, -1, 3, 4, -1, -1, 7, 8, 9, 138, + 139, -1, 141, 142, -1, 144, 145, 146, 19, 20, + -1, 22, 23, 24, 25, 26, 27, -1, -1, -1, + -1, 569, -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 7, 8, 54, 10, 11, 12, 13, 14, 15, - 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, - -1, -1, -1, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - -1, -1, -1, 49, -1, -1, 7, 8, -1, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 39, 130, - -1, 132, 133, 134, -1, -1, -1, -1, 49, -1, + -1, -1, 53, -1, 592, 593, -1, 58, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 151, -1, 7, 8, 155, -1, 157, -1, -1, 160, - -1, 162, -1, 164, 19, 20, 122, 22, 23, 24, - 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 610, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, -1, -1, -1, -1, -1, -1, 636, 637, + -1, -1, -1, 641, -1, -1, 644, -1, -1, -1, + -1, -1, 650, -1, -1, 653, -1, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + -1, 132, -1, 134, 135, 136, -1, 138, 139, -1, + 141, 142, -1, 144, 145, 146, 3, 4, -1, -1, + 7, 8, 9, -1, -1, 0, -1, -1, -1, -1, + -1, 162, 19, 20, -1, 22, 23, 24, 25, 26, + 27, 26, 27, 18, 19, 20, -1, 22, 23, 24, + -1, -1, -1, 40, 41, 30, 31, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 54, -1, -1, + -1, 58, -1, -1, -1, -1, 51, -1, -1, -1, + 55, -1, -1, -1, 59, -1, -1, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, -1, -1, -1, + -1, -1, -1, -1, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, -1, -1, + -1, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, -1, 132, -1, 134, 135, 136, + -1, -1, 7, 8, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 19, 20, 153, 22, 23, 24, + 25, -1, -1, -1, -1, 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 54, - 156, 157, -1, -1, 160, -1, 162, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 74, + -1, -1, -1, -1, -1, -1, -1, 7, 8, 54, + 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, + 20, -1, 22, 23, 24, -1, -1, -1, -1, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 156, 157, -1, -1, 160, - -1, 162, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, -1, 130, -1, 132, 133, 134, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 49, + 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, + 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, + -1, -1, -1, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, -1, 132, -1, 134, + 135, 136, 49, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 153, -1, + 7, 8, 157, -1, 159, -1, -1, 162, -1, 164, + -1, 166, 19, 20, -1, 22, 23, 24, 25, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 40, 41, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 54, 158, 159, + -1, -1, 162, -1, 164, 165, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, -1, -1, -1, + -1, 158, 159, -1, -1, 162, -1, 164, 165, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, -1, 132, -1, 134, 135, 136, -1, -1, -1, -1, -1, -1, -1, -1, 3, 4, - -1, -1, -1, -1, 9, -1, 151, -1, -1, -1, - -1, -1, 157, -1, -1, 160, -1, 162, -1, 164, + -1, -1, -1, -1, 9, -1, 153, -1, -1, -1, + -1, -1, 159, -1, -1, 162, -1, 164, -1, 166, 25, 26, 27, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 58, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 74, + -1, 7, 8, 58, 10, 11, 12, 13, 14, 15, + 16, 17, -1, 19, 20, -1, 22, 23, 24, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, -1, -1, -1, -1, - -1, -1, 7, 8, -1, 10, 11, 12, 13, 14, - 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, - -1, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 39, 130, -1, 132, 133, 134, - -1, -1, 7, 8, 49, 10, 11, 12, 13, 14, - 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, - -1, -1, -1, 7, 8, 160, 10, 11, 12, 13, - 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, - 24, -1, -1, -1, 49, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 39, -1, -1, -1, -1, - -1, -1, -1, 7, 8, 49, 10, 11, 12, 13, + 85, 86, 87, 88, 89, 90, 91, 92, -1, -1, + -1, -1, -1, 49, 7, 8, -1, 10, 11, 12, + 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, + 23, 24, -1, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 39, 132, -1, 134, + 135, 136, -1, -1, -1, -1, 49, 7, 8, -1, + 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, + 20, -1, 22, 23, 24, 7, 8, 162, 10, 11, + 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, + 22, 23, 24, -1, -1, -1, -1, -1, -1, 49, + -1, -1, -1, -1, -1, -1, -1, 39, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 49, -1, -1, + -1, -1, 158, 159, -1, -1, 162, -1, 164, 165, + 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, + 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 158, 159, -1, -1, 162, + -1, 164, 49, -1, 124, 7, 8, -1, 10, 11, + 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, + 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 39, 158, 159, + -1, -1, 162, -1, 164, -1, -1, 49, -1, -1, + -1, -1, -1, -1, -1, -1, 158, 159, -1, -1, + 162, -1, 164, 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, 39, 22, 23, 24, -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, -1, - -1, 156, 157, -1, -1, 160, -1, 162, -1, -1, + -1, 158, 159, -1, 161, 162, -1, 164, -1, -1, -1, 7, 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 156, 157, -1, 159, 160, -1, 162, -1, -1, - -1, -1, -1, 49, -1, -1, -1, -1, -1, -1, - -1, -1, 156, 157, -1, -1, 160, -1, 162, 7, + -1, -1, -1, -1, -1, -1, 158, 159, -1, -1, + 162, -1, 164, 49, 7, 8, -1, 10, 11, 12, + 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, + 23, 24, 7, 8, -1, 10, 11, 12, 13, 14, + 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, + -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, + -1, -1, -1, -1, 158, 159, -1, -1, 162, -1, + 164, -1, -1, -1, 49, -1, -1, -1, -1, -1, + -1, -1, 158, 159, -1, -1, 162, -1, 164, 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 156, 157, -1, -1, 160, -1, 162, -1, - -1, 49, -1, -1, -1, -1, -1, -1, -1, -1, - 156, 157, -1, -1, 160, -1, 162, 7, 8, -1, - 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, - 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 156, 157, -1, -1, 160, -1, 162, 7, 8, 49, - 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, - 20, -1, 22, 23, 24, 7, 8, -1, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, -1, -1, -1, -1, -1, -1, 49, - -1, -1, -1, -1, -1, -1, -1, -1, 156, 157, - -1, -1, 160, -1, 162, 7, 8, 49, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, 7, 8, -1, 10, 11, 12, 13, - 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, - 24, -1, -1, -1, -1, 19, -1, 49, 22, -1, - 24, -1, -1, -1, -1, -1, 156, 157, -1, -1, - 160, -1, 162, -1, -1, 49, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 53, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 156, 157, -1, -1, - 160, -1, 162, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 156, 157, -1, -1, 160, -1, - 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 158, 159, -1, -1, 162, -1, 164, -1, + -1, 49, 7, 8, -1, 10, 11, 12, 13, 14, + 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 118, 119, -1, -1, -1, -1, - -1, -1, -1, -1, 156, 157, -1, -1, 160, 36, - 162, -1, 136, 137, -1, 139, 140, -1, 142, 143, - 144, -1, 156, 157, -1, -1, 160, -1, 162, 56, - 57, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 158, 159, -1, -1, 162, + -1, 164, -1, -1, 49, -1, -1, -1, -1, -1, + -1, -1, -1, 158, 159, -1, -1, 162, -1, 164, + 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, + 17, -1, 19, 20, -1, 22, 23, 24, 7, 8, + -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, + 19, 20, 36, 22, 23, 24, -1, -1, -1, -1, + -1, -1, 49, -1, -1, -1, -1, -1, -1, -1, + 158, 159, 56, 57, 162, -1, 164, -1, -1, -1, + 49, -1, -1, -1, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, + -1, -1, -1, 158, 159, -1, -1, 162, -1, 164, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 113, + 114, 115, -1, -1, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 111, 112, 113, -1, -1, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135 + -1, 158, 159, -1, -1, 162, -1, 164, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 158, + 159, -1, -1, 162, -1, 164 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -2594,68 +2620,71 @@ static const yytype_uint8 yystos[] = { 0, 19, 20, 22, 23, 24, 30, 31, 51, 55, - 59, 173, 176, 177, 178, 179, 211, 212, 213, 215, - 214, 52, 67, 220, 153, 58, 153, 18, 153, 42, - 43, 44, 45, 46, 47, 48, 50, 148, 149, 150, - 180, 181, 182, 0, 213, 46, 48, 183, 230, 42, - 43, 44, 47, 184, 227, 229, 237, 153, 153, 157, - 221, 22, 219, 7, 8, 10, 11, 12, 13, 14, - 15, 16, 17, 49, 156, 157, 160, 162, 173, 177, - 198, 199, 233, 182, 182, 35, 37, 209, 182, 182, - 21, 238, 239, 29, 163, 228, 238, 22, 22, 22, - 222, 151, 4, 4, 4, 162, 10, 163, 199, 204, - 54, 151, 175, 209, 209, 42, 44, 185, 32, 33, - 208, 61, 62, 63, 64, 65, 66, 186, 225, 225, - 176, 242, 154, 159, 39, 199, 200, 202, 203, 158, - 158, 163, 204, 154, 163, 151, 203, 155, 208, 208, - 10, 122, 199, 201, 210, 11, 12, 13, 14, 15, - 16, 171, 172, 199, 205, 4, 201, 28, 162, 226, + 59, 175, 178, 179, 180, 181, 213, 214, 215, 217, + 216, 52, 67, 222, 155, 58, 155, 18, 155, 42, + 43, 44, 45, 46, 47, 48, 50, 150, 151, 152, + 182, 183, 184, 0, 215, 46, 48, 185, 232, 42, + 43, 44, 47, 186, 229, 231, 239, 155, 155, 159, + 223, 22, 221, 7, 8, 10, 11, 12, 13, 14, + 15, 16, 17, 49, 158, 159, 162, 164, 175, 179, + 200, 201, 235, 184, 184, 35, 37, 211, 184, 184, + 21, 240, 241, 29, 165, 230, 240, 22, 22, 22, + 224, 153, 4, 4, 4, 164, 10, 165, 201, 206, + 54, 153, 177, 211, 211, 42, 44, 187, 32, 33, + 210, 61, 62, 63, 64, 65, 66, 188, 227, 227, + 178, 244, 156, 161, 39, 201, 202, 204, 205, 160, + 160, 165, 206, 156, 165, 153, 205, 157, 210, 210, + 10, 124, 201, 203, 212, 11, 12, 13, 14, 15, + 16, 173, 174, 201, 207, 4, 203, 28, 164, 228, 36, 56, 57, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 111, 112, 113, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 166, - 167, 168, 240, 246, 247, 248, 249, 22, 188, 154, - 152, 199, 199, 161, 163, 199, 4, 152, 205, 199, - 151, 233, 26, 27, 3, 4, 5, 6, 9, 25, - 40, 41, 89, 90, 116, 130, 132, 133, 134, 157, - 160, 162, 164, 166, 167, 168, 206, 233, 175, 177, - 56, 10, 199, 235, 236, 11, 17, 11, 171, 186, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 169, 26, 27, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 170, 199, 199, - 235, 199, 199, 243, 235, 235, 235, 235, 235, 199, - 199, 199, 235, 186, 114, 115, 53, 118, 119, 136, - 137, 139, 140, 142, 143, 144, 187, 39, 200, 190, - 159, 161, 161, 152, 190, 175, 175, 210, 169, 170, - 151, 151, 151, 151, 151, 159, 205, 207, 162, 207, - 163, 207, 22, 151, 151, 151, 216, 151, 3, 4, - 9, 25, 26, 27, 40, 41, 58, 160, 206, 232, - 233, 234, 154, 234, 234, 234, 201, 199, 199, 154, - 193, 154, 193, 234, 157, 154, 154, 154, 154, 154, - 154, 234, 234, 234, 38, 201, 199, 235, 4, 136, - 137, 138, 141, 145, 146, 189, 217, 218, 38, 151, - 151, 205, 205, 205, 205, 205, 154, 159, 163, 199, - 207, 161, 163, 205, 205, 205, 154, 196, 39, 199, - 223, 224, 60, 231, 207, 235, 154, 154, 234, 234, - 234, 11, 53, 11, 245, 234, 157, 235, 199, 235, - 235, 235, 154, 154, 154, 199, 234, 234, 154, 196, - 196, 199, 205, 205, 245, 154, 154, 154, 154, 205, - 161, 163, 154, 154, 38, 34, 53, 194, 197, 188, - 154, 152, 22, 161, 17, 17, 151, 154, 154, 234, - 4, 234, 154, 154, 234, 154, 154, 154, 4, 234, - 234, 151, 154, 193, 199, 152, 154, 154, 152, 205, - 205, 205, 205, 161, 205, 205, 199, 22, 4, 196, - 173, 174, 39, 199, 190, 154, 234, 234, 17, 199, - 244, 234, 234, 193, 193, 235, 234, 154, 235, 235, - 235, 244, 234, 205, 205, 154, 152, 154, 154, 152, - 152, 152, 188, 194, 195, 22, 154, 157, 188, 188, - 152, 154, 159, 234, 152, 193, 152, 152, 205, 205, - 205, 174, 53, 192, 17, 159, 171, 241, 118, 119, - 234, 234, 190, 17, 199, 159, 190, 152, 152, 152, - 4, 147, 191, 234, 232, 159, 171, 188, 188, 38, - 188, 188, 22, 154, 232, 17, 234, 234, 17, 154, - 234, 188, 188, 234, 17, 72, 234, 17, 234 + 85, 86, 87, 88, 89, 90, 91, 92, 113, 114, + 115, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 168, 169, 170, 242, 248, 249, 250, 251, 22, + 190, 156, 154, 201, 201, 163, 165, 201, 4, 154, + 207, 201, 153, 235, 26, 27, 3, 4, 5, 6, + 9, 25, 40, 41, 89, 90, 91, 92, 118, 132, + 134, 135, 136, 159, 162, 164, 166, 168, 169, 170, + 208, 235, 177, 179, 56, 10, 201, 237, 238, 11, + 17, 11, 173, 188, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 171, 26, 27, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 172, 171, 172, 201, 201, 237, 201, 201, 245, + 237, 237, 237, 237, 237, 201, 201, 201, 237, 188, + 116, 117, 53, 120, 121, 138, 139, 141, 142, 144, + 145, 146, 189, 39, 202, 192, 161, 163, 163, 154, + 192, 177, 177, 212, 171, 172, 171, 172, 153, 153, + 153, 153, 153, 161, 207, 209, 164, 209, 165, 209, + 22, 153, 153, 153, 218, 153, 3, 4, 9, 25, + 26, 27, 40, 41, 58, 162, 208, 234, 235, 236, + 156, 236, 236, 236, 203, 201, 201, 201, 201, 156, + 195, 156, 195, 236, 159, 156, 156, 156, 156, 156, + 156, 236, 236, 236, 38, 203, 201, 237, 4, 138, + 139, 140, 143, 147, 148, 191, 219, 220, 38, 153, + 153, 153, 153, 207, 207, 207, 207, 207, 156, 161, + 165, 201, 209, 163, 165, 207, 207, 207, 156, 198, + 39, 201, 225, 226, 60, 233, 209, 237, 156, 156, + 236, 236, 236, 236, 236, 11, 53, 11, 247, 236, + 159, 237, 201, 237, 237, 237, 156, 156, 156, 201, + 236, 236, 156, 198, 198, 201, 207, 207, 207, 207, + 247, 156, 156, 156, 156, 207, 163, 165, 156, 156, + 38, 34, 53, 196, 199, 190, 156, 154, 22, 163, + 17, 17, 153, 156, 156, 156, 156, 236, 4, 236, + 156, 156, 236, 156, 156, 156, 4, 236, 236, 153, + 156, 195, 201, 154, 156, 156, 156, 156, 154, 207, + 207, 207, 207, 163, 207, 207, 201, 22, 4, 198, + 175, 176, 39, 201, 192, 156, 236, 236, 17, 201, + 246, 236, 236, 236, 236, 195, 195, 237, 236, 156, + 237, 237, 237, 246, 236, 207, 207, 207, 207, 156, + 154, 156, 156, 154, 154, 154, 190, 196, 197, 22, + 156, 159, 190, 190, 154, 156, 161, 236, 154, 195, + 154, 154, 154, 154, 207, 207, 207, 176, 53, 194, + 17, 161, 173, 243, 120, 121, 236, 236, 192, 17, + 201, 161, 192, 154, 154, 154, 4, 149, 193, 236, + 234, 161, 173, 190, 190, 38, 190, 190, 22, 156, + 234, 17, 236, 236, 17, 156, 236, 190, 190, 236, + 17, 72, 236, 17, 236 }; #define yyerrok (yyerrstatus = 0) @@ -3470,152 +3499,152 @@ switch (yyn) { case 29: -#line 1117 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1117 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} break; case 30: -#line 1117 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1117 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} break; case 31: -#line 1118 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1118 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} break; case 32: -#line 1118 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1118 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} break; case 33: -#line 1119 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1119 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} break; case 34: -#line 1119 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1119 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} break; case 35: -#line 1120 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1120 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} break; case 36: -#line 1120 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1120 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} break; case 37: -#line 1121 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1121 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} break; case 38: -#line 1121 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1121 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} break; case 39: -#line 1125 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1125 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} break; case 40: -#line 1125 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1125 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} break; case 41: -#line 1126 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1126 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} break; case 42: -#line 1126 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1126 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} break; case 43: -#line 1127 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1127 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} break; case 44: -#line 1127 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1127 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} break; case 45: -#line 1128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1128 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} break; case 46: -#line 1128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1128 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} break; case 47: -#line 1129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1129 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} break; case 48: -#line 1129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1129 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} break; case 49: -#line 1130 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1130 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} break; case 50: -#line 1130 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1130 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} break; case 51: -#line 1131 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1131 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} break; case 52: -#line 1131 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1131 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} break; case 53: -#line 1132 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1132 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} break; case 54: -#line 1133 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1133 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} break; case 65: -#line 1142 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1142 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 66: -#line 1144 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1144 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;} break; case 67: -#line 1145 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1145 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=0; ;} break; case 68: -#line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3623,7 +3652,7 @@ break; case 69: -#line 1153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1153 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3631,7 +3660,7 @@ break; case 73: -#line 1161 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1161 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3639,7 +3668,7 @@ break; case 74: -#line 1166 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1166 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3647,152 +3676,152 @@ break; case 75: -#line 1172 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1172 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 76: -#line 1173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1173 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 77: -#line 1174 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1174 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 78: -#line 1175 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1175 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 79: -#line 1176 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1176 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 80: -#line 1180 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1180 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 81: -#line 1181 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1181 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 82: -#line 1182 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1182 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 83: -#line 1186 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1186 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 84: -#line 1187 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1187 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 85: -#line 1188 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1188 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} break; case 86: -#line 1189 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1189 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} break; case 87: -#line 1193 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1193 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 88: -#line 1194 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1194 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 89: -#line 1195 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1195 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 90: -#line 1199 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1199 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 91: -#line 1200 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1200 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 92: -#line 1201 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1201 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 93: -#line 1202 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1202 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 94: -#line 1203 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1203 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 95: -#line 1207 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1207 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 96: -#line 1208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1208 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 97: -#line 1209 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1209 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 98: -#line 1212 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1212 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 99: -#line 1213 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1213 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 100: -#line 1214 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1214 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 101: -#line 1215 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1215 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 102: -#line 1216 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1216 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; case 103: -#line 1217 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1217 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} break; case 104: -#line 1218 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1218 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) GEN_ERROR("Calling conv too large"); @@ -3802,129 +3831,129 @@ break; case 105: -#line 1225 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1225 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 106: -#line 1226 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1226 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 107: -#line 1227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1227 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 108: -#line 1228 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1228 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 109: -#line 1229 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1229 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::InReg; ;} break; case 110: -#line 1230 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1230 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} break; case 111: -#line 1231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1231 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;} break; case 112: -#line 1232 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1232 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ByVal; ;} break; case 113: -#line 1233 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1233 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::Nest; ;} break; case 114: -#line 1234 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1234 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;} break; case 115: -#line 1238 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1238 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 116: -#line 1239 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1239 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); ;} break; case 117: -#line 1244 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1244 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} break; case 118: -#line 1245 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1245 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} break; case 119: -#line 1246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1246 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 120: -#line 1247 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1247 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 121: -#line 1248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1248 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;} break; case 122: -#line 1249 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1249 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;} break; case 123: -#line 1252 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1252 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 124: -#line 1253 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1253 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); ;} break; case 125: -#line 1258 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1258 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 126: -#line 1259 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1259 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); ;} break; case 127: -#line 1266 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1266 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 128: -#line 1267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1267 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3934,12 +3963,12 @@ break; case 129: -#line 1273 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1273 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 130: -#line 1274 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1274 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3949,7 +3978,7 @@ break; case 131: -#line 1283 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1283 "/llvm/lib/AsmParser/llvmAsmParser.y" { for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i) if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\') @@ -3960,27 +3989,27 @@ break; case 132: -#line 1291 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1291 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 133: -#line 1292 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1292 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} break; case 134: -#line 1297 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1297 "/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 135: -#line 1298 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1298 "/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 136: -#line 1299 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1299 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV->setSection(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -3989,7 +4018,7 @@ break; case 137: -#line 1304 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1304 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Alignment must be a power of two"); @@ -3999,7 +4028,7 @@ break; case 145: -#line 1320 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1320 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR @@ -4007,7 +4036,7 @@ break; case 146: -#line 1324 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1324 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); CHECK_FOR_ERROR @@ -4015,7 +4044,7 @@ break; case 147: -#line 1328 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1328 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Pointer type? if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); @@ -4026,7 +4055,7 @@ break; case 148: -#line 1335 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1335 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); CHECK_FOR_ERROR @@ -4035,7 +4064,7 @@ break; case 149: -#line 1340 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1340 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Type UpReference if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder @@ -4047,7 +4076,7 @@ break; case 150: -#line 1348 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1348 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4080,7 +4109,7 @@ break; case 151: -#line 1377 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1377 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4108,7 +4137,7 @@ break; case 152: -#line 1402 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1402 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Sized array type? (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); delete (yyvsp[(4) - (5)].TypeVal); @@ -4117,7 +4146,7 @@ break; case 153: -#line 1407 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1407 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Vector type? const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) @@ -4131,7 +4160,7 @@ break; case 154: -#line 1417 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1417 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), @@ -4145,7 +4174,7 @@ break; case 155: -#line 1427 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1427 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR @@ -4153,7 +4182,7 @@ break; case 156: -#line 1431 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1431 "/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements; for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), @@ -4167,7 +4196,7 @@ break; case 157: -#line 1441 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1441 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); CHECK_FOR_ERROR @@ -4175,7 +4204,7 @@ break; case 158: -#line 1448 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1448 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4185,7 +4214,7 @@ break; case 159: -#line 1457 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1457 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); @@ -4196,14 +4225,14 @@ break; case 160: -#line 1464 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1464 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); ;} break; case 161: -#line 1469 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1469 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); @@ -4212,7 +4241,7 @@ break; case 162: -#line 1474 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1474 "/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); CHECK_FOR_ERROR @@ -4220,7 +4249,7 @@ break; case 164: -#line 1482 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1482 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -4231,7 +4260,7 @@ break; case 165: -#line 1489 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1489 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -4242,7 +4271,7 @@ break; case 166: -#line 1496 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1496 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR @@ -4250,7 +4279,7 @@ break; case 167: -#line 1504 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1504 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); @@ -4260,7 +4289,7 @@ break; case 168: -#line 1510 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1510 "/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); delete (yyvsp[(3) - (3)].TypeVal); @@ -4269,7 +4298,7 @@ break; case 169: -#line 1522 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1522 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4301,7 +4330,7 @@ break; case 170: -#line 1550 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1550 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4321,7 +4350,7 @@ break; case 171: -#line 1566 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1566 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4352,7 +4381,7 @@ break; case 172: -#line 1593 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1593 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4384,7 +4413,7 @@ break; case 173: -#line 1621 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1621 "/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (STy == 0) @@ -4414,7 +4443,7 @@ break; case 174: -#line 1647 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1647 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4438,7 +4467,7 @@ break; case 175: -#line 1667 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1667 "/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); if (STy == 0) @@ -4468,7 +4497,7 @@ break; case 176: -#line 1693 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1693 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); @@ -4492,7 +4521,7 @@ break; case 177: -#line 1713 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1713 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4508,7 +4537,7 @@ break; case 178: -#line 1725 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1725 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4519,7 +4548,7 @@ break; case 179: -#line 1732 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1732 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4589,7 +4618,7 @@ break; case 180: -#line 1798 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1798 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4603,7 +4632,7 @@ break; case 181: -#line 1808 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1808 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4617,7 +4646,7 @@ break; case 182: -#line 1818 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1818 "/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4627,7 +4656,7 @@ break; case 183: -#line 1824 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1824 "/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4641,7 +4670,7 @@ break; case 184: -#line 1834 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1834 "/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4651,7 +4680,7 @@ break; case 185: -#line 1840 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1840 "/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4665,7 +4694,7 @@ break; case 186: -#line 1850 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1850 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); (yyval.ConstVal) = ConstantInt::getTrue(); @@ -4674,7 +4703,7 @@ break; case 187: -#line 1855 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1855 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); (yyval.ConstVal) = ConstantInt::getFalse(); @@ -4683,7 +4712,7 @@ break; case 188: -#line 1860 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1860 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Floating point constants if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal))) GEN_ERROR("Floating point constant invalid for type"); @@ -4698,7 +4727,7 @@ break; case 189: -#line 1873 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1873 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); @@ -4714,7 +4743,7 @@ break; case 190: -#line 1885 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1885 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); @@ -4740,7 +4769,7 @@ break; case 191: -#line 1907 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1907 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); @@ -4752,7 +4781,7 @@ break; case 192: -#line 1915 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1915 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Binary operator types must match"); @@ -4762,7 +4791,7 @@ break; case 193: -#line 1921 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1921 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Logical operator types must match"); @@ -4777,7 +4806,7 @@ break; case 194: -#line 1932 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1932 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("icmp operand types must match"); @@ -4786,7 +4815,7 @@ break; case 195: -#line 1937 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1937 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match"); @@ -4795,7 +4824,25 @@ break; case 196: -#line 1942 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1942 "/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) + GEN_ERROR("vicmp operand types must match"); + (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); + ;} + break; + + case 197: +#line 1947 "/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) + GEN_ERROR("vfcmp operand types must match"); + (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); + ;} + break; + + case 198: +#line 1952 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) GEN_ERROR("Invalid extractelement operands"); @@ -4804,8 +4851,8 @@ ;} break; - case 197: -#line 1948 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 199: +#line 1958 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid insertelement operands"); @@ -4814,8 +4861,8 @@ ;} break; - case 198: -#line 1954 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 200: +#line 1964 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -4824,16 +4871,16 @@ ;} break; - case 199: -#line 1963 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 201: +#line 1973 "/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); CHECK_FOR_ERROR ;} break; - case 200: -#line 1967 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 202: +#line 1977 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); @@ -4841,28 +4888,28 @@ ;} break; - case 201: -#line 1975 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 203: +#line 1985 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; - case 202: -#line 1975 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 204: +#line 1985 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; - case 203: -#line 1978 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 205: +#line 1988 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; - case 204: -#line 1978 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 206: +#line 1988 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; - case 205: -#line 1981 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 207: +#line 1991 "/llvm/lib/AsmParser/llvmAsmParser.y" { const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); @@ -4877,8 +4924,8 @@ ;} break; - case 206: -#line 1993 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 208: +#line 2003 "/llvm/lib/AsmParser/llvmAsmParser.y" { Constant *Val = (yyvsp[(3) - (6)].ConstVal); const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); @@ -4893,8 +4940,8 @@ ;} break; - case 207: -#line 2014 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 209: +#line 2024 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -4902,8 +4949,8 @@ ;} break; - case 208: -#line 2019 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 210: +#line 2029 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -4911,40 +4958,40 @@ ;} break; - case 211: -#line 2032 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 213: +#line 2042 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = false; ;} break; - case 212: -#line 2032 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 214: +#line 2042 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.FunctionDone(); CHECK_FOR_ERROR ;} break; - case 213: -#line 2036 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 215: +#line 2046 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; - case 214: -#line 2036 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 216: +#line 2046 "/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 215: -#line 2039 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 217: +#line 2049 "/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 216: -#line 2042 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 218: +#line 2052 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); @@ -4971,8 +5018,8 @@ ;} break; - case 217: -#line 2066 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 219: +#line 2076 "/llvm/lib/AsmParser/llvmAsmParser.y" { ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); @@ -4986,8 +5033,8 @@ ;} break; - case 218: -#line 2078 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 220: +#line 2088 "/llvm/lib/AsmParser/llvmAsmParser.y" { /* "Externally Visible" Linkage */ if ((yyvsp[(5) - (6)].ConstVal) == 0) @@ -4998,15 +5045,15 @@ ;} break; - case 219: -#line 2085 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 221: +#line 2095 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; - case 220: -#line 2089 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 222: +#line 2099 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(6) - (7)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); @@ -5015,15 +5062,15 @@ ;} break; - case 221: -#line 2094 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 223: +#line 2104 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; - case 222: -#line 2098 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 224: +#line 2108 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription()); @@ -5033,16 +5080,16 @@ ;} break; - case 223: -#line 2104 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 225: +#line 2114 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR ;} break; - case 224: -#line 2108 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 226: +#line 2118 "/llvm/lib/AsmParser/llvmAsmParser.y" { std::string Name; if ((yyvsp[(1) - (5)].StrVal)) { @@ -5085,22 +5132,22 @@ ;} break; - case 225: -#line 2148 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 227: +#line 2158 "/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 226: -#line 2151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 228: +#line 2161 "/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 227: -#line 2157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 229: +#line 2167 "/llvm/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); if (AsmSoFar.empty()) @@ -5112,24 +5159,24 @@ ;} break; - case 228: -#line 2167 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 230: +#line 2177 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); ;} break; - case 229: -#line 2171 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 231: +#line 2181 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); ;} break; - case 231: -#line 2178 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 233: +#line 2188 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5137,8 +5184,8 @@ ;} break; - case 232: -#line 2183 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 234: +#line 2193 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5146,15 +5193,15 @@ ;} break; - case 233: -#line 2188 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 235: +#line 2198 "/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 234: -#line 2197 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 236: +#line 2207 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -5167,8 +5214,8 @@ ;} break; - case 235: -#line 2207 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 237: +#line 2217 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -5181,16 +5228,16 @@ ;} break; - case 236: -#line 2218 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 238: +#line 2228 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); CHECK_FOR_ERROR ;} break; - case 237: -#line 2222 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 239: +#line 2232 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); struct ArgListEntry E; @@ -5202,8 +5249,8 @@ ;} break; - case 238: -#line 2231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 240: +#line 2241 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new ArgListType; struct ArgListEntry E; @@ -5215,16 +5262,16 @@ ;} break; - case 239: -#line 2240 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 241: +#line 2250 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR ;} break; - case 240: -#line 2246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 242: +#line 2256 "/llvm/lib/AsmParser/llvmAsmParser.y" { std::string FunctionName(*(yyvsp[(3) - (10)].StrVal)); delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory! @@ -5354,8 +5401,8 @@ ;} break; - case 243: -#line 2376 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 245: +#line 2386 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5366,16 +5413,16 @@ ;} break; - case 246: -#line 2387 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 248: +#line 2397 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR ;} break; - case 247: -#line 2392 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 249: +#line 2402 "/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); @@ -5385,88 +5432,88 @@ ;} break; - case 248: -#line 2404 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 250: +#line 2414 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 249: -#line 2408 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 251: +#line 2418 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 250: -#line 2413 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 252: +#line 2423 "/llvm/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); CHECK_FOR_ERROR ;} break; - case 251: -#line 2417 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 253: +#line 2427 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); CHECK_FOR_ERROR ;} break; - case 252: -#line 2421 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 254: +#line 2431 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); CHECK_FOR_ERROR ;} break; - case 253: -#line 2425 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 255: +#line 2435 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR ;} break; - case 254: -#line 2429 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 256: +#line 2439 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR ;} break; - case 255: -#line 2433 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 257: +#line 2443 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR ;} break; - case 256: -#line 2437 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 258: +#line 2447 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR ;} break; - case 257: -#line 2441 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 259: +#line 2451 "/llvm/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR ;} break; - case 258: -#line 2445 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 260: +#line 2455 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); int NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5494,16 +5541,16 @@ ;} break; - case 259: -#line 2470 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 261: +#line 2480 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR ;} break; - case 260: -#line 2474 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 262: +#line 2484 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal)); delete (yyvsp[(3) - (5)].StrVal); @@ -5512,24 +5559,24 @@ ;} break; - case 261: -#line 2484 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 263: +#line 2494 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR ;} break; - case 262: -#line 2488 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 264: +#line 2498 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR ;} break; - case 263: -#line 2492 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 265: +#line 2502 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5537,8 +5584,8 @@ ;} break; - case 264: -#line 2497 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 266: +#line 2507 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5546,8 +5593,8 @@ ;} break; - case 267: -#line 2510 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 269: +#line 2520 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -5557,8 +5604,8 @@ ;} break; - case 268: -#line 2519 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 270: +#line 2529 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); @@ -5566,32 +5613,32 @@ ;} break; - case 269: -#line 2524 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 271: +#line 2534 "/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal)); CHECK_FOR_ERROR ;} break; - case 270: -#line 2529 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 272: +#line 2539 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR ;} break; - case 271: -#line 2533 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 273: +#line 2543 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR ;} break; - case 272: -#line 2542 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 274: +#line 2552 "/llvm/lib/AsmParser/llvmAsmParser.y" { setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); CHECK_FOR_ERROR @@ -5602,8 +5649,8 @@ ;} break; - case 273: -#line 2551 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 275: +#line 2561 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) @@ -5615,16 +5662,16 @@ ;} break; - case 274: -#line 2560 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 276: +#line 2570 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty space between instruction lists (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); CHECK_FOR_ERROR ;} break; - case 275: -#line 2564 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 277: +#line 2574 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Labelled (named) basic block (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal))); delete (yyvsp[(1) - (1)].StrVal); @@ -5633,8 +5680,8 @@ ;} break; - case 276: -#line 2572 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 278: +#line 2582 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with a result... ValueList &VL = *(yyvsp[(2) - (2)].ValueList); assert(!VL.empty() && "Invalid ret operands!"); @@ -5644,16 +5691,16 @@ ;} break; - case 277: -#line 2579 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 279: +#line 2589 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = ReturnInst::Create(); CHECK_FOR_ERROR ;} break; - case 278: -#line 2583 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 280: +#line 2593 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); CHECK_FOR_ERROR @@ -5661,8 +5708,8 @@ ;} break; - case 279: -#line 2588 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 281: +#line 2598 "/llvm/lib/AsmParser/llvmAsmParser.y" { assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?"); BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal)); @@ -5675,8 +5722,8 @@ ;} break; - case 280: -#line 2598 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 282: +#line 2608 "/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR @@ -5698,8 +5745,8 @@ ;} break; - case 281: -#line 2617 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 283: +#line 2627 "/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); CHECK_FOR_ERROR @@ -5711,8 +5758,8 @@ ;} break; - case 282: -#line 2627 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 284: +#line 2637 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -5799,24 +5846,24 @@ ;} break; - case 283: -#line 2711 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 285: +#line 2721 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR ;} break; - case 284: -#line 2715 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 286: +#line 2725 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR ;} break; - case 285: -#line 2722 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 287: +#line 2732 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); @@ -5830,8 +5877,8 @@ ;} break; - case 286: -#line 2733 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 288: +#line 2743 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); @@ -5846,8 +5893,8 @@ ;} break; - case 287: -#line 2746 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 289: +#line 2756 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); @@ -5858,8 +5905,8 @@ ;} break; - case 288: -#line 2756 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 290: +#line 2766 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); @@ -5873,8 +5920,8 @@ ;} break; - case 289: -#line 2767 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 291: +#line 2777 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); @@ -5885,8 +5932,8 @@ ;} break; - case 290: -#line 2777 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 292: +#line 2787 "/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -5900,8 +5947,8 @@ ;} break; - case 291: -#line 2788 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 293: +#line 2798 "/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 // Labels are only valid in ASMs @@ -5912,8 +5959,8 @@ ;} break; - case 292: -#line 2796 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 294: +#line 2806 "/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -5926,8 +5973,8 @@ ;} break; - case 293: -#line 2806 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 295: +#line 2816 "/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); @@ -5937,18 +5984,18 @@ ;} break; - case 294: -#line 2813 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 296: +#line 2823 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamList) = new ParamList(); ;} break; - case 295: -#line 2816 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 297: +#line 2826 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); ;} break; - case 296: -#line 2817 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 298: +#line 2827 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); @@ -5956,24 +6003,24 @@ ;} break; - case 297: -#line 2824 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 299: +#line 2834 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 298: -#line 2828 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 300: +#line 2838 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 299: -#line 2833 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 301: +#line 2843 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -5992,8 +6039,8 @@ ;} break; - case 300: -#line 2849 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 302: +#line 2859 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6013,8 +6060,8 @@ ;} break; - case 301: -#line 2866 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 303: +#line 2876 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6031,8 +6078,8 @@ ;} break; - case 302: -#line 2880 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 304: +#line 2890 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6049,8 +6096,44 @@ ;} break; - case 303: -#line 2894 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 305: +#line 2904 "/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!UpRefs.empty()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); + if (!isa((*(yyvsp[(3) - (6)].TypeVal)).get())) + GEN_ERROR("Scalar types not supported by vicmp instruction"); + Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); + CHECK_FOR_ERROR + Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); + CHECK_FOR_ERROR + (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2); + if ((yyval.InstVal) == 0) + GEN_ERROR("icmp operator returned null"); + delete (yyvsp[(3) - (6)].TypeVal); + ;} + break; + + case 306: +#line 2918 "/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!UpRefs.empty()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); + if (!isa((*(yyvsp[(3) - (6)].TypeVal)).get())) + GEN_ERROR("Scalar types not supported by vfcmp instruction"); + Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); + CHECK_FOR_ERROR + Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); + CHECK_FOR_ERROR + (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2); + if ((yyval.InstVal) == 0) + GEN_ERROR("fcmp operator returned null"); + delete (yyvsp[(3) - (6)].TypeVal); + ;} + break; + + case 307: +#line 2932 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6065,8 +6148,8 @@ ;} break; - case 304: -#line 2906 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 308: +#line 2944 "/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty) GEN_ERROR("select condition must be boolean"); @@ -6077,8 +6160,8 @@ ;} break; - case 305: -#line 2914 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 309: +#line 2952 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6088,8 +6171,8 @@ ;} break; - case 306: -#line 2921 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 310: +#line 2959 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) GEN_ERROR("Invalid extractelement operands"); @@ -6098,8 +6181,8 @@ ;} break; - case 307: -#line 2927 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 311: +#line 2965 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid insertelement operands"); @@ -6108,8 +6191,8 @@ ;} break; - case 308: -#line 2933 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 312: +#line 2971 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -6118,8 +6201,8 @@ ;} break; - case 309: -#line 2939 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 313: +#line 2977 "/llvm/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) @@ -6137,8 +6220,8 @@ ;} break; - case 310: -#line 2955 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 314: +#line 2993 "/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6230,32 +6313,32 @@ ;} break; - case 311: -#line 3044 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 315: +#line 3082 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); CHECK_FOR_ERROR ;} break; - case 312: -#line 3049 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 316: +#line 3087 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 313: -#line 3053 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 317: +#line 3091 "/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 314: -#line 3060 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 318: +#line 3098 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6265,8 +6348,8 @@ ;} break; - case 315: -#line 3067 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 319: +#line 3105 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6277,8 +6360,8 @@ ;} break; - case 316: -#line 3075 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 320: +#line 3113 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6288,8 +6371,8 @@ ;} break; - case 317: -#line 3082 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 321: +#line 3120 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6300,8 +6383,8 @@ ;} break; - case 318: -#line 3090 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 322: +#line 3128 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + @@ -6311,8 +6394,8 @@ ;} break; - case 319: -#line 3098 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 323: +#line 3136 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -6329,8 +6412,8 @@ ;} break; - case 320: -#line 3112 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 324: +#line 3150 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); @@ -6350,8 +6433,8 @@ ;} break; - case 321: -#line 3129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 325: +#line 3167 "/llvm/lib/AsmParser/llvmAsmParser.y" { Value *TmpVal = getVal((yyvsp[(2) - (5)].TypeVal)->get(), (yyvsp[(3) - (5)].ValIDVal)); if (!GetResultInst::isValidOperands(TmpVal, (yyvsp[(5) - (5)].UInt64Val))) @@ -6362,8 +6445,8 @@ ;} break; - case 322: -#line 3137 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 326: +#line 3175 "/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); @@ -6383,7 +6466,7 @@ /* Line 1267 of yacc.c. */ -#line 6387 "llvmAsmParser.tab.c" +#line 6470 "llvmAsmParser.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -6597,7 +6680,7 @@ } -#line 3154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3192 "/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Mon May 12 14:01:56 2008 @@ -127,66 +127,68 @@ ASHR = 343, ICMP = 344, FCMP = 345, - EQ = 346, - NE = 347, - SLT = 348, - SGT = 349, - SLE = 350, - SGE = 351, - ULT = 352, - UGT = 353, - ULE = 354, - UGE = 355, - OEQ = 356, - ONE = 357, - OLT = 358, - OGT = 359, - OLE = 360, - OGE = 361, - ORD = 362, - UNO = 363, - UEQ = 364, - UNE = 365, - MALLOC = 366, - ALLOCA = 367, - FREE = 368, - LOAD = 369, - STORE = 370, - GETELEMENTPTR = 371, - TRUNC = 372, - ZEXT = 373, - SEXT = 374, - FPTRUNC = 375, - FPEXT = 376, - BITCAST = 377, - UITOFP = 378, - SITOFP = 379, - FPTOUI = 380, - FPTOSI = 381, - INTTOPTR = 382, - PTRTOINT = 383, - PHI_TOK = 384, - SELECT = 385, - VAARG = 386, - EXTRACTELEMENT = 387, - INSERTELEMENT = 388, - SHUFFLEVECTOR = 389, - GETRESULT = 390, - SIGNEXT = 391, - ZEROEXT = 392, - NORETURN = 393, - INREG = 394, - SRET = 395, - NOUNWIND = 396, - NOALIAS = 397, - BYVAL = 398, - NEST = 399, - READNONE = 400, - READONLY = 401, - GC = 402, - DEFAULT = 403, - HIDDEN = 404, - PROTECTED = 405 + VICMP = 346, + VFCMP = 347, + EQ = 348, + NE = 349, + SLT = 350, + SGT = 351, + SLE = 352, + SGE = 353, + ULT = 354, + UGT = 355, + ULE = 356, + UGE = 357, + OEQ = 358, + ONE = 359, + OLT = 360, + OGT = 361, + OLE = 362, + OGE = 363, + ORD = 364, + UNO = 365, + UEQ = 366, + UNE = 367, + MALLOC = 368, + ALLOCA = 369, + FREE = 370, + LOAD = 371, + STORE = 372, + GETELEMENTPTR = 373, + TRUNC = 374, + ZEXT = 375, + SEXT = 376, + FPTRUNC = 377, + FPEXT = 378, + BITCAST = 379, + UITOFP = 380, + SITOFP = 381, + FPTOUI = 382, + FPTOSI = 383, + INTTOPTR = 384, + PTRTOINT = 385, + PHI_TOK = 386, + SELECT = 387, + VAARG = 388, + EXTRACTELEMENT = 389, + INSERTELEMENT = 390, + SHUFFLEVECTOR = 391, + GETRESULT = 392, + SIGNEXT = 393, + ZEROEXT = 394, + NORETURN = 395, + INREG = 396, + SRET = 397, + NOUNWIND = 398, + NOALIAS = 399, + BYVAL = 400, + NEST = 401, + READNONE = 402, + READONLY = 403, + GC = 404, + DEFAULT = 405, + HIDDEN = 406, + PROTECTED = 407 }; #endif /* Tokens. */ @@ -278,73 +280,75 @@ #define ASHR 343 #define ICMP 344 #define FCMP 345 -#define EQ 346 -#define NE 347 -#define SLT 348 -#define SGT 349 -#define SLE 350 -#define SGE 351 -#define ULT 352 -#define UGT 353 -#define ULE 354 -#define UGE 355 -#define OEQ 356 -#define ONE 357 -#define OLT 358 -#define OGT 359 -#define OLE 360 -#define OGE 361 -#define ORD 362 -#define UNO 363 -#define UEQ 364 -#define UNE 365 -#define MALLOC 366 -#define ALLOCA 367 -#define FREE 368 -#define LOAD 369 -#define STORE 370 -#define GETELEMENTPTR 371 -#define TRUNC 372 -#define ZEXT 373 -#define SEXT 374 -#define FPTRUNC 375 -#define FPEXT 376 -#define BITCAST 377 -#define UITOFP 378 -#define SITOFP 379 -#define FPTOUI 380 -#define FPTOSI 381 -#define INTTOPTR 382 -#define PTRTOINT 383 -#define PHI_TOK 384 -#define SELECT 385 -#define VAARG 386 -#define EXTRACTELEMENT 387 -#define INSERTELEMENT 388 -#define SHUFFLEVECTOR 389 -#define GETRESULT 390 -#define SIGNEXT 391 -#define ZEROEXT 392 -#define NORETURN 393 -#define INREG 394 -#define SRET 395 -#define NOUNWIND 396 -#define NOALIAS 397 -#define BYVAL 398 -#define NEST 399 -#define READNONE 400 -#define READONLY 401 -#define GC 402 -#define DEFAULT 403 -#define HIDDEN 404 -#define PROTECTED 405 +#define VICMP 346 +#define VFCMP 347 +#define EQ 348 +#define NE 349 +#define SLT 350 +#define SGT 351 +#define SLE 352 +#define SGE 353 +#define ULT 354 +#define UGT 355 +#define ULE 356 +#define UGE 357 +#define OEQ 358 +#define ONE 359 +#define OLT 360 +#define OGT 361 +#define OLE 362 +#define OGE 363 +#define ORD 364 +#define UNO 365 +#define UEQ 366 +#define UNE 367 +#define MALLOC 368 +#define ALLOCA 369 +#define FREE 370 +#define LOAD 371 +#define STORE 372 +#define GETELEMENTPTR 373 +#define TRUNC 374 +#define ZEXT 375 +#define SEXT 376 +#define FPTRUNC 377 +#define FPEXT 378 +#define BITCAST 379 +#define UITOFP 380 +#define SITOFP 381 +#define FPTOUI 382 +#define FPTOSI 383 +#define INTTOPTR 384 +#define PTRTOINT 385 +#define PHI_TOK 386 +#define SELECT 387 +#define VAARG 388 +#define EXTRACTELEMENT 389 +#define INSERTELEMENT 390 +#define SHUFFLEVECTOR 391 +#define GETRESULT 392 +#define SIGNEXT 393 +#define ZEROEXT 394 +#define NORETURN 395 +#define INREG 396 +#define SRET 397 +#define NOUNWIND 398 +#define NOALIAS 399 +#define BYVAL 400 +#define NEST 401 +#define READNONE 402 +#define READONLY 403 +#define GC 404 +#define DEFAULT 405 +#define HIDDEN 406 +#define PROTECTED 407 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 949 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 949 "/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -392,7 +396,7 @@ llvm::FCmpInst::Predicate FPredicate; } /* Line 1529 of yacc.c. */ -#line 396 "llvmAsmParser.tab.h" +#line 400 "llvmAsmParser.tab.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Mon May 12 14:01:56 2008 @@ -1075,7 +1075,7 @@ %token ADD SUB MUL UDIV SDIV FDIV UREM SREM FREM AND OR XOR %token SHL LSHR ASHR -%token ICMP FCMP +%token ICMP FCMP VICMP VFCMP %type IPredicates %type FPredicates %token EQ NE SLT SGT SLE SGE ULT UGT ULE UGE @@ -1939,6 +1939,16 @@ GEN_ERROR("fcmp operand types must match"); $$ = ConstantExpr::getFCmp($2, $4, $6); } + | VICMP IPredicates '(' ConstVal ',' ConstVal ')' { + if ($4->getType() != $6->getType()) + GEN_ERROR("vicmp operand types must match"); + $$ = ConstantExpr::getVICmp($2, $4, $6); + } + | VFCMP FPredicates '(' ConstVal ',' ConstVal ')' { + if ($4->getType() != $6->getType()) + GEN_ERROR("vfcmp operand types must match"); + $$ = ConstantExpr::getVFCmp($2, $4, $6); + } | EXTRACTELEMENT '(' ConstVal ',' ConstVal ')' { if (!ExtractElementInst::isValidOperands($3, $5)) GEN_ERROR("Invalid extractelement operands"); @@ -2891,6 +2901,34 @@ GEN_ERROR("fcmp operator returned null"); delete $3; } + | VICMP IPredicates Types ValueRef ',' ValueRef { + if (!UpRefs.empty()) + GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription()); + if (!isa((*$3).get())) + GEN_ERROR("Scalar types not supported by vicmp instruction"); + Value* tmpVal1 = getVal(*$3, $4); + CHECK_FOR_ERROR + Value* tmpVal2 = getVal(*$3, $6); + CHECK_FOR_ERROR + $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2); + if ($$ == 0) + GEN_ERROR("icmp operator returned null"); + delete $3; + } + | VFCMP FPredicates Types ValueRef ',' ValueRef { + if (!UpRefs.empty()) + GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription()); + if (!isa((*$3).get())) + GEN_ERROR("Scalar types not supported by vfcmp instruction"); + Value* tmpVal1 = getVal(*$3, $4); + CHECK_FOR_ERROR + Value* tmpVal2 = getVal(*$3, $6); + CHECK_FOR_ERROR + $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2); + if ($$ == 0) + GEN_ERROR("fcmp operator returned null"); + delete $3; + } | CastOps ResolvedVal TO Types { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$4)->getDescription()); Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Mon May 12 14:01:56 2008 @@ -1075,7 +1075,7 @@ %token ADD SUB MUL UDIV SDIV FDIV UREM SREM FREM AND OR XOR %token SHL LSHR ASHR -%token ICMP FCMP +%token ICMP FCMP VICMP VFCMP %type IPredicates %type FPredicates %token EQ NE SLT SGT SLE SGE ULT UGT ULE UGE @@ -1939,6 +1939,16 @@ GEN_ERROR("fcmp operand types must match"); $$ = ConstantExpr::getFCmp($2, $4, $6); } + | VICMP IPredicates '(' ConstVal ',' ConstVal ')' { + if ($4->getType() != $6->getType()) + GEN_ERROR("vicmp operand types must match"); + $$ = ConstantExpr::getVICmp($2, $4, $6); + } + | VFCMP FPredicates '(' ConstVal ',' ConstVal ')' { + if ($4->getType() != $6->getType()) + GEN_ERROR("vfcmp operand types must match"); + $$ = ConstantExpr::getVFCmp($2, $4, $6); + } | EXTRACTELEMENT '(' ConstVal ',' ConstVal ')' { if (!ExtractElementInst::isValidOperands($3, $5)) GEN_ERROR("Invalid extractelement operands"); @@ -2891,6 +2901,34 @@ GEN_ERROR("fcmp operator returned null"); delete $3; } + | VICMP IPredicates Types ValueRef ',' ValueRef { + if (!UpRefs.empty()) + GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription()); + if (!isa((*$3).get())) + GEN_ERROR("Scalar types not supported by vicmp instruction"); + Value* tmpVal1 = getVal(*$3, $4); + CHECK_FOR_ERROR + Value* tmpVal2 = getVal(*$3, $6); + CHECK_FOR_ERROR + $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2); + if ($$ == 0) + GEN_ERROR("icmp operator returned null"); + delete $3; + } + | VFCMP FPredicates Types ValueRef ',' ValueRef { + if (!UpRefs.empty()) + GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription()); + if (!isa((*$3).get())) + GEN_ERROR("Scalar types not supported by vfcmp instruction"); + Value* tmpVal1 = getVal(*$3, $4); + CHECK_FOR_ERROR + Value* tmpVal2 = getVal(*$3, $6); + CHECK_FOR_ERROR + $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2); + if ($$ == 0) + GEN_ERROR("fcmp operator returned null"); + delete $3; + } | CastOps ResolvedVal TO Types { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$4)->getDescription()); Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon May 12 14:01:56 2008 @@ -818,8 +818,12 @@ if (OpTy->isFloatingPoint()) V = ConstantExpr::getFCmp(Record[3], Op0, Op1); - else + else if (OpTy->isInteger()) V = ConstantExpr::getICmp(Record[3], Op0, Op1); + else if (OpTy->isFPOrFPVector()) + V = ConstantExpr::getVFCmp(Record[3], Op0, Op1); + else + V = ConstantExpr::getVICmp(Record[3], Op0, Op1); break; } case bitc::CST_CODE_INLINEASM: { @@ -1355,10 +1359,14 @@ OpNum+1 != Record.size()) return Error("Invalid CMP record"); - if (LHS->getType()->isFPOrFPVector()) + if (LHS->getType()->isInteger()) + I = new ICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, RHS); + else if (LHS->getType()->isFloatingPoint()) I = new FCmpInst((FCmpInst::Predicate)Record[OpNum], LHS, RHS); + else if (LHS->getType()->isFPOrFPVector()) + I = new VFCmpInst((FCmpInst::Predicate)Record[OpNum], LHS, RHS); else - I = new ICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, RHS); + I = new VICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, RHS); break; } case bitc::FUNC_CODE_INST_GETRESULT: { // GETRESULT: [ty, val, n] Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Mon May 12 14:01:56 2008 @@ -635,6 +635,8 @@ break; case Instruction::ICmp: case Instruction::FCmp: + case Instruction::VICmp: + case Instruction::VFCmp: Code = bitc::CST_CODE_CE_CMP; Record.push_back(VE.getTypeID(C->getOperand(0)->getType())); Record.push_back(VE.getValueID(C->getOperand(0))); @@ -740,6 +742,8 @@ break; case Instruction::ICmp: case Instruction::FCmp: + case Instruction::VICmp: + case Instruction::VFCmp: Code = bitc::FUNC_CODE_INST_CMP; PushValueAndType(I.getOperand(0), InstID, Vals, VE); Vals.push_back(VE.getValueID(I.getOperand(1))); Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Mon May 12 14:01:56 2008 @@ -1251,11 +1251,8 @@ Out << I.getOpcodeName(); // Print out the compare instruction predicates - if (const FCmpInst *FCI = dyn_cast(&I)) { - Out << " " << getPredicateText(FCI->getPredicate()); - } else if (const ICmpInst *ICI = dyn_cast(&I)) { - Out << " " << getPredicateText(ICI->getPredicate()); - } + if (const CmpInst *CI = dyn_cast(&I)) + Out << " " << getPredicateText(CI->getPredicate()); // Print out the type of the operands... const Value *Operand = I.getNumOperands() ? I.getOperand(0) : 0; Modified: llvm/trunk/lib/VMCore/Constants.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Constants.cpp (original) +++ llvm/trunk/lib/VMCore/Constants.cpp Mon May 12 14:01:56 2008 @@ -557,9 +557,9 @@ return User::operator new(s, 2); } unsigned short predicate; - CompareConstantExpr(Instruction::OtherOps opc, unsigned short pred, - Constant* LHS, Constant* RHS) - : ConstantExpr(Type::Int1Ty, opc, &Op<0>(), 2), predicate(pred) { + CompareConstantExpr(const Type *ty, Instruction::OtherOps opc, + unsigned short pred, Constant* LHS, Constant* RHS) + : ConstantExpr(ty, opc, &Op<0>(), 2), predicate(pred) { Op<0>().init(LHS, this); Op<1>().init(RHS, this); } @@ -690,7 +690,10 @@ return get(Instruction::Xor, C1, C2); } unsigned ConstantExpr::getPredicate() const { - assert(getOpcode() == Instruction::FCmp || getOpcode() == Instruction::ICmp); + assert(getOpcode() == Instruction::FCmp || + getOpcode() == Instruction::ICmp || + getOpcode() == Instruction::VFCmp || + getOpcode() == Instruction::VICmp); return ((const CompareConstantExpr*)this)->predicate; } Constant *ConstantExpr::getShl(Constant *C1, Constant *C2) { @@ -1564,10 +1567,16 @@ // value and it is combined with the instruction opcode by multiplying // the opcode by one hundred. We must decode this to get the predicate. if (V.opcode == Instruction::ICmp) - return new CompareConstantExpr(Instruction::ICmp, V.predicate, + return new CompareConstantExpr(Ty, Instruction::ICmp, V.predicate, V.operands[0], V.operands[1]); if (V.opcode == Instruction::FCmp) - return new CompareConstantExpr(Instruction::FCmp, V.predicate, + return new CompareConstantExpr(Ty, Instruction::FCmp, V.predicate, + V.operands[0], V.operands[1]); + if (V.opcode == Instruction::VICmp) + return new CompareConstantExpr(Ty, Instruction::VICmp, V.predicate, + V.operands[0], V.operands[1]); + if (V.opcode == Instruction::VFCmp) + return new CompareConstantExpr(Ty, Instruction::VFCmp, V.predicate, V.operands[0], V.operands[1]); assert(0 && "Invalid ConstantExpr!"); return 0; @@ -2029,6 +2038,79 @@ return ExprConstants->getOrCreate(Type::Int1Ty, Key); } +Constant * +ConstantExpr::getVICmp(unsigned short pred, Constant* LHS, Constant* RHS) { + assert(isa(LHS->getType()) && + "Tried to create vicmp operation on non-vector type!"); + assert(LHS->getType() == RHS->getType()); + assert(pred >= ICmpInst::FIRST_ICMP_PREDICATE && + pred <= ICmpInst::LAST_ICMP_PREDICATE && "Invalid VICmp Predicate"); + + const Type *VTy = cast(LHS->getType()); + const Type *EltTy = VTy->getElementType(); + unsigned NumElts = VTy->getNumElements(); + + SmallVector Elts; + for (unsigned i = 0; i != NumElts; ++i) { + Constant *FC = ConstantFoldCompareInstruction(pred, LHS->getOperand(i), + RHS->getOperand(i)); + if (FC) { + uint64_t Val = cast(FC)->getZExtValue(); + if (Val != 0ULL) + Elts.push_back(ConstantInt::getAllOnesValue(EltTy)); + else + Elts.push_back(ConstantInt::get(EltTy, 0ULL)); + } + } + if (Elts.size() == NumElts) + return ConstantVector::get(&Elts[0], Elts.size()); + + // Look up the constant in the table first to ensure uniqueness + std::vector ArgVec; + ArgVec.push_back(LHS); + ArgVec.push_back(RHS); + // Get the key type with both the opcode and predicate + const ExprMapKeyType Key(Instruction::VICmp, ArgVec, pred); + return ExprConstants->getOrCreate(LHS->getType(), Key); +} + +Constant * +ConstantExpr::getVFCmp(unsigned short pred, Constant* LHS, Constant* RHS) { + assert(isa(LHS->getType()) && + "Tried to create vfcmp operation on non-vector type!"); + assert(LHS->getType() == RHS->getType()); + assert(pred <= FCmpInst::LAST_FCMP_PREDICATE && "Invalid VFCmp Predicate"); + + const VectorType *VTy = cast(LHS->getType()); + unsigned NumElts = VTy->getNumElements(); + const Type *EltTy = VTy->getElementType(); + const Type *REltTy = IntegerType::get(EltTy->getPrimitiveSizeInBits()); + const Type *ResultTy = VectorType::get(REltTy, NumElts); + + SmallVector Elts; + for (unsigned i = 0; i != NumElts; ++i) { + Constant *FC = ConstantFoldCompareInstruction(pred, LHS->getOperand(i), + RHS->getOperand(i)); + if (FC) { + uint64_t Val = cast(FC)->getZExtValue(); + if (Val != 0ULL) + Elts.push_back(ConstantInt::getAllOnesValue(REltTy)); + else + Elts.push_back(ConstantInt::get(REltTy, 0ULL)); + } + } + if (Elts.size() == NumElts) + return ConstantVector::get(&Elts[0], Elts.size()); + + // Look up the constant in the table first to ensure uniqueness + std::vector ArgVec; + ArgVec.push_back(LHS); + ArgVec.push_back(RHS); + // Get the key type with both the opcode and predicate + const ExprMapKeyType Key(Instruction::VFCmp, ArgVec, pred); + return ExprConstants->getOrCreate(ResultTy, Key); +} + Constant *ConstantExpr::getExtractElementTy(const Type *ReqTy, Constant *Val, Constant *Idx) { if (Constant *FC = ConstantFoldExtractElementInstruction(Val, Idx)) Modified: llvm/trunk/lib/VMCore/Instruction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instruction.cpp?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instruction.cpp (original) +++ llvm/trunk/lib/VMCore/Instruction.cpp Mon May 12 14:01:56 2008 @@ -128,6 +128,8 @@ // Other instructions... case ICmp: return "icmp"; case FCmp: return "fcmp"; + case VICmp: return "vicmp"; + case VFCmp: return "vfcmp"; case PHI: return "phi"; case Select: return "select"; case Call: return "call"; Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=50985&r1=50984&r2=50985&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Mon May 12 14:01:56 2008 @@ -2332,9 +2332,10 @@ // CmpInst Classes //===----------------------------------------------------------------------===// -CmpInst::CmpInst(OtherOps op, unsigned short predicate, Value *LHS, Value *RHS, - const std::string &Name, Instruction *InsertBefore) - : Instruction(Type::Int1Ty, op, +CmpInst::CmpInst(const Type *ty, OtherOps op, unsigned short predicate, + Value *LHS, Value *RHS, const std::string &Name, + Instruction *InsertBefore) + : Instruction(ty, op, OperandTraits::op_begin(this), OperandTraits::operands(this), InsertBefore) { @@ -2342,34 +2343,12 @@ Op<1>().init(RHS, this); SubclassData = predicate; setName(Name); - if (op == Instruction::ICmp) { - assert(predicate >= ICmpInst::FIRST_ICMP_PREDICATE && - predicate <= ICmpInst::LAST_ICMP_PREDICATE && - "Invalid ICmp predicate value"); - const Type* Op0Ty = getOperand(0)->getType(); - const Type* Op1Ty = getOperand(1)->getType(); - assert(Op0Ty == Op1Ty && - "Both operands to ICmp instruction are not of the same type!"); - // Check that the operands are the right type - assert((Op0Ty->isInteger() || isa(Op0Ty)) && - "Invalid operand types for ICmp instruction"); - return; - } - assert(op == Instruction::FCmp && "Invalid CmpInst opcode"); - assert(predicate <= FCmpInst::LAST_FCMP_PREDICATE && - "Invalid FCmp predicate value"); - const Type* Op0Ty = getOperand(0)->getType(); - const Type* Op1Ty = getOperand(1)->getType(); - assert(Op0Ty == Op1Ty && - "Both operands to FCmp instruction are not of the same type!"); - // Check that the operands are the right type - assert(Op0Ty->isFloatingPoint() && - "Invalid operand types for FCmp instruction"); } -CmpInst::CmpInst(OtherOps op, unsigned short predicate, Value *LHS, Value *RHS, - const std::string &Name, BasicBlock *InsertAtEnd) - : Instruction(Type::Int1Ty, op, +CmpInst::CmpInst(const Type *ty, OtherOps op, unsigned short predicate, + Value *LHS, Value *RHS, const std::string &Name, + BasicBlock *InsertAtEnd) + : Instruction(ty, op, OperandTraits::op_begin(this), OperandTraits::operands(this), InsertAtEnd) { @@ -2377,52 +2356,44 @@ Op<1>().init(RHS, this); SubclassData = predicate; setName(Name); - if (op == Instruction::ICmp) { - assert(predicate >= ICmpInst::FIRST_ICMP_PREDICATE && - predicate <= ICmpInst::LAST_ICMP_PREDICATE && - "Invalid ICmp predicate value"); - - const Type* Op0Ty = getOperand(0)->getType(); - const Type* Op1Ty = getOperand(1)->getType(); - assert(Op0Ty == Op1Ty && - "Both operands to ICmp instruction are not of the same type!"); - // Check that the operands are the right type - assert((Op0Ty->isInteger() || isa(Op0Ty)) && - "Invalid operand types for ICmp instruction"); - return; - } - assert(op == Instruction::FCmp && "Invalid CmpInst opcode"); - assert(predicate <= FCmpInst::LAST_FCMP_PREDICATE && - "Invalid FCmp predicate value"); - const Type* Op0Ty = getOperand(0)->getType(); - const Type* Op1Ty = getOperand(1)->getType(); - assert(Op0Ty == Op1Ty && - "Both operands to FCmp instruction are not of the same type!"); - // Check that the operands are the right type - assert(Op0Ty->isFloatingPoint() && - "Invalid operand types for FCmp instruction"); } CmpInst * CmpInst::create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2, const std::string &Name, Instruction *InsertBefore) { if (Op == Instruction::ICmp) { - return new ICmpInst(ICmpInst::Predicate(predicate), S1, S2, Name, + return new ICmpInst(CmpInst::Predicate(predicate), S1, S2, Name, InsertBefore); } - return new FCmpInst(FCmpInst::Predicate(predicate), S1, S2, Name, - InsertBefore); + if (Op == Instruction::FCmp) { + return new FCmpInst(CmpInst::Predicate(predicate), S1, S2, Name, + InsertBefore); + } + if (Op == Instruction::VICmp) { + return new VICmpInst(CmpInst::Predicate(predicate), S1, S2, Name, + InsertBefore); + } + return new VFCmpInst(CmpInst::Predicate(predicate), S1, S2, Name, + InsertBefore); } CmpInst * CmpInst::create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2, const std::string &Name, BasicBlock *InsertAtEnd) { if (Op == Instruction::ICmp) { - return new ICmpInst(ICmpInst::Predicate(predicate), S1, S2, Name, + return new ICmpInst(CmpInst::Predicate(predicate), S1, S2, Name, InsertAtEnd); } - return new FCmpInst(FCmpInst::Predicate(predicate), S1, S2, Name, - InsertAtEnd); + if (Op == Instruction::FCmp) { + return new FCmpInst(CmpInst::Predicate(predicate), S1, S2, Name, + InsertAtEnd); + } + if (Op == Instruction::VICmp) { + return new VICmpInst(CmpInst::Predicate(predicate), S1, S2, Name, + InsertAtEnd); + } + return new VFCmpInst(CmpInst::Predicate(predicate), S1, S2, Name, + InsertAtEnd); } void CmpInst::swapOperands() { @@ -2813,6 +2784,13 @@ return new ICmpInst(getPredicate(), Op<0>(), Op<1>()); } +VFCmpInst* VFCmpInst::clone() const { + return new VFCmpInst(getPredicate(), Op<0>(), Op<1>()); +} +VICmpInst* VICmpInst::clone() const { + return new VICmpInst(getPredicate(), Op<0>(), Op<1>()); +} + MallocInst *MallocInst::clone() const { return new MallocInst(*this); } AllocaInst *AllocaInst::clone() const { return new AllocaInst(*this); } FreeInst *FreeInst::clone() const { return new FreeInst(getOperand(0)); } From resistor at mac.com Mon May 12 14:14:21 2008 From: resistor at mac.com (Owen Anderson) Date: Mon, 12 May 2008 14:14:21 -0500 Subject: [llvm-commits] [llvm] r50985 - in /llvm/trunk: docs/ include/llvm/ include/llvm/Support/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Bitcode/Writer/ lib/VMCore/ In-Reply-To: <200805121902.m4CJ22Nt020896@zion.cs.uiuc.edu> References: <200805121902.m4CJ22Nt020896@zion.cs.uiuc.edu> Message-ID: <4BED2AB7-DBE9-48B3-BE8F-FA57B6F5EFC5@mac.com> Nate, This is breaking the build for me: Constants.cpp: In static member function ?static llvm::Constant* llvm::ConstantExpr::getVICmp(short unsigned int, llvm::Constant*, llvm::Constant*)?: Constants.cpp:2050: error: ?const class llvm::Type? has no member named ?getElementType? Constants.cpp:2051: error: ?const class llvm::Type? has no member named ?getNumElements? --Owen On May 12, 2008, at 2:01 PM, Nate Begeman wrote: > Author: sampo > Date: Mon May 12 14:01:56 2008 > New Revision: 50985 > > URL: http://llvm.org/viewvc/llvm-project?rev=50985&view=rev > Log: > Add two new instructions to the llvm IR, vicmp and vfcmp. see > updated LangRef > for details. CodeGen support coming in a follow up patch > > Modified: > llvm/trunk/docs/LangRef.html > llvm/trunk/include/llvm/Constants.h > llvm/trunk/include/llvm/DerivedTypes.h > llvm/trunk/include/llvm/InstrTypes.h > llvm/trunk/include/llvm/Instruction.def > llvm/trunk/include/llvm/Instructions.h > llvm/trunk/include/llvm/Support/InstVisitor.h > llvm/trunk/lib/AsmParser/LLLexer.cpp > llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs > llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs > llvm/trunk/lib/AsmParser/llvmAsmParser.y > llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs > llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp > llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp > llvm/trunk/lib/VMCore/AsmWriter.cpp > llvm/trunk/lib/VMCore/Constants.cpp > llvm/trunk/lib/VMCore/Instruction.cpp > llvm/trunk/lib/VMCore/Instructions.cpp > > Modified: llvm/trunk/docs/LangRef.html > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/docs/LangRef.html (original) > +++ llvm/trunk/docs/LangRef.html Mon May 12 14:01:56 2008 > @@ -140,6 +140,8 @@ >
          >
        1. 'icmp' Instruction
        2. >
        3. 'fcmp' Instruction
        4. > +
        5. 'vicmp' Instruction li> > +
        6. 'vfcmp' Instruction li> >
        7. 'phi' Instruction
        8. >
        9. 'select' Instruction li> >
        10. 'call' Instruction
        11. > @@ -1680,6 +1682,12 @@ >
          fcmp COND ( VAL1, VAL2 )
          >
          Performs the fcmp operation on > constants.
          > > +
          vicmp COND ( VAL1, VAL2 )
          > +
          Performs the vicmp operation on > constants.
          > + > +
          vfcmp COND ( VAL1, VAL2 )
          > +
          Performs the vfcmp operation on > constants.
          > + >
          extractelement ( VAL, IDX )
          > >
          Perform the extractelement > @@ -3672,9 +3680,9 @@ > floating point typed. They must have > identical > types.

          >
          Semantics:
          > -

          The 'fcmp' compares var1 and var2 > according to > -the condition code given as cond. The comparison performed > always > -yields a i1 result, as follows: > +

          The 'fcmp' instruction compares var1 and > var2 > +according to the condition code given as cond. The > comparison performed > +always yields a i1 result, as follows: >

            >
          1. false: always yields false, regardless of > operands.
          2. >
          3. oeq: yields true if both operands are not a > QNAN and > @@ -3715,6 +3723,106 @@ >
        > > > + > +
        > +
        Syntax:
        > +
          <result> = vicmp <cond> <ty> <var1>,  
        > <var2>   ; yields {ty}:result
        > +
        > +
        Overview:
        > +

        The 'vicmp' instruction returns an integer vector value > based on > +element-wise comparison of its two integer vector operands.

        > +
        Arguments:
        > +

        The 'vicmp' instruction takes three operands. The first > operand is > +the condition code indicating the kind of comparison to perform. It > is not > +a value, just a keyword. The possible condition code are: > +

          > +
        1. eq: equal
        2. > +
        3. ne: not equal
        4. > +
        5. ugt: unsigned greater than
        6. > +
        7. uge: unsigned greater or equal
        8. > +
        9. ult: unsigned less than
        10. > +
        11. ule: unsigned less or equal
        12. > +
        13. sgt: signed greater than
        14. > +
        15. sge: signed greater or equal
        16. > +
        17. slt: signed less than
        18. > +
        19. sle: signed less or equal
        20. > +
        > +

        The remaining two arguments must be vector a> of > +integer typed. They must also be identical > types.

        > +
        Semantics:
        > +

        The 'vicmp' instruction compares var1 and > var2 > +according to the condition code given as cond. The > comparison yields a > +vector of integer > result, of > +identical type as the values being compared. The most significant > bit in each > +element is 1 if the element-wise comparison evaluates to true, and > is 0 > +otherwise. All other bits of the result are undefined. The > condition codes > +are evaluated identically to the 'icmp' > +instruction. > + > +

        Example:
        > +
        > +  <result> = vicmp eq <2 x i32> < i32 4, i32 0 >, < i32 5,  
        > i32 0 >   ; yields: result=<2 x i32> < i32 0, i32 -1 >
        > +  <result> = vicmp ult <2 x i8> < i8 1, i8 2 >, < i8 2, i8  
        > 2>        ; yields: result=<2 x i8> < i8 -1, i8 0 >
        > +
        > +
        > + > + > + > +
        > +
        Syntax:
        > +
          <result> = vfcmp <cond> <ty> <var1>,  
        > <var2>
        > +
        Overview:
        > +

        The 'vfcmp' instruction returns an integer vector value > based on > +element-wise comparison of its two floating point vector operands. > The output > +elements have the same width as the input elements.

        > +
        Arguments:
        > +

        The 'vfcmp' instruction takes three operands. The first > operand is > +the condition code indicating the kind of comparison to perform. It > is not > +a value, just a keyword. The possible condition code are: > +

          > +
        1. false: no comparison, always returns false
        2. > +
        3. oeq: ordered and equal
        4. > +
        5. ogt: ordered and greater than
        6. > +
        7. oge: ordered and greater than or equal
        8. > +
        9. olt: ordered and less than
        10. > +
        11. ole: ordered and less than or equal
        12. > +
        13. one: ordered and not equal
        14. > +
        15. ord: ordered (no nans)
        16. > +
        17. ueq: unordered or equal
        18. > +
        19. ugt: unordered or greater than
        20. > +
        21. uge: unordered or greater than or equal
        22. > +
        23. ult: unordered or less than
        24. > +
        25. ule: unordered or less than or equal
        26. > +
        27. une: unordered or not equal
        28. > +
        29. uno: unordered (either nans)
        30. > +
        31. true: no comparison, always returns true
        32. > +
        > +

        The remaining two arguments must be vector a> of > +floating point typed. They must also be > identical > +types.

        > +
        Semantics:
        > +

        The 'vfcmp' instruction compares var1 and > var2 > +according to the condition code given as cond. The > comparison yields a > +vector of integer > result, with > +an identical number of elements as the values being compared, and > each element > +having identical with to the width of the floating point elements. > The most > +significant bit in each element is 1 if the element-wise comparison > evaluates to > +true, and is 0 otherwise. All other bits of the result are > undefined. The > +condition codes are evaluated identically to the > +'fcmp' instruction. > + > +

        Example:
        > +
        > +  <result> = vfcmp oeq <2 x float> < float 4, float 0 >, <  
        > float 5, float 0 >       ; yields: result=<2 x i32> < i32 0, i32  
        > -1 >
        > +  <result> = vfcmp ult <2 x double> < double 1, double 2 >, <  
        > double 2, double 2>   ; yields: result=<2 x i64> < i64 -1, i64 0  
        > >
        > +
        > +
        > + > + > >
        > > Modified: llvm/trunk/include/llvm/Constants.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Constants.h?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Constants.h (original) > +++ llvm/trunk/include/llvm/Constants.h Mon May 12 14:01:56 2008 > @@ -689,6 +689,8 @@ > static Constant *getXor(Constant *C1, Constant *C2); > static Constant *getICmp(unsigned short pred, Constant *LHS, > Constant *RHS); > static Constant *getFCmp(unsigned short pred, Constant *LHS, > Constant *RHS); > + static Constant *getVICmp(unsigned short pred, Constant *LHS, > Constant *RHS); > + static Constant *getVFCmp(unsigned short pred, Constant *LHS, > Constant *RHS); > static Constant *getShl(Constant *C1, Constant *C2); > static Constant *getLShr(Constant *C1, Constant *C2); > static Constant *getAShr(Constant *C1, Constant *C2); > > Modified: llvm/trunk/include/llvm/DerivedTypes.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DerivedTypes.h?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/DerivedTypes.h (original) > +++ llvm/trunk/include/llvm/DerivedTypes.h Mon May 12 14:01:56 2008 > @@ -349,6 +349,16 @@ > /// > static VectorType *get(const Type *ElementType, unsigned > NumElements); > > + /// VectorType::getInteger - This static method gets a VectorType > with the > + /// same number of elements as the input type, and the element > type is an > + /// integer type of the same width as the input element type. > + /// > + static VectorType *getInteger(const VectorType *VTy) { > + unsigned EltBits = VTy->getElementType()- > >getPrimitiveSizeInBits(); > + const Type *EltTy = IntegerType::get(EltBits); > + return VectorType::get(EltTy, VTy->getNumElements()); > + } > + > /// @brief Return the number of elements in the Vector type. > inline unsigned getNumElements() const { return NumElements; } > > > Modified: llvm/trunk/include/llvm/InstrTypes.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InstrTypes.h?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/InstrTypes.h (original) > +++ llvm/trunk/include/llvm/InstrTypes.h Mon May 12 14:01:56 2008 > @@ -498,13 +498,55 @@ > void *operator new(size_t, unsigned); // DO NOT IMPLEMENT > CmpInst(); // do not implement > protected: > - CmpInst(Instruction::OtherOps op, unsigned short pred, Value > *LHS, Value *RHS, > - const std::string &Name = "", Instruction *InsertBefore = > 0); > + CmpInst(const Type *ty, Instruction::OtherOps op, unsigned short > pred, > + Value *LHS, Value *RHS, const std::string &Name = "", > + Instruction *InsertBefore = 0); > > - CmpInst(Instruction::OtherOps op, unsigned short pred, Value > *LHS, Value *RHS, > - const std::string &Name, BasicBlock *InsertAtEnd); > + CmpInst(const Type *ty, Instruction::OtherOps op, unsigned short > pred, > + Value *LHS, Value *RHS, const std::string &Name, > + BasicBlock *InsertAtEnd); > > public: > + /// This enumeration lists the possible predicates for CmpInst > subclasses. > + /// Values in the range 0-31 are reserved for FCmpInst, while > values in the > + /// range 32-64 are reserved for ICmpInst. This is necessary to > ensure the > + /// predicate values are not overlapping between the classes. > + enum Predicate { > + // Opcode U L G E Intuitive operation > + FCMP_FALSE = 0, /// 0 0 0 0 Always false (always folded) > + FCMP_OEQ = 1, /// 0 0 0 1 True if ordered and equal > + FCMP_OGT = 2, /// 0 0 1 0 True if ordered and greater than > + FCMP_OGE = 3, /// 0 0 1 1 True if ordered and greater > than or equal > + FCMP_OLT = 4, /// 0 1 0 0 True if ordered and less than > + FCMP_OLE = 5, /// 0 1 0 1 True if ordered and less than > or equal > + FCMP_ONE = 6, /// 0 1 1 0 True if ordered and operands > are unequal > + FCMP_ORD = 7, /// 0 1 1 1 True if ordered (no nans) > + FCMP_UNO = 8, /// 1 0 0 0 True if unordered: isnan(X) | > isnan(Y) > + FCMP_UEQ = 9, /// 1 0 0 1 True if unordered or equal > + FCMP_UGT = 10, /// 1 0 1 0 True if unordered or greater > than > + FCMP_UGE = 11, /// 1 0 1 1 True if unordered, greater > than, or equal > + FCMP_ULT = 12, /// 1 1 0 0 True if unordered or less than > + FCMP_ULE = 13, /// 1 1 0 1 True if unordered, less than, > or equal > + FCMP_UNE = 14, /// 1 1 1 0 True if unordered or not equal > + FCMP_TRUE = 15, /// 1 1 1 1 Always true (always folded) > + FIRST_FCMP_PREDICATE = FCMP_FALSE, > + LAST_FCMP_PREDICATE = FCMP_TRUE, > + BAD_FCMP_PREDICATE = FCMP_TRUE + 1, > + ICMP_EQ = 32, /// equal > + ICMP_NE = 33, /// not equal > + ICMP_UGT = 34, /// unsigned greater than > + ICMP_UGE = 35, /// unsigned greater or equal > + ICMP_ULT = 36, /// unsigned less than > + ICMP_ULE = 37, /// unsigned less or equal > + ICMP_SGT = 38, /// signed greater than > + ICMP_SGE = 39, /// signed greater or equal > + ICMP_SLT = 40, /// signed less than > + ICMP_SLE = 41, /// signed less or equal > + FIRST_ICMP_PREDICATE = ICMP_EQ, > + LAST_ICMP_PREDICATE = ICMP_SLE, > + BAD_ICMP_PREDICATE = ICMP_SLE + 1 > + }; > + > // allocate space for exactly two operands > void *operator new(size_t s) { > return User::operator new(s, 2); > @@ -576,7 +618,9 @@ > static inline bool classof(const CmpInst *) { return true; } > static inline bool classof(const Instruction *I) { > return I->getOpcode() == Instruction::ICmp || > - I->getOpcode() == Instruction::FCmp; > + I->getOpcode() == Instruction::FCmp || > + I->getOpcode() == Instruction::VICmp || > + I->getOpcode() == Instruction::VFCmp; > } > static inline bool classof(const Value *V) { > return isa(V) && classof(cast(V)); > > Modified: llvm/trunk/include/llvm/Instruction.def > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instruction.def?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Instruction.def (original) > +++ llvm/trunk/include/llvm/Instruction.def Mon May 12 14:01:56 2008 > @@ -166,7 +166,10 @@ > HANDLE_OTHER_INST(50, ShuffleVector, ShuffleVectorInst) // shuffle > two vectors. > HANDLE_OTHER_INST(51, GetResult, GetResultInst) // Extract > individual value > //from aggregate > result > - LAST_OTHER_INST(51) > +HANDLE_OTHER_INST(52, VICmp , VICmpInst ) // Vec Int comparison > instruction. > +HANDLE_OTHER_INST(53, VFCmp , VFCmpInst ) // Vec FP point > comparison instr. > + > + LAST_OTHER_INST(53) > > #undef FIRST_TERM_INST > #undef HANDLE_TERM_INST > > Modified: llvm/trunk/include/llvm/Instructions.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Instructions.h (original) > +++ llvm/trunk/include/llvm/Instructions.h Mon May 12 14:01:56 2008 > @@ -610,31 +610,11 @@ > // > = > = > = > ----------------------------------------------------------------------= > ==// > > /// This instruction compares its operands according to the > predicate given > -/// to the constructor. It only operates on integers, pointers, or > packed > -/// vectors of integrals. The two operands must be the same type. > +/// to the constructor. It only operates on integers or pointers. > The operands > +/// must be identical types. > /// @brief Represent an integer comparison operator. > class ICmpInst: public CmpInst { > public: > - /// This enumeration lists the possible predicates for the > ICmpInst. The > - /// values in the range 0-31 are reserved for FCmpInst while > values in the > - /// range 32-64 are reserved for ICmpInst. This is necessary to > ensure the > - /// predicate values are not overlapping between the classes. > - enum Predicate { > - ICMP_EQ = 32, ///< equal > - ICMP_NE = 33, ///< not equal > - ICMP_UGT = 34, ///< unsigned greater than > - ICMP_UGE = 35, ///< unsigned greater or equal > - ICMP_ULT = 36, ///< unsigned less than > - ICMP_ULE = 37, ///< unsigned less or equal > - ICMP_SGT = 38, ///< signed greater than > - ICMP_SGE = 39, ///< signed greater or equal > - ICMP_SLT = 40, ///< signed less than > - ICMP_SLE = 41, ///< signed less or equal > - FIRST_ICMP_PREDICATE = ICMP_EQ, > - LAST_ICMP_PREDICATE = ICMP_SLE, > - BAD_ICMP_PREDICATE = ICMP_SLE + 1 > - }; > - > /// @brief Constructor with insert-before-instruction semantics. > ICmpInst( > Predicate pred, ///< The predicate to use for the comparison > @@ -642,7 +622,18 @@ > Value *RHS, ///< The right-hand-side of the expression > const std::string &Name = "", ///< Name of the instruction > Instruction *InsertBefore = 0 ///< Where to insert > - ) : CmpInst(Instruction::ICmp, pred, LHS, RHS, Name, > InsertBefore) { > + ) : CmpInst(Type::Int1Ty, Instruction::ICmp, pred, LHS, RHS, Name, > + InsertBefore) { > + assert(pred >= CmpInst::FIRST_ICMP_PREDICATE && > + pred <= CmpInst::LAST_ICMP_PREDICATE && > + "Invalid ICmp predicate value"); > + const Type* Op0Ty = getOperand(0)->getType(); > + const Type* Op1Ty = getOperand(1)->getType(); > + assert(Op0Ty == Op1Ty && > + "Both operands to ICmp instruction are not of the same > type!"); > + // Check that the operands are the right type > + assert((Op0Ty->isInteger() || isa(Op0Ty)) && > + "Invalid operand types for ICmp instruction"); > } > > /// @brief Constructor with insert-at-block-end semantics. > @@ -652,7 +643,18 @@ > Value *RHS, ///< The right-hand-side of the expression > const std::string &Name, ///< Name of the instruction > BasicBlock *InsertAtEnd ///< Block to insert into. > - ) : CmpInst(Instruction::ICmp, pred, LHS, RHS, Name, InsertAtEnd) { > + ) : CmpInst(Type::Int1Ty, Instruction::ICmp, pred, LHS, RHS, Name, > + InsertAtEnd) { > + assert(pred >= CmpInst::FIRST_ICMP_PREDICATE && > + pred <= CmpInst::LAST_ICMP_PREDICATE && > + "Invalid ICmp predicate value"); > + const Type* Op0Ty = getOperand(0)->getType(); > + const Type* Op1Ty = getOperand(1)->getType(); > + assert(Op0Ty == Op1Ty && > + "Both operands to ICmp instruction are not of the same > type!"); > + // Check that the operands are the right type > + assert((Op0Ty->isInteger() || isa(Op0Ty)) && > + "Invalid operand types for ICmp instruction"); > } > > /// @brief Return the predicate for this instruction. > @@ -783,31 +785,6 @@ > /// @brief Represents a floating point comparison operator. > class FCmpInst: public CmpInst { > public: > - /// This enumeration lists the possible predicates for the > FCmpInst. Values > - /// in the range 0-31 are reserved for FCmpInst. > - enum Predicate { > - // Opcode U L G E Intuitive operation > - FCMP_FALSE = 0, ///< 0 0 0 0 Always false (always folded) > - FCMP_OEQ = 1, ///< 0 0 0 1 True if ordered and equal > - FCMP_OGT = 2, ///< 0 0 1 0 True if ordered and greater than > - FCMP_OGE = 3, ///< 0 0 1 1 True if ordered and greater > than or equal > - FCMP_OLT = 4, ///< 0 1 0 0 True if ordered and less than > - FCMP_OLE = 5, ///< 0 1 0 1 True if ordered and less than > or equal > - FCMP_ONE = 6, ///< 0 1 1 0 True if ordered and operands > are unequal > - FCMP_ORD = 7, ///< 0 1 1 1 True if ordered (no nans) > - FCMP_UNO = 8, ///< 1 0 0 0 True if unordered: isnan(X) | > isnan(Y) > - FCMP_UEQ = 9, ///< 1 0 0 1 True if unordered or equal > - FCMP_UGT =10, ///< 1 0 1 0 True if unordered or greater > than > - FCMP_UGE =11, ///< 1 0 1 1 True if unordered, greater > than, or equal > - FCMP_ULT =12, ///< 1 1 0 0 True if unordered or less than > - FCMP_ULE =13, ///< 1 1 0 1 True if unordered, less than, > or equal > - FCMP_UNE =14, ///< 1 1 1 0 True if unordered or not equal > - FCMP_TRUE =15, ///< 1 1 1 1 Always true (always folded) > - FIRST_FCMP_PREDICATE = FCMP_FALSE, > - LAST_FCMP_PREDICATE = FCMP_TRUE, > - BAD_FCMP_PREDICATE = FCMP_TRUE + 1 > - }; > - > /// @brief Constructor with insert-before-instruction semantics. > FCmpInst( > Predicate pred, ///< The predicate to use for the comparison > @@ -815,7 +792,17 @@ > Value *RHS, ///< The right-hand-side of the expression > const std::string &Name = "", ///< Name of the instruction > Instruction *InsertBefore = 0 ///< Where to insert > - ) : CmpInst(Instruction::FCmp, pred, LHS, RHS, Name, > InsertBefore) { > + ) : CmpInst(Type::Int1Ty, Instruction::FCmp, pred, LHS, RHS, Name, > + InsertBefore) { > + assert(pred <= FCmpInst::LAST_FCMP_PREDICATE && > + "Invalid FCmp predicate value"); > + const Type* Op0Ty = getOperand(0)->getType(); > + const Type* Op1Ty = getOperand(1)->getType(); > + assert(Op0Ty == Op1Ty && > + "Both operands to FCmp instruction are not of the same > type!"); > + // Check that the operands are the right type > + assert(Op0Ty->isFloatingPoint() && > + "Invalid operand types for FCmp instruction"); > } > > /// @brief Constructor with insert-at-block-end semantics. > @@ -825,7 +812,17 @@ > Value *RHS, ///< The right-hand-side of the expression > const std::string &Name, ///< Name of the instruction > BasicBlock *InsertAtEnd ///< Block to insert into. > - ) : CmpInst(Instruction::FCmp, pred, LHS, RHS, Name, InsertAtEnd) { > + ) : CmpInst(Type::Int1Ty, Instruction::FCmp, pred, LHS, RHS, Name, > + InsertAtEnd) { > + assert(pred <= FCmpInst::LAST_FCMP_PREDICATE && > + "Invalid FCmp predicate value"); > + const Type* Op0Ty = getOperand(0)->getType(); > + const Type* Op1Ty = getOperand(1)->getType(); > + assert(Op0Ty == Op1Ty && > + "Both operands to FCmp instruction are not of the same > type!"); > + // Check that the operands are the right type > + assert(Op0Ty->isFloatingPoint() && > + "Invalid operand types for FCmp instruction"); > } > > /// @brief Return the predicate for this instruction. > @@ -898,6 +895,100 @@ > }; > > // > = > = > = > ----------------------------------------------------------------------= > ==// > +// VICmpInst Class > +// > = > = > = > ----------------------------------------------------------------------= > ==// > + > +/// This instruction compares its operands according to the > predicate given > +/// to the constructor. It only operates on vectors of integers. > +/// The operands must be identical types. > +/// @brief Represents a vector integer comparison operator. > +class VICmpInst: public CmpInst { > +public: > + /// @brief Constructor with insert-before-instruction semantics. > + VICmpInst( > + Predicate pred, ///< The predicate to use for the comparison > + Value *LHS, ///< The left-hand-side of the expression > + Value *RHS, ///< The right-hand-side of the expression > + const std::string &Name = "", ///< Name of the instruction > + Instruction *InsertBefore = 0 ///< Where to insert > + ) : CmpInst(LHS->getType(), Instruction::VICmp, pred, LHS, RHS, > Name, > + InsertBefore) { > + } > + > + /// @brief Constructor with insert-at-block-end semantics. > + VICmpInst( > + Predicate pred, ///< The predicate to use for the comparison > + Value *LHS, ///< The left-hand-side of the expression > + Value *RHS, ///< The right-hand-side of the expression > + const std::string &Name, ///< Name of the instruction > + BasicBlock *InsertAtEnd ///< Block to insert into. > + ) : CmpInst(LHS->getType(), Instruction::VICmp, pred, LHS, RHS, > Name, > + InsertAtEnd) { > + } > + > + /// @brief Return the predicate for this instruction. > + Predicate getPredicate() const { return Predicate(SubclassData); } > + > + virtual VICmpInst *clone() const; > + > + // Methods for support type inquiry through isa, cast, and > dyn_cast: > + static inline bool classof(const VICmpInst *) { return true; } > + static inline bool classof(const Instruction *I) { > + return I->getOpcode() == Instruction::VICmp; > + } > + static inline bool classof(const Value *V) { > + return isa(V) && classof(cast(V)); > + } > +}; > + > +// > = > = > = > ----------------------------------------------------------------------= > ==// > +// VFCmpInst Class > +// > = > = > = > ----------------------------------------------------------------------= > ==// > + > +/// This instruction compares its operands according to the > predicate given > +/// to the constructor. It only operates on vectors of floating > point values. > +/// The operands must be identical types. > +/// @brief Represents a vector floating point comparison operator. > +class VFCmpInst: public CmpInst { > +public: > + /// @brief Constructor with insert-before-instruction semantics. > + VFCmpInst( > + Predicate pred, ///< The predicate to use for the comparison > + Value *LHS, ///< The left-hand-side of the expression > + Value *RHS, ///< The right-hand-side of the expression > + const std::string &Name = "", ///< Name of the instruction > + Instruction *InsertBefore = 0 ///< Where to insert > + ) : CmpInst(VectorType::getInteger(cast(LHS- > >getType())), > + Instruction::VFCmp, pred, LHS, RHS, Name, > InsertBefore) { > + } > + > + /// @brief Constructor with insert-at-block-end semantics. > + VFCmpInst( > + Predicate pred, ///< The predicate to use for the comparison > + Value *LHS, ///< The left-hand-side of the expression > + Value *RHS, ///< The right-hand-side of the expression > + const std::string &Name, ///< Name of the instruction > + BasicBlock *InsertAtEnd ///< Block to insert into. > + ) : CmpInst(VectorType::getInteger(cast(LHS- > >getType())), > + Instruction::VFCmp, pred, LHS, RHS, Name, > InsertAtEnd) { > + } > + > + /// @brief Return the predicate for this instruction. > + Predicate getPredicate() const { return Predicate(SubclassData); } > + > + virtual VFCmpInst *clone() const; > + > + /// @brief Methods for support type inquiry through isa, cast, > and dyn_cast: > + static inline bool classof(const VFCmpInst *) { return true; } > + static inline bool classof(const Instruction *I) { > + return I->getOpcode() == Instruction::VFCmp; > + } > + static inline bool classof(const Value *V) { > + return isa(V) && classof(cast(V)); > + } > +}; > + > +// > = > = > = > ----------------------------------------------------------------------= > ==// > // CallInst Class > // > = > = > = > ----------------------------------------------------------------------= > ==// > /// CallInst - This class represents a function call, abstracting a > target > @@ -1908,8 +1999,6 @@ > // InvokeInst Class > // > = > = > = > ----------------------------------------------------------------------= > ==// > > -// > = > = > = > --------------------------------------------------------------------------- > - > /// InvokeInst - Invoke instruction. The SubclassData field is used > to hold the > /// calling convention of the call. > /// > > Modified: llvm/trunk/include/llvm/Support/InstVisitor.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/InstVisitor.h?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Support/InstVisitor.h (original) > +++ llvm/trunk/include/llvm/Support/InstVisitor.h Mon May 12 > 14:01:56 2008 > @@ -169,6 +169,8 @@ > RetTy visitUnreachableInst(UnreachableInst &I) > { DELEGATE(TerminatorInst);} > RetTy visitICmpInst(ICmpInst &I) > { DELEGATE(CmpInst);} > RetTy visitFCmpInst(FCmpInst &I) > { DELEGATE(CmpInst);} > + RetTy visitVICmpInst(VICmpInst &I) > { DELEGATE(CmpInst);} > + RetTy visitVFCmpInst(VFCmpInst &I) > { DELEGATE(CmpInst);} > RetTy visitMallocInst(MallocInst &I) > { DELEGATE(AllocationInst);} > RetTy visitAllocaInst(AllocaInst &I) > { DELEGATE(AllocationInst);} > RetTy visitFreeInst(FreeInst &I) > { DELEGATE(Instruction); } > > Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/AsmParser/LLLexer.cpp (original) > +++ llvm/trunk/lib/AsmParser/LLLexer.cpp Mon May 12 14:01:56 2008 > @@ -566,6 +566,8 @@ > INSTKEYWORD("xor", BinaryOpVal, Xor, XOR); > INSTKEYWORD("icmp", OtherOpVal, ICmp, ICMP); > INSTKEYWORD("fcmp", OtherOpVal, FCmp, FCMP); > + INSTKEYWORD("vicmp", OtherOpVal, VICmp, VICMP); > + INSTKEYWORD("vfcmp", OtherOpVal, VFCmp, VFCMP); > > INSTKEYWORD("phi", OtherOpVal, PHI, PHI_TOK); > INSTKEYWORD("call", OtherOpVal, Call, CALL); > > Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original) > +++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Mon May 12 > 14:01:56 2008 > @@ -162,66 +162,68 @@ > ASHR = 343, > ICMP = 344, > FCMP = 345, > - EQ = 346, > - NE = 347, > - SLT = 348, > - SGT = 349, > - SLE = 350, > - SGE = 351, > - ULT = 352, > - UGT = 353, > - ULE = 354, > - UGE = 355, > - OEQ = 356, > - ONE = 357, > - OLT = 358, > - OGT = 359, > - OLE = 360, > - OGE = 361, > - ORD = 362, > - UNO = 363, > - UEQ = 364, > - UNE = 365, > - MALLOC = 366, > - ALLOCA = 367, > - FREE = 368, > - LOAD = 369, > - STORE = 370, > - GETELEMENTPTR = 371, > - TRUNC = 372, > - ZEXT = 373, > - SEXT = 374, > - FPTRUNC = 375, > - FPEXT = 376, > - BITCAST = 377, > - UITOFP = 378, > - SITOFP = 379, > - FPTOUI = 380, > - FPTOSI = 381, > - INTTOPTR = 382, > - PTRTOINT = 383, > - PHI_TOK = 384, > - SELECT = 385, > - VAARG = 386, > - EXTRACTELEMENT = 387, > - INSERTELEMENT = 388, > - SHUFFLEVECTOR = 389, > - GETRESULT = 390, > - SIGNEXT = 391, > - ZEROEXT = 392, > - NORETURN = 393, > - INREG = 394, > - SRET = 395, > - NOUNWIND = 396, > - NOALIAS = 397, > - BYVAL = 398, > - NEST = 399, > - READNONE = 400, > - READONLY = 401, > - GC = 402, > - DEFAULT = 403, > - HIDDEN = 404, > - PROTECTED = 405 > + VICMP = 346, > + VFCMP = 347, > + EQ = 348, > + NE = 349, > + SLT = 350, > + SGT = 351, > + SLE = 352, > + SGE = 353, > + ULT = 354, > + UGT = 355, > + ULE = 356, > + UGE = 357, > + OEQ = 358, > + ONE = 359, > + OLT = 360, > + OGT = 361, > + OLE = 362, > + OGE = 363, > + ORD = 364, > + UNO = 365, > + UEQ = 366, > + UNE = 367, > + MALLOC = 368, > + ALLOCA = 369, > + FREE = 370, > + LOAD = 371, > + STORE = 372, > + GETELEMENTPTR = 373, > + TRUNC = 374, > + ZEXT = 375, > + SEXT = 376, > + FPTRUNC = 377, > + FPEXT = 378, > + BITCAST = 379, > + UITOFP = 380, > + SITOFP = 381, > + FPTOUI = 382, > + FPTOSI = 383, > + INTTOPTR = 384, > + PTRTOINT = 385, > + PHI_TOK = 386, > + SELECT = 387, > + VAARG = 388, > + EXTRACTELEMENT = 389, > + INSERTELEMENT = 390, > + SHUFFLEVECTOR = 391, > + GETRESULT = 392, > + SIGNEXT = 393, > + ZEROEXT = 394, > + NORETURN = 395, > + INREG = 396, > + SRET = 397, > + NOUNWIND = 398, > + NOALIAS = 399, > + BYVAL = 400, > + NEST = 401, > + READNONE = 402, > + READONLY = 403, > + GC = 404, > + DEFAULT = 405, > + HIDDEN = 406, > + PROTECTED = 407 > }; > #endif > /* Tokens. */ > @@ -313,72 +315,74 @@ > #define ASHR 343 > #define ICMP 344 > #define FCMP 345 > -#define EQ 346 > -#define NE 347 > -#define SLT 348 > -#define SGT 349 > -#define SLE 350 > -#define SGE 351 > -#define ULT 352 > -#define UGT 353 > -#define ULE 354 > -#define UGE 355 > -#define OEQ 356 > -#define ONE 357 > -#define OLT 358 > -#define OGT 359 > -#define OLE 360 > -#define OGE 361 > -#define ORD 362 > -#define UNO 363 > -#define UEQ 364 > -#define UNE 365 > -#define MALLOC 366 > -#define ALLOCA 367 > -#define FREE 368 > -#define LOAD 369 > -#define STORE 370 > -#define GETELEMENTPTR 371 > -#define TRUNC 372 > -#define ZEXT 373 > -#define SEXT 374 > -#define FPTRUNC 375 > -#define FPEXT 376 > -#define BITCAST 377 > -#define UITOFP 378 > -#define SITOFP 379 > -#define FPTOUI 380 > -#define FPTOSI 381 > -#define INTTOPTR 382 > -#define PTRTOINT 383 > -#define PHI_TOK 384 > -#define SELECT 385 > -#define VAARG 386 > -#define EXTRACTELEMENT 387 > -#define INSERTELEMENT 388 > -#define SHUFFLEVECTOR 389 > -#define GETRESULT 390 > -#define SIGNEXT 391 > -#define ZEROEXT 392 > -#define NORETURN 393 > -#define INREG 394 > -#define SRET 395 > -#define NOUNWIND 396 > -#define NOALIAS 397 > -#define BYVAL 398 > -#define NEST 399 > -#define READNONE 400 > -#define READONLY 401 > -#define GC 402 > -#define DEFAULT 403 > -#define HIDDEN 404 > -#define PROTECTED 405 > +#define VICMP 346 > +#define VFCMP 347 > +#define EQ 348 > +#define NE 349 > +#define SLT 350 > +#define SGT 351 > +#define SLE 352 > +#define SGE 353 > +#define ULT 354 > +#define UGT 355 > +#define ULE 356 > +#define UGE 357 > +#define OEQ 358 > +#define ONE 359 > +#define OLT 360 > +#define OGT 361 > +#define OLE 362 > +#define OGE 363 > +#define ORD 364 > +#define UNO 365 > +#define UEQ 366 > +#define UNE 367 > +#define MALLOC 368 > +#define ALLOCA 369 > +#define FREE 370 > +#define LOAD 371 > +#define STORE 372 > +#define GETELEMENTPTR 373 > +#define TRUNC 374 > +#define ZEXT 375 > +#define SEXT 376 > +#define FPTRUNC 377 > +#define FPEXT 378 > +#define BITCAST 379 > +#define UITOFP 380 > +#define SITOFP 381 > +#define FPTOUI 382 > +#define FPTOSI 383 > +#define INTTOPTR 384 > +#define PTRTOINT 385 > +#define PHI_TOK 386 > +#define SELECT 387 > +#define VAARG 388 > +#define EXTRACTELEMENT 389 > +#define INSERTELEMENT 390 > +#define SHUFFLEVECTOR 391 > +#define GETRESULT 392 > +#define SIGNEXT 393 > +#define ZEROEXT 394 > +#define NORETURN 395 > +#define INREG 396 > +#define SRET 397 > +#define NOUNWIND 398 > +#define NOALIAS 399 > +#define BYVAL 400 > +#define NEST 401 > +#define READNONE 402 > +#define READONLY 403 > +#define GC 404 > +#define DEFAULT 405 > +#define HIDDEN 406 > +#define PROTECTED 407 > > > > > /* Copy the first part of user declarations. */ > -#line 14 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 14 "/llvm/lib/AsmParser/llvmAsmParser.y" > > #include "ParserInternals.h" > #include "llvm/CallingConv.h" > @@ -1334,7 +1338,7 @@ > > #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED > typedef union YYSTYPE > -#line 949 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 949 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > llvm::Module *ModuleVal; > llvm::Function *FunctionVal; > @@ -1382,7 +1386,7 @@ > llvm::FCmpInst::Predicate FPredicate; > } > /* Line 193 of yacc.c. */ > -#line 1386 "llvmAsmParser.tab.c" > +#line 1390 "llvmAsmParser.tab.c" > YYSTYPE; > # define yystype YYSTYPE /* obsolescent; will be withdrawn */ > # define YYSTYPE_IS_DECLARED 1 > @@ -1395,7 +1399,7 @@ > > > /* Line 216 of yacc.c. */ > -#line 1399 "llvmAsmParser.tab.c" > +#line 1403 "llvmAsmParser.tab.c" > > #ifdef short > # undef short > @@ -1610,20 +1614,20 @@ > /* YYFINAL -- State number of the termination state. */ > #define YYFINAL 43 > /* YYLAST -- Last index in YYTABLE. */ > -#define YYLAST 1978 > +#define YYLAST 2035 > > /* YYNTOKENS -- Number of terminals. */ > -#define YYNTOKENS 165 > +#define YYNTOKENS 167 > /* YYNNTS -- Number of nonterminals. */ > #define YYNNTS 85 > /* YYNRULES -- Number of rules. */ > -#define YYNRULES 322 > +#define YYNRULES 326 > /* YYNRULES -- Number of states. */ > -#define YYNSTATES 629 > +#define YYNSTATES 655 > > /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to > YYLEX. */ > #define YYUNDEFTOK 2 > -#define YYMAXUTOK 405 > +#define YYMAXUTOK 407 > > #define YYTRANSLATE(YYX) \ > ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) > @@ -1635,15 +1639,15 @@ > 2, 2, 2, 2, 2, 2, 2, 2, > 2, 2, > 2, 2, 2, 2, 2, 2, 2, 2, > 2, 2, > 2, 2, 2, 2, 2, 2, 2, 2, > 2, 2, > - 151, 152, 155, 2, 154, 2, 2, 2, > 2, 2, > + 153, 154, 157, 2, 156, 2, 2, 2, > 2, 2, > 2, 2, 2, 2, 2, 2, 2, 2, > 2, 2, > - 160, 153, 161, 2, 2, 2, 2, 2, > 2, 2, > + 162, 155, 163, 2, 2, 2, 2, 2, > 2, 2, > 2, 2, 2, 2, 2, 2, 2, 2, > 2, 2, > 2, 2, 2, 2, 2, 2, 2, 2, > 2, 2, > - 2, 157, 156, 159, 2, 2, 2, 2, 2, > 164, > + 2, 159, 158, 161, 2, 2, 2, 2, 2, > 166, > 2, 2, 2, 2, 2, 2, 2, 2, > 2, 2, > 2, 2, 2, 2, 2, 2, 2, 2, > 2, 2, > - 158, 2, 2, 162, 2, 163, 2, 2, > 2, 2, > + 160, 2, 2, 164, 2, 165, 2, 2, > 2, 2, > 2, 2, 2, 2, 2, 2, 2, 2, > 2, 2, > 2, 2, 2, 2, 2, 2, 2, 2, > 2, 2, > 2, 2, 2, 2, 2, 2, 2, 2, > 2, 2, > @@ -1671,7 +1675,7 @@ > 115, 116, 117, 118, 119, 120, 121, 122, 123, > 124, > 125, 126, 127, 128, 129, 130, 131, 132, 133, > 134, > 135, 136, 137, 138, 139, 140, 141, 142, 143, > 144, > - 145, 146, 147, 148, 149, 150 > + 145, 146, 147, 148, 149, 150, 151, 152 > }; > > #if YYDEBUG > @@ -1698,127 +1702,130 @@ > 350, 352, 354, 358, 360, 364, 366, 367, 369, > 373, > 378, 382, 386, 391, 396, 400, 407, 413, 416, > 419, > 422, 425, 428, 431, 434, 437, 440, 443, 446, > 449, > - 456, 462, 471, 478, 485, 493, 501, 508, 517, > 526, > - 530, 532, 534, 536, 538, 539, 542, 549, 551, > 552, > - 554, 557, 558, 562, 563, 567, 571, 575, 579, > 580, > - 589, 590, 600, 601, 611, 617, 620, 624, 626, > 630, > - 634, 638, 642, 644, 645, 651, 655, 657, 661, > 663, > - 664, 675, 677, 679, 684, 686, 688, 691, 695, > 696, > - 698, 700, 702, 704, 706, 708, 710, 712, 714, > 718, > - 720, 726, 728, 730, 732, 734, 736, 738, 741, > 743, > - 747, 750, 753, 757, 760, 761, 763, 766, 769, > 773, > - 783, 793, 802, 817, 819, 821, 828, 834, 837, > 844, > - 852, 857, 862, 869, 876, 877, 878, 882, 885, > 887, > - 893, 899, 906, 913, 918, 925, 930, 935, 942, > 949, > - 952, 961, 963, 965, 966, 970, 977, 981, 988, > 991, > - 997, 1005, 1011 > + 456, 462, 471, 478, 485, 493, 501, 509, 517, > 524, > + 533, 542, 546, 548, 550, 552, 554, 555, 558, > 565, > + 567, 568, 570, 573, 574, 578, 579, 583, 587, > 591, > + 595, 596, 605, 606, 616, 617, 627, 633, 636, > 640, > + 642, 646, 650, 654, 658, 660, 661, 667, 671, > 673, > + 677, 679, 680, 691, 693, 695, 700, 702, 704, > 707, > + 711, 712, 714, 716, 718, 720, 722, 724, 726, > 728, > + 730, 734, 736, 742, 744, 746, 748, 750, 752, > 754, > + 757, 759, 763, 766, 769, 773, 776, 777, 779, > 782, > + 785, 789, 799, 809, 818, 833, 835, 837, 844, > 850, > + 853, 860, 868, 873, 878, 885, 892, 893, 894, > 898, > + 901, 903, 909, 915, 922, 929, 936, 943, 948, > 955, > + 960, 965, 972, 979, 982, 991, 993, 995, 996, > 1000, > + 1007, 1011, 1018, 1021, 1027, 1035, 1041 > }; > > /* YYRHS -- A `-1'-separated list of the rules' RHS. */ > static const yytype_int16 yyrhs[] = > { > - 211, 0, -1, 74, -1, 75, -1, 76, > -1, 77, > + 213, 0, -1, 74, -1, 75, -1, 76, > -1, 77, > -1, 78, -1, 79, -1, 80, -1, 81, -1, > 82, > -1, 86, -1, 87, -1, 88, -1, 83, -1, > 84, > - -1, 85, -1, 117, -1, 118, -1, 119, -1, > 120, > - -1, 121, -1, 122, -1, 123, -1, 124, -1, > 125, > - -1, 126, -1, 127, -1, 128, -1, 91, > -1, 92, > - -1, 93, -1, 94, -1, 95, -1, 96, > -1, 97, > - -1, 98, -1, 99, -1, 100, -1, 101, -1, > 102, > - -1, 103, -1, 104, -1, 105, -1, 106, -1, > 107, > - -1, 108, -1, 109, -1, 110, -1, 97, > -1, 98, > - -1, 99, -1, 100, -1, 26, -1, 27, > -1, 11, > + -1, 85, -1, 119, -1, 120, -1, 121, -1, > 122, > + -1, 123, -1, 124, -1, 125, -1, 126, -1, > 127, > + -1, 128, -1, 129, -1, 130, -1, 93, > -1, 94, > + -1, 95, -1, 96, -1, 97, -1, 98, > -1, 99, > + -1, 100, -1, 101, -1, 102, -1, 103, -1, > 104, > + -1, 105, -1, 106, -1, 107, -1, 108, -1, > 109, > + -1, 110, -1, 111, -1, 112, -1, 99, -1, > 100, > + -1, 101, -1, 102, -1, 26, -1, 27, > -1, 11, > -1, 12, -1, 13, -1, 16, -1, 15, -1, > 14, > - -1, 19, -1, 22, -1, 24, -1, 173, > -1, -1, > - 54, 151, 4, 152, -1, -1, 173, 153, > -1, -1, > - 20, -1, 23, -1, 179, -1, -1, 177, > 153, -1, > + -1, 19, -1, 22, -1, 24, -1, 175, > -1, -1, > + 54, 153, 4, 154, -1, -1, 175, 155, > -1, -1, > + 20, -1, 23, -1, 181, -1, -1, 179, > 155, -1, > 42, -1, 44, -1, 43, -1, 45, -1, 47, > -1, > - 46, -1, 48, -1, 50, -1, -1, 148, -1, > 149, > - -1, 150, -1, -1, 46, -1, 48, -1, > -1, 42, > + 46, -1, 48, -1, 50, -1, -1, 150, -1, > 151, > + -1, 152, -1, -1, 46, -1, 48, -1, > -1, 42, > -1, 43, -1, 44, -1, 47, -1, -1, 44, > -1, > 42, -1, -1, 62, -1, 63, -1, 64, -1, > 65, > - -1, 66, -1, 61, 4, -1, 137, -1, > 118, -1, > - 136, -1, 119, -1, 139, -1, 140, -1, > 142, -1, > - 143, -1, 144, -1, 53, 4, -1, -1, 188, > 187, > - -1, 138, -1, 141, -1, 137, -1, 136, -1, > 145, > - -1, 146, -1, -1, 190, 189, -1, -1, > 147, 22, > - -1, -1, 53, 4, -1, -1, 154, 53, > 4, -1, > - 34, 22, -1, -1, 194, -1, -1, 154, 197, > 196, > - -1, 194, -1, 53, 4, -1, 11, -1, > 12, -1, > + -1, 66, -1, 61, 4, -1, 139, -1, > 120, -1, > + 138, -1, 121, -1, 141, -1, 142, -1, > 144, -1, > + 145, -1, 146, -1, 53, 4, -1, -1, 190, > 189, > + -1, 140, -1, 143, -1, 139, -1, 138, -1, > 147, > + -1, 148, -1, -1, 192, 191, -1, -1, > 149, 22, > + -1, -1, 53, 4, -1, -1, 156, 53, > 4, -1, > + 34, 22, -1, -1, 196, -1, -1, 156, 199, > 198, > + -1, 196, -1, 53, 4, -1, 11, -1, > 12, -1, > 13, -1, 16, -1, 15, -1, 14, -1, 17, > -1, > - 49, -1, 198, -1, 199, 175, 155, -1, > 233, -1, > - 156, 4, -1, 199, 151, 203, 152, 190, > -1, 10, > - 151, 203, 152, 190, -1, 157, 4, 158, 199, > 159, > - -1, 160, 4, 158, 199, 161, -1, 162, 204, > 163, > - -1, 162, 163, -1, 160, 162, 204, 163, > 161, -1, > - 160, 162, 163, 161, -1, 199, 188, -1, > 199, -1, > - 10, -1, 200, -1, 202, 154, 200, -1, > 202, -1, > - 202, 154, 39, -1, 39, -1, -1, 199, -1, > 204, > - 154, 199, -1, 199, 157, 207, 159, -1, 199, > 157, > - 159, -1, 199, 164, 22, -1, 199, 160, 207, > 161, > - -1, 199, 162, 207, 163, -1, 199, 162, > 163, -1, > - 199, 160, 162, 207, 163, 161, -1, 199, 160, > 162, > - 163, 161, -1, 199, 40, -1, 199, 41, -1, > 199, > - 233, -1, 199, 206, -1, 199, 25, -1, > 171, 3, > - -1, 171, 5, -1, 171, 4, -1, 171, > 6, -1, > - 11, 26, -1, 11, 27, -1, 172, 9, -1, > 168, > - 151, 205, 38, 199, 152, -1, 116, 151, 205, > 245, > - 152, -1, 130, 151, 205, 154, 205, 154, 205, > 152, > - -1, 166, 151, 205, 154, 205, 152, -1, 167, > 151, > - 205, 154, 205, 152, -1, 89, 169, 151, 205, > 154, > - 205, 152, -1, 90, 170, 151, 205, 154, 205, > 152, > - -1, 132, 151, 205, 154, 205, 152, -1, 133, > 151, > - 205, 154, 205, 154, 205, 152, -1, 134, 151, > 205, > - 154, 205, 154, 205, 152, -1, 207, 154, > 205, -1, > - 205, -1, 32, -1, 33, -1, 37, -1, -1, > 201, > - 233, -1, 122, 151, 210, 38, 199, 152, -1, > 212, > - -1, -1, 213, -1, 212, 213, -1, -1, 31, > 214, > - 229, -1, -1, 30, 215, 230, -1, 59, 58, > 219, > - -1, 176, 18, 199, -1, 176, 18, 10, > -1, -1, > - 178, 182, 209, 208, 205, 175, 216, 196, > -1, -1, > - 178, 180, 182, 209, 208, 205, 175, 217, > 196, -1, > - -1, 178, 181, 182, 209, 208, 199, 175, 218, > 196, > - -1, 178, 182, 35, 185, 210, -1, 51, > 220, -1, > - 55, 153, 221, -1, 22, -1, 52, 153, > 22, -1, > - 67, 153, 22, -1, 157, 222, 159, -1, 222, > 154, > - 22, -1, 22, -1, -1, 223, 154, 199, 188, > 174, > - -1, 199, 188, 174, -1, 223, -1, 223, > 154, 39, > - -1, 39, -1, -1, 186, 201, 177, 151, 224, > 152, > - 190, 195, 192, 191, -1, 28, -1, 162, -1, > 184, > - 182, 225, 226, -1, 29, -1, 163, -1, 237, > 228, > - -1, 183, 182, 225, -1, -1, 60, -1, > 3, -1, > - 4, -1, 9, -1, 26, -1, 27, -1, > 40, -1, > - 41, -1, 25, -1, 160, 207, 161, -1, > 206, -1, > - 58, 231, 22, 154, 22, -1, 7, -1, > 8, -1, > - 173, -1, 177, -1, 233, -1, 232, -1, 199, > 234, > - -1, 235, -1, 236, 154, 235, -1, 237, > 238, -1, > - 227, 238, -1, 239, 176, 240, -1, 239, > 242, -1, > - -1, 21, -1, 68, 236, -1, 68, 10, > -1, 69, > - 17, 234, -1, 69, 11, 234, 154, 17, 234, > 154, > - 17, 234, -1, 70, 171, 234, 154, 17, 234, > 157, > - 241, 159, -1, 70, 171, 234, 154, 17, 234, > 157, > - 159, -1, 71, 186, 201, 234, 151, 244, 152, > 190, > - 38, 17, 234, 72, 17, 234, -1, 72, > -1, 73, > - -1, 241, 171, 232, 154, 17, 234, -1, 171, > 232, > - 154, 17, 234, -1, 176, 247, -1, 199, 157, > 234, > - 154, 234, 159, -1, 243, 154, 157, 234, 154, > 234, > - 159, -1, 199, 188, 234, 188, -1, 17, 188, > 234, > - 188, -1, 244, 154, 199, 188, 234, 188, -1, > 244, > - 154, 17, 188, 234, 188, -1, -1, -1, 245, > 154, > - 235, -1, 57, 56, -1, 56, -1, 166, 199, > 234, > - 154, 234, -1, 167, 199, 234, 154, 234, > -1, 89, > - 169, 199, 234, 154, 234, -1, 90, 170, 199, > 234, > - 154, 234, -1, 168, 235, 38, 199, -1, 130, > 235, > - 154, 235, 154, 235, -1, 131, 235, 154, > 199, -1, > - 132, 235, 154, 235, -1, 133, 235, 154, 235, > 154, > - 235, -1, 134, 235, 154, 235, 154, 235, -1, > 129, > - 243, -1, 246, 186, 201, 234, 151, 244, 152, > 190, > - -1, 249, -1, 36, -1, -1, 111, 199, > 193, -1, > - 111, 199, 154, 11, 234, 193, -1, 112, 199, > 193, > - -1, 112, 199, 154, 11, 234, 193, -1, 113, > 235, > - -1, 248, 114, 199, 234, 193, -1, 248, 115, > 235, > - 154, 199, 234, 193, -1, 135, 199, 234, > 154, 4, > - -1, 116, 199, 234, 245, -1 > + 49, -1, 200, -1, 201, 177, 157, -1, > 235, -1, > + 158, 4, -1, 201, 153, 205, 154, 192, > -1, 10, > + 153, 205, 154, 192, -1, 159, 4, 160, 201, > 161, > + -1, 162, 4, 160, 201, 163, -1, 164, 206, > 165, > + -1, 164, 165, -1, 162, 164, 206, 165, > 163, -1, > + 162, 164, 165, 163, -1, 201, 190, -1, > 201, -1, > + 10, -1, 202, -1, 204, 156, 202, -1, > 204, -1, > + 204, 156, 39, -1, 39, -1, -1, 201, -1, > 206, > + 156, 201, -1, 201, 159, 209, 161, -1, 201, > 159, > + 161, -1, 201, 166, 22, -1, 201, 162, 209, > 163, > + -1, 201, 164, 209, 165, -1, 201, 164, > 165, -1, > + 201, 162, 164, 209, 165, 163, -1, 201, 162, > 164, > + 165, 163, -1, 201, 40, -1, 201, 41, -1, > 201, > + 235, -1, 201, 208, -1, 201, 25, -1, > 173, 3, > + -1, 173, 5, -1, 173, 4, -1, 173, > 6, -1, > + 11, 26, -1, 11, 27, -1, 174, 9, -1, > 170, > + 153, 207, 38, 201, 154, -1, 118, 153, 207, > 247, > + 154, -1, 132, 153, 207, 156, 207, 156, 207, > 154, > + -1, 168, 153, 207, 156, 207, 154, -1, 169, > 153, > + 207, 156, 207, 154, -1, 89, 171, 153, 207, > 156, > + 207, 154, -1, 90, 172, 153, 207, 156, 207, > 154, > + -1, 91, 171, 153, 207, 156, 207, 154, > -1, 92, > + 172, 153, 207, 156, 207, 154, -1, 134, 153, > 207, > + 156, 207, 154, -1, 135, 153, 207, 156, 207, > 156, > + 207, 154, -1, 136, 153, 207, 156, 207, 156, > 207, > + 154, -1, 209, 156, 207, -1, 207, -1, > 32, -1, > + 33, -1, 37, -1, -1, 203, 235, -1, 124, > 153, > + 212, 38, 201, 154, -1, 214, -1, -1, > 215, -1, > + 214, 215, -1, -1, 31, 216, 231, -1, > -1, 30, > + 217, 232, -1, 59, 58, 221, -1, 178, 18, > 201, > + -1, 178, 18, 10, -1, -1, 180, 184, 211, > 210, > + 207, 177, 218, 198, -1, -1, 180, 182, 184, > 211, > + 210, 207, 177, 219, 198, -1, -1, 180, 183, > 184, > + 211, 210, 201, 177, 220, 198, -1, 180, > 184, 35, > + 187, 212, -1, 51, 222, -1, 55, 155, > 223, -1, > + 22, -1, 52, 155, 22, -1, 67, 155, > 22, -1, > + 159, 224, 161, -1, 224, 156, 22, -1, > 22, -1, > + -1, 225, 156, 201, 190, 176, -1, 201, 190, > 176, > + -1, 225, -1, 225, 156, 39, -1, 39, > -1, -1, > + 188, 203, 179, 153, 226, 154, 192, 197, 194, > 193, > + -1, 28, -1, 164, -1, 186, 184, 227, > 228, -1, > + 29, -1, 165, -1, 239, 230, -1, 185, 184, > 227, > + -1, -1, 60, -1, 3, -1, 4, -1, > 9, -1, > + 26, -1, 27, -1, 40, -1, 41, -1, > 25, -1, > + 162, 209, 163, -1, 208, -1, 58, 233, 22, > 156, > + 22, -1, 7, -1, 8, -1, 175, -1, > 179, -1, > + 235, -1, 234, -1, 201, 236, -1, 237, -1, > 238, > + 156, 237, -1, 239, 240, -1, 229, 240, -1, > 241, > + 178, 242, -1, 241, 244, -1, -1, 21, > -1, 68, > + 238, -1, 68, 10, -1, 69, 17, 236, > -1, 69, > + 11, 236, 156, 17, 236, 156, 17, 236, > -1, 70, > + 173, 236, 156, 17, 236, 159, 243, 161, > -1, 70, > + 173, 236, 156, 17, 236, 159, 161, -1, 71, > 188, > + 203, 236, 153, 246, 154, 192, 38, 17, > 236, 72, > + 17, 236, -1, 72, -1, 73, -1, 243, 173, > 234, > + 156, 17, 236, -1, 173, 234, 156, 17, > 236, -1, > + 178, 249, -1, 201, 159, 236, 156, 236, > 161, -1, > + 245, 156, 159, 236, 156, 236, 161, -1, 201, > 190, > + 236, 190, -1, 17, 190, 236, 190, -1, 246, > 156, > + 201, 190, 236, 190, -1, 246, 156, 17, 190, > 236, > + 190, -1, -1, -1, 247, 156, 237, -1, > 57, 56, > + -1, 56, -1, 168, 201, 236, 156, 236, -1, > 169, > + 201, 236, 156, 236, -1, 89, 171, 201, 236, > 156, > + 236, -1, 90, 172, 201, 236, 156, 236, > -1, 91, > + 171, 201, 236, 156, 236, -1, 92, 172, 201, > 236, > + 156, 236, -1, 170, 237, 38, 201, -1, 132, > 237, > + 156, 237, 156, 237, -1, 133, 237, 156, > 201, -1, > + 134, 237, 156, 237, -1, 135, 237, 156, 237, > 156, > + 237, -1, 136, 237, 156, 237, 156, 237, -1, > 131, > + 245, -1, 248, 188, 203, 236, 153, 246, 154, > 192, > + -1, 251, -1, 36, -1, -1, 113, 201, > 195, -1, > + 113, 201, 156, 11, 236, 195, -1, 114, 201, > 195, > + -1, 114, 201, 156, 11, 236, 195, -1, 115, > 237, > + -1, 250, 116, 201, 236, 195, -1, 250, 117, > 237, > + 156, 201, 236, 195, -1, 137, 201, 236, > 156, 4, > + -1, 118, 201, 236, 247, -1 > }; > > /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ > @@ -1843,20 +1850,20 @@ > 1464, 1469, 1474, 1481, 1482, 1489, 1496, 1504, 1510, > 1522, > 1550, 1566, 1593, 1621, 1647, 1667, 1693, 1713, 1725, > 1732, > 1798, 1808, 1818, 1824, 1834, 1840, 1850, 1855, 1860, > 1873, > - 1885, 1907, 1915, 1921, 1932, 1937, 1942, 1948, 1954, > 1963, > - 1967, 1975, 1975, 1978, 1978, 1981, 1993, 2014, 2019, > 2027, > - 2028, 2032, 2032, 2036, 2036, 2039, 2042, 2066, 2078, > 2077, > - 2089, 2088, 2098, 2097, 2108, 2148, 2151, 2157, 2167, > 2171, > - 2176, 2178, 2183, 2188, 2197, 2207, 2218, 2222, 2231, > 2240, > - 2245, 2374, 2374, 2376, 2385, 2385, 2387, 2392, 2404, > 2408, > - 2413, 2417, 2421, 2425, 2429, 2433, 2437, 2441, 2445, > 2470, > - 2474, 2484, 2488, 2492, 2497, 2504, 2504, 2510, 2519, > 2524, > - 2529, 2533, 2542, 2551, 2560, 2564, 2572, 2579, 2583, > 2588, > - 2598, 2617, 2626, 2711, 2715, 2722, 2733, 2746, 2756, > 2767, > - 2777, 2788, 2796, 2806, 2813, 2816, 2817, 2824, 2828, > 2833, > - 2849, 2866, 2880, 2894, 2906, 2914, 2921, 2927, 2933, > 2939, > - 2954, 3044, 3049, 3053, 3060, 3067, 3075, 3082, 3090, > 3098, > - 3112, 3129, 3137 > + 1885, 1907, 1915, 1921, 1932, 1937, 1942, 1947, 1952, > 1958, > + 1964, 1973, 1977, 1985, 1985, 1988, 1988, 1991, 2003, > 2024, > + 2029, 2037, 2038, 2042, 2042, 2046, 2046, 2049, 2052, > 2076, > + 2088, 2087, 2099, 2098, 2108, 2107, 2118, 2158, 2161, > 2167, > + 2177, 2181, 2186, 2188, 2193, 2198, 2207, 2217, 2228, > 2232, > + 2241, 2250, 2255, 2384, 2384, 2386, 2395, 2395, 2397, > 2402, > + 2414, 2418, 2423, 2427, 2431, 2435, 2439, 2443, 2447, > 2451, > + 2455, 2480, 2484, 2494, 2498, 2502, 2507, 2514, 2514, > 2520, > + 2529, 2534, 2539, 2543, 2552, 2561, 2570, 2574, 2582, > 2589, > + 2593, 2598, 2608, 2627, 2636, 2721, 2725, 2732, 2743, > 2756, > + 2766, 2777, 2787, 2798, 2806, 2816, 2823, 2826, 2827, > 2834, > + 2838, 2843, 2859, 2876, 2890, 2904, 2918, 2932, 2944, > 2952, > + 2959, 2965, 2971, 2977, 2992, 3082, 3087, 3091, 3098, > 3105, > + 3113, 3120, 3128, 3136, 3150, 3167, 3175 > }; > #endif > > @@ -1879,24 +1886,25 @@ > "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", > "X86_FASTCALLCC_TOK", > "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", > "UNREACHABLE", > "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM", > - "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "EQ", > "NE", > - "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE", "UGE", "OEQ", > "ONE", > - "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE", "MALLOC", > - "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", > "ZEXT", > - "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP", "SITOFP", > "FPTOUI", > - "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK", "SELECT", "VAARG", > - "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "GETRESULT", > - "SIGNEXT", "ZEROEXT", "NORETURN", "INREG", "SRET", "NOUNWIND", > "NOALIAS", > - "BYVAL", "NEST", "READNONE", "READONLY", "GC", "DEFAULT", "HIDDEN", > - "PROTECTED", "'('", "')'", "'='", "','", "'*'", "'\\\\'", "'['", > "'x'", > - "']'", "'<'", "'>'", "'{'", "'}'", "'c'", "$accept", > "ArithmeticOps", > - "LogicalOps", "CastOps", "IPredicates", "FPredicates", "IntType", > - "FPType", "LocalName", "OptLocalName", "OptAddrSpace", > "OptLocalAssign", > - "GlobalName", "OptGlobalAssign", "GlobalAssign", > "GVInternalLinkage", > - "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage", > - "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", > "ParamAttr", > - "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign", > - "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes", > + "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "VICMP", > + "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", > "ULE", > + "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", > "UEQ", > + "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", > "GETELEMENTPTR", > + "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP", > + "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK", > + "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", > "SHUFFLEVECTOR", > + "GETRESULT", "SIGNEXT", "ZEROEXT", "NORETURN", "INREG", "SRET", > + "NOUNWIND", "NOALIAS", "BYVAL", "NEST", "READNONE", "READONLY", > "GC", > + "DEFAULT", "HIDDEN", "PROTECTED", "'('", "')'", "'='", "','", > "'*'", > + "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'", "'c'", > + "$accept", "ArithmeticOps", "LogicalOps", "CastOps", "IPredicates", > + "FPredicates", "IntType", "FPType", "LocalName", "OptLocalName", > + "OptAddrSpace", "OptLocalAssign", "GlobalName", "OptGlobalAssign", > + "GlobalAssign", "GVInternalLinkage", "GVExternalLinkage", > + "GVVisibilityStyle", "FunctionDeclareLinkage", > "FunctionDefineLinkage", > + "AliasLinkage", "OptCallingConv", "ParamAttr", "OptParamAttrs", > + "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign", "OptCAlign", > + "SectionString", "OptSection", "GlobalVarAttributes", > "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes", > "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr", > "ConstVector", "GlobalType", "ThreadLocal", "AliaseeRef", "Module", > @@ -1931,47 +1939,47 @@ > 375, 376, 377, 378, 379, 380, 381, 382, 383, > 384, > 385, 386, 387, 388, 389, 390, 391, 392, 393, > 394, > 395, 396, 397, 398, 399, 400, 401, 402, 403, > 404, > - 405, 40, 41, 61, 44, 42, 92, 91, > 120, 93, > - 60, 62, 123, 125, 99 > + 405, 406, 407, 40, 41, 61, 44, 42, > 92, 91, > + 120, 93, 60, 62, 123, 125, 99 > }; > # endif > > /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ > static const yytype_uint8 yyr1[] = > { > - 0, 165, 166, 166, 166, 166, 166, 166, 166, > 166, > - 166, 167, 167, 167, 167, 167, 167, 168, 168, > 168, > - 168, 168, 168, 168, 168, 168, 168, 168, 168, > 169, > - 169, 169, 169, 169, 169, 169, 169, 169, 169, > 170, > - 170, 170, 170, 170, 170, 170, 170, 170, 170, > 170, > - 170, 170, 170, 170, 170, 171, 172, 172, 172, > 172, > - 172, 173, 173, 173, 174, 174, 175, 175, 176, > 176, > - 177, 177, 178, 178, 179, 180, 180, 180, 180, > 180, > - 181, 181, 181, 182, 182, 182, 182, 183, 183, > 183, > - 184, 184, 184, 184, 184, 185, 185, 185, 186, > 186, > - 186, 186, 186, 186, 186, 187, 187, 187, 187, > 187, > - 187, 187, 187, 187, 187, 188, 188, 189, 189, > 189, > - 189, 189, 189, 190, 190, 191, 191, 192, 192, > 193, > - 193, 194, 195, 195, 196, 196, 197, 197, 198, > 198, > - 198, 198, 198, 198, 198, 199, 199, 199, 199, > 199, > - 199, 199, 199, 199, 199, 199, 199, 199, 200, > 201, > - 201, 202, 202, 203, 203, 203, 203, 204, 204, > 205, > - 205, 205, 205, 205, 205, 205, 205, 205, 205, > 205, > - 205, 205, 205, 205, 205, 205, 205, 205, 205, > 206, > - 206, 206, 206, 206, 206, 206, 206, 206, 206, > 207, > - 207, 208, 208, 209, 209, 210, 210, 211, 211, > 212, > - 212, 214, 213, 215, 213, 213, 213, 213, 216, > 213, > - 217, 213, 218, 213, 213, 213, 213, 219, 220, > 220, > - 221, 222, 222, 222, 223, 223, 224, 224, 224, > 224, > - 225, 226, 226, 227, 228, 228, 229, 230, 231, > 231, > - 232, 232, 232, 232, 232, 232, 232, 232, 232, > 232, > - 232, 233, 233, 233, 233, 234, 234, 235, 236, > 236, > - 237, 237, 238, 239, 239, 239, 240, 240, 240, > 240, > - 240, 240, 240, 240, 240, 241, 241, 242, 243, > 243, > - 244, 244, 244, 244, 244, 245, 245, 246, 246, > 247, > - 247, 247, 247, 247, 247, 247, 247, 247, 247, > 247, > - 247, 247, 248, 248, 249, 249, 249, 249, 249, > 249, > - 249, 249, 249 > + 0, 167, 168, 168, 168, 168, 168, 168, 168, > 168, > + 168, 169, 169, 169, 169, 169, 169, 170, 170, > 170, > + 170, 170, 170, 170, 170, 170, 170, 170, 170, > 171, > + 171, 171, 171, 171, 171, 171, 171, 171, 171, > 172, > + 172, 172, 172, 172, 172, 172, 172, 172, 172, > 172, > + 172, 172, 172, 172, 172, 173, 174, 174, 174, > 174, > + 174, 175, 175, 175, 176, 176, 177, 177, 178, > 178, > + 179, 179, 180, 180, 181, 182, 182, 182, 182, > 182, > + 183, 183, 183, 184, 184, 184, 184, 185, 185, > 185, > + 186, 186, 186, 186, 186, 187, 187, 187, 188, > 188, > + 188, 188, 188, 188, 188, 189, 189, 189, 189, > 189, > + 189, 189, 189, 189, 189, 190, 190, 191, 191, > 191, > + 191, 191, 191, 192, 192, 193, 193, 194, 194, > 195, > + 195, 196, 197, 197, 198, 198, 199, 199, 200, > 200, > + 200, 200, 200, 200, 200, 201, 201, 201, 201, > 201, > + 201, 201, 201, 201, 201, 201, 201, 201, 202, > 203, > + 203, 204, 204, 205, 205, 205, 205, 206, 206, > 207, > + 207, 207, 207, 207, 207, 207, 207, 207, 207, > 207, > + 207, 207, 207, 207, 207, 207, 207, 207, 207, > 208, > + 208, 208, 208, 208, 208, 208, 208, 208, 208, > 208, > + 208, 209, 209, 210, 210, 211, 211, 212, 212, > 213, > + 213, 214, 214, 216, 215, 217, 215, 215, 215, > 215, > + 218, 215, 219, 215, 220, 215, 215, 215, 215, > 221, > + 222, 222, 223, 224, 224, 224, 225, 225, 226, > 226, > + 226, 226, 227, 228, 228, 229, 230, 230, 231, > 232, > + 233, 233, 234, 234, 234, 234, 234, 234, 234, > 234, > + 234, 234, 234, 235, 235, 235, 235, 236, 236, > 237, > + 238, 238, 239, 239, 240, 241, 241, 241, 242, > 242, > + 242, 242, 242, 242, 242, 242, 242, 243, 243, > 244, > + 245, 245, 246, 246, 246, 246, 246, 247, 247, > 248, > + 248, 249, 249, 249, 249, 249, 249, 249, 249, > 249, > + 249, 249, 249, 249, 249, 249, 250, 250, 251, > 251, > + 251, 251, 251, 251, 251, 251, 251 > }; > > /* YYR2[YYN] -- Number of symbols composing right hand side of rule > YYN. */ > @@ -1996,20 +2004,20 @@ > 1, 1, 3, 1, 3, 1, 0, 1, > 3, 4, > 3, 3, 4, 4, 3, 6, 5, 2, > 2, 2, > 2, 2, 2, 2, 2, 2, 2, 2, > 2, 6, > - 5, 8, 6, 6, 7, 7, 6, 8, > 8, 3, > - 1, 1, 1, 1, 0, 2, 6, 1, > 0, 1, > - 2, 0, 3, 0, 3, 3, 3, 3, > 0, 8, > - 0, 9, 0, 9, 5, 2, 3, 1, > 3, 3, > - 3, 3, 1, 0, 5, 3, 1, 3, > 1, 0, > - 10, 1, 1, 4, 1, 1, 2, 3, > 0, 1, > - 1, 1, 1, 1, 1, 1, 1, 1, > 3, 1, > - 5, 1, 1, 1, 1, 1, 1, 2, > 1, 3, > - 2, 2, 3, 2, 0, 1, 2, 2, > 3, 9, > - 9, 8, 14, 1, 1, 6, 5, 2, > 6, 7, > - 4, 4, 6, 6, 0, 0, 3, 2, > 1, 5, > - 5, 6, 6, 4, 6, 4, 4, 6, > 6, 2, > - 8, 1, 1, 0, 3, 6, 3, 6, > 2, 5, > - 7, 5, 4 > + 5, 8, 6, 6, 7, 7, 7, 7, > 6, 8, > + 8, 3, 1, 1, 1, 1, 0, 2, > 6, 1, > + 0, 1, 2, 0, 3, 0, 3, 3, > 3, 3, > + 0, 8, 0, 9, 0, 9, 5, 2, > 3, 1, > + 3, 3, 3, 3, 1, 0, 5, 3, > 1, 3, > + 1, 0, 10, 1, 1, 4, 1, 1, > 2, 3, > + 0, 1, 1, 1, 1, 1, 1, 1, > 1, 1, > + 3, 1, 5, 1, 1, 1, 1, 1, > 1, 2, > + 1, 3, 2, 2, 3, 2, 0, 1, > 2, 2, > + 3, 9, 9, 8, 14, 1, 1, 6, > 5, 2, > + 6, 7, 4, 4, 6, 6, 0, 0, > 3, 2, > + 1, 5, 5, 6, 6, 6, 6, 4, > 6, 4, > + 4, 6, 6, 2, 8, 1, 1, 0, > 3, 6, > + 3, 6, 2, 5, 7, 5, 4 > }; > > /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state > @@ -2017,576 +2025,594 @@ > means the default is an error. */ > static const yytype_uint16 yydefact[] = > { > - 73, 61, 70, 62, 71, 63, 213, 211, > 0, 0, > - 0, 0, 0, 0, 83, 72, 0, 73, > 209, 87, > - 90, 0, 0, 225, 0, 0, 68, 0, > 74, 75, > + 73, 61, 70, 62, 71, 63, 215, 213, > 0, 0, > + 0, 0, 0, 0, 83, 72, 0, 73, > 211, 87, > + 90, 0, 0, 227, 0, 0, 68, 0, > 74, 75, > 77, 76, 78, 80, 79, 81, 82, 84, 85, > 86, > - 83, 83, 204, 1, 210, 88, 89, 83, > 214, 91, > - 92, 93, 94, 83, 274, 212, 274, 0, 0, > 233, > - 226, 227, 215, 261, 262, 217, 138, 139, 140, > 143, > - 142, 141, 144, 145, 0, 0, 0, 0, 263, > 264, > - 146, 216, 148, 204, 204, 95, 203, 0, > 98, 98, > - 275, 271, 69, 244, 245, 246, 270, 228, 229, > 232, > + 83, 83, 206, 1, 212, 88, 89, 83, > 216, 91, > + 92, 93, 94, 83, 276, 214, 276, 0, 0, > 235, > + 228, 229, 217, 263, 264, 219, 138, 139, 140, > 143, > + 142, 141, 144, 145, 0, 0, 0, 0, 265, > 266, > + 146, 218, 148, 206, 206, 95, 205, 0, > 98, 98, > + 277, 273, 69, 246, 247, 248, 272, 230, 231, > 234, > 0, 166, 149, 0, 0, 0, 0, 155, > 167, 0, > - 0, 166, 0, 0, 0, 97, 96, 0, 201, > 202, > - 0, 0, 99, 100, 101, 102, 103, 0, > 247, 0, > - 313, 273, 0, 230, 165, 115, 161, 163, > 0, 0, > + 0, 166, 0, 0, 0, 97, 96, 0, 203, > 204, > + 0, 0, 99, 100, 101, 102, 103, 0, > 249, 0, > + 317, 275, 0, 232, 165, 115, 161, 163, > 0, 0, > 0, 0, 0, 0, 154, 0, 0, 147, > 0, 0, > - 160, 0, 159, 0, 224, 138, 139, 140, 143, > 142, > - 141, 0, 0, 67, 67, 104, 0, 241, 242, > 243, > - 312, 298, 0, 0, 0, 0, 98, 283, > 284, 2, > + 160, 0, 159, 0, 226, 138, 139, 140, 143, > 142, > + 141, 0, 0, 67, 67, 104, 0, 243, 244, > 245, > + 316, 300, 0, 0, 0, 0, 98, 285, > 286, 2, > 3, 4, 5, 6, 7, 8, 9, 10, 14, > 15, > 16, 11, 12, 13, 0, 0, 0, 0, > 0, 0, > - 17, 18, 19, 20, 21, 22, 23, 24, > 25, 26, > - 27, 28, 0, 0, 0, 0, 0, 0, > 0, 0, > - 0, 0, 272, 98, 287, 0, 311, 231, > 158, 0, > - 123, 67, 67, 157, 0, 168, 0, 123, > 67, 67, > - 0, 205, 186, 187, 182, 184, 183, 185, 188, > 181, > - 177, 178, 0, 0, 0, 0, 0, 0, > 0, 0, > - 0, 0, 0, 0, 0, 0, 180, 179, > 218, 0, > - 297, 277, 67, 268, 276, 0, 0, 55, > 0, 0, > - 29, 30, 31, 32, 33, 34, 35, 36, > 37, 38, > - 0, 53, 54, 49, 50, 51, 52, 39, > 40, 41, > - 42, 43, 44, 45, 46, 47, 48, 0, 129, > 129, > - 318, 67, 67, 309, 0, 0, 0, 0, > 0, 67, > - 67, 67, 0, 0, 0, 0, 0, 106, 108, > 107, > - 105, 109, 110, 111, 112, 113, 116, 164, 162, > 151, > - 152, 153, 156, 66, 150, 220, 222, 0, > 0, 0, > - 0, 0, 0, 0, 0, 170, 200, 0, > 0, 0, > - 174, 0, 171, 0, 0, 0, 134, 239, 250, > 251, > - 252, 257, 253, 254, 255, 256, 248, 0, 259, > 266, > - 265, 267, 0, 0, 278, 0, 0, 67, > 67, 0, > - 314, 0, 316, 295, 0, 0, 0, 0, > 0, 0, > + 0, 0, 17, 18, 19, 20, 21, 22, > 23, 24, > + 25, 26, 27, 28, 0, 0, 0, 0, > 0, 0, > + 0, 0, 0, 0, 274, 98, 289, 0, 315, > 233, > + 158, 0, 123, 67, 67, 157, 0, 168, 0, > 123, > + 67, 67, 0, 207, 186, 187, 182, 184, 183, > 185, > + 188, 181, 177, 178, 0, 0, 0, 0, > 0, 0, > + 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > + 180, 179, 220, 0, 299, 279, 67, 270, > 278, 0, > + 0, 55, 0, 0, 29, 30, 31, 32, > 33, 34, > + 35, 36, 37, 38, 0, 53, 54, 49, > 50, 51, > + 52, 39, 40, 41, 42, 43, 44, 45, > 46, 47, > + 48, 0, 0, 0, 129, 129, 322, 67, 67, > 313, > + 0, 0, 0, 0, 0, 67, 67, 67, > 0, 0, > + 0, 0, 0, 106, 108, 107, 105, 109, 110, > 111, > + 112, 113, 116, 164, 162, 151, 152, 153, > 156, 66, > + 150, 222, 224, 0, 0, 0, 0, 0, > 0, 0, > + 0, 0, 0, 170, 202, 0, 0, 0, > 174, 0, > + 171, 0, 0, 0, 134, 241, 252, 253, 254, > 259, > + 255, 256, 257, 258, 250, 0, 261, 268, 267, > 269, > + 0, 0, 280, 0, 0, 67, 67, 67, > 67, 0, > + 318, 0, 320, 297, 0, 0, 0, 0, > 0, 0, > 0, 0, 0, 0, 0, 0, 67, 0, 114, > 120, > 119, 117, 118, 121, 122, 124, 134, 134, > 0, 0, > - 0, 295, 0, 0, 0, 0, 0, 169, 155, > 167, > - 0, 172, 173, 0, 0, 0, 0, 219, 238, > 115, > - 236, 0, 249, 0, 0, 269, 0, 0, > 0, 0, > - 0, 0, 0, 0, 322, 0, 0, 0, 305, > 306, > - 0, 0, 0, 0, 0, 303, 0, 129, 0, > 221, > - 223, 67, 0, 0, 0, 0, 0, 0, 0, > 199, > - 176, 0, 0, 0, 0, 0, 0, 136, > 134, 65, > - 0, 123, 0, 258, 0, 0, 294, 0, 0, > 129, > - 130, 129, 0, 0, 0, 0, 0, 0, 321, > 299, > - 300, 294, 0, 319, 67, 206, 0, 0, > 190, 0, > + 0, 0, 0, 297, 0, 0, 0, 0, 0, > 169, > + 155, 167, 0, 172, 173, 0, 0, 0, 0, > 221, > + 240, 115, 238, 0, 251, 0, 0, 271, > 0, 0, > + 0, 0, 0, 0, 0, 0, 0, 0, > 326, 0, > + 0, 0, 309, 310, 0, 0, 0, 0, 0, > 307, > + 0, 129, 0, 223, 225, 67, 0, 0, > 0, 0, > + 0, 0, 0, 0, 0, 201, 176, 0, > 0, 0, > + 0, 0, 0, 136, 134, 65, 0, 123, 0, > 260, > + 0, 0, 296, 0, 0, 0, 0, 129, 130, > 129, > + 0, 0, 0, 0, 0, 0, 325, 301, 302, > 296, > + 0, 323, 67, 208, 0, 0, 0, 0, > 190, 0, > 0, 0, 0, 175, 0, 0, 67, 131, 137, > 135, > - 64, 235, 237, 115, 132, 0, 0, 0, 115, > 115, > - 0, 301, 302, 315, 317, 296, 0, 0, 304, > 307, > - 308, 0, 129, 0, 0, 0, 196, 0, 0, > 192, > - 193, 189, 65, 133, 127, 260, 0, 0, > 0, 0, > - 123, 0, 288, 0, 123, 320, 194, 195, > 0, 0, > - 0, 234, 0, 125, 0, 281, 0, 0, 106, > 108, > - 115, 115, 0, 115, 115, 289, 310, 191, 197, > 198, > - 128, 0, 240, 279, 0, 280, 0, 291, > 290, 0, > - 0, 0, 126, 0, 0, 0, 115, 115, > 0, 0, > - 0, 293, 292, 286, 0, 0, 285, 0, 282 > + 64, 237, 239, 115, 132, 0, 0, 0, 115, > 115, > + 0, 303, 304, 305, 306, 319, 321, 298, > 0, 0, > + 308, 311, 312, 0, 129, 0, 0, 0, > 0, 0, > + 198, 0, 0, 192, 193, 189, 65, 133, 127, > 262, > + 0, 0, 0, 0, 123, 0, 290, 0, 123, > 324, > + 194, 195, 196, 197, 0, 0, 0, 236, 0, > 125, > + 0, 283, 0, 0, 106, 108, 115, 115, 0, > 115, > + 115, 291, 314, 191, 199, 200, 128, 0, 242, > 281, > + 0, 282, 0, 293, 292, 0, 0, 0, > 126, 0, > + 0, 0, 115, 115, 0, 0, 0, 295, 294, > 288, > + 0, 0, 287, 0, 284 > }; > > /* YYDEFGOTO[NTERM-NUM]. */ > static const yytype_int16 yydefgoto[] = > { > - -1, 263, 264, 265, 290, 307, 161, 162, 78, > 531, > + -1, 267, 268, 269, 294, 311, 161, 162, 78, > 551, > 112, 12, 79, 14, 15, 40, 41, 42, 47, > 53, > - 117, 127, 336, 228, 415, 339, 602, 583, 390, > 487, > - 564, 437, 488, 80, 163, 136, 153, 137, 138, > 109, > - 356, 378, 357, 120, 87, 154, 16, 17, > 18, 20, > - 19, 366, 416, 417, 62, 23, 60, 100, 440, > 441, > - 128, 169, 54, 95, 55, 48, 443, 379, 82, > 381, > - 273, 274, 56, 91, 92, 222, 587, 131, 313, > 540, > - 454, 223, 224, 225, 226 > + 117, 127, 342, 230, 425, 345, 628, 609, 400, > 503, > + 588, 449, 504, 80, 163, 136, 153, 137, 138, > 109, > + 364, 386, 365, 120, 87, 154, 16, 17, > 18, 20, > + 19, 374, 426, 427, 62, 23, 60, 100, 452, > 453, > + 128, 169, 54, 95, 55, 48, 455, 387, 82, > 389, > + 277, 278, 56, 91, 92, 224, 613, 131, 319, > 560, > + 468, 225, 226, 227, 228 > }; > > /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing > STATE-NUM. */ > -#define YYPACT_NINF -561 > +#define YYPACT_NINF -572 > static const yytype_int16 yypact[] = > { > - 284, -561, -561, -561, -561, -561, -561, -561, -34, > -121, > - 14, -63, 101, -22, 17, -561, 127, 883, > -561, 22, > - 162, 10, 23, -561, 12, 158, -561, 1464, -561, > -561, > - -561, -561, -561, -561, -561, -561, -561, -561, -561, > -561, > - -46, -46, 176, -561, -561, -561, -561, -46, -561, > -561, > - -561, -561, -561, -46, 200, -561, -10, 209, 219, > 234, > - -561, -561, -561, -561, -561, 124, -561, -561, -561, > -561, > - -561, -561, -561, -561, 272, 275, 2, 126, -561, > -561, > - -561, 28, -561, 243, 243, 196, -561, 165, > 33, 33, > - -561, -561, 215, -561, -561, -561, -561, -561, -561, > -561, > - -73, 1059, -561, 129, 132, 506, 124, -561, 28, > -111, > - 134, 1059, 137, 165, 165, -561, -561, 1014, -561, > -561, > - 1504, 292, -561, -561, -561, -561, -561, 1562, > -561, -6, > - 1843, -561, 278, -561, -561, 28, -561, 147, 153, > 1620, > - 1620, 148, -110, 1620, -561, 309, 164, -561, 1504, > 1620, > - 124, 166, 28, 388, -561, 342, 310, 311, 314, > 316, > - 317, 156, 322, 1115, 279, -561, 16, -561, -561, > -561, > - -561, -561, 281, 1660, 20, 327, 33, -561, -561, > -561, > - -561, -561, -561, -561, -561, -561, -561, -561, -561, > -561, > - -561, -561, -561, -561, 511, 787, 1620, 1620, 1620, > 1620, > - -561, -561, -561, -561, -561, -561, -561, -561, -561, > -561, > - -561, -561, 1620, 1620, 1620, 1620, 1620, 1620, 1620, > 1620, > - 1620, 1620, -561, 33, -561, -60, -561, -561, 434, > 1345, > - -561, -7, -33, -561, 181, 28, 192, -561, 279, > -16, > - 1014, -561, -561, -561, -561, -561, -561, -561, -561, > -561, > - -561, -561, 511, 787, 198, 199, 201, 203, 204, > 1385, > - 1678, 609, 329, 207, 208, 210, -561, -561, -561, > 211, > - -561, 124, 702, -561, 206, 841, 841, -561, 841, > 1562, > - -561, -561, -561, -561, -561, -561, -561, -561, -561, > -561, > - 1620, -561, -561, -561, -561, -561, -561, -561, -561, > -561, > - -561, -561, -561, -561, -561, -561, -561, 1620, 100, > 114, > - -561, 702, -31, 222, 225, 227, 228, 235, 239, > 702, > - 702, 702, 325, 1562, 1620, 1620, 360, -561, -561, > -561, > - -561, -561, -561, -561, -561, -561, -561, -561, -561, > -96, > - -561, -561, -561, -561, -96, -561, 137, 361, 247, > 252, > - 1504, 1504, 1504, 1504, 1504, -561, -561, -54, 788, > -88, > - -561, -85, -561, 1504, 1504, 1504, 250, 1406, -561, > -561, > - -561, -561, -561, -561, -561, -561, 345, 1504, -561, > -561, > - -561, -561, 1620, 255, -561, 259, 841, 702, > 702, 4, > - -561, 5, -561, -561, 841, 249, 1620, 1620, 1620, > 1620, > - 1620, 261, 262, 263, 1620, 841, 702, 266, -561, > -561, > - -561, -561, -561, -561, -561, -561, 250, 250, 1620, > 1504, > - 1504, -561, 269, 274, 276, 277, 1504, -561, 265, > 969, > - -83, -561, -561, 282, 283, 391, -5, -561, > -561, 28, > - 285, 289, -561, 413, -78, -561, 426, 427, 294, > 293, > - 295, 841, 442, 841, 296, 299, 841, 300, 28, > -561, > - 301, 302, 444, 841, 841, 28, 306, 305, 1620, > -561, > - -561, -45, 307, 308, 94, 1504, 1504, 1504, 1504, > -561, > - -561, 312, 1504, 1504, 1620, 438, 463, -561, 250, > 1746, > - 1446, -561, 315, -561, 841, 841, 1718, 841, 841, > 305, > - -561, 305, 1620, 841, 318, 1620, 1620, 1620, -561, > -561, > - -561, 1718, 415, -561, 702, -561, 1504, 1504, -561, > 320, > - 323, 324, 328, -561, 331, 332, -30, -561, -561, > -561, > - -561, -561, -561, 28, 81, 455, 334, 333, > 123, 28, > - 95, -561, -561, -561, -561, -561, 335, 841, -561, > -561, > - -561, 98, 305, 339, 343, 1504, -561, 1504, 1504, > -561, > - -561, -561, 1746, -561, 433, -561, 479, -4, 560, > 560, > - -561, 1736, -561, 341, -561, -561, -561, -561, 346, > 349, > - 351, -561, 500, 358, 841, -561, 1255, -1, 355, > 356, > - -561, -561, 87, 123, 28, -561, -96, -561, -561, > -561, > - -561, 489, -561, -561, 370, -561, 1255, 434, 434, > 495, > - 560, 560, -561, 498, 373, 841, -561, -561, 841, > 514, > - 460, 434, 434, -561, 841, 516, -561, 841, -561 > + 445, -572, -572, -572, -572, -572, -572, -572, -2, > -122, > + 19, -58, 90, -40, 26, -572, 112, 855, > -572, 52, > + 217, -28, 4, -572, 12, 146, -572, 1594, -572, > -572, > + -572, -572, -572, -572, -572, -572, -572, -572, -572, > -572, > + 70, 70, 125, -572, -572, -572, -572, 70, -572, > -572, > + -572, -572, -572, 70, 166, -572, -8, 176, 185, > 201, > + -572, -572, -572, -572, -572, 80, -572, -572, -572, > -572, > + -572, -572, -572, -572, 232, 241, 2, 227, -572, > -572, > + -572, -1, -572, 211, 211, 137, -572, 118, 258, > 258, > + -572, -572, 87, -572, -572, -572, -572, -572, -572, > -572, > + -57, 1357, -572, 105, 139, 1020, 80, -572, -1, > -107, > + 109, 1357, 145, 118, 118, -572, -572, 1400, -572, > -572, > + 1634, 302, -572, -572, -572, -572, -572, 1677, -572, > -16, > + 1856, -572, 290, -572, -572, -1, -572, 159, 177, > 1695, > + 1695, 179, -102, 1695, -572, 331, 189, -572, 1634, > 1695, > + 80, 186, -1, 247, -572, 226, 335, 338, 339, > 342, > + 344, 269, 345, 1123, 303, -572, 24, -572, -572, > -572, > + -572, -572, 300, 1752, 76, 347, 258, -572, -572, > -572, > + -572, -572, -572, -572, -572, -572, -572, -572, -572, > -572, > + -572, -572, -572, -572, 314, 845, 314, 845, 1695, > 1695, > + 1695, 1695, -572, -572, -572, -572, -572, -572, -572, > -572, > + -572, -572, -572, -572, 1695, 1695, 1695, 1695, 1695, > 1695, > + 1695, 1695, 1695, 1695, -572, 258, -572, 97, -572, > -572, > + 172, 1418, -572, -43, -31, -572, 196, -1, 206, > -572, > + 303, -12, 1400, -572, -572, -572, -572, -572, -572, > -572, > + -572, -572, -572, -572, 314, 845, 314, 845, 208, > 216, > + 219, 220, 223, 1473, 1795, 1063, 348, 224, 225, > 234, > + -572, -572, -572, 237, -572, 80, 843, -572, 238, > 524, > + 524, -572, 524, 1677, -572, -572, -572, -572, -572, > -572, > + -572, -572, -572, -572, 1695, -572, -572, -572, -572, > -572, > + -572, -572, -572, -572, -572, -572, -572, -572, -572, > -572, > + -572, 1695, 1695, 1695, 27, 29, -572, 843, -23, > 248, > + 249, 263, 264, 265, 266, 843, 843, 843, 341, > 1677, > + 1695, 1695, 389, -572, -572, -572, -572, -572, -572, > -572, > + -572, -572, -572, -572, -572, 198, -572, -572, -572, > -572, > + 198, -572, 145, 359, 250, 270, 271, 272, 1634, > 1634, > + 1634, 1634, 1634, -572, -572, -30, 1314, -104, -572, > -101, > + -572, 1634, 1634, 1634, 275, 1518, -572, -572, -572, > -572, > + -572, -572, -572, -572, 366, 1634, -572, -572, -572, > -572, > + 1695, 276, -572, 277, 524, 843, 843, 843, > 843, 25, > + -572, 35, -572, -572, 524, 278, 1695, 1695, 1695, > 1695, > + 1695, 280, 282, 283, 1695, 524, 843, 287, -572, > -572, > + -572, -572, -572, -572, -572, -572, 275, 275, 1695, > 1634, > + 1634, 1634, 1634, -572, 291, 292, 293, 294, 1634, > -572, > + 288, 975, -99, -572, -572, 296, 297, 408, 9, > -572, > + -572, -1, 299, 304, -572, 435, -96, -572, 442, > 443, > + 308, 306, 310, 325, 326, 524, 479, 524, 328, > 329, > + 524, 334, -1, -572, 336, 337, 487, 524, > 524, -1, > + 349, 350, 1695, -572, -572, -20, 351, 352, 353, > 354, > + 102, 1634, 1634, 1634, 1634, -572, -572, 356, 1634, > 1634, > + 1695, 489, 497, -572, 275, 571, 1576, -572, 357, > -572, > + 524, 524, 1853, 524, 524, 524, 524, 350, -572, > 350, > + 1695, 524, 358, 1695, 1695, 1695, -572, -572, -572, > 1853, > + 459, -572, 843, -572, 1634, 1634, 1634, 1634, -572, > 360, > + 369, 364, 368, -572, 371, 376, -15, -572, -572, > -572, > + -572, -572, -572, -1, 6, 512, 380, 378, > 71, -1, > + 171, -572, -572, -572, -572, -572, -572, -572, 379, > 524, > + -572, -572, -572, 174, 350, 385, 387, 388, 391, > 1634, > + -572, 1634, 1634, -572, -572, -572, 571, -572, 499, > -572, > + 536, -6, 699, 699, -572, 1871, -572, 393, -572, > -572, > + -572, -572, -572, -572, 401, 407, 409, -572, 558, > 418, > + 524, -572, 1265, -3, 415, 417, -572, -572, > -19, 71, > + -1, -572, 198, -572, -572, -572, -572, 549, -572, > -572, > + 416, -572, 1265, 172, 172, 556, 699, 699, -572, > 557, > + 419, 524, -572, -572, 524, 559, 507, 172, 172, > -572, > + 524, 563, -572, 524, -572 > }; > > /* YYPGOTO[NTERM-NUM]. */ > static const yytype_int16 yypgoto[] = > { > - -561, 406, 407, 408, 298, 303, -173, -561, 0, > -15, > - -150, 454, 8, -561, -561, -561, -561, 189, -561, > -561, > - -561, -149, -561, -409, -561, -234, -561, -561, > -289, 24, > - -561, -404, -561, -561, -26, 330, -122, -561, 443, > 452, > - -92, -159, -226, 102, 183, 321, -561, -561, 548, > -561, > - -561, -561, -561, -561, -561, -561, -561, -561, -561, > -561, > - 477, -561, -561, -561, -561, -561, -561, -560, > -76, 46, > - -105, -561, -561, 519, -561, -561, -561, -561, > -561, 61, > - 160, -561, -561, -561, -561 > + -572, 451, 453, 454, -174, -152, -173, -572, > 0, 1, > + -146, 493, 3, -572, -572, -572, -572, 49, -572, > -572, > + -572, -139, -572, -416, -572, -223, -572, -572, > -311, 34, > + -572, -397, -572, -572, -26, 361, -120, -572, 478, > 486, > + -64, -153, -250, 164, 207, 355, -572, -572, 577, > -572, > + -572, -572, -572, -572, -572, -572, -572, -572, -572, > -572, > + 528, -572, -572, -572, -572, -572, -572, -571, -115, > 162, > + -191, -572, -572, 540, -572, -572, -572, -572, > -572, 89, > + 187, -572, -572, -572, -572 > }; > > /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If > positive, shift that token. If negative, reduce the rule which > number is the opposite. If zero, do what YYDEFACT says. > If YYTABLE_NINF, syntax error. */ > -#define YYTABLE_NINF -209 > +#define YYTABLE_NINF -211 > static const yytype_int16 yytable[] = > { > - 11, 81, 278, 344, 266, 166, 104, 277, 13, > 110, > - 277, 90, 469, 470, 268, 451, 453, 11, > 21, 93, > - 392, 110, 167, 110, 110, 13, 604, 279, 164, > 485, > - 489, 275, 24, 22, 359, 361, 2, 276, > 110, 4, > - 409, 410, 411, 143, 143, 412, 614, 110, 486, > 413, > - 414, 108, 144, 234, 324, 325, 238, 452, > 452, 29, > - 30, 31, 32, 33, 34, 35, 426, 36, 45, > 426, > - 46, 426, 25, 431, 323, 135, 426, 241, 432, > 108, > - 481, 132, 110, 493, 529, 135, 133, 267, 345, > 346, > - 26, 152, 11, 310, 121, 122, 123, 124, 125, > 126, > - 426, 152, 37, 38, 39, 427, 111, 515, 314, > 315, > - 316, 317, 318, 231, 232, 485, 322, 235, > 111, 27, > - 111, 111, 561, 239, 562, 609, 394, 43, 341, > 568, > - 569, 28, 430, 63, 64, 111, 106, 66, > 67, 68, > - 69, 70, 71, 72, 111, 1, 2, 272, > 3, 4, > - 5, 444, 340, 94, 110, 585, 168, 386, 605, > 244, > - 245, 246, 247, 57, 105, 37, 38, 39, > 110, 59, > - 308, 309, 272, 311, 269, 73, 58, -144, 513, > 111, > - 61, 607, 608, -67, 610, 611, 312, 272, 272, > 272, > - 272, 272, 319, 320, 321, 272, 380, 118, 119, > 380, > - 380, 405, 380, 135, 49, 50, 51, 621, > 622, 52, > - 543, 85, 544, 86, 152, 148, 149, 409, 410, > 411, > - 407, 90, 412, 409, 410, 411, 413, 414, > 412, 83, > - 84, 97, 413, 414, 1, 380, 88, 3, > 115, 5, > - 116, 98, 89, 380, 380, 380, 518, 570, 502, > 571, > - 574, 111, 571, 152, 389, -67, 99, 534, 421, > 422, > - 423, 424, 425, 575, 387, 111, 113, 114, 391, > -67, > - 266, 433, 434, 435, -144, 101, 102, 445, -144, > 103, > - 86, 388, 74, 75, -208, 145, 76, 139, 77, > 107, > - 140, 457, 147, 459, 460, 461, 165, 152, 406, > 272, > - 227, 229, -69, 1, 2, 230, 3, 4, 5, > 233, > - 380, 380, 380, 236, 6, 7, 237, 240, 380, > -56, > - -57, 383, 384, -60, 385, -59, -58, 472, 473, > 380, > - 380, 248, 429, 110, 479, 8, 592, 270, > 277, 9, > - 596, 439, 342, 10, 343, -55, -55, -55, -55, > 350, > - 351, 362, 352, 267, 353, 354, 272, 393, 363, > 364, > - 382, 365, 367, 404, 408, 401, 402, 403, 242, > 243, > - 272, 458, 272, 272, 272, 380, 395, 380, 465, > 396, > - 380, 397, 398, 519, 520, 521, 522, 380, 380, > 399, > - 524, 525, 471, 400, 586, 63, 64, 545, 419, > 418, > - 548, 549, 550, 420, 436, 442, 456, 1, 2, > 446, > - 3, 4, 5, 447, 606, 462, 463, 464, 380, > 380, > - 468, 380, 380, 475, 553, 554, 480, 380, 476, > 484, > - 477, 478, 448, 449, 450, 492, 482, 483, 380, > 490, > - 455, 491, 514, 494, 495, 496, 500, 497, 508, > 498, > - 502, 466, 467, 503, 505, 506, 507, 511, 526, > 512, > - 527, 516, 517, 578, 533, 579, 580, 528, 452, > 535, > - 539, 380, 547, 523, 555, 556, 272, 565, 557, > 272, > - 272, 272, 558, 559, 560, 539, 582, 326, 566, > 530, > - 567, 576, 380, 380, 572, 577, 584, 499, 597, > 501, > - 595, 598, 504, 599, 600, 601, -18, -19, 380, > 509, > - 510, 612, 615, 63, 64, 618, 106, 66, > 67, 68, > - 69, 70, 71, 72, 613, 1, 2, 619, > 3, 4, > - 5, 624, 625, 627, 380, 380, 219, 220, 221, > 380, > - 536, 537, 380, 541, 542, 594, 130, 581, 380, > 546, > - 348, 380, 327, 328, 146, 73, 349, 142, 563, > 338, > - 552, 347, 530, 368, 369, 44, 129, 63, 64, > 370, > - 329, 330, 551, 331, 332, 96, 333, 334, > 335, 1, > - 2, 474, 3, 4, 5, 371, 372, 373, > 0, 0, > - 0, 0, 0, 573, 0, 0, 0, 0, > 0, 0, > - 374, 375, 280, 281, 282, 283, 284, 285, 286, > 287, > - 288, 289, 0, 326, 590, 591, 63, 64, 376, > 106, > - 155, 156, 157, 158, 159, 160, 72, 0, > 1, 2, > - 603, 3, 4, 5, 179, 180, 181, 182, 183, > 184, > - 185, 186, 187, 188, 189, 190, 191, 192, 193, > 252, > - 253, 0, 0, 0, 0, 0, 616, 617, > 73, 0, > - 0, 620, 74, 75, 623, 0, 76, 0, 77, > 141, > - 626, 0, 0, 628, 0, 0, 254, 200, 588, > 589, > - 203, 204, 205, 206, 207, 208, 209, 210, > 211, 0, > - 255, 0, 256, 257, 258, 0, 329, 330, 0, > 331, > - 332, 0, 333, 334, 335, 368, 369, 0, > 0, 63, > - 64, 370, 0, 0, 0, 0, 0, 0, > 0, 0, > - 377, 1, 2, 0, 3, 4, 5, 371, 372, > 373, > + 11, 81, 282, 13, 402, 281, 104, 166, 281, > 316, > + 270, 110, 167, 90, 367, 369, 350, 11, 272, > 635, > + 13, 93, 312, 110, 320, 321, 322, 323, 324, > 483, > + 484, 110, 328, 24, 110, 505, 465, 283, 243, > 110, > + 501, 630, 110, 501, 2, 313, 467, 4, 271, > 143, > + 21, 108, 438, 110, 143, 438, 164, 438, 144, > 443, > + 438, 640, 502, 236, 444, 22, 497, 509, > 29, 30, > + 31, 32, 33, 34, 35, 135, 36, 25, 466, > 108, > + 354, 110, 356, 110, 240, 135, 329, 279, > 466, 83, > + 84, 152, 11, 280, 351, 352, 88, 26, 45, > 132, > + 46, 152, 89, 355, 133, 357, 1, 549, > 27, 3, > + 111, 5, 43, 233, 234, 28, 442, 237, 346, > 419, > + 420, 421, 111, 241, 422, -144, 438, 57, 423, > 424, > + 111, 439, 347, 111, 533, 456, 404, 586, 111, > 585, > + 417, 111, 592, 593, 419, 420, 421, 276, 168, > 422, > + 118, 119, 111, 423, 424, 611, -67, 94, > 631, 58, > + 85, 388, 86, 394, 388, 388, 105, 388, 61, > 273, > + 531, 59, 314, 315, 276, 317, 37, 38, 39, > 115, > + 111, 116, 111, 399, -67, 401, -67, 90, 318, > 276, > + 276, 276, 276, 276, 325, 326, 327, 276, 97, > 457, > + 633, 634, 388, 636, 637, 135, 565, 98, 566, > 415, > + 388, 388, 388, 330, 331, 471, 152, 473, 474, > 475, > + 37, 38, 39, 99, -144, 332, 647, 648, -144, > -55, > + -55, -55, -55, 101, 63, 64, 102, 106, > 66, 67, > + 68, 69, 70, 71, 72, 103, 1, 2, > 86, 3, > + 4, 5, 244, 245, 63, 64, 538, 152, > 520, 49, > + 50, 51, 145, 599, 52, 139, 1, 2, > 395, 3, > + 4, 5, 246, 247, 248, 249, 73, 148, 149, > 388, > + 388, 388, 388, 388, 554, 396, 397, 398, 270, > 388, > + 113, 114, 333, 334, 433, 434, 435, 436, 437, > 140, > + 388, 388, 147, 152, 416, 276, 165, 445, 446, > 447, > + 335, 336, 229, 337, 338, 231, 339, 340, 341, > 121, > + 122, 123, 124, 125, 126, 594, 271, 595, 598, > 567, > + 595, 232, 570, 571, 572, 238, 419, 420, 421, > 242, > + 441, 422, 235, 239, -56, 423, 424, -57, -60, > 451, > + 388, -59, 388, -58, 250, 388, 274, 110, 281, > 348, > + 349, 358, 388, 388, 276, 486, 487, 488, 489, > 359, > + 370, 618, 360, 361, 495, 622, 362, 371, 372, > 414, > + 276, 472, 276, 276, 276, 74, 75, 373, > 479, 76, > + 375, 77, 107, 418, 390, 388, 388, 428, 388, > 388, > + 388, 388, 485, 429, 405, 406, 388, 284, 285, > 286, > + 287, 288, 289, 290, 291, 292, 293, 388, 612, > 407, > + 408, 409, 410, 430, 431, 432, 454, 539, 540, > 541, > + 542, 448, 458, 459, 544, 545, 476, 470, 477, > 478, > + 632, 391, 392, 482, 393, -210, 500, 491, 492, > 493, > + 494, 496, 498, 499, 388, 506, 532, 508, 507, > 510, > + 511, 512, 513, -69, 1, 2, 514, 3, > 4, 5, > + 575, 576, 577, 578, 546, 6, 7, 388, 388, > 403, > + 553, 515, 516, 518, 520, 521, 559, 411, 412, > 413, > + 523, 526, 524, 525, 276, 388, 8, 276, 276, > 276, > + 9, 548, 529, 559, 10, 550, 530, 534, 535, > 536, > + 537, 547, 466, 555, 569, 604, 579, 605, 606, > 543, > + 581, 388, 388, 580, 582, 583, 388, 376, 377, > 388, > + 584, 63, 64, 378, 589, 388, 590, 591, 388, > 600, > + 596, 601, 602, 1, 2, 603, 3, 4, 5, > 379, > + 380, 381, 608, 610, 621, 623, 460, 461, 462, > 463, > + 464, 624, 626, 625, 382, 383, 469, 627, -18, > 620, > + -19, 638, 639, 641, 644, 645, 650, 480, 481, > 651, > + 653, 221, 384, 222, 223, 130, 550, 607, 587, > 146, > + 1, 142, 344, 3, 44, 5, 96, 353, 179, > 180, > + 181, 182, 183, 184, 185, 186, 187, 188, 189, > 190, > + 191, 192, 193, 254, 255, 256, 257, 129, > 573, 0, > + 490, 0, 0, 0, 332, 0, 0, 517, 0, > 519, > + 0, 0, 522, 0, 0, 0, 0, 0, 0, > 527, > + 528, 0, 258, 202, 203, 204, 205, 206, 207, > 208, > + 209, 210, 211, 212, 213, 0, 259, 0, 260, > 261, > + 262, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > + 0, 0, 556, 557, 0, 561, 562, 563, > 564, 0, > + 0, 0, 0, 568, 0, 0, 385, 0, > 0, 0, > + 0, 333, 334, 0, 574, 0, 0, 0, > 0, 0, > + 0, 0, 376, 377, 0, 0, 63, 64, 378, > 335, > + 336, 0, 337, 338, 0, 339, 340, 341, > 1, 2, > + 0, 3, 4, 5, 379, 380, 381, 0, > 0, 0, > + 0, 597, 0, 0, 0, 0, 0, 0, 0, > 382, > + 383, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > + 0, 0, 332, 0, 616, 617, 0, 384, > 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > - 0, 0, 374, 375, 0, 0, 0, 0, > 0, 0, > - 0, 0, 0, 0, 0, 0, 110, 0, > 0, 0, > - 376, 0, 0, 0, 0, 74, 75, 0, > 0, 76, > - 0, 77, 360, 0, 0, 0, 179, 180, 181, > 182, > - 183, 184, 185, 186, 187, 188, 189, 190, 191, > 192, > - 193, 252, 253, 0, 0, 63, 64, 0, 106, > 155, > - 156, 157, 158, 159, 160, 72, 0, 1, > 2, 0, > - 3, 4, 5, 291, 292, 0, 0, 0, 254, > 200, > - 201, 202, 203, 204, 205, 206, 207, 208, 209, > 210, > - 211, 0, 255, 0, 256, 257, 258, 73, > 0, 0, > - 0, 0, 0, 0, 368, 369, 0, 0, > 63, 64, > - 370, 0, 0, 111, 0, 0, 0, 0, > 0, 0, > - 1, 2, 377, 3, 4, 5, 371, 372, > 373, 0, > + 0, 0, 629, 179, 180, 181, 182, 183, 184, > 185, > + 186, 187, 188, 189, 190, 191, 192, 193, 254, > 255, > + 256, 257, 0, 0, 0, 0, 0, 0, 642, > 643, > + 0, 0, 0, 646, 0, 0, 649, 0, > 0, 0, > + 0, 0, 652, 0, 0, 654, 0, 258, 202, > 614, > + 615, 205, 206, 207, 208, 209, 210, 211, 212, > 213, > + 0, 259, 0, 260, 261, 262, 0, 335, > 336, 0, > + 337, 338, 0, 339, 340, 341, 376, 377, > 0, 0, > + 63, 64, 378, 0, 0, -209, 0, 0, > 0, 0, > + 0, 385, 1, 2, 0, 3, 4, 5, 379, > 380, > + 381, 295, 296, -69, 1, 2, 0, 3, > 4, 5, > + 0, 0, 0, 382, 383, 6, 7, 0, > 0, 0, > + 0, 0, 0, 0, 0, 0, 0, 110, > 0, 0, > + 0, 384, 0, 0, 0, 0, 8, 0, > 0, 0, > + 9, 0, 0, 0, 10, 0, 0, 179, 180, > 181, > + 182, 183, 184, 185, 186, 187, 188, 189, 190, > 191, > + 192, 193, 254, 255, 256, 257, 0, 0, > 0, 0, > + 0, 0, 0, 0, 297, 298, 299, 300, 301, > 302, > + 303, 304, 305, 306, 307, 308, 309, 310, > 0, 0, > + 0, 258, 202, 203, 204, 205, 206, 207, 208, > 209, > + 210, 211, 212, 213, 0, 259, 0, 260, 261, > 262, > + 0, 0, 63, 64, 0, 0, 0, 0, > 0, 0, > + 0, 0, 0, 0, 1, 2, 111, 3, > 4, 5, > + 251, 0, 0, 0, 0, 385, 0, 0, > 0, 0, > + 0, 0, 0, 0, 0, 252, 253, 0, > 0, 0, > + 0, 0, 0, 0, 0, 0, 0, 63, 64, > 110, > + 106, 66, 67, 68, 69, 70, 71, 72, > 0, 1, > + 2, 0, 3, 4, 5, 0, 0, 0, 0, > 179, > + 180, 181, 182, 183, 184, 185, 186, 187, 188, > 189, > + 190, 191, 192, 193, 254, 255, 256, 257, > 0, 73, > + 63, 64, 0, 106, 155, 156, 157, 158, 159, > 160, > + 72, 0, 1, 2, 0, 3, 4, 5, > 0, 0, > + 0, 0, 0, 258, 202, 203, 204, 205, 206, > 207, > + 208, 209, 210, 211, 212, 213, 0, 259, 0, > 260, > + 261, 262, 73, 0, 0, 0, 0, 0, > 0, 0, > + 0, 0, 0, 0, 0, 0, 0, 0, > 111, 0, > + 63, 64, -67, 0, 263, 0, 0, 264, 0, > 265, > + 0, 266, 1, 2, 0, 3, 4, 5, > 251, 0, > 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > - 0, 374, 375, -207, 293, 294, 295, 296, 297, > 298, > - 299, 300, 301, 302, 303, 304, 305, 306, 0, > 376, > - 0, -69, 1, 2, 0, 3, 4, 5, > 0, 0, > - 0, 0, 0, 6, 7, 179, 180, 181, 182, > 183, > - 184, 185, 186, 187, 188, 189, 190, 191, 192, > 193, > - 252, 253, 0, 0, 8, 0, 0, 0, > 9, 0, > - 0, 0, 10, 0, 74, 75, 0, 0, > 76, 0, > - 77, 428, 0, 0, 0, 0, 0, 254, 200, > 201, > - 202, 203, 204, 205, 206, 207, 208, 209, 210, > 211, > - 0, 255, 0, 256, 257, 258, 63, 64, > 0, 0, > - 0, 0, 0, 0, 0, 0, 0, 0, > 1, 2, > - 0, 3, 4, 5, 249, 0, 0, 0, > 0, 0, > - 0, 377, 0, 0, 0, 0, 0, 0, 0, > 250, > - 251, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > - 0, 63, 64, 110, 150, 66, 67, 68, > 69, 70, > - 71, 72, 0, 1, 2, 0, 3, 4, > 5, 0, > - 0, 0, 0, 179, 180, 181, 182, 183, 184, > 185, > - 186, 187, 188, 189, 190, 191, 192, 193, 252, > 253, > - 0, 0, 0, 73, 0, 0, 63, 64, 0, > 106, > - 66, 67, 68, 69, 70, 71, 72, 0, > 1, 2, > - 0, 3, 4, 5, 0, 254, 200, 201, 202, > 203, > - 204, 205, 206, 207, 208, 209, 210, 211, 134, > 255, > - 0, 256, 257, 258, 0, 0, 0, 0, > 73, 0, > + 0, 0, 0, 252, 253, 0, 0, 0, > 0, 0, > + 0, 0, 0, 0, 0, 0, 0, 110, > 74, 75, > + 0, 0, 76, 0, 77, 141, 0, 0, > 0, 0, > + 0, 0, 0, 0, 0, 0, 0, 179, 180, > 181, > + 182, 183, 184, 185, 186, 187, 188, 189, 190, > 191, > + 192, 193, 254, 255, 256, 257, 0, 0, > 0, 0, > + 0, 74, 75, 0, 0, 76, 0, 77, > 368, 0, > 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > - 111, 0, 63, 64, -67, 0, 259, 0, 0, > 260, > - 0, 261, 0, 262, 1, 2, 151, 3, > 4, 5, > - 249, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > - 0, 0, 0, 0, 0, 250, 251, 0, > 0, 0, > - 0, 0, 0, 0, 0, 0, 0, 0, 0, > 110, > - 74, 75, 0, 0, 76, 0, 77, 0, > 0, 0, > - 0, 0, 0, 0, 0, 0, 0, 0, 0, > 179, > - 180, 181, 182, 183, 184, 185, 186, 187, 188, > 189, > - 190, 191, 192, 193, 252, 253, 0, 0, > 0, 0, > - 0, 0, 0, 0, 0, 74, 75, 0, > 0, 76, > - 0, 77, 0, 0, 0, 0, 0, 0, > 0, 0, > - 0, 254, 200, 201, 202, 203, 204, 205, 206, > 207, > - 208, 209, 210, 211, 0, 255, 0, 256, 257, > 258, > - 0, 0, 0, 0, 0, 0, 0, 0, 368, > 369, > - 0, 0, 0, 0, 370, 0, 111, 0, > 0, 0, > - 0, 0, 259, 0, 0, 260, 0, 261, 0, > 262, > - 371, 372, 373, 0, 0, 0, 0, 0, > 0, 0, > - 0, 0, 0, 0, 0, 374, 375, 0, > 0, 0, > + 0, 258, 202, 203, 204, 205, 206, 207, 208, > 209, > + 210, 211, 212, 213, 0, 259, 0, 260, 261, > 262, > + 0, 0, 0, 0, 0, 0, 0, 0, 376, > 377, > + 0, 0, 0, 0, 378, 0, 111, 0, > 0, 0, > + 0, 0, 263, 0, 0, 264, 0, 265, 0, > 266, > + 379, 380, 381, 0, 0, 0, 0, 0, > 0, 0, > + 0, 0, 0, 0, 0, 382, 383, 0, > 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > - 0, 0, 0, 376, 0, 0, 0, 0, > 0, 0, > - 0, 0, 0, 0, 0, 0, 0, 0, 0, > 179, > + 0, 63, 64, 384, 106, 155, 156, 157, 158, > 159, > + 160, 72, 0, 1, 2, 0, 3, 4, 5, > 179, > 180, 181, 182, 183, 184, 185, 186, 187, 188, > 189, > - 190, 191, 192, 193, 252, 253, 0, 0, > 0, 0, > - 0, 0, 63, 64, 0, 106, 66, 67, > 68, 69, > - 70, 71, 72, 0, 1, 2, 0, 3, > 4, 5, > - 0, 254, 200, 201, 202, 203, 204, 205, 206, > 207, > - 208, 209, 210, 211, 337, 255, 0, 256, 257, > 258, > - 0, 0, 63, 64, 73, 106, 155, 156, 157, > 158, > - 159, 160, 72, 0, 1, 2, 0, 3, > 4, 5, > - 0, 0, 0, 63, 64, 377, 106, 66, > 67, 68, > - 69, 70, 71, 72, 0, 1, 2, 0, > 3, 4, > - 5, 0, 0, 0, 73, 0, 0, 0, > 0, 0, > - 0, 0, 0, 0, 0, 438, 0, 0, > 0, 0, > - 0, 0, 0, 63, 64, 73, 106, 66, > 67, 68, > + 190, 191, 192, 193, 254, 255, 256, 257, > 0, 0, > + 0, 0, 0, 73, 63, 64, 0, 106, > 66, 67, > + 68, 69, 70, 71, 72, 0, 1, 2, > 0, 3, > + 4, 5, 0, 258, 202, 203, 204, 205, 206, > 207, > + 208, 209, 210, 211, 212, 213, 134, 259, 0, > 260, > + 261, 262, 0, 0, 0, 0, 73, 63, > 64, 0, > + 150, 66, 67, 68, 69, 70, 71, 72, > 0, 1, > + 2, 0, 3, 4, 5, 63, 64, 385, > 106, 66, > + 67, 68, 69, 70, 71, 72, 0, 1, > 2, 0, > + 3, 4, 5, 0, 0, 0, 0, 0, > 0, 73, > + 0, 0, 0, 0, 0, 0, 0, 343, > 0, 0, > + 0, 0, 0, 0, 0, 0, 0, 73, > 0, 0, > + 0, 0, 74, 75, 0, 0, 76, 0, 77, > 440, > + 63, 64, 0, 106, 155, 156, 157, 158, 159, > 160, > + 72, 0, 1, 2, 0, 3, 4, 5, > 0, 0, > + 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > + 0, 0, 0, 0, 0, 74, 75, 0, > 0, 76, > + 0, 77, 73, 0, 151, 63, 64, 0, > 106, 66, > + 67, 68, 69, 70, 71, 72, 0, 1, > 2, 0, > + 3, 4, 5, 0, 0, 0, 0, 0, > 0, 0, > + 0, 0, 0, 0, 0, 0, 0, 450, > 74, 75, > + 0, 0, 76, 0, 77, 0, 0, 73, > 0, 0, > + 0, 0, 0, 0, 0, 0, 74, 75, > 0, 0, > + 76, 0, 77, 63, 64, 0, 106, 66, > 67, 68, > 69, 70, 71, 72, 0, 1, 2, 0, > 3, 4, > 5, 63, 64, 0, 65, 66, 67, 68, 69, > 70, > - 71, 72, 0, 1, 2, 532, 3, 4, > 5, 0, > + 71, 72, 0, 1, 2, 552, 3, 4, > 5, 0, > 0, 0, 0, 0, 0, 73, 0, 0, > 0, 0, > - 0, 74, 75, 0, 0, 76, 0, 77, > 0, 0, > + 0, 74, 75, 0, 363, 76, 0, 77, > 0, 0, > 0, 63, 64, 73, 106, 155, 156, 157, 158, > 159, > 160, 72, 0, 1, 2, 0, 3, 4, > 5, 0, > 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > - 0, 74, 75, 0, 355, 76, 0, 77, > 0, 0, > - 0, 0, 0, 73, 0, 0, 0, 0, > 0, 0, > + 0, 0, 0, 0, 0, 0, 74, 75, > 0, 0, > + 76, 0, 77, 73, 63, 64, 0, 150, > 66, 67, > + 68, 69, 70, 71, 72, 0, 1, 2, > 0, 3, > + 4, 5, 63, 64, 0, 106, 66, 67, > 68, 69, > + 70, 71, 72, 0, 1, 2, 0, 3, > 4, 5, > + 0, 0, 0, 0, 0, 0, 73, 0, > 0, 0, > + 0, 0, 0, 0, 74, 75, 0, 0, > 76, 0, > + 77, 0, 0, 0, 73, 0, 0, 0, > 0, 0, > 0, 0, 74, 75, 0, 0, 76, 0, 77, > 63, > - 64, 0, 150, 66, 67, 68, 69, 70, > 71, 72, > + 64, 0, 275, 66, 67, 68, 69, 70, > 71, 72, > 0, 1, 2, 0, 3, 4, 5, 0, > 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > 0, 0, 74, 75, 0, 0, 76, 0, > 77, 0, > - 0, 73, 0, 0, 0, 0, 0, 0, > 0, 0, > - 74, 75, 0, 0, 76, 0, 77, 63, > 64, 0, > - 106, 66, 67, 68, 69, 70, 71, 72, > 0, 1, > - 2, 0, 3, 4, 5, 0, 0, 0, > 0, 0, > - 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > - 74, 75, 0, 0, 76, 0, 77, 63, > 64, 73, > - 271, 66, 67, 68, 69, 70, 71, 72, > 0, 1, > - 2, 0, 3, 4, 5, 63, 64, 0, 106, > 155, > - 156, 157, 158, 159, 160, 72, 0, 1, > 2, 0, > - 3, 4, 5, 0, 0, 0, 0, 0, > 0, 73, > - 0, 0, 0, 0, 0, 0, 0, 0, > 74, 75, > - 0, 0, 76, 0, 77, 63, 64, 73, > 106, 66, > - 67, 68, 69, 70, 71, 538, 0, 1, > 2, 0, > - 3, 4, 5, 63, 64, 0, 106, 66, > 67, 68, > - 69, 70, 71, 593, 0, 1, 2, 0, > 3, 4, > - 5, 0, 0, 0, 0, 1, 0, 73, > 3, 0, > - 5, 0, 0, 0, 0, 0, 74, 75, > 0, 0, > - 76, 0, 77, 0, 0, 73, 0, 0, > 0, 0, > - 0, 0, 0, 0, 0, 0, 0, 0, 0, > 326, > - 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > - 0, 0, 0, 0, 0, 0, 74, 75, > 0, 0, > - 76, 0, 77, 0, 0, 0, 0, 0, > 0, 0, > - 0, 0, 0, 0, 74, 75, 0, 0, > 76, 0, > - 358, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > + 0, 73, 63, 64, 0, 106, 155, 156, 157, > 158, > + 159, 160, 72, 0, 1, 2, 0, 3, > 4, 5, > 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > - 0, 0, 0, 0, 327, 328, 0, 0, > 0, 0, > - 0, 0, 0, 0, 74, 75, 0, 0, 76, > 170, > - 77, 0, 329, 330, 0, 331, 332, 0, 333, > 334, > - 335, 0, 74, 75, 0, 0, 76, 0, 77, > 171, > - 172, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > - 0, 173, 174, 175, 176, 177, 178, 179, 180, > 181, > - 182, 183, 184, 185, 186, 187, 188, 189, 190, > 191, > - 192, 193, 194, 195, 0, 0, 0, 0, > 0, 0, > + 0, 0, 0, 0, 0, 74, 75, 0, > 0, 76, > + 0, 77, 0, 0, 73, 0, 0, 0, > 0, 0, > + 0, 0, 0, 74, 75, 0, 0, 76, > 0, 77, > + 63, 64, 0, 106, 66, 67, 68, 69, > 70, 71, > + 558, 0, 1, 2, 0, 3, 4, 5, > 63, 64, > + 0, 106, 66, 67, 68, 69, 70, 71, > 619, 0, > + 1, 2, 170, 3, 4, 5, 0, 0, > 0, 0, > + 0, 0, 73, 0, 0, 0, 0, 0, > 0, 0, > + 74, 75, 171, 172, 76, 0, 77, 0, > 0, 0, > + 73, 0, 0, 0, 173, 174, 175, 176, 177, > 178, > + 179, 180, 181, 182, 183, 184, 185, 186, 187, > 188, > + 189, 190, 191, 192, 193, 194, 195, 196, > 197, 0, > + 0, 0, 0, 74, 75, 0, 0, 76, 0, > 366, > + 0, 0, 0, 0, 0, 0, 0, 0, 0, > 198, > + 199, 200, 0, 0, 201, 202, 203, 204, 205, > 206, > + 207, 208, 209, 210, 211, 212, 213, 214, 215, > 216, > + 217, 218, 219, 220, 0, 0, 0, 0, > 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, > - 0, 0, 0, 0, 196, 197, 198, 0, 0, > 199, > - 200, 201, 202, 203, 204, 205, 206, 207, 208, > 209, > - 210, 211, 212, 213, 214, 215, 216, 217, 218 > + 0, 74, 75, 0, 0, 76, 0, 77, > 0, 0, > + 0, 0, 0, 0, 0, 0, 0, 0, > 0, 74, > + 75, 0, 0, 76, 0, 77 > }; > > static const yytype_int16 yycheck[] = > { > - 0, 27, 175, 237, 163, 127, 4, 11, > 0, 54, > - 11, 21, 416, 417, 164, 11, 11, 17, > 52, 29, > - 309, 54, 28, 54, 54, 17, 586, 176, > 120, 34, > - 439, 11, 153, 67, 260, 261, 20, 17, > 54, 23, > - 136, 137, 138, 154, 154, 141, 606, 54, 53, > 145, > - 146, 77, 163, 163, 114, 115, 148, 53, > 53, 42, > - 43, 44, 45, 46, 47, 48, 154, 50, 46, > 154, > - 48, 154, 58, 161, 223, 101, 154, 153, 163, > 105, > - 163, 154, 54, 161, 488, 111, 159, 163, 238, > 239, > - 153, 117, 92, 198, 61, 62, 63, 64, > 65, 66, > - 154, 127, 148, 149, 150, 159, 151, 152, 213, > 214, > - 215, 216, 217, 139, 140, 34, 221, 143, > 151, 18, > - 151, 151, 152, 149, 533, 38, 157, 0, 161, > 538, > - 539, 153, 358, 7, 8, 151, 10, 11, > 12, 13, > - 14, 15, 16, 17, 151, 19, 20, 173, > 22, 23, > - 24, 377, 159, 163, 54, 159, 162, 279, > 159, 3, > - 4, 5, 6, 153, 162, 148, 149, 150, 54, > 157, > - 196, 197, 198, 199, 166, 49, 153, 54, 467, > 151, > - 22, 590, 591, 155, 593, 594, 212, 213, 214, > 215, > - 216, 217, 218, 219, 220, 221, 272, 32, 33, > 275, > - 276, 323, 278, 229, 42, 43, 44, 616, > 617, 47, > - 499, 35, 501, 37, 240, 113, 114, 136, 137, > 138, > - 325, 21, 141, 136, 137, 138, 145, 146, > 141, 40, > - 41, 22, 145, 146, 19, 311, 47, 22, > 42, 24, > - 44, 22, 53, 319, 320, 321, 152, 152, 154, > 154, > - 152, 151, 154, 279, 154, 155, 22, 491, 350, > 351, > - 352, 353, 354, 552, 290, 151, 83, 84, 154, > 155, > - 429, 363, 364, 365, 151, 151, 4, 382, > 155, 4, > - 37, 307, 156, 157, 0, 151, 160, 158, 162, > 163, > - 158, 396, 155, 398, 399, 400, 4, 323, 324, > 325, > - 22, 154, 18, 19, 20, 152, 22, 23, 24, > 161, > - 386, 387, 388, 4, 30, 31, 152, 151, > 394, 9, > - 9, 275, 276, 9, 278, 9, 9, 419, 420, > 405, > - 406, 9, 358, 54, 426, 51, 570, 56, > 11, 55, > - 574, 367, 161, 59, 152, 3, 4, 5, 6, > 151, > - 151, 22, 151, 429, 151, 151, 382, 311, 151, > 151, > - 154, 151, 151, 38, 4, 319, 320, 321, > 26, 27, > - 396, 397, 398, 399, 400, 451, 154, 453, 404, > 154, > - 456, 154, 154, 475, 476, 477, 478, 463, 464, > 154, > - 482, 483, 418, 154, 567, 7, 8, 502, > 151, 38, > - 505, 506, 507, 151, 154, 60, 157, 19, 20, > 154, > - 22, 23, 24, 154, 587, 154, 154, 154, 494, > 495, > - 154, 497, 498, 154, 516, 517, 161, 503, > 154, 38, > - 154, 154, 386, 387, 388, 22, 154, 154, 514, > 154, > - 394, 152, 468, 17, 17, 151, 4, 154, 4, > 154, > - 154, 405, 406, 154, 154, 154, 154, 151, 484, > 154, > - 22, 154, 154, 555, 490, 557, 558, 4, 53, > 154, > - 496, 547, 154, 161, 154, 152, 502, 22, 154, > 505, > - 506, 507, 154, 152, 152, 511, 53, 53, 154, > 489, > - 157, 152, 568, 569, 159, 152, 17, 451, 152, > 453, > - 159, 152, 456, 152, 4, 147, 151, 151, 584, > 463, > - 464, 22, 17, 7, 8, 17, 10, 11, > 12, 13, > - 14, 15, 16, 17, 154, 19, 20, 154, > 22, 23, > - 24, 17, 72, 17, 610, 611, 130, 130, 130, > 615, > - 494, 495, 618, 497, 498, 571, 92, 562, 624, > 503, > - 252, 627, 118, 119, 111, 49, 253, 105, 534, > 229, > - 514, 240, 562, 3, 4, 17, 89, 7, > 8, 9, > - 136, 137, 511, 139, 140, 56, 142, 143, > 144, 19, > - 20, 421, 22, 23, 24, 25, 26, 27, > -1, -1, > - -1, -1, -1, 547, -1, -1, -1, -1, > -1, -1, > - 40, 41, 91, 92, 93, 94, 95, 96, > 97, 98, > - 99, 100, -1, 53, 568, 569, 7, 8, > 58, 10, > - 11, 12, 13, 14, 15, 16, 17, -1, > 19, 20, > - 584, 22, 23, 24, 74, 75, 76, 77, > 78, 79, > - 80, 81, 82, 83, 84, 85, 86, 87, > 88, 89, > - 90, -1, -1, -1, -1, -1, 610, 611, > 49, -1, > - -1, 615, 156, 157, 618, -1, 160, -1, 162, > 163, > - 624, -1, -1, 627, -1, -1, 116, 117, 118, > 119, > - 120, 121, 122, 123, 124, 125, 126, 127, > 128, -1, > - 130, -1, 132, 133, 134, -1, 136, 137, -1, > 139, > - 140, -1, 142, 143, 144, 3, 4, -1, > -1, 7, > - 8, 9, -1, -1, -1, -1, -1, -1, > -1, -1, > - 160, 19, 20, -1, 22, 23, 24, 25, > 26, 27, > - -1, -1, -1, -1, -1, -1, -1, -1, > -1, -1, > - -1, -1, 40, 41, -1, -1, -1, -1, > -1, -1, > - -1, -1, -1, -1, -1, -1, 54, -1, > -1, -1, > - 58, -1, -1, -1, -1, 156, 157, -1, -1, > 160, > - -1, 162, 163, -1, -1, -1, 74, 75, > 76, 77, > - 78, 79, 80, 81, 82, 83, 84, 85, > 86, 87, > - 88, 89, 90, -1, -1, 7, 8, -1, > 10, 11, > - 12, 13, 14, 15, 16, 17, -1, 19, > 20, -1, > - 22, 23, 24, 26, 27, -1, -1, -1, 116, > 117, > - 118, 119, 120, 121, 122, 123, 124, 125, 126, > 127, > - 128, -1, 130, -1, 132, 133, 134, 49, > -1, -1, > - -1, -1, -1, -1, 3, 4, -1, -1, > 7, 8, > - 9, -1, -1, 151, -1, -1, -1, -1, > -1, -1, > - 19, 20, 160, 22, 23, 24, 25, 26, > 27, -1, > - -1, -1, -1, -1, -1, -1, -1, -1, > -1, -1, > - -1, 40, 41, 0, 97, 98, 99, 100, 101, > 102, > - 103, 104, 105, 106, 107, 108, 109, 110, > -1, 58, > - -1, 18, 19, 20, -1, 22, 23, 24, > -1, -1, > - -1, -1, -1, 30, 31, 74, 75, 76, > 77, 78, > - 79, 80, 81, 82, 83, 84, 85, 86, > 87, 88, > - 89, 90, -1, -1, 51, -1, -1, -1, > 55, -1, > - -1, -1, 59, -1, 156, 157, -1, -1, > 160, -1, > - 162, 163, -1, -1, -1, -1, -1, 116, 117, > 118, > - 119, 120, 121, 122, 123, 124, 125, 126, 127, > 128, > - -1, 130, -1, 132, 133, 134, 7, 8, > -1, -1, > - -1, -1, -1, -1, -1, -1, -1, -1, > 19, 20, > - -1, 22, 23, 24, 25, -1, -1, -1, > -1, -1, > - -1, 160, -1, -1, -1, -1, -1, -1, > -1, 40, > + 0, 27, 175, 0, 315, 11, 4, 127, 11, > 200, > + 163, 54, 28, 21, 264, 265, 239, 17, > 164, 38, > + 17, 29, 196, 54, 215, 216, 217, 218, 219, > 426, > + 427, 54, 223, 155, 54, 451, 11, 176, > 153, 54, > + 34, 612, 54, 34, 20, 197, 11, 23, 163, > 156, > + 52, 77, 156, 54, 156, 156, 120, 156, 165, > 163, > + 156, 632, 53, 165, 165, 67, 165, 163, > 42, 43, > + 44, 45, 46, 47, 48, 101, 50, 58, 53, > 105, > + 254, 54, 256, 54, 148, 111, 225, 11, > 53, 40, > + 41, 117, 92, 17, 240, 241, 47, 155, 46, > 156, > + 48, 127, 53, 255, 161, 257, 19, 504, > 18, 22, > + 153, 24, 0, 139, 140, 155, 366, 143, 161, > 138, > + 139, 140, 153, 149, 143, 54, 156, 155, 147, > 148, > + 153, 161, 163, 153, 154, 385, 159, 553, 153, > 154, > + 331, 153, 558, 559, 138, 139, 140, 173, 164, > 143, > + 32, 33, 153, 147, 148, 161, 157, 165, 161, > 155, > + 35, 276, 37, 283, 279, 280, 164, 282, 22, > 166, > + 481, 159, 198, 199, 200, 201, 150, 151, > 152, 42, > + 153, 44, 153, 156, 157, 156, 157, 21, 214, > 215, > + 216, 217, 218, 219, 220, 221, 222, 223, 22, > 390, > + 616, 617, 317, 619, 620, 231, 517, 22, 519, > 329, > + 325, 326, 327, 116, 117, 406, 242, 408, 409, > 410, > + 150, 151, 152, 22, 153, 53, 642, 643, > 157, 3, > + 4, 5, 6, 153, 7, 8, 4, 10, > 11, 12, > + 13, 14, 15, 16, 17, 4, 19, 20, > 37, 22, > + 23, 24, 26, 27, 7, 8, 154, 283, > 156, 42, > + 43, 44, 153, 574, 47, 160, 19, 20, > 294, 22, > + 23, 24, 3, 4, 5, 6, 49, 113, 114, > 394, > + 395, 396, 397, 398, 507, 311, 312, 313, 441, > 404, > + 83, 84, 120, 121, 358, 359, 360, 361, 362, > 160, > + 415, 416, 157, 329, 330, 331, 4, 371, 372, > 373, > + 138, 139, 22, 141, 142, 156, 144, 145, > 146, 61, > + 62, 63, 64, 65, 66, 154, 441, 156, 154, > 520, > + 156, 154, 523, 524, 525, 4, 138, 139, 140, > 153, > + 366, 143, 163, 154, 9, 147, 148, 9, 9, > 375, > + 465, 9, 467, 9, 9, 470, 56, 54, 11, > 163, > + 154, 153, 477, 478, 390, 429, 430, 431, 432, > 153, > + 22, 594, 153, 153, 438, 598, 153, 153, > 153, 38, > + 406, 407, 408, 409, 410, 158, 159, 153, 414, > 162, > + 153, 164, 165, 4, 156, 510, 511, 38, 513, > 514, > + 515, 516, 428, 153, 156, 156, 521, 93, > 94, 95, > + 96, 97, 98, 99, 100, 101, 102, 532, 591, > 156, > + 156, 156, 156, 153, 153, 153, 60, 491, 492, > 493, > + 494, 156, 156, 156, 498, 499, 156, 159, 156, > 156, > + 613, 279, 280, 156, 282, 0, 38, 156, 156, > 156, > + 156, 163, 156, 156, 569, 156, 482, 22, > 154, 17, > + 17, 153, 156, 18, 19, 20, 156, 22, > 23, 24, > + 534, 535, 536, 537, 500, 30, 31, 592, 593, > 317, > + 506, 156, 156, 4, 156, 156, 512, 325, 326, > 327, > + 156, 4, 156, 156, 520, 610, 51, 523, 524, > 525, > + 55, 4, 153, 529, 59, 505, 156, 156, 156, > 156, > + 156, 22, 53, 156, 156, 579, 156, 581, 582, > 163, > + 156, 636, 637, 154, 156, 154, 641, 3, 4, > 644, > + 154, 7, 8, 9, 22, 650, 156, 159, 653, > 154, > + 161, 154, 154, 19, 20, 154, 22, 23, > 24, 25, > + 26, 27, 53, 17, 161, 154, 394, 395, 396, > 397, > + 398, 154, 4, 154, 40, 41, 404, 149, 153, > 595, > + 153, 22, 156, 17, 17, 156, 17, 415, > 416, 72, > + 17, 130, 58, 130, 130, 92, 586, 586, 554, > 111, > + 19, 105, 231, 22, 17, 24, 56, 242, > 74, 75, > + 76, 77, 78, 79, 80, 81, 82, 83, > 84, 85, > + 86, 87, 88, 89, 90, 91, 92, 89, > 529, -1, > + 433, -1, -1, -1, 53, -1, -1, 465, -1, > 467, > + -1, -1, 470, -1, -1, -1, -1, -1, -1, > 477, > + 478, -1, 118, 119, 120, 121, 122, 123, 124, > 125, > + 126, 127, 128, 129, 130, -1, 132, -1, 134, > 135, > + 136, -1, -1, -1, -1, -1, -1, -1, > -1, -1, > + -1, -1, 510, 511, -1, 513, 514, 515, > 516, -1, > + -1, -1, -1, 521, -1, -1, 162, -1, > -1, -1, > + -1, 120, 121, -1, 532, -1, -1, -1, > -1, -1, > + -1, -1, 3, 4, -1, -1, 7, 8, 9, > 138, > + 139, -1, 141, 142, -1, 144, 145, 146, > 19, 20, > + -1, 22, 23, 24, 25, 26, 27, -1, > -1, -1, > + -1, 569, -1, -1, -1, -1, -1, -1, > -1, 40, > 41, -1, -1, -1, -1, -1, -1, -1, -1, > -1, > - -1, 7, 8, 54, 10, 11, 12, 13, > 14, 15, > - 16, 17, -1, 19, 20, -1, 22, 23, > 24, -1, > - -1, -1, -1, 74, 75, 76, 77, 78, > 79, 80, > - 81, 82, 83, 84, 85, 86, 87, 88, > 89, 90, > - -1, -1, -1, 49, -1, -1, 7, 8, > -1, 10, > - 11, 12, 13, 14, 15, 16, 17, -1, > 19, 20, > - -1, 22, 23, 24, -1, 116, 117, 118, 119, > 120, > - 121, 122, 123, 124, 125, 126, 127, 128, 39, > 130, > - -1, 132, 133, 134, -1, -1, -1, -1, > 49, -1, > + -1, -1, 53, -1, 592, 593, -1, 58, > -1, -1, > -1, -1, -1, -1, -1, -1, -1, -1, -1, > -1, > - 151, -1, 7, 8, 155, -1, 157, -1, -1, > 160, > - -1, 162, -1, 164, 19, 20, 122, 22, > 23, 24, > - 25, -1, -1, -1, -1, -1, -1, -1, > -1, -1, > + -1, -1, 610, 74, 75, 76, 77, 78, > 79, 80, > + 81, 82, 83, 84, 85, 86, 87, 88, > 89, 90, > + 91, 92, -1, -1, -1, -1, -1, -1, 636, > 637, > + -1, -1, -1, 641, -1, -1, 644, -1, > -1, -1, > + -1, -1, 650, -1, -1, 653, -1, 118, 119, > 120, > + 121, 122, 123, 124, 125, 126, 127, 128, 129, > 130, > + -1, 132, -1, 134, 135, 136, -1, 138, > 139, -1, > + 141, 142, -1, 144, 145, 146, 3, 4, > -1, -1, > + 7, 8, 9, -1, -1, 0, -1, -1, > -1, -1, > + -1, 162, 19, 20, -1, 22, 23, 24, > 25, 26, > + 27, 26, 27, 18, 19, 20, -1, 22, > 23, 24, > + -1, -1, -1, 40, 41, 30, 31, -1, > -1, -1, > + -1, -1, -1, -1, -1, -1, -1, 54, > -1, -1, > + -1, 58, -1, -1, -1, -1, 51, -1, > -1, -1, > + 55, -1, -1, -1, 59, -1, -1, 74, > 75, 76, > + 77, 78, 79, 80, 81, 82, 83, 84, > 85, 86, > + 87, 88, 89, 90, 91, 92, -1, -1, > -1, -1, > + -1, -1, -1, -1, 99, 100, 101, 102, 103, > 104, > + 105, 106, 107, 108, 109, 110, 111, 112, > -1, -1, > + -1, 118, 119, 120, 121, 122, 123, 124, 125, > 126, > + 127, 128, 129, 130, -1, 132, -1, 134, 135, > 136, > + -1, -1, 7, 8, -1, -1, -1, -1, > -1, -1, > + -1, -1, -1, -1, 19, 20, 153, 22, > 23, 24, > + 25, -1, -1, -1, -1, 162, -1, -1, > -1, -1, > -1, -1, -1, -1, -1, 40, 41, -1, -1, > -1, > - -1, -1, -1, -1, -1, -1, -1, -1, > -1, 54, > - 156, 157, -1, -1, 160, -1, 162, -1, > -1, -1, > - -1, -1, -1, -1, -1, -1, -1, -1, > -1, 74, > + -1, -1, -1, -1, -1, -1, -1, 7, > 8, 54, > + 10, 11, 12, 13, 14, 15, 16, 17, > -1, 19, > + 20, -1, 22, 23, 24, -1, -1, -1, > -1, 74, > 75, 76, 77, 78, 79, 80, 81, 82, 83, > 84, > - 85, 86, 87, 88, 89, 90, -1, -1, > -1, -1, > - -1, -1, -1, -1, -1, 156, 157, -1, -1, > 160, > - -1, 162, -1, -1, -1, -1, -1, -1, > -1, -1, > - -1, 116, 117, 118, 119, 120, 121, 122, 123, > 124, > - 125, 126, 127, 128, -1, 130, -1, 132, 133, > 134, > + 85, 86, 87, 88, 89, 90, 91, 92, > -1, 49, > + 7, 8, -1, 10, 11, 12, 13, 14, > 15, 16, > + 17, -1, 19, 20, -1, 22, 23, 24, > -1, -1, > + -1, -1, -1, 118, 119, 120, 121, 122, 123, > 124, > + 125, 126, 127, 128, 129, 130, -1, 132, -1, > 134, > + 135, 136, 49, -1, -1, -1, -1, -1, > -1, -1, > + -1, -1, -1, -1, -1, -1, -1, -1, > 153, -1, > + 7, 8, 157, -1, 159, -1, -1, 162, -1, > 164, > + -1, 166, 19, 20, -1, 22, 23, 24, > 25, -1, > + -1, -1, -1, -1, -1, -1, -1, -1, > -1, -1, > + -1, -1, -1, 40, 41, -1, -1, -1, > -1, -1, > + -1, -1, -1, -1, -1, -1, -1, 54, 158, > 159, > + -1, -1, 162, -1, 164, 165, -1, -1, > -1, -1, > + -1, -1, -1, -1, -1, -1, -1, 74, > 75, 76, > + 77, 78, 79, 80, 81, 82, 83, 84, > 85, 86, > + 87, 88, 89, 90, 91, 92, -1, -1, > -1, -1, > + -1, 158, 159, -1, -1, 162, -1, 164, > 165, -1, > + -1, -1, -1, -1, -1, -1, -1, -1, > -1, -1, > + -1, 118, 119, 120, 121, 122, 123, 124, 125, > 126, > + 127, 128, 129, 130, -1, 132, -1, 134, 135, > 136, > -1, -1, -1, -1, -1, -1, -1, -1, > 3, 4, > - -1, -1, -1, -1, 9, -1, 151, -1, > -1, -1, > - -1, -1, 157, -1, -1, 160, -1, 162, -1, > 164, > + -1, -1, -1, -1, 9, -1, 153, -1, > -1, -1, > + -1, -1, 159, -1, -1, 162, -1, 164, -1, > 166, > 25, 26, 27, -1, -1, -1, -1, -1, -1, > -1, > -1, -1, -1, -1, -1, 40, 41, -1, -1, > -1, > -1, -1, -1, -1, -1, -1, -1, -1, -1, > -1, > - -1, -1, -1, 58, -1, -1, -1, -1, > -1, -1, > - -1, -1, -1, -1, -1, -1, -1, -1, > -1, 74, > + -1, 7, 8, 58, 10, 11, 12, 13, > 14, 15, > + 16, 17, -1, 19, 20, -1, 22, 23, > 24, 74, > 75, 76, 77, 78, 79, 80, 81, 82, 83, > 84, > - 85, 86, 87, 88, 89, 90, -1, -1, > -1, -1, > - -1, -1, 7, 8, -1, 10, 11, 12, > 13, 14, > - 15, 16, 17, -1, 19, 20, -1, 22, > 23, 24, > - -1, 116, 117, 118, 119, 120, 121, 122, 123, > 124, > - 125, 126, 127, 128, 39, 130, -1, 132, 133, > 134, > - -1, -1, 7, 8, 49, 10, 11, 12, > 13, 14, > - 15, 16, 17, -1, 19, 20, -1, 22, > 23, 24, > - -1, -1, -1, 7, 8, 160, 10, 11, > 12, 13, > - 14, 15, 16, 17, -1, 19, 20, -1, > 22, 23, > - 24, -1, -1, -1, 49, -1, -1, -1, > -1, -1, > - -1, -1, -1, -1, -1, 39, -1, -1, > -1, -1, > - -1, -1, -1, 7, 8, 49, 10, 11, > 12, 13, > + 85, 86, 87, 88, 89, 90, 91, 92, > -1, -1, > + -1, -1, -1, 49, 7, 8, -1, 10, > 11, 12, > + 13, 14, 15, 16, 17, -1, 19, 20, > -1, 22, > + 23, 24, -1, 118, 119, 120, 121, 122, 123, > 124, > + 125, 126, 127, 128, 129, 130, 39, 132, -1, > 134, > + 135, 136, -1, -1, -1, -1, 49, 7, > 8, -1, > + 10, 11, 12, 13, 14, 15, 16, 17, > -1, 19, > + 20, -1, 22, 23, 24, 7, 8, 162, > 10, 11, > + 12, 13, 14, 15, 16, 17, -1, 19, > 20, -1, > + 22, 23, 24, -1, -1, -1, -1, -1, > -1, 49, > + -1, -1, -1, -1, -1, -1, -1, 39, > -1, -1, > + -1, -1, -1, -1, -1, -1, -1, 49, > -1, -1, > + -1, -1, 158, 159, -1, -1, 162, -1, 164, > 165, > + 7, 8, -1, 10, 11, 12, 13, 14, > 15, 16, > + 17, -1, 19, 20, -1, 22, 23, 24, > -1, -1, > + -1, -1, -1, -1, -1, -1, -1, -1, > -1, -1, > + -1, -1, -1, -1, -1, 158, 159, -1, -1, > 162, > + -1, 164, 49, -1, 124, 7, 8, -1, > 10, 11, > + 12, 13, 14, 15, 16, 17, -1, 19, > 20, -1, > + 22, 23, 24, -1, -1, -1, -1, -1, > -1, -1, > + -1, -1, -1, -1, -1, -1, -1, 39, 158, > 159, > + -1, -1, 162, -1, 164, -1, -1, 49, > -1, -1, > + -1, -1, -1, -1, -1, -1, 158, 159, > -1, -1, > + 162, -1, 164, 7, 8, -1, 10, 11, > 12, 13, > 14, 15, 16, 17, -1, 19, 20, -1, 22, > 23, > 24, 7, 8, -1, 10, 11, 12, 13, 14, > 15, > 16, 17, -1, 19, 20, 39, 22, 23, 24, > -1, > -1, -1, -1, -1, -1, 49, -1, -1, -1, > -1, > - -1, 156, 157, -1, -1, 160, -1, 162, > -1, -1, > + -1, 158, 159, -1, 161, 162, -1, 164, > -1, -1, > -1, 7, 8, 49, 10, 11, 12, 13, 14, > 15, > 16, 17, -1, 19, 20, -1, 22, 23, 24, > -1, > -1, -1, -1, -1, -1, -1, -1, -1, -1, > -1, > - -1, 156, 157, -1, 159, 160, -1, 162, > -1, -1, > - -1, -1, -1, 49, -1, -1, -1, -1, > -1, -1, > - -1, -1, 156, 157, -1, -1, 160, -1, > 162, 7, > + -1, -1, -1, -1, -1, -1, 158, 159, > -1, -1, > + 162, -1, 164, 49, 7, 8, -1, 10, > 11, 12, > + 13, 14, 15, 16, 17, -1, 19, 20, > -1, 22, > + 23, 24, 7, 8, -1, 10, 11, 12, > 13, 14, > + 15, 16, 17, -1, 19, 20, -1, 22, > 23, 24, > + -1, -1, -1, -1, -1, -1, 49, -1, > -1, -1, > + -1, -1, -1, -1, 158, 159, -1, -1, > 162, -1, > + 164, -1, -1, -1, 49, -1, -1, -1, > -1, -1, > + -1, -1, 158, 159, -1, -1, 162, -1, > 164, 7, > 8, -1, 10, 11, 12, 13, 14, 15, 16, > 17, > -1, 19, 20, -1, 22, 23, 24, -1, -1, > -1, > -1, -1, -1, -1, -1, -1, -1, -1, -1, > -1, > - -1, -1, 156, 157, -1, -1, 160, -1, > 162, -1, > - -1, 49, -1, -1, -1, -1, -1, -1, > -1, -1, > - 156, 157, -1, -1, 160, -1, 162, 7, > 8, -1, > - 10, 11, 12, 13, 14, 15, 16, 17, > -1, 19, > - 20, -1, 22, 23, 24, -1, -1, -1, > -1, -1, > - -1, -1, -1, -1, -1, -1, -1, -1, > -1, -1, > - 156, 157, -1, -1, 160, -1, 162, 7, > 8, 49, > - 10, 11, 12, 13, 14, 15, 16, 17, > -1, 19, > - 20, -1, 22, 23, 24, 7, 8, -1, > 10, 11, > - 12, 13, 14, 15, 16, 17, -1, 19, > 20, -1, > - 22, 23, 24, -1, -1, -1, -1, -1, > -1, 49, > - -1, -1, -1, -1, -1, -1, -1, -1, 156, > 157, > - -1, -1, 160, -1, 162, 7, 8, 49, > 10, 11, > - 12, 13, 14, 15, 16, 17, -1, 19, > 20, -1, > - 22, 23, 24, 7, 8, -1, 10, 11, > 12, 13, > - 14, 15, 16, 17, -1, 19, 20, -1, > 22, 23, > - 24, -1, -1, -1, -1, 19, -1, 49, > 22, -1, > - 24, -1, -1, -1, -1, -1, 156, 157, > -1, -1, > - 160, -1, 162, -1, -1, 49, -1, -1, > -1, -1, > - -1, -1, -1, -1, -1, -1, -1, -1, > -1, 53, > - -1, -1, -1, -1, -1, -1, -1, -1, > -1, -1, > - -1, -1, -1, -1, -1, -1, 156, 157, > -1, -1, > - 160, -1, 162, -1, -1, -1, -1, -1, > -1, -1, > - -1, -1, -1, -1, 156, 157, -1, -1, > 160, -1, > - 162, -1, -1, -1, -1, -1, -1, -1, > -1, -1, > + -1, -1, 158, 159, -1, -1, 162, -1, > 164, -1, > + -1, 49, 7, 8, -1, 10, 11, 12, > 13, 14, > + 15, 16, 17, -1, 19, 20, -1, 22, > 23, 24, > -1, -1, -1, -1, -1, -1, -1, -1, -1, > -1, > - -1, -1, -1, -1, 118, 119, -1, -1, > -1, -1, > - -1, -1, -1, -1, 156, 157, -1, -1, > 160, 36, > - 162, -1, 136, 137, -1, 139, 140, -1, 142, > 143, > - 144, -1, 156, 157, -1, -1, 160, -1, > 162, 56, > - 57, -1, -1, -1, -1, -1, -1, -1, > -1, -1, > - -1, 68, 69, 70, 71, 72, 73, 74, > 75, 76, > - 77, 78, 79, 80, 81, 82, 83, 84, > 85, 86, > - 87, 88, 89, 90, -1, -1, -1, -1, > -1, -1, > + -1, -1, -1, -1, -1, 158, 159, -1, -1, > 162, > + -1, 164, -1, -1, 49, -1, -1, -1, > -1, -1, > + -1, -1, -1, 158, 159, -1, -1, 162, -1, > 164, > + 7, 8, -1, 10, 11, 12, 13, 14, > 15, 16, > + 17, -1, 19, 20, -1, 22, 23, 24, > 7, 8, > + -1, 10, 11, 12, 13, 14, 15, 16, > 17, -1, > + 19, 20, 36, 22, 23, 24, -1, -1, > -1, -1, > + -1, -1, 49, -1, -1, -1, -1, -1, > -1, -1, > + 158, 159, 56, 57, 162, -1, 164, -1, > -1, -1, > + 49, -1, -1, -1, 68, 69, 70, 71, > 72, 73, > + 74, 75, 76, 77, 78, 79, 80, 81, > 82, 83, > + 84, 85, 86, 87, 88, 89, 90, 91, > 92, -1, > + -1, -1, -1, 158, 159, -1, -1, 162, -1, > 164, > + -1, -1, -1, -1, -1, -1, -1, -1, -1, > 113, > + 114, 115, -1, -1, 118, 119, 120, 121, 122, > 123, > + 124, 125, 126, 127, 128, 129, 130, 131, 132, > 133, > + 134, 135, 136, 137, -1, -1, -1, -1, > -1, -1, > -1, -1, -1, -1, -1, -1, -1, -1, -1, > -1, > - -1, -1, -1, -1, 111, 112, 113, -1, -1, > 116, > - 117, 118, 119, 120, 121, 122, 123, 124, 125, > 126, > - 127, 128, 129, 130, 131, 132, 133, 134, 135 > + -1, 158, 159, -1, -1, 162, -1, 164, > -1, -1, > + -1, -1, -1, -1, -1, -1, -1, -1, -1, > 158, > + 159, -1, -1, 162, -1, 164 > }; > > /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing > @@ -2594,68 +2620,71 @@ > static const yytype_uint8 yystos[] = > { > 0, 19, 20, 22, 23, 24, 30, 31, 51, > 55, > - 59, 173, 176, 177, 178, 179, 211, 212, 213, > 215, > - 214, 52, 67, 220, 153, 58, 153, 18, > 153, 42, > - 43, 44, 45, 46, 47, 48, 50, 148, 149, > 150, > - 180, 181, 182, 0, 213, 46, 48, 183, > 230, 42, > - 43, 44, 47, 184, 227, 229, 237, 153, 153, > 157, > - 221, 22, 219, 7, 8, 10, 11, 12, > 13, 14, > - 15, 16, 17, 49, 156, 157, 160, 162, 173, > 177, > - 198, 199, 233, 182, 182, 35, 37, 209, 182, > 182, > - 21, 238, 239, 29, 163, 228, 238, 22, > 22, 22, > - 222, 151, 4, 4, 4, 162, 10, 163, 199, > 204, > - 54, 151, 175, 209, 209, 42, 44, 185, > 32, 33, > - 208, 61, 62, 63, 64, 65, 66, 186, 225, > 225, > - 176, 242, 154, 159, 39, 199, 200, 202, 203, > 158, > - 158, 163, 204, 154, 163, 151, 203, 155, 208, > 208, > - 10, 122, 199, 201, 210, 11, 12, 13, > 14, 15, > - 16, 171, 172, 199, 205, 4, 201, 28, 162, > 226, > + 59, 175, 178, 179, 180, 181, 213, 214, 215, > 217, > + 216, 52, 67, 222, 155, 58, 155, 18, > 155, 42, > + 43, 44, 45, 46, 47, 48, 50, 150, 151, > 152, > + 182, 183, 184, 0, 215, 46, 48, 185, > 232, 42, > + 43, 44, 47, 186, 229, 231, 239, 155, 155, > 159, > + 223, 22, 221, 7, 8, 10, 11, 12, > 13, 14, > + 15, 16, 17, 49, 158, 159, 162, 164, 175, > 179, > + 200, 201, 235, 184, 184, 35, 37, 211, 184, > 184, > + 21, 240, 241, 29, 165, 230, 240, 22, > 22, 22, > + 224, 153, 4, 4, 4, 164, 10, 165, 201, > 206, > + 54, 153, 177, 211, 211, 42, 44, 187, > 32, 33, > + 210, 61, 62, 63, 64, 65, 66, 188, 227, > 227, > + 178, 244, 156, 161, 39, 201, 202, 204, 205, > 160, > + 160, 165, 206, 156, 165, 153, 205, 157, 210, > 210, > + 10, 124, 201, 203, 212, 11, 12, 13, > 14, 15, > + 16, 173, 174, 201, 207, 4, 203, 28, 164, > 228, > 36, 56, 57, 68, 69, 70, 71, 72, 73, > 74, > 75, 76, 77, 78, 79, 80, 81, 82, 83, > 84, > - 85, 86, 87, 88, 89, 90, 111, 112, 113, > 116, > - 117, 118, 119, 120, 121, 122, 123, 124, 125, > 126, > - 127, 128, 129, 130, 131, 132, 133, 134, 135, > 166, > - 167, 168, 240, 246, 247, 248, 249, 22, 188, > 154, > - 152, 199, 199, 161, 163, 199, 4, 152, 205, > 199, > - 151, 233, 26, 27, 3, 4, 5, 6, > 9, 25, > - 40, 41, 89, 90, 116, 130, 132, 133, 134, > 157, > - 160, 162, 164, 166, 167, 168, 206, 233, 175, > 177, > - 56, 10, 199, 235, 236, 11, 17, 11, 171, > 186, > - 91, 92, 93, 94, 95, 96, 97, 98, 99, > 100, > - 169, 26, 27, 97, 98, 99, 100, 101, 102, > 103, > - 104, 105, 106, 107, 108, 109, 110, 170, 199, > 199, > - 235, 199, 199, 243, 235, 235, 235, 235, 235, > 199, > - 199, 199, 235, 186, 114, 115, 53, 118, 119, > 136, > - 137, 139, 140, 142, 143, 144, 187, 39, 200, > 190, > - 159, 161, 161, 152, 190, 175, 175, 210, 169, > 170, > - 151, 151, 151, 151, 151, 159, 205, 207, 162, > 207, > - 163, 207, 22, 151, 151, 151, 216, 151, > 3, 4, > - 9, 25, 26, 27, 40, 41, 58, 160, 206, > 232, > - 233, 234, 154, 234, 234, 234, 201, 199, 199, > 154, > - 193, 154, 193, 234, 157, 154, 154, 154, 154, > 154, > - 154, 234, 234, 234, 38, 201, 199, 235, 4, > 136, > - 137, 138, 141, 145, 146, 189, 217, 218, 38, > 151, > - 151, 205, 205, 205, 205, 205, 154, 159, 163, > 199, > - 207, 161, 163, 205, 205, 205, 154, 196, 39, > 199, > - 223, 224, 60, 231, 207, 235, 154, 154, 234, > 234, > - 234, 11, 53, 11, 245, 234, 157, 235, 199, > 235, > - 235, 235, 154, 154, 154, 199, 234, 234, 154, > 196, > - 196, 199, 205, 205, 245, 154, 154, 154, 154, > 205, > - 161, 163, 154, 154, 38, 34, 53, 194, 197, > 188, > - 154, 152, 22, 161, 17, 17, 151, 154, 154, > 234, > - 4, 234, 154, 154, 234, 154, 154, 154, 4, > 234, > - 234, 151, 154, 193, 199, 152, 154, 154, 152, > 205, > - 205, 205, 205, 161, 205, 205, 199, 22, 4, > 196, > - 173, 174, 39, 199, 190, 154, 234, 234, 17, > 199, > - 244, 234, 234, 193, 193, 235, 234, 154, 235, > 235, > - 235, 244, 234, 205, 205, 154, 152, 154, 154, > 152, > - 152, 152, 188, 194, 195, 22, 154, 157, 188, > 188, > - 152, 154, 159, 234, 152, 193, 152, 152, 205, > 205, > - 205, 174, 53, 192, 17, 159, 171, 241, 118, > 119, > - 234, 234, 190, 17, 199, 159, 190, 152, 152, > 152, > - 4, 147, 191, 234, 232, 159, 171, 188, > 188, 38, > - 188, 188, 22, 154, 232, 17, 234, 234, 17, > 154, > - 234, 188, 188, 234, 17, 72, 234, 17, 234 > + 85, 86, 87, 88, 89, 90, 91, 92, 113, > 114, > + 115, 118, 119, 120, 121, 122, 123, 124, 125, > 126, > + 127, 128, 129, 130, 131, 132, 133, 134, 135, > 136, > + 137, 168, 169, 170, 242, 248, 249, 250, > 251, 22, > + 190, 156, 154, 201, 201, 163, 165, 201, 4, > 154, > + 207, 201, 153, 235, 26, 27, 3, 4, > 5, 6, > + 9, 25, 40, 41, 89, 90, 91, 92, 118, > 132, > + 134, 135, 136, 159, 162, 164, 166, 168, 169, > 170, > + 208, 235, 177, 179, 56, 10, 201, 237, > 238, 11, > + 17, 11, 173, 188, 93, 94, 95, 96, > 97, 98, > + 99, 100, 101, 102, 171, 26, 27, 99, 100, > 101, > + 102, 103, 104, 105, 106, 107, 108, 109, 110, > 111, > + 112, 172, 171, 172, 201, 201, 237, 201, 201, > 245, > + 237, 237, 237, 237, 237, 201, 201, 201, 237, > 188, > + 116, 117, 53, 120, 121, 138, 139, 141, 142, > 144, > + 145, 146, 189, 39, 202, 192, 161, 163, 163, > 154, > + 192, 177, 177, 212, 171, 172, 171, 172, 153, > 153, > + 153, 153, 153, 161, 207, 209, 164, 209, 165, > 209, > + 22, 153, 153, 153, 218, 153, 3, 4, > 9, 25, > + 26, 27, 40, 41, 58, 162, 208, 234, 235, > 236, > + 156, 236, 236, 236, 203, 201, 201, 201, 201, > 156, > + 195, 156, 195, 236, 159, 156, 156, 156, 156, > 156, > + 156, 236, 236, 236, 38, 203, 201, 237, 4, > 138, > + 139, 140, 143, 147, 148, 191, 219, 220, 38, > 153, > + 153, 153, 153, 207, 207, 207, 207, 207, 156, > 161, > + 165, 201, 209, 163, 165, 207, 207, 207, 156, > 198, > + 39, 201, 225, 226, 60, 233, 209, 237, 156, > 156, > + 236, 236, 236, 236, 236, 11, 53, 11, 247, > 236, > + 159, 237, 201, 237, 237, 237, 156, 156, 156, > 201, > + 236, 236, 156, 198, 198, 201, 207, 207, 207, > 207, > + 247, 156, 156, 156, 156, 207, 163, 165, 156, > 156, > + 38, 34, 53, 196, 199, 190, 156, 154, 22, > 163, > + 17, 17, 153, 156, 156, 156, 156, 236, 4, > 236, > + 156, 156, 236, 156, 156, 156, 4, 236, 236, > 153, > + 156, 195, 201, 154, 156, 156, 156, 156, 154, > 207, > + 207, 207, 207, 163, 207, 207, 201, 22, 4, > 198, > + 175, 176, 39, 201, 192, 156, 236, 236, 17, > 201, > + 246, 236, 236, 236, 236, 195, 195, 237, 236, > 156, > + 237, 237, 237, 246, 236, 207, 207, 207, 207, > 156, > + 154, 156, 156, 154, 154, 154, 190, 196, > 197, 22, > + 156, 159, 190, 190, 154, 156, 161, 236, 154, > 195, > + 154, 154, 154, 154, 207, 207, 207, 176, 53, > 194, > + 17, 161, 173, 243, 120, 121, 236, 236, > 192, 17, > + 201, 161, 192, 154, 154, 154, 4, 149, 193, > 236, > + 234, 161, 173, 190, 190, 38, 190, 190, 22, > 156, > + 234, 17, 236, 236, 17, 156, 236, 190, 190, > 236, > + 17, 72, 236, 17, 236 > }; > > #define yyerrok (yyerrstatus = 0) > @@ -3470,152 +3499,152 @@ > switch (yyn) > { > case 29: > -#line 1117 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1117 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} > break; > > case 30: > -#line 1117 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1117 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} > break; > > case 31: > -#line 1118 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1118 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} > break; > > case 32: > -#line 1118 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1118 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} > break; > > case 33: > -#line 1119 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1119 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} > break; > > case 34: > -#line 1119 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1119 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} > break; > > case 35: > -#line 1120 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1120 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} > break; > > case 36: > -#line 1120 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1120 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} > break; > > case 37: > -#line 1121 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1121 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} > break; > > case 38: > -#line 1121 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1121 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} > break; > > case 39: > -#line 1125 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1125 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} > break; > > case 40: > -#line 1125 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1125 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} > break; > > case 41: > -#line 1126 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1126 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} > break; > > case 42: > -#line 1126 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1126 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} > break; > > case 43: > -#line 1127 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1127 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} > break; > > case 44: > -#line 1127 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1127 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} > break; > > case 45: > -#line 1128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1128 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} > break; > > case 46: > -#line 1128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1128 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} > break; > > case 47: > -#line 1129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1129 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} > break; > > case 48: > -#line 1129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1129 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} > break; > > case 49: > -#line 1130 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1130 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} > break; > > case 50: > -#line 1130 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1130 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} > break; > > case 51: > -#line 1131 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1131 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} > break; > > case 52: > -#line 1131 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1131 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} > break; > > case 53: > -#line 1132 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1132 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} > break; > > case 54: > -#line 1133 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1133 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} > break; > > case 65: > -#line 1142 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1142 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.StrVal) = 0; ;} > break; > > case 66: > -#line 1144 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1144 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;} > break; > > case 67: > -#line 1145 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1145 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal)=0; ;} > break; > > case 68: > -#line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1149 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); > CHECK_FOR_ERROR > @@ -3623,7 +3652,7 @@ > break; > > case 69: > -#line 1153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1153 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.StrVal) = 0; > CHECK_FOR_ERROR > @@ -3631,7 +3660,7 @@ > break; > > case 73: > -#line 1161 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1161 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.StrVal) = 0; > CHECK_FOR_ERROR > @@ -3639,7 +3668,7 @@ > break; > > case 74: > -#line 1166 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1166 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); > CHECK_FOR_ERROR > @@ -3647,152 +3676,152 @@ > break; > > case 75: > -#line 1172 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1172 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} > break; > > case 76: > -#line 1173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1173 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} > break; > > case 77: > -#line 1174 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1174 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} > break; > > case 78: > -#line 1175 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1175 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} > break; > > case 79: > -#line 1176 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1176 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} > break; > > case 80: > -#line 1180 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1180 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} > break; > > case 81: > -#line 1181 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1181 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} > break; > > case 82: > -#line 1182 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1182 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} > break; > > case 83: > -#line 1186 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1186 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} > break; > > case 84: > -#line 1187 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1187 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} > break; > > case 85: > -#line 1188 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1188 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} > break; > > case 86: > -#line 1189 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1189 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} > break; > > case 87: > -#line 1193 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1193 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} > break; > > case 88: > -#line 1194 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1194 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} > break; > > case 89: > -#line 1195 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1195 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} > break; > > case 90: > -#line 1199 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1199 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} > break; > > case 91: > -#line 1200 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1200 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} > break; > > case 92: > -#line 1201 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1201 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} > break; > > case 93: > -#line 1202 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1202 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} > break; > > case 94: > -#line 1203 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1203 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} > break; > > case 95: > -#line 1207 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1207 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} > break; > > case 96: > -#line 1208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1208 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} > break; > > case 97: > -#line 1209 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1209 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} > break; > > case 98: > -#line 1212 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1212 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = CallingConv::C; ;} > break; > > case 99: > -#line 1213 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1213 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = CallingConv::C; ;} > break; > > case 100: > -#line 1214 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1214 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = CallingConv::Fast; ;} > break; > > case 101: > -#line 1215 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1215 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = CallingConv::Cold; ;} > break; > > case 102: > -#line 1216 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1216 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} > break; > > case 103: > -#line 1217 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1217 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} > break; > > case 104: > -#line 1218 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1218 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != > (yyvsp[(2) - (2)].UInt64Val)) > GEN_ERROR("Calling conv too large"); > @@ -3802,129 +3831,129 @@ > break; > > case 105: > -#line 1225 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1225 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} > break; > > case 106: > -#line 1226 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1226 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} > break; > > case 107: > -#line 1227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1227 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::SExt; ;} > break; > > case 108: > -#line 1228 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1228 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::SExt; ;} > break; > > case 109: > -#line 1229 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1229 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::InReg; ;} > break; > > case 110: > -#line 1230 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1230 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} > break; > > case 111: > -#line 1231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1231 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;} > break; > > case 112: > -#line 1232 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1232 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::ByVal; ;} > break; > > case 113: > -#line 1233 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1233 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::Nest; ;} > break; > > case 114: > -#line 1234 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1234 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = > > ParamAttr::constructAlignmentFromInt((yyvsp[(2) - > (2)].UInt64Val)); ;} > break; > > case 115: > -#line 1238 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1238 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::None; ;} > break; > > case 116: > -#line 1239 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1239 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | > (yyvsp[(2) - (2)].ParamAttrs); > ;} > break; > > case 117: > -#line 1244 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1244 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} > break; > > case 118: > -#line 1245 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1245 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} > break; > > case 119: > -#line 1246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1246 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} > break; > > case 120: > -#line 1247 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1247 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::SExt; ;} > break; > > case 121: > -#line 1248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1248 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;} > break; > > case 122: > -#line 1249 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1249 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;} > break; > > case 123: > -#line 1252 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1252 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamAttrs) = ParamAttr::None; ;} > break; > > case 124: > -#line 1253 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1253 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | > (yyvsp[(2) - (2)].ParamAttrs); > ;} > break; > > case 125: > -#line 1258 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1258 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.StrVal) = 0; ;} > break; > > case 126: > -#line 1259 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1259 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); > ;} > break; > > case 127: > -#line 1266 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1266 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = 0; ;} > break; > > case 128: > -#line 1267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1267 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); > if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) > @@ -3934,12 +3963,12 @@ > break; > > case 129: > -#line 1273 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1273 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.UIntVal) = 0; ;} > break; > > case 130: > -#line 1274 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1274 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); > if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) > @@ -3949,7 +3978,7 @@ > break; > > case 131: > -#line 1283 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1283 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != > e; ++i) > if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - > (2)].StrVal))[i] == '\\') > @@ -3960,27 +3989,27 @@ > break; > > case 132: > -#line 1291 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1291 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.StrVal) = 0; ;} > break; > > case 133: > -#line 1292 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1292 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} > break; > > case 134: > -#line 1297 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1297 "/llvm/lib/AsmParser/llvmAsmParser.y" > {;} > break; > > case 135: > -#line 1298 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1298 "/llvm/lib/AsmParser/llvmAsmParser.y" > {;} > break; > > case 136: > -#line 1299 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1299 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurGV->setSection(*(yyvsp[(1) - (1)].StrVal)); > delete (yyvsp[(1) - (1)].StrVal); > @@ -3989,7 +4018,7 @@ > break; > > case 137: > -#line 1304 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1304 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(2) - (2)].UInt64Val) != 0 && ! > isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) > GEN_ERROR("Alignment must be a power of two"); > @@ -3999,7 +4028,7 @@ > break; > > case 145: > -#line 1320 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1320 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); > CHECK_FOR_ERROR > @@ -4007,7 +4036,7 @@ > break; > > case 146: > -#line 1324 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1324 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); > CHECK_FOR_ERROR > @@ -4015,7 +4044,7 @@ > break; > > case 147: > -#line 1328 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1328 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Pointer type? > if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy) > GEN_ERROR("Cannot form a pointer to a basic block"); > @@ -4026,7 +4055,7 @@ > break; > > case 148: > -#line 1335 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1335 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Named types are also simple types... > const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); > CHECK_FOR_ERROR > @@ -4035,7 +4064,7 @@ > break; > > case 149: > -#line 1340 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1340 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Type UpReference > if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) > GEN_ERROR("Value out of range"); > OpaqueType *OT = OpaqueType::get(); // Use temporary > placeholder > @@ -4047,7 +4076,7 @@ > break; > > case 150: > -#line 1348 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1348 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // Allow but ignore attributes on function types; this permits > auto-upgrade. > // FIXME: remove in LLVM 3.0. > @@ -4080,7 +4109,7 @@ > break; > > case 151: > -#line 1377 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1377 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // Allow but ignore attributes on function types; this permits > auto-upgrade. > // FIXME: remove in LLVM 3.0. > @@ -4108,7 +4137,7 @@ > break; > > case 152: > -#line 1402 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1402 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Sized array type? > (yyval.TypeVal) = new > PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - > (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); > delete (yyvsp[(4) - (5)].TypeVal); > @@ -4117,7 +4146,7 @@ > break; > > case 153: > -#line 1407 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1407 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Vector type? > const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); > if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - > (5)].UInt64Val)) > @@ -4131,7 +4160,7 @@ > break; > > case 154: > -#line 1417 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1417 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Structure type? > std::vector Elements; > for (std::list::iterator I = (yyvsp[(2) - > (3)].TypeList)->begin(), > @@ -4145,7 +4174,7 @@ > break; > > case 155: > -#line 1427 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1427 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Empty structure type? > (yyval.TypeVal) = new > PATypeHolder(StructType::get(std::vector())); > CHECK_FOR_ERROR > @@ -4153,7 +4182,7 @@ > break; > > case 156: > -#line 1431 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1431 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > std::vector Elements; > for (std::list::iterator I = (yyvsp[(3) - > (5)].TypeList)->begin(), > @@ -4167,7 +4196,7 @@ > break; > > case 157: > -#line 1441 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1441 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Empty structure type? > (yyval.TypeVal) = new > PATypeHolder(StructType::get(std::vector(), true)); > CHECK_FOR_ERROR > @@ -4175,7 +4204,7 @@ > break; > > case 158: > -#line 1448 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1448 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // Allow but ignore attributes on function types; this permits > auto-upgrade. > // FIXME: remove in LLVM 3.0. > @@ -4185,7 +4214,7 @@ > break; > > case 159: > -#line 1457 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1457 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (1)].TypeVal))->getDescription()); > @@ -4196,14 +4225,14 @@ > break; > > case 160: > -#line 1464 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1464 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); > ;} > break; > > case 161: > -#line 1469 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1469 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); > (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - > (1)].TypeWithAttrs)); > @@ -4212,7 +4241,7 @@ > break; > > case 162: > -#line 1474 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1474 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))- > >push_back((yyvsp[(3) - (3)].TypeWithAttrs)); > CHECK_FOR_ERROR > @@ -4220,7 +4249,7 @@ > break; > > case 164: > -#line 1482 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1482 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); > TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; > @@ -4231,7 +4260,7 @@ > break; > > case 165: > -#line 1489 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1489 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeWithAttrsList) = new TypeWithAttrsList; > TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; > @@ -4242,7 +4271,7 @@ > break; > > case 166: > -#line 1496 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1496 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); > CHECK_FOR_ERROR > @@ -4250,7 +4279,7 @@ > break; > > case 167: > -#line 1504 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1504 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TypeList) = new std::list(); > (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); > @@ -4260,7 +4289,7 @@ > break; > > case 168: > -#line 1510 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1510 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))- > >push_back(*(yyvsp[(3) - (3)].TypeVal)); > delete (yyvsp[(3) - (3)].TypeVal); > @@ -4269,7 +4298,7 @@ > break; > > case 169: > -#line 1522 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1522 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Nonempty unsized arr > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (4)].TypeVal))->getDescription()); > @@ -4301,7 +4330,7 @@ > break; > > case 170: > -#line 1550 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1550 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (3)].TypeVal))->getDescription()); > @@ -4321,7 +4350,7 @@ > break; > > case 171: > -#line 1566 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1566 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (3)].TypeVal))->getDescription()); > @@ -4352,7 +4381,7 @@ > break; > > case 172: > -#line 1593 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1593 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Nonempty unsized arr > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (4)].TypeVal))->getDescription()); > @@ -4384,7 +4413,7 @@ > break; > > case 173: > -#line 1621 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1621 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > const StructType *STy = dyn_cast((yyvsp[(1) - > (4)].TypeVal)->get()); > if (STy == 0) > @@ -4414,7 +4443,7 @@ > break; > > case 174: > -#line 1647 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1647 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (3)].TypeVal))->getDescription()); > @@ -4438,7 +4467,7 @@ > break; > > case 175: > -#line 1667 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1667 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > const StructType *STy = dyn_cast((yyvsp[(1) - > (6)].TypeVal)->get()); > if (STy == 0) > @@ -4468,7 +4497,7 @@ > break; > > case 176: > -#line 1693 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1693 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (5)].TypeVal))->getDescription()); > @@ -4492,7 +4521,7 @@ > break; > > case 177: > -#line 1713 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1713 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (2)].TypeVal))->getDescription()); > @@ -4508,7 +4537,7 @@ > break; > > case 178: > -#line 1725 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1725 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (2)].TypeVal))->getDescription()); > @@ -4519,7 +4548,7 @@ > break; > > case 179: > -#line 1732 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1732 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (2)].TypeVal))->getDescription()); > @@ -4589,7 +4618,7 @@ > break; > > case 180: > -#line 1798 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1798 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (2)].TypeVal))->getDescription()); > @@ -4603,7 +4632,7 @@ > break; > > case 181: > -#line 1808 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1808 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (2)].TypeVal))->getDescription()); > @@ -4617,7 +4646,7 @@ > break; > > case 182: > -#line 1818 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1818 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // integral constants > if (!ConstantInt::isValueValidForType((yyvsp[(1) - > (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) > GEN_ERROR("Constant value doesn't fit in type"); > @@ -4627,7 +4656,7 @@ > break; > > case 183: > -#line 1824 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1824 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // arbitrary precision integer constants > uint32_t BitWidth = cast((yyvsp[(1) - > (2)].PrimType))->getBitWidth(); > if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { > @@ -4641,7 +4670,7 @@ > break; > > case 184: > -#line 1834 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1834 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // integral constants > if (!ConstantInt::isValueValidForType((yyvsp[(1) - > (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) > GEN_ERROR("Constant value doesn't fit in type"); > @@ -4651,7 +4680,7 @@ > break; > > case 185: > -#line 1840 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1840 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // arbitrary precision integer constants > uint32_t BitWidth = cast((yyvsp[(1) - > (2)].PrimType))->getBitWidth(); > if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { > @@ -4665,7 +4694,7 @@ > break; > > case 186: > -#line 1850 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1850 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Boolean constants > assert(cast((yyvsp[(1) - (2)].PrimType))- > >getBitWidth() == 1 && "Not Bool?"); > (yyval.ConstVal) = ConstantInt::getTrue(); > @@ -4674,7 +4703,7 @@ > break; > > case 187: > -#line 1855 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1855 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Boolean constants > assert(cast((yyvsp[(1) - (2)].PrimType))- > >getBitWidth() == 1 && "Not Bool?"); > (yyval.ConstVal) = ConstantInt::getFalse(); > @@ -4683,7 +4712,7 @@ > break; > > case 188: > -#line 1860 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1860 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Floating point constants > if (!ConstantFP::isValueValidForType((yyvsp[(1) - > (2)].PrimType), *(yyvsp[(2) - (2)].FPVal))) > GEN_ERROR("Floating point constant invalid for type"); > @@ -4698,7 +4727,7 @@ > break; > > case 189: > -#line 1873 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1873 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - > (6)].TypeVal))->getDescription()); > @@ -4714,7 +4743,7 @@ > break; > > case 190: > -#line 1885 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1885 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) > GEN_ERROR("GetElementPtr requires a pointer operand"); > @@ -4740,7 +4769,7 @@ > break; > > case 191: > -#line 1907 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1907 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) > GEN_ERROR("Select condition must be of boolean type"); > @@ -4752,7 +4781,7 @@ > break; > > case 192: > -#line 1915 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1915 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - > (6)].ConstVal)->getType()) > GEN_ERROR("Binary operator types must match"); > @@ -4762,7 +4791,7 @@ > break; > > case 193: > -#line 1921 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1921 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - > (6)].ConstVal)->getType()) > GEN_ERROR("Logical operator types must match"); > @@ -4777,7 +4806,7 @@ > break; > > case 194: > -#line 1932 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1932 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - > (7)].ConstVal)->getType()) > GEN_ERROR("icmp operand types must match"); > @@ -4786,7 +4815,7 @@ > break; > > case 195: > -#line 1937 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1937 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - > (7)].ConstVal)->getType()) > GEN_ERROR("fcmp operand types must match"); > @@ -4795,7 +4824,25 @@ > break; > > case 196: > -#line 1942 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 1942 "/llvm/lib/AsmParser/llvmAsmParser.y" > + { > + if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - > (7)].ConstVal)->getType()) > + GEN_ERROR("vicmp operand types must match"); > + (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - > (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - > (7)].ConstVal)); > + ;} > + break; > + > + case 197: > +#line 1947 "/llvm/lib/AsmParser/llvmAsmParser.y" > + { > + if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - > (7)].ConstVal)->getType()) > + GEN_ERROR("vfcmp operand types must match"); > + (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - > (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - > (7)].ConstVal)); > + ;} > + break; > + > + case 198: > +#line 1952 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!ExtractElementInst::isValidOperands((yyvsp[(3) - > (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) > GEN_ERROR("Invalid extractelement operands"); > @@ -4804,8 +4851,8 @@ > ;} > break; > > - case 197: > -#line 1948 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 199: > +#line 1958 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!InsertElementInst::isValidOperands((yyvsp[(3) - > (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - > (8)].ConstVal))) > GEN_ERROR("Invalid insertelement operands"); > @@ -4814,8 +4861,8 @@ > ;} > break; > > - case 198: > -#line 1954 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 200: > +#line 1964 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - > (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - > (8)].ConstVal))) > GEN_ERROR("Invalid shufflevector operands"); > @@ -4824,16 +4871,16 @@ > ;} > break; > > - case 199: > -#line 1963 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 201: > +#line 1973 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))- > >push_back((yyvsp[(3) - (3)].ConstVal)); > CHECK_FOR_ERROR > ;} > break; > > - case 200: > -#line 1967 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 202: > +#line 1977 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ConstVector) = new std::vector(); > (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); > @@ -4841,28 +4888,28 @@ > ;} > break; > > - case 201: > -#line 1975 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 203: > +#line 1985 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.BoolVal) = false; ;} > break; > > - case 202: > -#line 1975 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 204: > +#line 1985 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.BoolVal) = true; ;} > break; > > - case 203: > -#line 1978 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 205: > +#line 1988 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.BoolVal) = true; ;} > break; > > - case 204: > -#line 1978 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 206: > +#line 1988 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.BoolVal) = false; ;} > break; > > - case 205: > -#line 1981 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 207: > +#line 1991 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); > Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); > @@ -4877,8 +4924,8 @@ > ;} > break; > > - case 206: > -#line 1993 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 208: > +#line 2003 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > Constant *Val = (yyvsp[(3) - (6)].ConstVal); > const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); > @@ -4893,8 +4940,8 @@ > ;} > break; > > - case 207: > -#line 2014 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 209: > +#line 2024 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; > CurModule.ModuleDone(); > @@ -4902,8 +4949,8 @@ > ;} > break; > > - case 208: > -#line 2019 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 210: > +#line 2029 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; > CurModule.ModuleDone(); > @@ -4911,40 +4958,40 @@ > ;} > break; > > - case 211: > -#line 2032 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 213: > +#line 2042 "/llvm/lib/AsmParser/llvmAsmParser.y" > { CurFun.isDeclare = false; ;} > break; > > - case 212: > -#line 2032 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 214: > +#line 2042 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurFun.FunctionDone(); > CHECK_FOR_ERROR > ;} > break; > > - case 213: > -#line 2036 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 215: > +#line 2046 "/llvm/lib/AsmParser/llvmAsmParser.y" > { CurFun.isDeclare = true; ;} > break; > > - case 214: > -#line 2036 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 216: > +#line 2046 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CHECK_FOR_ERROR > ;} > break; > > - case 215: > -#line 2039 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 217: > +#line 2049 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CHECK_FOR_ERROR > ;} > break; > > - case 216: > -#line 2042 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 218: > +#line 2052 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - > (3)].TypeVal))->getDescription()); > @@ -4971,8 +5018,8 @@ > ;} > break; > > - case 217: > -#line 2066 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 219: > +#line 2076 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - > (3)].PrimType)); > > @@ -4986,8 +5033,8 @@ > ;} > break; > > - case 218: > -#line 2078 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 220: > +#line 2088 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > /* "Externally Visible" Linkage */ > if ((yyvsp[(5) - (6)].ConstVal) == 0) > @@ -4998,15 +5045,15 @@ > ;} > break; > > - case 219: > -#line 2085 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 221: > +#line 2095 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurGV = 0; > ;} > break; > > - case 220: > -#line 2089 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 222: > +#line 2099 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(6) - (7)].ConstVal) == 0) > GEN_ERROR("Global value initializer is not a constant"); > @@ -5015,15 +5062,15 @@ > ;} > break; > > - case 221: > -#line 2094 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 223: > +#line 2104 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurGV = 0; > ;} > break; > > - case 222: > -#line 2098 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 224: > +#line 2108 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - > (7)].TypeVal))->getDescription()); > @@ -5033,16 +5080,16 @@ > ;} > break; > > - case 223: > -#line 2104 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 225: > +#line 2114 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurGV = 0; > CHECK_FOR_ERROR > ;} > break; > > - case 224: > -#line 2108 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 226: > +#line 2118 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > std::string Name; > if ((yyvsp[(1) - (5)].StrVal)) { > @@ -5085,22 +5132,22 @@ > ;} > break; > > - case 225: > -#line 2148 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 227: > +#line 2158 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CHECK_FOR_ERROR > ;} > break; > > - case 226: > -#line 2151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 228: > +#line 2161 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CHECK_FOR_ERROR > ;} > break; > > - case 227: > -#line 2157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 229: > +#line 2167 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > const std::string &AsmSoFar = CurModule.CurrentModule- > >getModuleInlineAsm(); > if (AsmSoFar.empty()) > @@ -5112,24 +5159,24 @@ > ;} > break; > > - case 228: > -#line 2167 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 230: > +#line 2177 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - > (3)].StrVal)); > delete (yyvsp[(3) - (3)].StrVal); > ;} > break; > > - case 229: > -#line 2171 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 231: > +#line 2181 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - > (3)].StrVal)); > delete (yyvsp[(3) - (3)].StrVal); > ;} > break; > > - case 231: > -#line 2178 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 233: > +#line 2188 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - > (3)].StrVal)); > delete (yyvsp[(3) - (3)].StrVal); > @@ -5137,8 +5184,8 @@ > ;} > break; > > - case 232: > -#line 2183 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 234: > +#line 2193 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - > (1)].StrVal)); > delete (yyvsp[(1) - (1)].StrVal); > @@ -5146,15 +5193,15 @@ > ;} > break; > > - case 233: > -#line 2188 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 235: > +#line 2198 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CHECK_FOR_ERROR > ;} > break; > > - case 234: > -#line 2197 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 236: > +#line 2207 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - > (5)].TypeVal))->getDescription()); > @@ -5167,8 +5214,8 @@ > ;} > break; > > - case 235: > -#line 2207 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 237: > +#line 2217 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (3)].TypeVal))->getDescription()); > @@ -5181,16 +5228,16 @@ > ;} > break; > > - case 236: > -#line 2218 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 238: > +#line 2228 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); > CHECK_FOR_ERROR > ;} > break; > > - case 237: > -#line 2222 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 239: > +#line 2232 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); > struct ArgListEntry E; > @@ -5202,8 +5249,8 @@ > ;} > break; > > - case 238: > -#line 2231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 240: > +#line 2241 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ArgList) = new ArgListType; > struct ArgListEntry E; > @@ -5215,16 +5262,16 @@ > ;} > break; > > - case 239: > -#line 2240 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 241: > +#line 2250 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ArgList) = 0; > CHECK_FOR_ERROR > ;} > break; > > - case 240: > -#line 2246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 242: > +#line 2256 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > std::string FunctionName(*(yyvsp[(3) - (10)].StrVal)); > delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory! > @@ -5354,8 +5401,8 @@ > ;} > break; > > - case 243: > -#line 2376 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 245: > +#line 2386 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.FunctionVal) = CurFun.CurrentFunction; > > @@ -5366,16 +5413,16 @@ > ;} > break; > > - case 246: > -#line 2387 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 248: > +#line 2397 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); > CHECK_FOR_ERROR > ;} > break; > > - case 247: > -#line 2392 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 249: > +#line 2402 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); > CurFun.CurrentFunction->setVisibility((yyvsp[(2) - > (3)].Visibility)); > @@ -5385,88 +5432,88 @@ > ;} > break; > > - case 248: > -#line 2404 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 250: > +#line 2414 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.BoolVal) = false; > CHECK_FOR_ERROR > ;} > break; > > - case 249: > -#line 2408 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 251: > +#line 2418 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.BoolVal) = true; > CHECK_FOR_ERROR > ;} > break; > > - case 250: > -#line 2413 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 252: > +#line 2423 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // A reference to a direct constant > (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); > CHECK_FOR_ERROR > ;} > break; > > - case 251: > -#line 2417 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 253: > +#line 2427 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); > CHECK_FOR_ERROR > ;} > break; > > - case 252: > -#line 2421 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 254: > +#line 2431 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Perhaps it's an FP constant? > (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); > CHECK_FOR_ERROR > ;} > break; > > - case 253: > -#line 2425 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 255: > +#line 2435 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); > CHECK_FOR_ERROR > ;} > break; > > - case 254: > -#line 2429 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 256: > +#line 2439 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); > CHECK_FOR_ERROR > ;} > break; > > - case 255: > -#line 2433 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 257: > +#line 2443 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::createNull(); > CHECK_FOR_ERROR > ;} > break; > > - case 256: > -#line 2437 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 258: > +#line 2447 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::createUndef(); > CHECK_FOR_ERROR > ;} > break; > > - case 257: > -#line 2441 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 259: > +#line 2451 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // A vector zero constant. > (yyval.ValIDVal) = ValID::createZeroInit(); > CHECK_FOR_ERROR > ;} > break; > > - case 258: > -#line 2445 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 260: > +#line 2455 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Nonempty unsized packed vector > const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); > int NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); > @@ -5494,16 +5541,16 @@ > ;} > break; > > - case 259: > -#line 2470 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 261: > +#line 2480 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); > CHECK_FOR_ERROR > ;} > break; > > - case 260: > -#line 2474 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 262: > +#line 2484 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - > (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal)); > delete (yyvsp[(3) - (5)].StrVal); > @@ -5512,24 +5559,24 @@ > ;} > break; > > - case 261: > -#line 2484 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 263: > +#line 2494 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Is it an integer reference...? > (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - > (1)].UIntVal)); > CHECK_FOR_ERROR > ;} > break; > > - case 262: > -#line 2488 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 264: > +#line 2498 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - > (1)].UIntVal)); > CHECK_FOR_ERROR > ;} > break; > > - case 263: > -#line 2492 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 265: > +#line 2502 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Is it a named reference...? > (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - > (1)].StrVal)); > delete (yyvsp[(1) - (1)].StrVal); > @@ -5537,8 +5584,8 @@ > ;} > break; > > - case 264: > -#line 2497 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 266: > +#line 2507 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Is it a named reference...? > (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - > (1)].StrVal)); > delete (yyvsp[(1) - (1)].StrVal); > @@ -5546,8 +5593,8 @@ > ;} > break; > > - case 267: > -#line 2510 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 269: > +#line 2520 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (2)].TypeVal))->getDescription()); > @@ -5557,8 +5604,8 @@ > ;} > break; > > - case 268: > -#line 2519 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 270: > +#line 2529 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValueList) = new std::vector(); > (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); > @@ -5566,32 +5613,32 @@ > ;} > break; > > - case 269: > -#line 2524 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 271: > +#line 2534 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))- > >push_back((yyvsp[(3) - (3)].ValueVal)); > CHECK_FOR_ERROR > ;} > break; > > - case 270: > -#line 2529 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 272: > +#line 2539 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); > CHECK_FOR_ERROR > ;} > break; > > - case 271: > -#line 2533 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 273: > +#line 2543 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Do not allow functions with 0 basic blocks > (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); > CHECK_FOR_ERROR > ;} > break; > > - case 272: > -#line 2542 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 274: > +#line 2552 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - > (3)].StrVal)); > CHECK_FOR_ERROR > @@ -5602,8 +5649,8 @@ > ;} > break; > > - case 273: > -#line 2551 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 275: > +#line 2561 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (CastInst *CI1 = dyn_cast((yyvsp[(2) - > (2)].InstVal))) > if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) > @@ -5615,16 +5662,16 @@ > ;} > break; > > - case 274: > -#line 2560 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 276: > +#line 2570 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Empty space between instruction lists > (yyval.BasicBlockVal) = > defineBBVal(ValID::createLocalID(CurFun.NextValNum)); > CHECK_FOR_ERROR > ;} > break; > > - case 275: > -#line 2564 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 277: > +#line 2574 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Labelled (named) basic block > (yyval.BasicBlockVal) = > defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal))); > delete (yyvsp[(1) - (1)].StrVal); > @@ -5633,8 +5680,8 @@ > ;} > break; > > - case 276: > -#line 2572 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 278: > +#line 2582 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Return with a result... > ValueList &VL = *(yyvsp[(2) - (2)].ValueList); > assert(!VL.empty() && "Invalid ret operands!"); > @@ -5644,16 +5691,16 @@ > ;} > break; > > - case 277: > -#line 2579 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 279: > +#line 2589 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Return with no result... > (yyval.TermInstVal) = ReturnInst::Create(); > CHECK_FOR_ERROR > ;} > break; > > - case 278: > -#line 2583 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 280: > +#line 2593 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Unconditional Branch... > BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); > CHECK_FOR_ERROR > @@ -5661,8 +5708,8 @@ > ;} > break; > > - case 279: > -#line 2588 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 281: > +#line 2598 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > assert(cast((yyvsp[(2) - (9)].PrimType))- > >getBitWidth() == 1 && "Not Bool?"); > BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal)); > @@ -5675,8 +5722,8 @@ > ;} > break; > > - case 280: > -#line 2598 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 282: > +#line 2608 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - > (9)].ValIDVal)); > CHECK_FOR_ERROR > @@ -5698,8 +5745,8 @@ > ;} > break; > > - case 281: > -#line 2617 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 283: > +#line 2627 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - > (8)].ValIDVal)); > CHECK_FOR_ERROR > @@ -5711,8 +5758,8 @@ > ;} > break; > > - case 282: > -#line 2627 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 284: > +#line 2637 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > > // Handle the short syntax > @@ -5799,24 +5846,24 @@ > ;} > break; > > - case 283: > -#line 2711 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 285: > +#line 2721 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TermInstVal) = new UnwindInst(); > CHECK_FOR_ERROR > ;} > break; > > - case 284: > -#line 2715 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 286: > +#line 2725 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.TermInstVal) = new UnreachableInst(); > CHECK_FOR_ERROR > ;} > break; > > - case 285: > -#line 2722 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 287: > +#line 2732 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); > Constant *V = cast(getExistingVal((yyvsp[(2) - > (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); > @@ -5830,8 +5877,8 @@ > ;} > break; > > - case 286: > -#line 2733 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 288: > +#line 2743 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.JumpTable) = new std::vector BasicBlock*> >(); > Constant *V = cast(getExistingVal((yyvsp[(1) - > (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); > @@ -5846,8 +5893,8 @@ > ;} > break; > > - case 287: > -#line 2746 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 289: > +#line 2756 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // Is this definition named?? if so, assign the name... > setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - > (2)].StrVal)); > @@ -5858,8 +5905,8 @@ > ;} > break; > > - case 288: > -#line 2756 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 290: > +#line 2766 "/llvm/lib/AsmParser/llvmAsmParser.y" > { // Used for PHI nodes > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - > (6)].TypeVal))->getDescription()); > @@ -5873,8 +5920,8 @@ > ;} > break; > > - case 289: > -#line 2767 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 291: > +#line 2777 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); > Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first- > >getType(), (yyvsp[(4) - (7)].ValIDVal)); > @@ -5885,8 +5932,8 @@ > ;} > break; > > - case 290: > -#line 2777 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 292: > +#line 2787 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a > mistake in 2.0 > if (!UpRefs.empty()) > @@ -5900,8 +5947,8 @@ > ;} > break; > > - case 291: > -#line 2788 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 293: > +#line 2798 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a > mistake in 2.0 > // Labels are only valid in ASMs > @@ -5912,8 +5959,8 @@ > ;} > break; > > - case 292: > -#line 2796 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 294: > +#line 2806 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a > mistake in 2.0 > if (!UpRefs.empty()) > @@ -5926,8 +5973,8 @@ > ;} > break; > > - case 293: > -#line 2806 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 295: > +#line 2816 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a > mistake in 2.0 > (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); > @@ -5937,18 +5984,18 @@ > ;} > break; > > - case 294: > -#line 2813 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 296: > +#line 2823 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ParamList) = new ParamList(); ;} > break; > > - case 295: > -#line 2816 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 297: > +#line 2826 "/llvm/lib/AsmParser/llvmAsmParser.y" > { (yyval.ValueList) = new std::vector(); ;} > break; > > - case 296: > -#line 2817 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 298: > +#line 2827 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); > (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); > @@ -5956,24 +6003,24 @@ > ;} > break; > > - case 297: > -#line 2824 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 299: > +#line 2834 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.BoolVal) = true; > CHECK_FOR_ERROR > ;} > break; > > - case 298: > -#line 2828 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 300: > +#line 2838 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.BoolVal) = false; > CHECK_FOR_ERROR > ;} > break; > > - case 299: > -#line 2833 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 301: > +#line 2843 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (5)].TypeVal))->getDescription()); > @@ -5992,8 +6039,8 @@ > ;} > break; > > - case 300: > -#line 2849 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 302: > +#line 2859 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (5)].TypeVal))->getDescription()); > @@ -6013,8 +6060,8 @@ > ;} > break; > > - case 301: > -#line 2866 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 303: > +#line 2876 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - > (6)].TypeVal))->getDescription()); > @@ -6031,8 +6078,8 @@ > ;} > break; > > - case 302: > -#line 2880 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 304: > +#line 2890 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - > (6)].TypeVal))->getDescription()); > @@ -6049,8 +6096,44 @@ > ;} > break; > > - case 303: > -#line 2894 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 305: > +#line 2904 "/llvm/lib/AsmParser/llvmAsmParser.y" > + { > + if (!UpRefs.empty()) > + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - > (6)].TypeVal))->getDescription()); > + if (!isa((*(yyvsp[(3) - (6)].TypeVal)).get())) > + GEN_ERROR("Scalar types not supported by vicmp instruction"); > + Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) > - (6)].ValIDVal)); > + CHECK_FOR_ERROR > + Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) > - (6)].ValIDVal)); > + CHECK_FOR_ERROR > + (yyval.InstVal) = CmpInst::create((yyvsp[(1) - > (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2); > + if ((yyval.InstVal) == 0) > + GEN_ERROR("icmp operator returned null"); > + delete (yyvsp[(3) - (6)].TypeVal); > + ;} > + break; > + > + case 306: > +#line 2918 "/llvm/lib/AsmParser/llvmAsmParser.y" > + { > + if (!UpRefs.empty()) > + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - > (6)].TypeVal))->getDescription()); > + if (!isa((*(yyvsp[(3) - (6)].TypeVal)).get())) > + GEN_ERROR("Scalar types not supported by vfcmp instruction"); > + Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) > - (6)].ValIDVal)); > + CHECK_FOR_ERROR > + Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) > - (6)].ValIDVal)); > + CHECK_FOR_ERROR > + (yyval.InstVal) = CmpInst::create((yyvsp[(1) - > (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2); > + if ((yyval.InstVal) == 0) > + GEN_ERROR("fcmp operator returned null"); > + delete (yyvsp[(3) - (6)].TypeVal); > + ;} > + break; > + > + case 307: > +#line 2932 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - > (4)].TypeVal))->getDescription()); > @@ -6065,8 +6148,8 @@ > ;} > break; > > - case 304: > -#line 2906 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 308: > +#line 2944 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty) > GEN_ERROR("select condition must be boolean"); > @@ -6077,8 +6160,8 @@ > ;} > break; > > - case 305: > -#line 2914 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 309: > +#line 2952 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - > (4)].TypeVal))->getDescription()); > @@ -6088,8 +6171,8 @@ > ;} > break; > > - case 306: > -#line 2921 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 310: > +#line 2959 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!ExtractElementInst::isValidOperands((yyvsp[(2) - > (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) > GEN_ERROR("Invalid extractelement operands"); > @@ -6098,8 +6181,8 @@ > ;} > break; > > - case 307: > -#line 2927 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 311: > +#line 2965 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!InsertElementInst::isValidOperands((yyvsp[(2) - > (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - > (6)].ValueVal))) > GEN_ERROR("Invalid insertelement operands"); > @@ -6108,8 +6191,8 @@ > ;} > break; > > - case 308: > -#line 2933 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 312: > +#line 2971 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - > (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - > (6)].ValueVal))) > GEN_ERROR("Invalid shufflevector operands"); > @@ -6118,8 +6201,8 @@ > ;} > break; > > - case 309: > -#line 2939 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 313: > +#line 2977 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first- > >getType(); > if (!Ty->isFirstClassType()) > @@ -6137,8 +6220,8 @@ > ;} > break; > > - case 310: > -#line 2955 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 314: > +#line 2993 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > > // Handle the short syntax > @@ -6230,32 +6313,32 @@ > ;} > break; > > - case 311: > -#line 3044 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 315: > +#line 3082 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); > CHECK_FOR_ERROR > ;} > break; > > - case 312: > -#line 3049 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 316: > +#line 3087 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.BoolVal) = true; > CHECK_FOR_ERROR > ;} > break; > > - case 313: > -#line 3053 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 317: > +#line 3091 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > (yyval.BoolVal) = false; > CHECK_FOR_ERROR > ;} > break; > > - case 314: > -#line 3060 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 318: > +#line 3098 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (3)].TypeVal))->getDescription()); > @@ -6265,8 +6348,8 @@ > ;} > break; > > - case 315: > -#line 3067 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 319: > +#line 3105 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (6)].TypeVal))->getDescription()); > @@ -6277,8 +6360,8 @@ > ;} > break; > > - case 316: > -#line 3075 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 320: > +#line 3113 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (3)].TypeVal))->getDescription()); > @@ -6288,8 +6371,8 @@ > ;} > break; > > - case 317: > -#line 3082 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 321: > +#line 3120 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (6)].TypeVal))->getDescription()); > @@ -6300,8 +6383,8 @@ > ;} > break; > > - case 318: > -#line 3090 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 322: > +#line 3128 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) > GEN_ERROR("Trying to free nonpointer type " + > @@ -6311,8 +6394,8 @@ > ;} > break; > > - case 319: > -#line 3098 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 323: > +#line 3136 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - > (5)].TypeVal))->getDescription()); > @@ -6329,8 +6412,8 @@ > ;} > break; > > - case 320: > -#line 3112 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 324: > +#line 3150 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - > (7)].TypeVal))->getDescription()); > @@ -6350,8 +6433,8 @@ > ;} > break; > > - case 321: > -#line 3129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 325: > +#line 3167 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > Value *TmpVal = getVal((yyvsp[(2) - (5)].TypeVal)->get(), > (yyvsp[(3) - (5)].ValIDVal)); > if (!GetResultInst::isValidOperands(TmpVal, (yyvsp[(5) - > (5)].UInt64Val))) > @@ -6362,8 +6445,8 @@ > ;} > break; > > - case 322: > -#line 3137 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > + case 326: > +#line 3175 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - > (4)].TypeVal))->getDescription()); > @@ -6383,7 +6466,7 @@ > > > /* Line 1267 of yacc.c. */ > -#line 6387 "llvmAsmParser.tab.c" > +#line 6470 "llvmAsmParser.tab.c" > default: break; > } > YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); > @@ -6597,7 +6680,7 @@ > } > > > -#line 3154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 3192 "/llvm/lib/AsmParser/llvmAsmParser.y" > > > // common code from the two 'RunVMAsmParser' functions > > Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original) > +++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Mon May 12 14:01:56 > 2008 > @@ -127,66 +127,68 @@ > ASHR = 343, > ICMP = 344, > FCMP = 345, > - EQ = 346, > - NE = 347, > - SLT = 348, > - SGT = 349, > - SLE = 350, > - SGE = 351, > - ULT = 352, > - UGT = 353, > - ULE = 354, > - UGE = 355, > - OEQ = 356, > - ONE = 357, > - OLT = 358, > - OGT = 359, > - OLE = 360, > - OGE = 361, > - ORD = 362, > - UNO = 363, > - UEQ = 364, > - UNE = 365, > - MALLOC = 366, > - ALLOCA = 367, > - FREE = 368, > - LOAD = 369, > - STORE = 370, > - GETELEMENTPTR = 371, > - TRUNC = 372, > - ZEXT = 373, > - SEXT = 374, > - FPTRUNC = 375, > - FPEXT = 376, > - BITCAST = 377, > - UITOFP = 378, > - SITOFP = 379, > - FPTOUI = 380, > - FPTOSI = 381, > - INTTOPTR = 382, > - PTRTOINT = 383, > - PHI_TOK = 384, > - SELECT = 385, > - VAARG = 386, > - EXTRACTELEMENT = 387, > - INSERTELEMENT = 388, > - SHUFFLEVECTOR = 389, > - GETRESULT = 390, > - SIGNEXT = 391, > - ZEROEXT = 392, > - NORETURN = 393, > - INREG = 394, > - SRET = 395, > - NOUNWIND = 396, > - NOALIAS = 397, > - BYVAL = 398, > - NEST = 399, > - READNONE = 400, > - READONLY = 401, > - GC = 402, > - DEFAULT = 403, > - HIDDEN = 404, > - PROTECTED = 405 > + VICMP = 346, > + VFCMP = 347, > + EQ = 348, > + NE = 349, > + SLT = 350, > + SGT = 351, > + SLE = 352, > + SGE = 353, > + ULT = 354, > + UGT = 355, > + ULE = 356, > + UGE = 357, > + OEQ = 358, > + ONE = 359, > + OLT = 360, > + OGT = 361, > + OLE = 362, > + OGE = 363, > + ORD = 364, > + UNO = 365, > + UEQ = 366, > + UNE = 367, > + MALLOC = 368, > + ALLOCA = 369, > + FREE = 370, > + LOAD = 371, > + STORE = 372, > + GETELEMENTPTR = 373, > + TRUNC = 374, > + ZEXT = 375, > + SEXT = 376, > + FPTRUNC = 377, > + FPEXT = 378, > + BITCAST = 379, > + UITOFP = 380, > + SITOFP = 381, > + FPTOUI = 382, > + FPTOSI = 383, > + INTTOPTR = 384, > + PTRTOINT = 385, > + PHI_TOK = 386, > + SELECT = 387, > + VAARG = 388, > + EXTRACTELEMENT = 389, > + INSERTELEMENT = 390, > + SHUFFLEVECTOR = 391, > + GETRESULT = 392, > + SIGNEXT = 393, > + ZEROEXT = 394, > + NORETURN = 395, > + INREG = 396, > + SRET = 397, > + NOUNWIND = 398, > + NOALIAS = 399, > + BYVAL = 400, > + NEST = 401, > + READNONE = 402, > + READONLY = 403, > + GC = 404, > + DEFAULT = 405, > + HIDDEN = 406, > + PROTECTED = 407 > }; > #endif > /* Tokens. */ > @@ -278,73 +280,75 @@ > #define ASHR 343 > #define ICMP 344 > #define FCMP 345 > -#define EQ 346 > -#define NE 347 > -#define SLT 348 > -#define SGT 349 > -#define SLE 350 > -#define SGE 351 > -#define ULT 352 > -#define UGT 353 > -#define ULE 354 > -#define UGE 355 > -#define OEQ 356 > -#define ONE 357 > -#define OLT 358 > -#define OGT 359 > -#define OLE 360 > -#define OGE 361 > -#define ORD 362 > -#define UNO 363 > -#define UEQ 364 > -#define UNE 365 > -#define MALLOC 366 > -#define ALLOCA 367 > -#define FREE 368 > -#define LOAD 369 > -#define STORE 370 > -#define GETELEMENTPTR 371 > -#define TRUNC 372 > -#define ZEXT 373 > -#define SEXT 374 > -#define FPTRUNC 375 > -#define FPEXT 376 > -#define BITCAST 377 > -#define UITOFP 378 > -#define SITOFP 379 > -#define FPTOUI 380 > -#define FPTOSI 381 > -#define INTTOPTR 382 > -#define PTRTOINT 383 > -#define PHI_TOK 384 > -#define SELECT 385 > -#define VAARG 386 > -#define EXTRACTELEMENT 387 > -#define INSERTELEMENT 388 > -#define SHUFFLEVECTOR 389 > -#define GETRESULT 390 > -#define SIGNEXT 391 > -#define ZEROEXT 392 > -#define NORETURN 393 > -#define INREG 394 > -#define SRET 395 > -#define NOUNWIND 396 > -#define NOALIAS 397 > -#define BYVAL 398 > -#define NEST 399 > -#define READNONE 400 > -#define READONLY 401 > -#define GC 402 > -#define DEFAULT 403 > -#define HIDDEN 404 > -#define PROTECTED 405 > +#define VICMP 346 > +#define VFCMP 347 > +#define EQ 348 > +#define NE 349 > +#define SLT 350 > +#define SGT 351 > +#define SLE 352 > +#define SGE 353 > +#define ULT 354 > +#define UGT 355 > +#define ULE 356 > +#define UGE 357 > +#define OEQ 358 > +#define ONE 359 > +#define OLT 360 > +#define OGT 361 > +#define OLE 362 > +#define OGE 363 > +#define ORD 364 > +#define UNO 365 > +#define UEQ 366 > +#define UNE 367 > +#define MALLOC 368 > +#define ALLOCA 369 > +#define FREE 370 > +#define LOAD 371 > +#define STORE 372 > +#define GETELEMENTPTR 373 > +#define TRUNC 374 > +#define ZEXT 375 > +#define SEXT 376 > +#define FPTRUNC 377 > +#define FPEXT 378 > +#define BITCAST 379 > +#define UITOFP 380 > +#define SITOFP 381 > +#define FPTOUI 382 > +#define FPTOSI 383 > +#define INTTOPTR 384 > +#define PTRTOINT 385 > +#define PHI_TOK 386 > +#define SELECT 387 > +#define VAARG 388 > +#define EXTRACTELEMENT 389 > +#define INSERTELEMENT 390 > +#define SHUFFLEVECTOR 391 > +#define GETRESULT 392 > +#define SIGNEXT 393 > +#define ZEROEXT 394 > +#define NORETURN 395 > +#define INREG 396 > +#define SRET 397 > +#define NOUNWIND 398 > +#define NOALIAS 399 > +#define BYVAL 400 > +#define NEST 401 > +#define READNONE 402 > +#define READONLY 403 > +#define GC 404 > +#define DEFAULT 405 > +#define HIDDEN 406 > +#define PROTECTED 407 > > > > > #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED > typedef union YYSTYPE > -#line 949 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" > +#line 949 "/llvm/lib/AsmParser/llvmAsmParser.y" > { > llvm::Module *ModuleVal; > llvm::Function *FunctionVal; > @@ -392,7 +396,7 @@ > llvm::FCmpInst::Predicate FPredicate; > } > /* Line 1529 of yacc.c. */ > -#line 396 "llvmAsmParser.tab.h" > +#line 400 "llvmAsmParser.tab.h" > YYSTYPE; > # define yystype YYSTYPE /* obsolescent; will be withdrawn */ > # define YYSTYPE_IS_DECLARED 1 > > Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original) > +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Mon May 12 14:01:56 2008 > @@ -1075,7 +1075,7 @@ > %token ADD SUB MUL UDIV SDIV FDIV UREM SREM FREM AND > OR XOR > %token SHL LSHR ASHR > > -%token ICMP FCMP > +%token ICMP FCMP VICMP VFCMP > %type IPredicates > %type FPredicates > %token EQ NE SLT SGT SLE SGE ULT UGT ULE UGE > @@ -1939,6 +1939,16 @@ > GEN_ERROR("fcmp operand types must match"); > $$ = ConstantExpr::getFCmp($2, $4, $6); > } > + | VICMP IPredicates '(' ConstVal ',' ConstVal ')' { > + if ($4->getType() != $6->getType()) > + GEN_ERROR("vicmp operand types must match"); > + $$ = ConstantExpr::getVICmp($2, $4, $6); > + } > + | VFCMP FPredicates '(' ConstVal ',' ConstVal ')' { > + if ($4->getType() != $6->getType()) > + GEN_ERROR("vfcmp operand types must match"); > + $$ = ConstantExpr::getVFCmp($2, $4, $6); > + } > | EXTRACTELEMENT '(' ConstVal ',' ConstVal ')' { > if (!ExtractElementInst::isValidOperands($3, $5)) > GEN_ERROR("Invalid extractelement operands"); > @@ -2891,6 +2901,34 @@ > GEN_ERROR("fcmp operator returned null"); > delete $3; > } > + | VICMP IPredicates Types ValueRef ',' ValueRef { > + if (!UpRefs.empty()) > + GEN_ERROR("Invalid upreference in type: " + (*$3)- > >getDescription()); > + if (!isa((*$3).get())) > + GEN_ERROR("Scalar types not supported by vicmp instruction"); > + Value* tmpVal1 = getVal(*$3, $4); > + CHECK_FOR_ERROR > + Value* tmpVal2 = getVal(*$3, $6); > + CHECK_FOR_ERROR > + $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2); > + if ($$ == 0) > + GEN_ERROR("icmp operator returned null"); > + delete $3; > + } > + | VFCMP FPredicates Types ValueRef ',' ValueRef { > + if (!UpRefs.empty()) > + GEN_ERROR("Invalid upreference in type: " + (*$3)- > >getDescription()); > + if (!isa((*$3).get())) > + GEN_ERROR("Scalar types not supported by vfcmp instruction"); > + Value* tmpVal1 = getVal(*$3, $4); > + CHECK_FOR_ERROR > + Value* tmpVal2 = getVal(*$3, $6); > + CHECK_FOR_ERROR > + $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2); > + if ($$ == 0) > + GEN_ERROR("fcmp operator returned null"); > + delete $3; > + } > | CastOps ResolvedVal TO Types { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*$4)- > >getDescription()); > > Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original) > +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Mon May 12 14:01:56 > 2008 > @@ -1075,7 +1075,7 @@ > %token ADD SUB MUL UDIV SDIV FDIV UREM SREM FREM AND > OR XOR > %token SHL LSHR ASHR > > -%token ICMP FCMP > +%token ICMP FCMP VICMP VFCMP > %type IPredicates > %type FPredicates > %token EQ NE SLT SGT SLE SGE ULT UGT ULE UGE > @@ -1939,6 +1939,16 @@ > GEN_ERROR("fcmp operand types must match"); > $$ = ConstantExpr::getFCmp($2, $4, $6); > } > + | VICMP IPredicates '(' ConstVal ',' ConstVal ')' { > + if ($4->getType() != $6->getType()) > + GEN_ERROR("vicmp operand types must match"); > + $$ = ConstantExpr::getVICmp($2, $4, $6); > + } > + | VFCMP FPredicates '(' ConstVal ',' ConstVal ')' { > + if ($4->getType() != $6->getType()) > + GEN_ERROR("vfcmp operand types must match"); > + $$ = ConstantExpr::getVFCmp($2, $4, $6); > + } > | EXTRACTELEMENT '(' ConstVal ',' ConstVal ')' { > if (!ExtractElementInst::isValidOperands($3, $5)) > GEN_ERROR("Invalid extractelement operands"); > @@ -2891,6 +2901,34 @@ > GEN_ERROR("fcmp operator returned null"); > delete $3; > } > + | VICMP IPredicates Types ValueRef ',' ValueRef { > + if (!UpRefs.empty()) > + GEN_ERROR("Invalid upreference in type: " + (*$3)- > >getDescription()); > + if (!isa((*$3).get())) > + GEN_ERROR("Scalar types not supported by vicmp instruction"); > + Value* tmpVal1 = getVal(*$3, $4); > + CHECK_FOR_ERROR > + Value* tmpVal2 = getVal(*$3, $6); > + CHECK_FOR_ERROR > + $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2); > + if ($$ == 0) > + GEN_ERROR("icmp operator returned null"); > + delete $3; > + } > + | VFCMP FPredicates Types ValueRef ',' ValueRef { > + if (!UpRefs.empty()) > + GEN_ERROR("Invalid upreference in type: " + (*$3)- > >getDescription()); > + if (!isa((*$3).get())) > + GEN_ERROR("Scalar types not supported by vfcmp instruction"); > + Value* tmpVal1 = getVal(*$3, $4); > + CHECK_FOR_ERROR > + Value* tmpVal2 = getVal(*$3, $6); > + CHECK_FOR_ERROR > + $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2); > + if ($$ == 0) > + GEN_ERROR("fcmp operator returned null"); > + delete $3; > + } > | CastOps ResolvedVal TO Types { > if (!UpRefs.empty()) > GEN_ERROR("Invalid upreference in type: " + (*$4)- > >getDescription()); > > Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) > +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon May 12 > 14:01:56 2008 > @@ -818,8 +818,12 @@ > > if (OpTy->isFloatingPoint()) > V = ConstantExpr::getFCmp(Record[3], Op0, Op1); > - else > + else if (OpTy->isInteger()) > V = ConstantExpr::getICmp(Record[3], Op0, Op1); > + else if (OpTy->isFPOrFPVector()) > + V = ConstantExpr::getVFCmp(Record[3], Op0, Op1); > + else > + V = ConstantExpr::getVICmp(Record[3], Op0, Op1); > break; > } > case bitc::CST_CODE_INLINEASM: { > @@ -1355,10 +1359,14 @@ > OpNum+1 != Record.size()) > return Error("Invalid CMP record"); > > - if (LHS->getType()->isFPOrFPVector()) > + if (LHS->getType()->isInteger()) > + I = new ICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, > RHS); > + else if (LHS->getType()->isFloatingPoint()) > I = new FCmpInst((FCmpInst::Predicate)Record[OpNum], LHS, > RHS); > + else if (LHS->getType()->isFPOrFPVector()) > + I = new VFCmpInst((FCmpInst::Predicate)Record[OpNum], LHS, > RHS); > else > - I = new ICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, > RHS); > + I = new VICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, > RHS); > break; > } > case bitc::FUNC_CODE_INST_GETRESULT: { // GETRESULT: [ty, val, n] > > Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original) > +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Mon May 12 > 14:01:56 2008 > @@ -635,6 +635,8 @@ > break; > case Instruction::ICmp: > case Instruction::FCmp: > + case Instruction::VICmp: > + case Instruction::VFCmp: > Code = bitc::CST_CODE_CE_CMP; > Record.push_back(VE.getTypeID(C->getOperand(0)->getType())); > Record.push_back(VE.getValueID(C->getOperand(0))); > @@ -740,6 +742,8 @@ > break; > case Instruction::ICmp: > case Instruction::FCmp: > + case Instruction::VICmp: > + case Instruction::VFCmp: > Code = bitc::FUNC_CODE_INST_CMP; > PushValueAndType(I.getOperand(0), InstID, Vals, VE); > Vals.push_back(VE.getValueID(I.getOperand(1))); > > Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) > +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Mon May 12 14:01:56 2008 > @@ -1251,11 +1251,8 @@ > Out << I.getOpcodeName(); > > // Print out the compare instruction predicates > - if (const FCmpInst *FCI = dyn_cast(&I)) { > - Out << " " << getPredicateText(FCI->getPredicate()); > - } else if (const ICmpInst *ICI = dyn_cast(&I)) { > - Out << " " << getPredicateText(ICI->getPredicate()); > - } > + if (const CmpInst *CI = dyn_cast(&I)) > + Out << " " << getPredicateText(CI->getPredicate()); > > // Print out the type of the operands... > const Value *Operand = I.getNumOperands() ? I.getOperand(0) : 0; > > Modified: llvm/trunk/lib/VMCore/Constants.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/VMCore/Constants.cpp (original) > +++ llvm/trunk/lib/VMCore/Constants.cpp Mon May 12 14:01:56 2008 > @@ -557,9 +557,9 @@ > return User::operator new(s, 2); > } > unsigned short predicate; > - CompareConstantExpr(Instruction::OtherOps opc, unsigned short pred, > - Constant* LHS, Constant* RHS) > - : ConstantExpr(Type::Int1Ty, opc, &Op<0>(), 2), predicate(pred) { > + CompareConstantExpr(const Type *ty, Instruction::OtherOps opc, > + unsigned short pred, Constant* LHS, > Constant* RHS) > + : ConstantExpr(ty, opc, &Op<0>(), 2), predicate(pred) { > Op<0>().init(LHS, this); > Op<1>().init(RHS, this); > } > @@ -690,7 +690,10 @@ > return get(Instruction::Xor, C1, C2); > } > unsigned ConstantExpr::getPredicate() const { > - assert(getOpcode() == Instruction::FCmp || getOpcode() == > Instruction::ICmp); > + assert(getOpcode() == Instruction::FCmp || > + getOpcode() == Instruction::ICmp || > + getOpcode() == Instruction::VFCmp || > + getOpcode() == Instruction::VICmp); > return ((const CompareConstantExpr*)this)->predicate; > } > Constant *ConstantExpr::getShl(Constant *C1, Constant *C2) { > @@ -1564,10 +1567,16 @@ > // value and it is combined with the instruction opcode by > multiplying > // the opcode by one hundred. We must decode this to get the > predicate. > if (V.opcode == Instruction::ICmp) > - return new CompareConstantExpr(Instruction::ICmp, > V.predicate, > + return new CompareConstantExpr(Ty, Instruction::ICmp, > V.predicate, > V.operands[0], V.operands[1]); > if (V.opcode == Instruction::FCmp) > - return new CompareConstantExpr(Instruction::FCmp, > V.predicate, > + return new CompareConstantExpr(Ty, Instruction::FCmp, > V.predicate, > + V.operands[0], V.operands[1]); > + if (V.opcode == Instruction::VICmp) > + return new CompareConstantExpr(Ty, Instruction::VICmp, > V.predicate, > + V.operands[0], V.operands[1]); > + if (V.opcode == Instruction::VFCmp) > + return new CompareConstantExpr(Ty, Instruction::VFCmp, > V.predicate, > V.operands[0], V.operands[1]); > assert(0 && "Invalid ConstantExpr!"); > return 0; > @@ -2029,6 +2038,79 @@ > return ExprConstants->getOrCreate(Type::Int1Ty, Key); > } > > +Constant * > +ConstantExpr::getVICmp(unsigned short pred, Constant* LHS, > Constant* RHS) { > + assert(isa(LHS->getType()) && > + "Tried to create vicmp operation on non-vector type!"); > + assert(LHS->getType() == RHS->getType()); > + assert(pred >= ICmpInst::FIRST_ICMP_PREDICATE && > + pred <= ICmpInst::LAST_ICMP_PREDICATE && "Invalid VICmp > Predicate"); > + > + const Type *VTy = cast(LHS->getType()); > + const Type *EltTy = VTy->getElementType(); > + unsigned NumElts = VTy->getNumElements(); > + > + SmallVector Elts; > + for (unsigned i = 0; i != NumElts; ++i) { > + Constant *FC = ConstantFoldCompareInstruction(pred, LHS- > >getOperand(i), > + RHS- > >getOperand(i)); > + if (FC) { > + uint64_t Val = cast(FC)->getZExtValue(); > + if (Val != 0ULL) > + Elts.push_back(ConstantInt::getAllOnesValue(EltTy)); > + else > + Elts.push_back(ConstantInt::get(EltTy, 0ULL)); > + } > + } > + if (Elts.size() == NumElts) > + return ConstantVector::get(&Elts[0], Elts.size()); > + > + // Look up the constant in the table first to ensure uniqueness > + std::vector ArgVec; > + ArgVec.push_back(LHS); > + ArgVec.push_back(RHS); > + // Get the key type with both the opcode and predicate > + const ExprMapKeyType Key(Instruction::VICmp, ArgVec, pred); > + return ExprConstants->getOrCreate(LHS->getType(), Key); > +} > + > +Constant * > +ConstantExpr::getVFCmp(unsigned short pred, Constant* LHS, > Constant* RHS) { > + assert(isa(LHS->getType()) && > + "Tried to create vfcmp operation on non-vector type!"); > + assert(LHS->getType() == RHS->getType()); > + assert(pred <= FCmpInst::LAST_FCMP_PREDICATE && "Invalid VFCmp > Predicate"); > + > + const VectorType *VTy = cast(LHS->getType()); > + unsigned NumElts = VTy->getNumElements(); > + const Type *EltTy = VTy->getElementType(); > + const Type *REltTy = IntegerType::get(EltTy- > >getPrimitiveSizeInBits()); > + const Type *ResultTy = VectorType::get(REltTy, NumElts); > + > + SmallVector Elts; > + for (unsigned i = 0; i != NumElts; ++i) { > + Constant *FC = ConstantFoldCompareInstruction(pred, LHS- > >getOperand(i), > + RHS- > >getOperand(i)); > + if (FC) { > + uint64_t Val = cast(FC)->getZExtValue(); > + if (Val != 0ULL) > + Elts.push_back(ConstantInt::getAllOnesValue(REltTy)); > + else > + Elts.push_back(ConstantInt::get(REltTy, 0ULL)); > + } > + } > + if (Elts.size() == NumElts) > + return ConstantVector::get(&Elts[0], Elts.size()); > + > + // Look up the constant in the table first to ensure uniqueness > + std::vector ArgVec; > + ArgVec.push_back(LHS); > + ArgVec.push_back(RHS); > + // Get the key type with both the opcode and predicate > + const ExprMapKeyType Key(Instruction::VFCmp, ArgVec, pred); > + return ExprConstants->getOrCreate(ResultTy, Key); > +} > + > Constant *ConstantExpr::getExtractElementTy(const Type *ReqTy, > Constant *Val, > Constant *Idx) { > if (Constant *FC = ConstantFoldExtractElementInstruction(Val, Idx)) > > Modified: llvm/trunk/lib/VMCore/Instruction.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instruction.cpp?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/VMCore/Instruction.cpp (original) > +++ llvm/trunk/lib/VMCore/Instruction.cpp Mon May 12 14:01:56 2008 > @@ -128,6 +128,8 @@ > // Other instructions... > case ICmp: return "icmp"; > case FCmp: return "fcmp"; > + case VICmp: return "vicmp"; > + case VFCmp: return "vfcmp"; > case PHI: return "phi"; > case Select: return "select"; > case Call: return "call"; > > Modified: llvm/trunk/lib/VMCore/Instructions.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=50985&r1=50984&r2=50985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/VMCore/Instructions.cpp (original) > +++ llvm/trunk/lib/VMCore/Instructions.cpp Mon May 12 14:01:56 2008 > @@ -2332,9 +2332,10 @@ > // CmpInst Classes > // > = > = > = > ----------------------------------------------------------------------= > ==// > > -CmpInst::CmpInst(OtherOps op, unsigned short predicate, Value *LHS, > Value *RHS, > - const std::string &Name, Instruction *InsertBefore) > - : Instruction(Type::Int1Ty, op, > +CmpInst::CmpInst(const Type *ty, OtherOps op, unsigned short > predicate, > + Value *LHS, Value *RHS, const std::string &Name, > + Instruction *InsertBefore) > + : Instruction(ty, op, > OperandTraits::op_begin(this), > OperandTraits::operands(this), > InsertBefore) { > @@ -2342,34 +2343,12 @@ > Op<1>().init(RHS, this); > SubclassData = predicate; > setName(Name); > - if (op == Instruction::ICmp) { > - assert(predicate >= ICmpInst::FIRST_ICMP_PREDICATE && > - predicate <= ICmpInst::LAST_ICMP_PREDICATE && > - "Invalid ICmp predicate value"); > - const Type* Op0Ty = getOperand(0)->getType(); > - const Type* Op1Ty = getOperand(1)->getType(); > - assert(Op0Ty == Op1Ty && > - "Both operands to ICmp instruction are not of the same > type!"); > - // Check that the operands are the right type > - assert((Op0Ty->isInteger() || isa(Op0Ty)) && > - "Invalid operand types for ICmp instruction"); > - return; > - } > - assert(op == Instruction::FCmp && "Invalid CmpInst opcode"); > - assert(predicate <= FCmpInst::LAST_FCMP_PREDICATE && > - "Invalid FCmp predicate value"); > - const Type* Op0Ty = getOperand(0)->getType(); > - const Type* Op1Ty = getOperand(1)->getType(); > - assert(Op0Ty == Op1Ty && > - "Both operands to FCmp instruction are not of the same > type!"); > - // Check that the operands are the right type > - assert(Op0Ty->isFloatingPoint() && > - "Invalid operand types for FCmp instruction"); > } > > -CmpInst::CmpInst(OtherOps op, unsigned short predicate, Value *LHS, > Value *RHS, > - const std::string &Name, BasicBlock *InsertAtEnd) > - : Instruction(Type::Int1Ty, op, > +CmpInst::CmpInst(const Type *ty, OtherOps op, unsigned short > predicate, > + Value *LHS, Value *RHS, const std::string &Name, > + BasicBlock *InsertAtEnd) > + : Instruction(ty, op, > OperandTraits::op_begin(this), > OperandTraits::operands(this), > InsertAtEnd) { > @@ -2377,52 +2356,44 @@ > Op<1>().init(RHS, this); > SubclassData = predicate; > setName(Name); > - if (op == Instruction::ICmp) { > - assert(predicate >= ICmpInst::FIRST_ICMP_PREDICATE && > - predicate <= ICmpInst::LAST_ICMP_PREDICATE && > - "Invalid ICmp predicate value"); > - > - const Type* Op0Ty = getOperand(0)->getType(); > - const Type* Op1Ty = getOperand(1)->getType(); > - assert(Op0Ty == Op1Ty && > - "Both operands to ICmp instruction are not of the same > type!"); > - // Check that the operands are the right type > - assert((Op0Ty->isInteger() || isa(Op0Ty)) && > - "Invalid operand types for ICmp instruction"); > - return; > - } > - assert(op == Instruction::FCmp && "Invalid CmpInst opcode"); > - assert(predicate <= FCmpInst::LAST_FCMP_PREDICATE && > - "Invalid FCmp predicate value"); > - const Type* Op0Ty = getOperand(0)->getType(); > - const Type* Op1Ty = getOperand(1)->getType(); > - assert(Op0Ty == Op1Ty && > - "Both operands to FCmp instruction are not of the same > type!"); > - // Check that the operands are the right type > - assert(Op0Ty->isFloatingPoint() && > - "Invalid operand types for FCmp instruction"); > } > > CmpInst * > CmpInst::create(OtherOps Op, unsigned short predicate, Value *S1, > Value *S2, > const std::string &Name, Instruction *InsertBefore) { > if (Op == Instruction::ICmp) { > - return new ICmpInst(ICmpInst::Predicate(predicate), S1, S2, Name, > + return new ICmpInst(CmpInst::Predicate(predicate), S1, S2, Name, > InsertBefore); > } > - return new FCmpInst(FCmpInst::Predicate(predicate), S1, S2, Name, > - InsertBefore); > + if (Op == Instruction::FCmp) { > + return new FCmpInst(CmpInst::Predicate(predicate), S1, S2, Name, > + InsertBefore); > + } > + if (Op == Instruction::VICmp) { > + return new VICmpInst(CmpInst::Predicate(predicate), S1, S2, Name, > + InsertBefore); > + } > + return new VFCmpInst(CmpInst::Predicate(predicate), S1, S2, Name, > + InsertBefore); > } > > CmpInst * > CmpInst::create(OtherOps Op, unsigned short predicate, Value *S1, > Value *S2, > const std::string &Name, BasicBlock *InsertAtEnd) { > if (Op == Instruction::ICmp) { > - return new ICmpInst(ICmpInst::Predicate(predicate), S1, S2, Name, > + return new ICmpInst(CmpInst::Predicate(predicate), S1, S2, Name, > InsertAtEnd); > } > - return new FCmpInst(FCmpInst::Predicate(predicate), S1, S2, Name, > - InsertAtEnd); > + if (Op == Instruction::FCmp) { > + return new FCmpInst(CmpInst::Predicate(predicate), S1, S2, Name, > + InsertAtEnd); > + } > + if (Op == Instruction::VICmp) { > + return new VICmpInst(CmpInst::Predicate(predicate), S1, S2, Name, > + InsertAtEnd); > + } > + return new VFCmpInst(CmpInst::Predicate(predicate), S1, S2, Name, > + InsertAtEnd); > } > > void CmpInst::swapOperands() { > @@ -2813,6 +2784,13 @@ > return new ICmpInst(getPredicate(), Op<0>(), Op<1>()); > } > > +VFCmpInst* VFCmpInst::clone() const { > + return new VFCmpInst(getPredicate(), Op<0>(), Op<1>()); > +} > +VICmpInst* VICmpInst::clone() const { > + return new VICmpInst(getPredicate(), Op<0>(), Op<1>()); > +} > + > MallocInst *MallocInst::clone() const { return new > MallocInst(*this); } > AllocaInst *AllocaInst::clone() const { return new > AllocaInst(*this); } > FreeInst *FreeInst::clone() const { return new > FreeInst(getOperand(0)); } > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4260 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080512/7f71a060/attachment.bin From natebegeman at mac.com Mon May 12 14:23:22 2008 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 12 May 2008 19:23:22 -0000 Subject: [llvm-commits] [llvm] r50986 - /llvm/trunk/lib/VMCore/Constants.cpp Message-ID: <200805121923.m4CJNMrn021700@zion.cs.uiuc.edu> Author: sampo Date: Mon May 12 14:23:22 2008 New Revision: 50986 URL: http://llvm.org/viewvc/llvm-project?rev=50986&view=rev Log: Fix build breakage Modified: llvm/trunk/lib/VMCore/Constants.cpp Modified: llvm/trunk/lib/VMCore/Constants.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=50986&r1=50985&r2=50986&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Constants.cpp (original) +++ llvm/trunk/lib/VMCore/Constants.cpp Mon May 12 14:23:22 2008 @@ -2046,7 +2046,7 @@ assert(pred >= ICmpInst::FIRST_ICMP_PREDICATE && pred <= ICmpInst::LAST_ICMP_PREDICATE && "Invalid VICmp Predicate"); - const Type *VTy = cast(LHS->getType()); + const VectorType *VTy = cast(LHS->getType()); const Type *EltTy = VTy->getElementType(); unsigned NumElts = VTy->getNumElements(); From isanbard at gmail.com Mon May 12 14:38:33 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 12 May 2008 19:38:33 -0000 Subject: [llvm-commits] [llvm] r50987 - /llvm/trunk/lib/CodeGen/MachineLICM.cpp Message-ID: <200805121938.m4CJcXXi022126@zion.cs.uiuc.edu> Author: void Date: Mon May 12 14:38:32 2008 New Revision: 50987 URL: http://llvm.org/viewvc/llvm-project?rev=50987&view=rev Log: One real change - don't hoist something that's trivially rematerializable. It's possible for it to produce worse code than before. The rest of this patch is code cleanup. Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=50987&r1=50986&r2=50987&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Mon May 12 14:38:32 2008 @@ -34,16 +34,16 @@ class VISIBILITY_HIDDEN MachineLICM : public MachineFunctionPass { const TargetMachine *TM; const TargetInstrInfo *TII; - MachineFunction *CurMF; // Current MachineFunction + MachineFunction *CurMF; // Current MachineFunction // Various analyses that we use... - MachineLoopInfo *LI; // Current MachineLoopInfo - MachineDominatorTree *DT; // Machine dominator tree for the current Loop + MachineLoopInfo *LI; // Current MachineLoopInfo + MachineDominatorTree *DT; // Machine dominator tree for the cur loop MachineRegisterInfo *RegInfo; // Machine register information // State that is updated as we process loops - bool Changed; // True if a loop is changed. - MachineLoop *CurLoop; // The current loop we are working on. + bool Changed; // True if a loop is changed. + MachineLoop *CurLoop; // The current loop we are working on. public: static char ID; // Pass identification, replacement for typeid MachineLICM() : MachineFunctionPass((intptr_t)&ID) {} @@ -233,15 +233,14 @@ return false; if (TID.mayLoad()) { - // Okay, this instruction does a load. As a refinement, allow the target - // to decide whether the loaded value is actually a constant. If so, we - // can actually use it as a load. - if (!TII->isInvariantLoad(&I)) { + // Okay, this instruction does a load. As a refinement, we allow the target + // to decide whether the loaded value is actually a constant. If so, we can + // actually use it as a load. + if (!TII->isInvariantLoad(&I)) // FIXME: we should be able to sink loads with no other side effects if // there is nothing that can change memory from here until the end of - // block. This is a trivial form of alias analysis. + // block. This is a trivial form of alias analysis. return false; - } } DEBUG({ @@ -263,12 +262,9 @@ *ImpDefs; ++ImpDefs) DOUT << " -> " << TRI->getName(*ImpDefs) << "\n"; } - - //if (TII->hasUnmodelledSideEffects(&I)) - //DOUT << " * Instruction has side effects.\n"; }); - // The instruction is loop invariant if all of its operands are loop-invariant + // The instruction is loop invariant if all of its operands are. for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) { const MachineOperand &MO = I.getOperand(i); @@ -282,7 +278,8 @@ if (TargetRegisterInfo::isPhysicalRegister(Reg)) return false; - assert(RegInfo->getVRegDef(Reg)&&"Machine instr not mapped for this vreg?"); + assert(RegInfo->getVRegDef(Reg) && + "Machine instr not mapped for this vreg?!"); // If the loop contains the definition of an operand, then the instruction // isn't loop invariant. @@ -294,12 +291,16 @@ return true; } -/// Hoist - When an instruction is found to only use loop invariant operands -/// that is safe to hoist, this instruction is called to do the dirty work. +/// Hoist - When an instruction is found to use only loop invariant operands +/// that are safe to hoist, this instruction is called to do the dirty work. /// void MachineLICM::Hoist(MachineInstr &MI) { if (!IsLoopInvariantInst(MI)) return; + // Hoisting things that are trivially rematerializable may result in worse + // code than before. + if (TII->isTriviallyReMaterializable(&MI)) return; + std::vector Preds; // Non-back-edge predecessors. From natebegeman at mac.com Mon May 12 14:40:03 2008 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 12 May 2008 19:40:03 -0000 Subject: [llvm-commits] [llvm] r50988 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/TargetSelectionDAG.td Message-ID: <200805121940.m4CJe5a4022201@zion.cs.uiuc.edu> Author: sampo Date: Mon May 12 14:40:03 2008 New Revision: 50988 URL: http://llvm.org/viewvc/llvm-project?rev=50988&view=rev Log: Add support for vicmp/vfcmp codegen, more legalize support coming. This is necessary to unbreak the build. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Target/TargetSelectionDAG.td Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=50988&r1=50987&r2=50988&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Mon May 12 14:40:03 2008 @@ -346,6 +346,14 @@ return getNode(ISD::SETCC, VT, LHS, RHS, getCondCode(Cond)); } + /// getVSetCC - Helper function to make it easier to build VSetCC's nodes + /// if you just have an ISD::CondCode instead of an SDOperand. + /// + SDOperand getVSetCC(MVT::ValueType VT, SDOperand LHS, SDOperand RHS, + ISD::CondCode Cond) { + return getNode(ISD::VSETCC, VT, LHS, RHS, getCondCode(Cond)); + } + /// getSelectCC - Helper function to make it easier to build SelectCC's if you /// just have an ISD::CondCode instead of an SDOperand. /// Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=50988&r1=50987&r2=50988&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon May 12 14:40:03 2008 @@ -332,6 +332,14 @@ // (op #2) as a CondCodeSDNode. SETCC, + // Vector SetCC operator - This evaluates to a vector of integer elements + // with the high bit in each element set to true if the comparison is true + // and false if the comparison is false. All other bits in each element + // are undefined. The operands to this are the left and right operands + // to compare (ops #0, and #1) and the condition code to compare them with + // (op #2) as a CondCodeSDNode. + VSETCC, + // SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded // integer shift operations, just like ADD/SUB_PARTS. The operation // ordering is: Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=50988&r1=50987&r2=50988&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon May 12 14:40:03 2008 @@ -2886,6 +2886,24 @@ break; } break; + case ISD::VSETCC: { + Tmp1 = LegalizeOp(Node->getOperand(0)); // LHS + Tmp2 = LegalizeOp(Node->getOperand(1)); // RHS + SDOperand CC = Node->getOperand(2); + + Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2, CC); + + // Everything is legal, see if we should expand this op or something. + switch (TLI.getOperationAction(ISD::VSETCC, Tmp1.getValueType())) { + default: assert(0 && "This action is not supported yet!"); + case TargetLowering::Legal: break; + case TargetLowering::Custom: + Tmp1 = TLI.LowerOperation(Result, DAG); + if (Tmp1.Val) Result = Tmp1; + break; + } + break; + } case ISD::SHL_PARTS: case ISD::SRA_PARTS: @@ -6875,6 +6893,14 @@ } break; } + case ISD::VSETCC: { + SDOperand LL, LH, RL, RH; + SplitVectorOp(Node->getOperand(0), LL, LH); + SplitVectorOp(Node->getOperand(1), RL, RH); + Lo = DAG.getNode(ISD::VSETCC, NewVT_Lo, LL, RL, Node->getOperand(2)); + Hi = DAG.getNode(ISD::VSETCC, NewVT_Hi, LH, RH, Node->getOperand(2)); + break; + } case ISD::ADD: case ISD::SUB: case ISD::MUL: Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=50988&r1=50987&r2=50988&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon May 12 14:40:03 2008 @@ -4383,6 +4383,7 @@ case ISD::FGETSIGN: return "fgetsign"; case ISD::SETCC: return "setcc"; + case ISD::VSETCC: return "vsetcc"; case ISD::SELECT: return "select"; case ISD::SELECT_CC: return "select_cc"; case ISD::INSERT_VECTOR_ELT: return "insert_vector_elt"; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=50988&r1=50987&r2=50988&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon May 12 14:40:03 2008 @@ -685,6 +685,8 @@ void visitAShr(User &I) { visitShift(I, ISD::SRA); } void visitICmp(User &I); void visitFCmp(User &I); + void visitVICmp(User &I); + void visitVFCmp(User &I); // Visit the conversion instructions void visitTrunc(User &I); void visitZExt(User &I); @@ -2342,6 +2344,75 @@ setValue(&I, DAG.getSetCC(MVT::i1, Op1, Op2, Condition)); } +void SelectionDAGLowering::visitVICmp(User &I) { + ICmpInst::Predicate predicate = ICmpInst::BAD_ICMP_PREDICATE; + if (VICmpInst *IC = dyn_cast(&I)) + predicate = IC->getPredicate(); + else if (ConstantExpr *IC = dyn_cast(&I)) + predicate = ICmpInst::Predicate(IC->getPredicate()); + SDOperand Op1 = getValue(I.getOperand(0)); + SDOperand Op2 = getValue(I.getOperand(1)); + ISD::CondCode Opcode; + switch (predicate) { + case ICmpInst::ICMP_EQ : Opcode = ISD::SETEQ; break; + case ICmpInst::ICMP_NE : Opcode = ISD::SETNE; break; + case ICmpInst::ICMP_UGT : Opcode = ISD::SETUGT; break; + case ICmpInst::ICMP_UGE : Opcode = ISD::SETUGE; break; + case ICmpInst::ICMP_ULT : Opcode = ISD::SETULT; break; + case ICmpInst::ICMP_ULE : Opcode = ISD::SETULE; break; + case ICmpInst::ICMP_SGT : Opcode = ISD::SETGT; break; + case ICmpInst::ICMP_SGE : Opcode = ISD::SETGE; break; + case ICmpInst::ICMP_SLT : Opcode = ISD::SETLT; break; + case ICmpInst::ICMP_SLE : Opcode = ISD::SETLE; break; + default: + assert(!"Invalid ICmp predicate value"); + Opcode = ISD::SETEQ; + break; + } + setValue(&I, DAG.getVSetCC(Op1.getValueType(), Op1, Op2, Opcode)); +} + +void SelectionDAGLowering::visitVFCmp(User &I) { + FCmpInst::Predicate predicate = FCmpInst::BAD_FCMP_PREDICATE; + if (VFCmpInst *FC = dyn_cast(&I)) + predicate = FC->getPredicate(); + else if (ConstantExpr *FC = dyn_cast(&I)) + predicate = FCmpInst::Predicate(FC->getPredicate()); + SDOperand Op1 = getValue(I.getOperand(0)); + SDOperand Op2 = getValue(I.getOperand(1)); + ISD::CondCode Condition, FOC, FPC; + switch (predicate) { + case FCmpInst::FCMP_FALSE: FOC = FPC = ISD::SETFALSE; break; + case FCmpInst::FCMP_OEQ: FOC = ISD::SETEQ; FPC = ISD::SETOEQ; break; + case FCmpInst::FCMP_OGT: FOC = ISD::SETGT; FPC = ISD::SETOGT; break; + case FCmpInst::FCMP_OGE: FOC = ISD::SETGE; FPC = ISD::SETOGE; break; + case FCmpInst::FCMP_OLT: FOC = ISD::SETLT; FPC = ISD::SETOLT; break; + case FCmpInst::FCMP_OLE: FOC = ISD::SETLE; FPC = ISD::SETOLE; break; + case FCmpInst::FCMP_ONE: FOC = ISD::SETNE; FPC = ISD::SETONE; break; + case FCmpInst::FCMP_ORD: FOC = FPC = ISD::SETO; break; + case FCmpInst::FCMP_UNO: FOC = FPC = ISD::SETUO; break; + case FCmpInst::FCMP_UEQ: FOC = ISD::SETEQ; FPC = ISD::SETUEQ; break; + case FCmpInst::FCMP_UGT: FOC = ISD::SETGT; FPC = ISD::SETUGT; break; + case FCmpInst::FCMP_UGE: FOC = ISD::SETGE; FPC = ISD::SETUGE; break; + case FCmpInst::FCMP_ULT: FOC = ISD::SETLT; FPC = ISD::SETULT; break; + case FCmpInst::FCMP_ULE: FOC = ISD::SETLE; FPC = ISD::SETULE; break; + case FCmpInst::FCMP_UNE: FOC = ISD::SETNE; FPC = ISD::SETUNE; break; + case FCmpInst::FCMP_TRUE: FOC = FPC = ISD::SETTRUE; break; + default: + assert(!"Invalid VFCmp predicate value"); + FOC = FPC = ISD::SETFALSE; + break; + } + if (FiniteOnlyFPMath()) + Condition = FOC; + else + Condition = FPC; + + MVT::ValueType DestVT = TLI.getValueType(I.getType()); + + setValue(&I, DAG.getVSetCC(DestVT, Op1, Op2, Condition)); +} + void SelectionDAGLowering::visitSelect(User &I) { SDOperand Cond = getValue(I.getOperand(0)); SDOperand TrueVal = getValue(I.getOperand(1)); Modified: llvm/trunk/lib/Target/TargetSelectionDAG.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetSelectionDAG.td?rev=50988&r1=50987&r2=50988&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetSelectionDAG.td (original) +++ llvm/trunk/lib/Target/TargetSelectionDAG.td Mon May 12 14:40:03 2008 @@ -337,6 +337,7 @@ def setcc : SDNode<"ISD::SETCC" , SDTSetCC>; def select : SDNode<"ISD::SELECT" , SDTSelect>; def selectcc : SDNode<"ISD::SELECT_CC" , SDTSelectCC>; +def vsetcc : SDNode<"ISD::VSETCC" , SDTSetCC>; def brcond : SDNode<"ISD::BRCOND" , SDTBrcond, [SDNPHasChain]>; def brind : SDNode<"ISD::BRIND" , SDTBrind, [SDNPHasChain]>; From evan.cheng at apple.com Mon May 12 14:44:44 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 12 May 2008 12:44:44 -0700 Subject: [llvm-commits] [llvm] r50987 - /llvm/trunk/lib/CodeGen/MachineLICM.cpp In-Reply-To: <200805121938.m4CJcXXi022126@zion.cs.uiuc.edu> References: <200805121938.m4CJcXXi022126@zion.cs.uiuc.edu> Message-ID: <4FEAC067-5B96-4FE0-BB23-56FCD2E9A172@apple.com> This is wrong. We definitely *want* to hoist instructions that are rematerializable. These instructions can be remat at the uses in case LICM increases register pressure and spilling ensues. Evan On May 12, 2008, at 12:38 PM, Bill Wendling wrote: > Author: void > Date: Mon May 12 14:38:32 2008 > New Revision: 50987 > > URL: http://llvm.org/viewvc/llvm-project?rev=50987&view=rev > Log: > One real change - don't hoist something that's trivially > rematerializable. It's > possible for it to produce worse code than before. > > The rest of this patch is code cleanup. > > Modified: > llvm/trunk/lib/CodeGen/MachineLICM.cpp > > Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=50987&r1=50986&r2=50987&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) > +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Mon May 12 14:38:32 2008 > @@ -34,16 +34,16 @@ > class VISIBILITY_HIDDEN MachineLICM : public MachineFunctionPass { > const TargetMachine *TM; > const TargetInstrInfo *TII; > - MachineFunction *CurMF; // Current MachineFunction > + MachineFunction *CurMF; // Current MachineFunction > > // Various analyses that we use... > - MachineLoopInfo *LI; // Current MachineLoopInfo > - MachineDominatorTree *DT; // Machine dominator tree for the > current Loop > + MachineLoopInfo *LI; // Current MachineLoopInfo > + MachineDominatorTree *DT; // Machine dominator tree for > the cur loop > MachineRegisterInfo *RegInfo; // Machine register information > > // State that is updated as we process loops > - bool Changed; // True if a loop is changed. > - MachineLoop *CurLoop; // The current loop we are working > on. > + bool Changed; // True if a loop is changed. > + MachineLoop *CurLoop; // The current loop we are > working on. > public: > static char ID; // Pass identification, replacement for typeid > MachineLICM() : MachineFunctionPass((intptr_t)&ID) {} > @@ -233,15 +233,14 @@ > return false; > > if (TID.mayLoad()) { > - // Okay, this instruction does a load. As a refinement, allow > the target > - // to decide whether the loaded value is actually a constant. > If so, we > - // can actually use it as a load. > - if (!TII->isInvariantLoad(&I)) { > + // Okay, this instruction does a load. As a refinement, we > allow the target > + // to decide whether the loaded value is actually a constant. > If so, we can > + // actually use it as a load. > + if (!TII->isInvariantLoad(&I)) > // FIXME: we should be able to sink loads with no other side > effects if > // there is nothing that can change memory from here until the > end of > - // block. This is a trivial form of alias analysis. > + // block. This is a trivial form of alias analysis. > return false; > - } > } > > DEBUG({ > @@ -263,12 +262,9 @@ > *ImpDefs; ++ImpDefs) > DOUT << " -> " << TRI->getName(*ImpDefs) << "\n"; > } > - > - //if (TII->hasUnmodelledSideEffects(&I)) > - //DOUT << " * Instruction has side effects.\n"; > }); > > - // The instruction is loop invariant if all of its operands are > loop-invariant > + // The instruction is loop invariant if all of its operands are. > for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) { > const MachineOperand &MO = I.getOperand(i); > > @@ -282,7 +278,8 @@ > if (TargetRegisterInfo::isPhysicalRegister(Reg)) > return false; > > - assert(RegInfo->getVRegDef(Reg)&&"Machine instr not mapped for > this vreg?"); > + assert(RegInfo->getVRegDef(Reg) && > + "Machine instr not mapped for this vreg?!"); > > // If the loop contains the definition of an operand, then the > instruction > // isn't loop invariant. > @@ -294,12 +291,16 @@ > return true; > } > > -/// Hoist - When an instruction is found to only use loop invariant > operands > -/// that is safe to hoist, this instruction is called to do the > dirty work. > +/// Hoist - When an instruction is found to use only loop invariant > operands > +/// that are safe to hoist, this instruction is called to do the > dirty work. > /// > void MachineLICM::Hoist(MachineInstr &MI) { > if (!IsLoopInvariantInst(MI)) return; > > + // Hoisting things that are trivially rematerializable may result > in worse > + // code than before. > + if (TII->isTriviallyReMaterializable(&MI)) return; > + > std::vector Preds; > > // Non-back-edge predecessors. > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From tonic at nondot.org Mon May 12 14:46:27 2008 From: tonic at nondot.org (Tanya Lattner) Date: Mon, 12 May 2008 19:46:27 -0000 Subject: [llvm-commits] [llvm] r50989 - /llvm/branches/release_23/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200805121946.m4CJkSlr022428@zion.cs.uiuc.edu> Author: tbrethou Date: Mon May 12 14:46:27 2008 New Revision: 50989 URL: http://llvm.org/viewvc/llvm-project?rev=50989&view=rev Log: Merge from mainline. Fix a missing break in the ISD::FLT_ROUNDS_ handling. Modified: llvm/branches/release_23/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/branches/release_23/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_23/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=50989&r1=50988&r2=50989&view=diff ============================================================================== --- llvm/branches/release_23/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/branches/release_23/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon May 12 14:46:27 2008 @@ -3999,6 +3999,7 @@ Result = DAG.getConstant(1, VT); break; } + break; } case ISD::TRAP: { MVT::ValueType VT = Node->getValueType(0); From isanbard at gmail.com Mon May 12 14:47:19 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 12 May 2008 19:47:19 -0000 Subject: [llvm-commits] [llvm] r50990 - /llvm/trunk/lib/CodeGen/MachineLICM.cpp Message-ID: <200805121947.m4CJlJvq022460@zion.cs.uiuc.edu> Author: void Date: Mon May 12 14:47:18 2008 New Revision: 50990 URL: http://llvm.org/viewvc/llvm-project?rev=50990&view=rev Log: Revert the previous commit. Go ahead and hoist rematerializable instructions. Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=50990&r1=50989&r2=50990&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Mon May 12 14:47:18 2008 @@ -297,10 +297,6 @@ void MachineLICM::Hoist(MachineInstr &MI) { if (!IsLoopInvariantInst(MI)) return; - // Hoisting things that are trivially rematerializable may result in worse - // code than before. - if (TII->isTriviallyReMaterializable(&MI)) return; - std::vector Preds; // Non-back-edge predecessors. From evan.cheng at apple.com Mon May 12 14:56:54 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 12 May 2008 19:56:54 -0000 Subject: [llvm-commits] [llvm] r50991 - in /llvm/trunk/lib: CodeGen/SelectionDAG/TargetLowering.cpp Target/X86/X86ISelLowering.cpp Target/X86/X86ISelLowering.h Message-ID: <200805121956.m4CJuueV022748@zion.cs.uiuc.edu> Author: evancheng Date: Mon May 12 14:56:52 2008 New Revision: 50991 URL: http://llvm.org/viewvc/llvm-project?rev=50991&view=rev Log: Refactor isConsecutiveLoad from X86 to TargetLowering so DAG combiner can make use of it. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=50991&r1=50990&r2=50991&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon May 12 14:56:52 2008 @@ -19,6 +19,7 @@ #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/GlobalVariable.h" #include "llvm/DerivedTypes.h" +#include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/STLExtras.h" @@ -1478,6 +1479,73 @@ return SDOperand(); } +/// isGAPlusOffset - Returns true (and the GlobalValue and the offset) if the +/// node is a GlobalAddress + offset. +bool TargetLowering::isGAPlusOffset(SDNode *N, GlobalValue* &GA, + int64_t &Offset) const { + if (isa(N)) { + GA = cast(N)->getGlobal(); + return true; + } + + if (N->getOpcode() == ISD::ADD) { + SDOperand N1 = N->getOperand(0); + SDOperand N2 = N->getOperand(1); + if (isGAPlusOffset(N1.Val, GA, Offset)) { + ConstantSDNode *V = dyn_cast(N2); + if (V) { + Offset += V->getSignExtended(); + return true; + } + } else if (isGAPlusOffset(N2.Val, GA, Offset)) { + ConstantSDNode *V = dyn_cast(N1); + if (V) { + Offset += V->getSignExtended(); + return true; + } + } + } + return false; +} + + +/// isConsecutiveLoad - Return true if LD (which must be a LoadSDNode) is +/// loading 'Bytes' bytes from a location that is 'Dist' units away from the +/// location that the 'Base' load is loading from. +bool TargetLowering::isConsecutiveLoad(SDNode *LD, SDNode *Base, + unsigned Bytes, int Dist, + MachineFrameInfo *MFI) const { + if (LD->getOperand(0).Val != Base->getOperand(0).Val) + return false; + MVT::ValueType VT = LD->getValueType(0); + if (MVT::getSizeInBits(VT) / 8 != Bytes) + return false; + + SDOperand Loc = LD->getOperand(1); + SDOperand BaseLoc = Base->getOperand(1); + if (Loc.getOpcode() == ISD::FrameIndex) { + if (BaseLoc.getOpcode() != ISD::FrameIndex) + return false; + int FI = cast(Loc)->getIndex(); + int BFI = cast(BaseLoc)->getIndex(); + int FS = MFI->getObjectSize(FI); + int BFS = MFI->getObjectSize(BFI); + if (FS != BFS || FS != (int)Bytes) return false; + return MFI->getObjectOffset(FI) == (MFI->getObjectOffset(BFI) + Dist*Bytes); + } + + GlobalValue *GV1 = NULL; + GlobalValue *GV2 = NULL; + int64_t Offset1 = 0; + int64_t Offset2 = 0; + bool isGA1 = isGAPlusOffset(Loc.Val, GV1, Offset1); + bool isGA2 = isGAPlusOffset(BaseLoc.Val, GV2, Offset2); + if (isGA1 && isGA2 && GV1 == GV2) + return Offset1 == (Offset2 + Dist*Bytes); + return false; +} + + SDOperand TargetLowering:: PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const { // Default implementation: no optimization. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=50991&r1=50990&r2=50991&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon May 12 14:56:52 2008 @@ -6194,71 +6194,23 @@ } /// isGAPlusOffset - Returns true (and the GlobalValue and the offset) if the -/// node is a GlobalAddress + an offset. -static bool isGAPlusOffset(SDNode *N, GlobalValue* &GA, int64_t &Offset) { - unsigned Opc = N->getOpcode(); - if (Opc == X86ISD::Wrapper) { - if (dyn_cast(N->getOperand(0))) { +/// node is a GlobalAddress + offset. +bool X86TargetLowering::isGAPlusOffset(SDNode *N, + GlobalValue* &GA, int64_t &Offset) const{ + if (N->getOpcode() == X86ISD::Wrapper) { + if (isa(N->getOperand(0))) { GA = cast(N->getOperand(0))->getGlobal(); return true; } - } else if (Opc == ISD::ADD) { - SDOperand N1 = N->getOperand(0); - SDOperand N2 = N->getOperand(1); - if (isGAPlusOffset(N1.Val, GA, Offset)) { - ConstantSDNode *V = dyn_cast(N2); - if (V) { - Offset += V->getSignExtended(); - return true; - } - } else if (isGAPlusOffset(N2.Val, GA, Offset)) { - ConstantSDNode *V = dyn_cast(N1); - if (V) { - Offset += V->getSignExtended(); - return true; - } - } - } - return false; -} - -/// isConsecutiveLoad - Returns true if N is loading from an address of Base -/// + Dist * Size. -static bool isConsecutiveLoad(SDNode *N, SDNode *Base, int Dist, int Size, - MachineFrameInfo *MFI) { - if (N->getOperand(0).Val != Base->getOperand(0).Val) - return false; - - SDOperand Loc = N->getOperand(1); - SDOperand BaseLoc = Base->getOperand(1); - if (Loc.getOpcode() == ISD::FrameIndex) { - if (BaseLoc.getOpcode() != ISD::FrameIndex) - return false; - int FI = cast(Loc)->getIndex(); - int BFI = cast(BaseLoc)->getIndex(); - int FS = MFI->getObjectSize(FI); - int BFS = MFI->getObjectSize(BFI); - if (FS != BFS || FS != Size) return false; - return MFI->getObjectOffset(FI) == (MFI->getObjectOffset(BFI) + Dist*Size); - } else { - GlobalValue *GV1 = NULL; - GlobalValue *GV2 = NULL; - int64_t Offset1 = 0; - int64_t Offset2 = 0; - bool isGA1 = isGAPlusOffset(Loc.Val, GV1, Offset1); - bool isGA2 = isGAPlusOffset(BaseLoc.Val, GV2, Offset2); - if (isGA1 && isGA2 && GV1 == GV2) - return Offset1 == (Offset2 + Dist*Size); } - - return false; + return TargetLowering::isGAPlusOffset(N, GA, Offset); } -static bool isBaseAlignmentOfN(unsigned N, SDNode *Base, MachineFrameInfo *MFI, - const X86Subtarget *Subtarget) { +static bool isBaseAlignmentOfN(unsigned N, SDNode *Base, + const TargetLowering &TLI) { GlobalValue *GV; int64_t Offset = 0; - if (isGAPlusOffset(Base, GV, Offset)) + if (TLI.isGAPlusOffset(Base, GV, Offset)) return (GV->getAlignment() >= N && (Offset % N) == 0); // DAG combine handles the stack object case. return false; @@ -6266,8 +6218,9 @@ static bool EltsFromConsecutiveLoads(SDNode *N, SDOperand PermMask, unsigned NumElems, MVT::ValueType EVT, - MachineFrameInfo *MFI, - SelectionDAG &DAG, SDNode *&Base) { + SDNode *&Base, + SelectionDAG &DAG, MachineFrameInfo *MFI, + const TargetLowering &TLI) { Base = NULL; for (unsigned i = 0; i < NumElems; ++i) { SDOperand Idx = PermMask.getOperand(i); @@ -6291,7 +6244,8 @@ if (Elt.getOpcode() == ISD::UNDEF) continue; - if (!isConsecutiveLoad(Elt.Val, Base, i, MVT::getSizeInBits(EVT)/8,MFI)) + if (!TLI.isConsecutiveLoad(Elt.Val, Base, + MVT::getSizeInBits(EVT)/8, i, MFI)) return false; } return true; @@ -6302,18 +6256,19 @@ /// if the load addresses are consecutive, non-overlapping, and in the right /// order. static SDOperand PerformShuffleCombine(SDNode *N, SelectionDAG &DAG, - const X86Subtarget *Subtarget) { + const TargetLowering &TLI) { MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo(); MVT::ValueType VT = N->getValueType(0); MVT::ValueType EVT = MVT::getVectorElementType(VT); SDOperand PermMask = N->getOperand(2); unsigned NumElems = PermMask.getNumOperands(); SDNode *Base = NULL; - if (!EltsFromConsecutiveLoads(N, PermMask, NumElems, EVT, MFI, DAG, Base)) + if (!EltsFromConsecutiveLoads(N, PermMask, NumElems, EVT, Base, + DAG, MFI, TLI)) return SDOperand(); LoadSDNode *LD = cast(Base); - if (isBaseAlignmentOfN(16, Base->getOperand(1).Val, MFI, Subtarget)) + if (isBaseAlignmentOfN(16, Base->getOperand(1).Val, TLI)) return DAG.getLoad(VT, LD->getChain(), LD->getBasePtr(), LD->getSrcValue(), LD->getSrcValueOffset(), LD->isVolatile()); return DAG.getLoad(VT, LD->getChain(), LD->getBasePtr(), LD->getSrcValue(), @@ -6329,7 +6284,8 @@ } static SDOperand PerformBuildVectorCombine(SDNode *N, SelectionDAG &DAG, - const X86Subtarget *Subtarget) { + const X86Subtarget *Subtarget, + const TargetLowering &TLI) { // Ignore single operand BUILD_VECTOR. if (N->getNumOperands() == 1) return SDOperand(); @@ -6360,7 +6316,7 @@ return SDOperand(); SDNode *NextLD = getBuildPairElt(Pair, 1); if (!ISD::isNON_EXTLoad(NextLD) || - !isConsecutiveLoad(NextLD, Base, 1, 4/*32 bits*/, MFI)) + !TLI.isConsecutiveLoad(NextLD, Base, 4/*32 bits*/, 1, MFI)) return SDOperand(); } LoadSDNode *LD = cast(Base); @@ -6564,8 +6520,9 @@ SelectionDAG &DAG = DCI.DAG; switch (N->getOpcode()) { default: break; - case ISD::VECTOR_SHUFFLE: return PerformShuffleCombine(N, DAG, Subtarget); - case ISD::BUILD_VECTOR: return PerformBuildVectorCombine(N, DAG, Subtarget); + case ISD::VECTOR_SHUFFLE: return PerformShuffleCombine(N, DAG, *this); + case ISD::BUILD_VECTOR: + return PerformBuildVectorCombine(N, DAG, Subtarget, *this); case ISD::SELECT: return PerformSELECTCombine(N, DAG, Subtarget); case ISD::STORE: return PerformSTORECombine(N, DAG, Subtarget); case X86ISD::FXOR: Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=50991&r1=50990&r2=50991&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Mon May 12 14:56:52 2008 @@ -369,6 +369,9 @@ APInt &KnownOne, const SelectionDAG &DAG, unsigned Depth = 0) const; + + virtual bool + isGAPlusOffset(SDNode *N, GlobalValue* &GA, int64_t &Offset) const; SDOperand getReturnAddressFrameIndex(SelectionDAG &DAG); From isanbard at gmail.com Mon May 12 14:59:00 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 12 May 2008 12:59:00 -0700 Subject: [llvm-commits] [llvm] r50987 - /llvm/trunk/lib/CodeGen/MachineLICM.cpp In-Reply-To: <4FEAC067-5B96-4FE0-BB23-56FCD2E9A172@apple.com> References: <200805121938.m4CJcXXi022126@zion.cs.uiuc.edu> <4FEAC067-5B96-4FE0-BB23-56FCD2E9A172@apple.com> Message-ID: <16e5fdf90805121259x5c12aee5ge008f14782173920@mail.gmail.com> Yeah. I realized my error afterwards. Reverted. -bw On Mon, May 12, 2008 at 12:44 PM, Evan Cheng wrote: > This is wrong. We definitely *want* to hoist instructions that are > rematerializable. These instructions can be remat at the uses in case > LICM increases register pressure and spilling ensues. > > Evan > > On May 12, 2008, at 12:38 PM, Bill Wendling wrote: > >> Author: void >> Date: Mon May 12 14:38:32 2008 >> New Revision: 50987 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=50987&view=rev >> Log: >> One real change - don't hoist something that's trivially >> rematerializable. It's >> possible for it to produce worse code than before. >> >> The rest of this patch is code cleanup. >> >> Modified: >> llvm/trunk/lib/CodeGen/MachineLICM.cpp >> >> Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=50987&r1=50986&r2=50987&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> ====================================================================== >> --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) >> +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Mon May 12 14:38:32 2008 >> @@ -34,16 +34,16 @@ >> class VISIBILITY_HIDDEN MachineLICM : public MachineFunctionPass { >> const TargetMachine *TM; >> const TargetInstrInfo *TII; >> - MachineFunction *CurMF; // Current MachineFunction >> + MachineFunction *CurMF; // Current MachineFunction >> >> // Various analyses that we use... >> - MachineLoopInfo *LI; // Current MachineLoopInfo >> - MachineDominatorTree *DT; // Machine dominator tree for the >> current Loop >> + MachineLoopInfo *LI; // Current MachineLoopInfo >> + MachineDominatorTree *DT; // Machine dominator tree for >> the cur loop >> MachineRegisterInfo *RegInfo; // Machine register information >> >> // State that is updated as we process loops >> - bool Changed; // True if a loop is changed. >> - MachineLoop *CurLoop; // The current loop we are working >> on. >> + bool Changed; // True if a loop is changed. >> + MachineLoop *CurLoop; // The current loop we are >> working on. >> public: >> static char ID; // Pass identification, replacement for typeid >> MachineLICM() : MachineFunctionPass((intptr_t)&ID) {} >> @@ -233,15 +233,14 @@ >> return false; >> >> if (TID.mayLoad()) { >> - // Okay, this instruction does a load. As a refinement, allow >> the target >> - // to decide whether the loaded value is actually a constant. >> If so, we >> - // can actually use it as a load. >> - if (!TII->isInvariantLoad(&I)) { >> + // Okay, this instruction does a load. As a refinement, we >> allow the target >> + // to decide whether the loaded value is actually a constant. >> If so, we can >> + // actually use it as a load. >> + if (!TII->isInvariantLoad(&I)) >> // FIXME: we should be able to sink loads with no other side >> effects if >> // there is nothing that can change memory from here until the >> end of >> - // block. This is a trivial form of alias analysis. >> + // block. This is a trivial form of alias analysis. >> return false; >> - } >> } >> >> DEBUG({ >> @@ -263,12 +262,9 @@ >> *ImpDefs; ++ImpDefs) >> DOUT << " -> " << TRI->getName(*ImpDefs) << "\n"; >> } >> - >> - //if (TII->hasUnmodelledSideEffects(&I)) >> - //DOUT << " * Instruction has side effects.\n"; >> }); >> >> - // The instruction is loop invariant if all of its operands are >> loop-invariant >> + // The instruction is loop invariant if all of its operands are. >> for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) { >> const MachineOperand &MO = I.getOperand(i); >> >> @@ -282,7 +278,8 @@ >> if (TargetRegisterInfo::isPhysicalRegister(Reg)) >> return false; >> >> - assert(RegInfo->getVRegDef(Reg)&&"Machine instr not mapped for >> this vreg?"); >> + assert(RegInfo->getVRegDef(Reg) && >> + "Machine instr not mapped for this vreg?!"); >> >> // If the loop contains the definition of an operand, then the >> instruction >> // isn't loop invariant. >> @@ -294,12 +291,16 @@ >> return true; >> } >> >> -/// Hoist - When an instruction is found to only use loop invariant >> operands >> -/// that is safe to hoist, this instruction is called to do the >> dirty work. >> +/// Hoist - When an instruction is found to use only loop invariant >> operands >> +/// that are safe to hoist, this instruction is called to do the >> dirty work. >> /// >> void MachineLICM::Hoist(MachineInstr &MI) { >> if (!IsLoopInvariantInst(MI)) return; >> >> + // Hoisting things that are trivially rematerializable may result >> in worse >> + // code than before. >> + if (TII->isTriviallyReMaterializable(&MI)) return; >> + >> std::vector Preds; >> >> // Non-back-edge predecessors. >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From natebegeman at mac.com Mon May 12 15:01:57 2008 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 12 May 2008 20:01:57 -0000 Subject: [llvm-commits] [llvm] r50992 - /llvm/trunk/lib/VMCore/Instructions.cpp Message-ID: <200805122001.m4CK1v9O032143@zion.cs.uiuc.edu> Author: sampo Date: Mon May 12 15:01:56 2008 New Revision: 50992 URL: http://llvm.org/viewvc/llvm-project?rev=50992&view=rev Log: Hard code CmpInst back to i1 for now while I go track down what in the bitcode reader/writer is assuming i1 This was breaking a bunch of tests Modified: llvm/trunk/lib/VMCore/Instructions.cpp Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=50992&r1=50991&r2=50992&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Mon May 12 15:01:56 2008 @@ -2335,7 +2335,7 @@ CmpInst::CmpInst(const Type *ty, OtherOps op, unsigned short predicate, Value *LHS, Value *RHS, const std::string &Name, Instruction *InsertBefore) - : Instruction(ty, op, + : Instruction(Type::Int1Ty, op, OperandTraits::op_begin(this), OperandTraits::operands(this), InsertBefore) { @@ -2348,7 +2348,7 @@ CmpInst::CmpInst(const Type *ty, OtherOps op, unsigned short predicate, Value *LHS, Value *RHS, const std::string &Name, BasicBlock *InsertAtEnd) - : Instruction(ty, op, + : Instruction(Type::Int1Ty, op, OperandTraits::op_begin(this), OperandTraits::operands(this), InsertAtEnd) { From gohman at apple.com Mon May 12 15:01:55 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 12 May 2008 13:01:55 -0700 Subject: [llvm-commits] [llvm] r50985 - in /llvm/trunk: docs/ include/llvm/ include/llvm/Support/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Bitcode/Writer/ lib/VMCore/ In-Reply-To: <200805121902.m4CJ22Nt020896@zion.cs.uiuc.edu> References: <200805121902.m4CJ22Nt020896@zion.cs.uiuc.edu> Message-ID: <7F43E616-CAAE-4571-A7F2-0A5AC5A8791F@apple.com> On May 12, 2008, at 12:01 PM, Nate Begeman wrote: > Author: sampo > Date: Mon May 12 14:01:56 2008 > New Revision: 50985 > > URL: http://llvm.org/viewvc/llvm-project?rev=50985&view=rev > Log: > Add two new instructions to the llvm IR, vicmp and vfcmp. see > updated LangRef > for details. CodeGen support coming in a follow up patch Awesome! > +
        Semantics:
        > +

        The 'vicmp' instruction compares var1 and > var2 > +according to the condition code given as cond. The > comparison yields a > +vector of integer > result, of > +identical type as the values being compared. The most significant > bit in each > +element is 1 if the element-wise comparison evaluates to true, and > is 0 > +otherwise. All other bits of the result are undefined. The > condition codes > +are evaluated identically to the 'icmp' > +instruction. It would be neat to overload the existing fcmp and icmp instead of introducing new instructions. But vicmp and vfcmp address a real need today without requiring the codegen to perform a bunch of magic on vectors of i1 to make this approach work well on current targets. Fortunately, nothing here rules out extending fcmp and icmp in the future :-). Dan From resistor at mac.com Mon May 12 15:05:25 2008 From: resistor at mac.com (Owen Anderson) Date: Mon, 12 May 2008 15:05:25 -0500 Subject: [llvm-commits] [llvm] r50991 - in /llvm/trunk/lib: CodeGen/SelectionDAG/TargetLowering.cpp Target/X86/X86ISelLowering.cpp Target/X86/X86ISelLowering.h In-Reply-To: <200805121956.m4CJuueV022748@zion.cs.uiuc.edu> References: <200805121956.m4CJuueV022748@zion.cs.uiuc.edu> Message-ID: <1D2E46A3-380C-402E-A5F5-C5E0BCAE01FC@mac.com> This is breaking the build. llvm[3]: Compiling TargetLowering.cpp for Release build TargetLowering.cpp:1485: error: no ?bool llvm::TargetLowering::isGAPlusOffset(llvm::SDNode*, llvm::GlobalValue*&, int64_t&) const? member function declared in class ?llvm::TargetLowering? TargetLowering.cpp:1517: error: no ?bool llvm::TargetLowering::isConsecutiveLoad(llvm::SDNode*, llvm::SDNode*, unsigned int, int, llvm::MachineFrameInfo*) const? member function declared in class ?llvm::TargetLowering? --Owen On May 12, 2008, at 2:56 PM, Evan Cheng wrote: > Author: evancheng > Date: Mon May 12 14:56:52 2008 > New Revision: 50991 > > URL: http://llvm.org/viewvc/llvm-project?rev=50991&view=rev > Log: > Refactor isConsecutiveLoad from X86 to TargetLowering so DAG > combiner can make use of it. > > Modified: > llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp > llvm/trunk/lib/Target/X86/X86ISelLowering.cpp > llvm/trunk/lib/Target/X86/X86ISelLowering.h > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=50991&r1=50990&r2=50991&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon May > 12 14:56:52 2008 > @@ -19,6 +19,7 @@ > #include "llvm/Target/TargetRegisterInfo.h" > #include "llvm/GlobalVariable.h" > #include "llvm/DerivedTypes.h" > +#include "llvm/CodeGen/MachineFrameInfo.h" > #include "llvm/CodeGen/SelectionDAG.h" > #include "llvm/ADT/StringExtras.h" > #include "llvm/ADT/STLExtras.h" > @@ -1478,6 +1479,73 @@ > return SDOperand(); > } > > +/// isGAPlusOffset - Returns true (and the GlobalValue and the > offset) if the > +/// node is a GlobalAddress + offset. > +bool TargetLowering::isGAPlusOffset(SDNode *N, GlobalValue* &GA, > + int64_t &Offset) const { > + if (isa(N)) { > + GA = cast(N)->getGlobal(); > + return true; > + } > + > + if (N->getOpcode() == ISD::ADD) { > + SDOperand N1 = N->getOperand(0); > + SDOperand N2 = N->getOperand(1); > + if (isGAPlusOffset(N1.Val, GA, Offset)) { > + ConstantSDNode *V = dyn_cast(N2); > + if (V) { > + Offset += V->getSignExtended(); > + return true; > + } > + } else if (isGAPlusOffset(N2.Val, GA, Offset)) { > + ConstantSDNode *V = dyn_cast(N1); > + if (V) { > + Offset += V->getSignExtended(); > + return true; > + } > + } > + } > + return false; > +} > + > + > +/// isConsecutiveLoad - Return true if LD (which must be a > LoadSDNode) is > +/// loading 'Bytes' bytes from a location that is 'Dist' units away > from the > +/// location that the 'Base' load is loading from. > +bool TargetLowering::isConsecutiveLoad(SDNode *LD, SDNode *Base, > + unsigned Bytes, int Dist, > + MachineFrameInfo *MFI) const { > + if (LD->getOperand(0).Val != Base->getOperand(0).Val) > + return false; > + MVT::ValueType VT = LD->getValueType(0); > + if (MVT::getSizeInBits(VT) / 8 != Bytes) > + return false; > + > + SDOperand Loc = LD->getOperand(1); > + SDOperand BaseLoc = Base->getOperand(1); > + if (Loc.getOpcode() == ISD::FrameIndex) { > + if (BaseLoc.getOpcode() != ISD::FrameIndex) > + return false; > + int FI = cast(Loc)->getIndex(); > + int BFI = cast(BaseLoc)->getIndex(); > + int FS = MFI->getObjectSize(FI); > + int BFS = MFI->getObjectSize(BFI); > + if (FS != BFS || FS != (int)Bytes) return false; > + return MFI->getObjectOffset(FI) == (MFI->getObjectOffset(BFI) + > Dist*Bytes); > + } > + > + GlobalValue *GV1 = NULL; > + GlobalValue *GV2 = NULL; > + int64_t Offset1 = 0; > + int64_t Offset2 = 0; > + bool isGA1 = isGAPlusOffset(Loc.Val, GV1, Offset1); > + bool isGA2 = isGAPlusOffset(BaseLoc.Val, GV2, Offset2); > + if (isGA1 && isGA2 && GV1 == GV2) > + return Offset1 == (Offset2 + Dist*Bytes); > + return false; > +} > + > + > SDOperand TargetLowering:: > PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const { > // Default implementation: no optimization. > > Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=50991&r1=50990&r2=50991&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon May 12 > 14:56:52 2008 > @@ -6194,71 +6194,23 @@ > } > > /// isGAPlusOffset - Returns true (and the GlobalValue and the > offset) if the > -/// node is a GlobalAddress + an offset. > -static bool isGAPlusOffset(SDNode *N, GlobalValue* &GA, int64_t > &Offset) { > - unsigned Opc = N->getOpcode(); > - if (Opc == X86ISD::Wrapper) { > - if (dyn_cast(N->getOperand(0))) { > +/// node is a GlobalAddress + offset. > +bool X86TargetLowering::isGAPlusOffset(SDNode *N, > + GlobalValue* &GA, int64_t > &Offset) const{ > + if (N->getOpcode() == X86ISD::Wrapper) { > + if (isa(N->getOperand(0))) { > GA = cast(N->getOperand(0))->getGlobal(); > return true; > } > - } else if (Opc == ISD::ADD) { > - SDOperand N1 = N->getOperand(0); > - SDOperand N2 = N->getOperand(1); > - if (isGAPlusOffset(N1.Val, GA, Offset)) { > - ConstantSDNode *V = dyn_cast(N2); > - if (V) { > - Offset += V->getSignExtended(); > - return true; > - } > - } else if (isGAPlusOffset(N2.Val, GA, Offset)) { > - ConstantSDNode *V = dyn_cast(N1); > - if (V) { > - Offset += V->getSignExtended(); > - return true; > - } > - } > - } > - return false; > -} > - > -/// isConsecutiveLoad - Returns true if N is loading from an > address of Base > -/// + Dist * Size. > -static bool isConsecutiveLoad(SDNode *N, SDNode *Base, int Dist, > int Size, > - MachineFrameInfo *MFI) { > - if (N->getOperand(0).Val != Base->getOperand(0).Val) > - return false; > - > - SDOperand Loc = N->getOperand(1); > - SDOperand BaseLoc = Base->getOperand(1); > - if (Loc.getOpcode() == ISD::FrameIndex) { > - if (BaseLoc.getOpcode() != ISD::FrameIndex) > - return false; > - int FI = cast(Loc)->getIndex(); > - int BFI = cast(BaseLoc)->getIndex(); > - int FS = MFI->getObjectSize(FI); > - int BFS = MFI->getObjectSize(BFI); > - if (FS != BFS || FS != Size) return false; > - return MFI->getObjectOffset(FI) == (MFI->getObjectOffset(BFI) + > Dist*Size); > - } else { > - GlobalValue *GV1 = NULL; > - GlobalValue *GV2 = NULL; > - int64_t Offset1 = 0; > - int64_t Offset2 = 0; > - bool isGA1 = isGAPlusOffset(Loc.Val, GV1, Offset1); > - bool isGA2 = isGAPlusOffset(BaseLoc.Val, GV2, Offset2); > - if (isGA1 && isGA2 && GV1 == GV2) > - return Offset1 == (Offset2 + Dist*Size); > } > - > - return false; > + return TargetLowering::isGAPlusOffset(N, GA, Offset); > } > > -static bool isBaseAlignmentOfN(unsigned N, SDNode *Base, > MachineFrameInfo *MFI, > - const X86Subtarget *Subtarget) { > +static bool isBaseAlignmentOfN(unsigned N, SDNode *Base, > + const TargetLowering &TLI) { > GlobalValue *GV; > int64_t Offset = 0; > - if (isGAPlusOffset(Base, GV, Offset)) > + if (TLI.isGAPlusOffset(Base, GV, Offset)) > return (GV->getAlignment() >= N && (Offset % N) == 0); > // DAG combine handles the stack object case. > return false; > @@ -6266,8 +6218,9 @@ > > static bool EltsFromConsecutiveLoads(SDNode *N, SDOperand PermMask, > unsigned NumElems, > MVT::ValueType EVT, > - MachineFrameInfo *MFI, > - SelectionDAG &DAG, SDNode > *&Base) { > + SDNode *&Base, > + SelectionDAG &DAG, > MachineFrameInfo *MFI, > + const TargetLowering &TLI) { > Base = NULL; > for (unsigned i = 0; i < NumElems; ++i) { > SDOperand Idx = PermMask.getOperand(i); > @@ -6291,7 +6244,8 @@ > if (Elt.getOpcode() == ISD::UNDEF) > continue; > > - if (!isConsecutiveLoad(Elt.Val, Base, i, > MVT::getSizeInBits(EVT)/8,MFI)) > + if (!TLI.isConsecutiveLoad(Elt.Val, Base, > + MVT::getSizeInBits(EVT)/8, i, MFI)) > return false; > } > return true; > @@ -6302,18 +6256,19 @@ > /// if the load addresses are consecutive, non-overlapping, and in > the right > /// order. > static SDOperand PerformShuffleCombine(SDNode *N, SelectionDAG &DAG, > - const X86Subtarget > *Subtarget) { > + const TargetLowering &TLI) { > MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo(); > MVT::ValueType VT = N->getValueType(0); > MVT::ValueType EVT = MVT::getVectorElementType(VT); > SDOperand PermMask = N->getOperand(2); > unsigned NumElems = PermMask.getNumOperands(); > SDNode *Base = NULL; > - if (!EltsFromConsecutiveLoads(N, PermMask, NumElems, EVT, MFI, > DAG, Base)) > + if (!EltsFromConsecutiveLoads(N, PermMask, NumElems, EVT, Base, > + DAG, MFI, TLI)) > return SDOperand(); > > LoadSDNode *LD = cast(Base); > - if (isBaseAlignmentOfN(16, Base->getOperand(1).Val, MFI, > Subtarget)) > + if (isBaseAlignmentOfN(16, Base->getOperand(1).Val, TLI)) > return DAG.getLoad(VT, LD->getChain(), LD->getBasePtr(), LD- > >getSrcValue(), > LD->getSrcValueOffset(), LD->isVolatile()); > return DAG.getLoad(VT, LD->getChain(), LD->getBasePtr(), LD- > >getSrcValue(), > @@ -6329,7 +6284,8 @@ > } > > static SDOperand PerformBuildVectorCombine(SDNode *N, SelectionDAG > &DAG, > - const X86Subtarget > *Subtarget) { > + const X86Subtarget > *Subtarget, > + const TargetLowering > &TLI) { > // Ignore single operand BUILD_VECTOR. > if (N->getNumOperands() == 1) > return SDOperand(); > @@ -6360,7 +6316,7 @@ > return SDOperand(); > SDNode *NextLD = getBuildPairElt(Pair, 1); > if (!ISD::isNON_EXTLoad(NextLD) || > - !isConsecutiveLoad(NextLD, Base, 1, 4/*32 bits*/, MFI)) > + !TLI.isConsecutiveLoad(NextLD, Base, 4/*32 bits*/, 1, MFI)) > return SDOperand(); > } > LoadSDNode *LD = cast(Base); > @@ -6564,8 +6520,9 @@ > SelectionDAG &DAG = DCI.DAG; > switch (N->getOpcode()) { > default: break; > - case ISD::VECTOR_SHUFFLE: return PerformShuffleCombine(N, DAG, > Subtarget); > - case ISD::BUILD_VECTOR: return PerformBuildVectorCombine(N, > DAG, Subtarget); > + case ISD::VECTOR_SHUFFLE: return PerformShuffleCombine(N, DAG, > *this); > + case ISD::BUILD_VECTOR: > + return PerformBuildVectorCombine(N, DAG, Subtarget, *this); > case ISD::SELECT: return PerformSELECTCombine(N, DAG, > Subtarget); > case ISD::STORE: return PerformSTORECombine(N, DAG, > Subtarget); > case X86ISD::FXOR: > > Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=50991&r1=50990&r2=50991&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) > +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Mon May 12 14:56:52 > 2008 > @@ -369,6 +369,9 @@ > APInt &KnownOne, > const SelectionDAG > &DAG, > unsigned Depth = 0) > const; > + > + virtual bool > + isGAPlusOffset(SDNode *N, GlobalValue* &GA, int64_t &Offset) > const; > > SDOperand getReturnAddressFrameIndex(SelectionDAG &DAG); > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4260 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080512/744a53ee/attachment.bin From evan.cheng at apple.com Mon May 12 15:08:12 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 12 May 2008 20:08:12 -0000 Subject: [llvm-commits] [llvm] r50993 - /llvm/trunk/include/llvm/Target/TargetLowering.h Message-ID: <200805122008.m4CK8DVW001908@zion.cs.uiuc.edu> Author: evancheng Date: Mon May 12 15:08:05 2008 New Revision: 50993 URL: http://llvm.org/viewvc/llvm-project?rev=50993&view=rev Log: Forgot this. Modified: llvm/trunk/include/llvm/Target/TargetLowering.h Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=50993&r1=50992&r2=50993&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Mon May 12 15:08:05 2008 @@ -32,18 +32,19 @@ #include namespace llvm { - class Value; class Function; - class TargetMachine; - class TargetData; - class TargetRegisterClass; + class MachineBasicBlock; + class MachineFrameInfo; + class MachineInstr; class SDNode; class SDOperand; class SelectionDAG; - class MachineBasicBlock; - class MachineInstr; - class VectorType; + class TargetData; + class TargetMachine; + class TargetRegisterClass; class TargetSubtarget; + class Value; + class VectorType; //===----------------------------------------------------------------------===// /// TargetLowering - This class defines information used to lower LLVM code to @@ -681,6 +682,17 @@ ISD::CondCode Cond, bool foldBooleans, DAGCombinerInfo &DCI) const; + /// isGAPlusOffset - Returns true (and the GlobalValue and the offset) if the + /// node is a GlobalAddress + offset. + virtual bool + isGAPlusOffset(SDNode *N, GlobalValue* &GA, int64_t &Offset) const; + + /// isConsecutiveLoad - Return true if LD (which must be a LoadSDNode) is + /// loading 'Bytes' bytes from a location that is 'Dist' units away from the + /// location that the 'Base' load is loading from. + bool isConsecutiveLoad(SDNode *LD, SDNode *Base, unsigned Bytes, int Dist, + MachineFrameInfo *MFI) const; + /// PerformDAGCombine - This method will be invoked for all target nodes and /// for any target-independent nodes that the target has registered with /// invoke it for. From natebegeman at mac.com Mon May 12 15:11:05 2008 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 12 May 2008 20:11:05 -0000 Subject: [llvm-commits] [llvm] r50994 - in /llvm/trunk/lib: Bitcode/Reader/BitcodeReader.cpp VMCore/Instructions.cpp Message-ID: <200805122011.m4CKB50B002744@zion.cs.uiuc.edu> Author: sampo Date: Mon May 12 15:11:05 2008 New Revision: 50994 URL: http://llvm.org/viewvc/llvm-project?rev=50994&view=rev Log: Pointer comparisons should be handled by icmp, not vicmp :) Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/VMCore/Instructions.cpp Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=50994&r1=50993&r2=50994&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon May 12 15:11:05 2008 @@ -1359,7 +1359,7 @@ OpNum+1 != Record.size()) return Error("Invalid CMP record"); - if (LHS->getType()->isInteger()) + if (LHS->getType()->isInteger() || isa(LHS->getType())) I = new ICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, RHS); else if (LHS->getType()->isFloatingPoint()) I = new FCmpInst((FCmpInst::Predicate)Record[OpNum], LHS, RHS); Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=50994&r1=50993&r2=50994&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Mon May 12 15:11:05 2008 @@ -2335,7 +2335,7 @@ CmpInst::CmpInst(const Type *ty, OtherOps op, unsigned short predicate, Value *LHS, Value *RHS, const std::string &Name, Instruction *InsertBefore) - : Instruction(Type::Int1Ty, op, + : Instruction(ty, op, OperandTraits::op_begin(this), OperandTraits::operands(this), InsertBefore) { @@ -2348,7 +2348,7 @@ CmpInst::CmpInst(const Type *ty, OtherOps op, unsigned short predicate, Value *LHS, Value *RHS, const std::string &Name, BasicBlock *InsertAtEnd) - : Instruction(Type::Int1Ty, op, + : Instruction(ty, op, OperandTraits::op_begin(this), OperandTraits::operands(this), InsertAtEnd) { From resistor at mac.com Mon May 12 15:15:57 2008 From: resistor at mac.com (Owen Anderson) Date: Mon, 12 May 2008 20:15:57 -0000 Subject: [llvm-commits] [llvm] r50995 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp Message-ID: <200805122015.m4CKFvXi011285@zion.cs.uiuc.edu> Author: resistor Date: Mon May 12 15:15:55 2008 New Revision: 50995 URL: http://llvm.org/viewvc/llvm-project?rev=50995&view=rev Log: Go back to passing the analyses around as parameters. Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=50995&r1=50994&r2=50995&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Mon May 12 15:15:55 2008 @@ -42,10 +42,6 @@ // ValueTable Class //===----------------------------------------------------------------------===// -static DominatorTree* DT; -static AliasAnalysis* AA; -static MemoryDependenceAnalysis* MD; - /// This class holds the mapping between values and value numbers. It is used /// as an efficient mechanism to determine the expression-wise equivalence of /// two values. @@ -133,6 +129,9 @@ private: DenseMap valueNumbering; DenseMap expressionNumbering; + AliasAnalysis* AA; + MemoryDependenceAnalysis* MD; + DominatorTree* DT; uint32_t nextValueNumber; @@ -156,6 +155,9 @@ void clear(); void erase(Value* v); unsigned size(); + void setAliasAnalysis(AliasAnalysis* A) { AA = A; } + void setMemDep(MemoryDependenceAnalysis* M) { MD = M; } + void setDomTree(DominatorTree* D) { DT = D; } }; } @@ -734,6 +736,7 @@ } Value* GVN::CollapsePhi(PHINode* p) { + DominatorTree &DT = getAnalysis(); Value* constVal = p->hasConstantValue(); if (!constVal) return 0; @@ -742,7 +745,7 @@ if (!inst) return constVal; - if (DT->dominates(inst, p)) + if (DT.dominates(inst, p)) if (isSafeReplacement(p, inst)) return inst; return 0; @@ -793,7 +796,8 @@ PN->addIncoming(val, *PI); } - AA->copyValue(orig, PN); + AliasAnalysis& AA = getAnalysis(); + AA.copyValue(orig, PN); // Attempt to collapse PHI nodes that are trivially redundant Value* v = CollapsePhi(PN); @@ -802,8 +806,10 @@ phiMap[orig->getPointerOperand()].insert(PN); return PN; } + + MemoryDependenceAnalysis& MD = getAnalysis(); - MD->removeInstruction(PN); + MD.removeInstruction(PN); PN->replaceAllUsesWith(v); for (DenseMap::iterator I = Phis.begin(), @@ -821,9 +827,11 @@ /// non-local by performing PHI construction. bool GVN::processNonLocalLoad(LoadInst* L, SmallVectorImpl &toErase) { + MemoryDependenceAnalysis& MD = getAnalysis(); + // Find the non-local dependencies of the load DenseMap deps; - MD->getNonLocalDependency(L, deps); + MD.getNonLocalDependency(L, deps); DenseMap repl; @@ -854,7 +862,7 @@ for (SmallPtrSet::iterator I = p.begin(), E = p.end(); I != E; ++I) { if ((*I)->getParent() == L->getParent()) { - MD->removeInstruction(L); + MD.removeInstruction(L); L->replaceAllUsesWith(*I); toErase.push_back(L); NumGVNLoad++; @@ -868,7 +876,7 @@ SmallPtrSet visited; Value* v = GetValueForBlock(L->getParent(), L, repl, true); - MD->removeInstruction(L); + MD.removeInstruction(L); L->replaceAllUsesWith(v); toErase.push_back(L); NumGVNLoad++; @@ -889,8 +897,9 @@ LoadInst*& last = lastLoad[pointer]; // ... to a pointer that has been loaded from before... + MemoryDependenceAnalysis& MD = getAnalysis(); bool removedNonLocal = false; - Instruction* dep = MD->getDependency(L); + Instruction* dep = MD.getDependency(L); if (dep == MemoryDependenceAnalysis::NonLocal && L->getParent() != &L->getParent()->getParent()->getEntryBlock()) { removedNonLocal = processNonLocalLoad(L, toErase); @@ -913,7 +922,7 @@ if (StoreInst* S = dyn_cast(dep)) { if (S->getPointerOperand() == pointer) { // Remove it! - MD->removeInstruction(L); + MD.removeInstruction(L); L->replaceAllUsesWith(S->getOperand(0)); toErase.push_back(L); @@ -930,7 +939,7 @@ break; } else if (dep == last) { // Remove it! - MD->removeInstruction(L); + MD.removeInstruction(L); L->replaceAllUsesWith(last); toErase.push_back(L); @@ -939,7 +948,7 @@ break; } else { - dep = MD->getDependency(L, dep); + dep = MD.getDependency(L, dep); } } @@ -961,7 +970,7 @@ // If this load depends directly on an allocation, there isn't // anything stored there; therefore, we can optimize this load // to undef. - MD->removeInstruction(L); + MD.removeInstruction(L); L->replaceAllUsesWith(UndefValue::get(L->getType())); toErase.push_back(L); @@ -1009,7 +1018,8 @@ Value* repl = find_leader(currAvail, num); // Remove it! - MD->removeInstruction(I); + MemoryDependenceAnalysis& MD = getAnalysis(); + MD.removeInstruction(I); VN.erase(I); I->replaceAllUsesWith(repl); @@ -1027,9 +1037,9 @@ // function. // bool GVN::runOnFunction(Function& F) { - DT = &getAnalysis(); - AA = &getAnalysis(); - MD = &getAnalysis(); + VN.setAliasAnalysis(&getAnalysis()); + VN.setMemDep(&getAnalysis()); + VN.setDomTree(&getAnalysis()); bool changed = false; bool shouldContinue = true; @@ -1052,13 +1062,15 @@ bool changed_function = false; + DominatorTree &DT = getAnalysis(); + SmallVector toErase; DenseMap lastSeenLoad; DenseMap numChildrenVisited; // Top-down walk of the dominator tree - for (df_iterator DI = df_begin(DT->getRootNode()), - E = df_end(DT->getRootNode()); DI != E; ++DI) { + for (df_iterator DI = df_begin(DT.getRootNode()), + E = df_end(DT.getRootNode()); DI != E; ++DI) { // Get the set to update for this block ValueNumberedSet& currAvail = availableOut[DI->getBlock()]; From natebegeman at mac.com Mon May 12 15:16:56 2008 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 12 May 2008 20:16:56 -0000 Subject: [llvm-commits] [llvm] r50996 - /llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200805122016.m4CKGusI011348@zion.cs.uiuc.edu> Author: sampo Date: Mon May 12 15:16:55 2008 New Revision: 50996 URL: http://llvm.org/viewvc/llvm-project?rev=50996&view=rev Log: Pointer comparisons should use icmp, not vicmp Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=50996&r1=50995&r2=50996&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon May 12 15:16:55 2008 @@ -818,7 +818,7 @@ if (OpTy->isFloatingPoint()) V = ConstantExpr::getFCmp(Record[3], Op0, Op1); - else if (OpTy->isInteger()) + else if (OpTy->isInteger() || isa(OpTy)) V = ConstantExpr::getICmp(Record[3], Op0, Op1); else if (OpTy->isFPOrFPVector()) V = ConstantExpr::getVFCmp(Record[3], Op0, Op1); From gohman at apple.com Mon May 12 15:22:46 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 12 May 2008 20:22:46 -0000 Subject: [llvm-commits] [llvm] r50997 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td Message-ID: <200805122022.m4CKMkDh012549@zion.cs.uiuc.edu> Author: djg Date: Mon May 12 15:22:45 2008 New Revision: 50997 URL: http://llvm.org/viewvc/llvm-project?rev=50997&view=rev Log: Fix a copy+paste bug; pseudo-instructions shouldn't have encoding information. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=50997&r1=50996&r2=50997&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Mon May 12 15:22:45 2008 @@ -2601,58 +2601,51 @@ // Atomic exchange and and, or, xor let Constraints = "$val = $dst", Defs = [EFLAGS], usesCustomDAGSchedInserter = 1 in { -def ATOMAND32 : I<0xC1, MRMSrcMem,(outs GR32:$dst),(ins i32mem:$ptr, GR32:$val), +def ATOMAND32 : I<0, Pseudo, (outs GR32:$dst),(ins i32mem:$ptr, GR32:$val), "#ATOMAND32 PSUEDO!", - [(set GR32:$dst, (atomic_load_and addr:$ptr, GR32:$val))]>, - TB, LOCK; + [(set GR32:$dst, (atomic_load_and addr:$ptr, GR32:$val))]>; } let Constraints = "$val = $dst", Defs = [EFLAGS], usesCustomDAGSchedInserter = 1 in { -def ATOMOR32 : I<0xC1, MRMSrcMem, (outs GR32:$dst),(ins i32mem:$ptr, GR32:$val), +def ATOMOR32 : I<0, Pseudo, (outs GR32:$dst),(ins i32mem:$ptr, GR32:$val), "#ATOMOR32 PSUEDO!", - [(set GR32:$dst, (atomic_load_or addr:$ptr, GR32:$val))]>, - TB, LOCK; + [(set GR32:$dst, (atomic_load_or addr:$ptr, GR32:$val))]>; } let Constraints = "$val = $dst", Defs = [EFLAGS], usesCustomDAGSchedInserter = 1 in { -def ATOMXOR32 : I<0xC1, MRMSrcMem,(outs GR32:$dst),(ins i32mem:$ptr, GR32:$val), +def ATOMXOR32 : I<0, Pseudo,(outs GR32:$dst),(ins i32mem:$ptr, GR32:$val), "#ATOMXOR32 PSUEDO!", - [(set GR32:$dst, (atomic_load_xor addr:$ptr, GR32:$val))]>, - TB, LOCK; + [(set GR32:$dst, (atomic_load_xor addr:$ptr, GR32:$val))]>; } let Constraints = "$val = $dst", Defs = [EFLAGS], usesCustomDAGSchedInserter = 1 in { -def ATOMMIN32: I<0xC1, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), +def ATOMMIN32: I<0, Pseudo, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), "#ATOMMIN32 PSUEDO!", - [(set GR32:$dst, (atomic_load_min addr:$ptr, GR32:$val))]>, - TB, LOCK; + [(set GR32:$dst, (atomic_load_min addr:$ptr, GR32:$val))]>; } let Constraints = "$val = $dst", Defs = [EFLAGS], usesCustomDAGSchedInserter = 1 in { -def ATOMMAX32: I<0xC1, MRMSrcMem, (outs GR32:$dst),(ins i32mem:$ptr, GR32:$val), +def ATOMMAX32: I<0, Pseudo, (outs GR32:$dst),(ins i32mem:$ptr, GR32:$val), "#ATOMMAX32 PSUEDO!", - [(set GR32:$dst, (atomic_load_max addr:$ptr, GR32:$val))]>, - TB, LOCK; + [(set GR32:$dst, (atomic_load_max addr:$ptr, GR32:$val))]>; } let Constraints = "$val = $dst", Defs = [EFLAGS], usesCustomDAGSchedInserter = 1 in { -def ATOMUMIN32: I<0xC1, MRMSrcMem,(outs GR32:$dst),(ins i32mem:$ptr, GR32:$val), +def ATOMUMIN32: I<0, Pseudo, (outs GR32:$dst),(ins i32mem:$ptr, GR32:$val), "#ATOMUMIN32 PSUEDO!", - [(set GR32:$dst, (atomic_load_umin addr:$ptr, GR32:$val))]>, - TB, LOCK; + [(set GR32:$dst, (atomic_load_umin addr:$ptr, GR32:$val))]>; } let Constraints = "$val = $dst", Defs = [EFLAGS], usesCustomDAGSchedInserter = 1 in { -def ATOMUMAX32: I<0xC1, MRMSrcMem,(outs GR32:$dst),(ins i32mem:$ptr, GR32:$val), +def ATOMUMAX32: I<0, Pseudo, (outs GR32:$dst),(ins i32mem:$ptr, GR32:$val), "#ATOMUMAX32 PSUEDO!", - [(set GR32:$dst, (atomic_load_umax addr:$ptr, GR32:$val))]>, - TB, LOCK; + [(set GR32:$dst, (atomic_load_umax addr:$ptr, GR32:$val))]>; } //===----------------------------------------------------------------------===// From clattner at apple.com Mon May 12 15:24:40 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 12 May 2008 13:24:40 -0700 Subject: [llvm-commits] [llvm] r50985 - in /llvm/trunk: docs/ include/llvm/ include/llvm/Support/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Bitcode/Writer/ lib/VMCore/ In-Reply-To: <7F43E616-CAAE-4571-A7F2-0A5AC5A8791F@apple.com> References: <200805121902.m4CJ22Nt020896@zion.cs.uiuc.edu> <7F43E616-CAAE-4571-A7F2-0A5AC5A8791F@apple.com> Message-ID: <6FD9ACF7-6A37-473A-B7AE-4AB0C6F5B59B@apple.com> On May 12, 2008, at 1:01 PM, Dan Gohman wrote: >> +vector of integer >> result, of >> +identical type as the values being compared. The most significant >> bit in each >> +element is 1 if the element-wise comparison evaluates to true, and >> is 0 >> +otherwise. All other bits of the result are undefined. The >> condition codes >> +are evaluated identically to the 'icmp' >> +instruction. > > It would be neat to overload the existing fcmp and icmp instead of > introducing new instructions. But vicmp and vfcmp address a real > need today without requiring the codegen to perform a bunch of magic > on vectors of i1 to make this approach work well on current targets. > > Fortunately, nothing here rules out extending fcmp and icmp in the > future :-). Nate and I chatted about this, and decided the change would be really invasive. The issue is that the vcmp instructions actually return a vector of integers, not a vector of i1. This is pretty dissimilar to how icmp/fcmp works. -Chris From dalej at apple.com Mon May 12 15:33:57 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 12 May 2008 20:33:57 -0000 Subject: [llvm-commits] [llvm] r50999 - /llvm/trunk/lib/CodeGen/BranchFolding.cpp Message-ID: <200805122033.m4CKXvpU001380@zion.cs.uiuc.edu> Author: johannes Date: Mon May 12 15:33:57 2008 New Revision: 50999 URL: http://llvm.org/viewvc/llvm-project?rev=50999&view=rev Log: Further rework of tail merge algorithm. Not quite semantically identical, but little difference in either results or execution speed; but it's much easier to read, at least IMO. Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=50999&r1=50998&r2=50999&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original) +++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Mon May 12 15:33:57 2008 @@ -74,10 +74,13 @@ unsigned ComputeSameTails(unsigned CurHash, unsigned minCommonTailLength); void RemoveBlocksWithHash(unsigned CurHash, MachineBasicBlock* SuccBB, MachineBasicBlock* PredBB); + unsigned CreateCommonTailOnlyBlock(MachineBasicBlock *&PredBB, + unsigned maxCommonTailLength); typedef std::pair MergePotentialsElt; typedef std::vector::iterator MPIterator; std::vector MergePotentials; + typedef std::pair SameTailElt; std::vector SameTails; @@ -422,42 +425,6 @@ return Time; } -/// ShouldSplitFirstBlock - We need to either split MBB1 at MBB1I or MBB2 at -/// MBB2I and then insert an unconditional branch in the other block. Determine -/// which is the best to split -static bool ShouldSplitFirstBlock(MachineBasicBlock *MBB1, - MachineBasicBlock::iterator MBB1I, - MachineBasicBlock *MBB2, - MachineBasicBlock::iterator MBB2I, - MachineBasicBlock *PredBB) { - // If one block is the entry block, split the other one; we can't generate - // a branch to the entry block, as its label is not emitted. - MachineBasicBlock *Entry = MBB1->getParent()->begin(); - if (MBB1 == Entry) - return false; - if (MBB2 == Entry) - return true; - - // If one block falls through into the common successor, choose that - // one to split; it is one instruction less to do that. - if (PredBB) { - if (MBB1 == PredBB) - return true; - else if (MBB2 == PredBB) - return false; - } - // TODO: if we had some notion of which block was hotter, we could split - // the hot block, so it is the fall-through. Since we don't have profile info - // make a decision based on which will hurt most to split. - unsigned MBB1Time = EstimateRuntime(MBB1->begin(), MBB1I); - unsigned MBB2Time = EstimateRuntime(MBB2->begin(), MBB2I); - - // If the MBB1 prefix takes "less time" to run than the MBB2 prefix, split the - // MBB1 block so it falls through. This will penalize the MBB2 path, but will - // have a lower overall impact on the program execution. - return MBB1Time < MBB2Time; -} - // CurMBB needs to add an unconditional branch to SuccMBB (we removed these // branches temporarily for tail merging). In the case where CurMBB ends // with a conditional branch to the next block, optimize by reversing the @@ -565,6 +532,44 @@ } } +/// CreateCommonTailOnlyBlock - None of the blocks to be tail-merged consist +/// only of the common tail. Create a block that does by splitting one. +unsigned BranchFolder::CreateCommonTailOnlyBlock(MachineBasicBlock *&PredBB, + unsigned maxCommonTailLength) { + unsigned i, commonTailIndex; + unsigned TimeEstimate = ~0U; + for (i=0, commonTailIndex=0; isecond==PredBB) { + commonTailIndex = i; + break; + } + // Otherwise, make a (fairly bogus) choice based on estimate of + // how long it will take the various blocks to execute. + unsigned t = EstimateRuntime(SameTails[i].first->second->begin(), + SameTails[i].second); + if (t<=TimeEstimate) { + TimeEstimate = t; + commonTailIndex = i; + } + } + + MachineBasicBlock::iterator BBI = SameTails[commonTailIndex].second; + MachineBasicBlock *MBB = SameTails[commonTailIndex].first->second; + + DOUT << "\nSplitting " << MBB->getNumber() << ", size " << + maxCommonTailLength; + + MachineBasicBlock *newMBB = SplitMBBAt(*MBB, BBI); + SameTails[commonTailIndex].first->second = newMBB; + SameTails[commonTailIndex].second = newMBB->begin(); + // If we split PredBB, newMBB is the new predecessor. + if (PredBB==MBB) + PredBB = newMBB; + + return commonTailIndex; +} + // See if any of the blocks in MergePotentials (which all have a common single // successor, or all have no successor) can be tail-merged. If there is a // successor, any blocks in MergePotentials that are not tail-merged and @@ -575,10 +580,6 @@ bool BranchFolder::TryMergeBlocks(MachineBasicBlock *SuccBB, MachineBasicBlock* PredBB) { - // We cannot jump to the entry block, which affects various choices below. - MachineBasicBlock *Entry = MergePotentials.begin()->second-> - getParent()->begin(); - // It doesn't make sense to save a single instruction since tail merging // will add a jump. // FIXME: Ask the target to provide the threshold? @@ -608,78 +609,43 @@ } // If one of the blocks is the entire common tail (and not the entry - // block, which we can't jump to), treat all blocks with this same - // tail at once. - unsigned int i; - for (i=0; isecond-> + getParent()->begin(); + unsigned int commonTailIndex, i; + for (commonTailIndex=SameTails.size(), i=0; isecond; - if (MBB->begin() == SameTails[i].second && MBB != Entry) - break; - } - if (i!=SameTails.size()) { - MachineBasicBlock *MBB = SameTails[i].first->second; - // MBB is common tail. Adjust all other BB's to jump to this one. - // Traversal must be forwards so erases work. - DOUT << "\nUsing common tail " << MBB->getNumber() << " for "; - for (unsigned int j=0; jsecond->getNumber() << ","; - // Hack the end off BB j, making it jump to BB i instead. - ReplaceTailWithBranchTo(SameTails[j].second, MBB); - // This modifies BB j, so remove it from the worklist. - MergePotentials.erase(SameTails[j].first); + if (MBB->begin() == SameTails[i].second && MBB != EntryBB) { + commonTailIndex = i; + if (MBB==PredBB) + break; } - DOUT << "\n"; - // We leave i in the worklist in case there are other blocks that - // match it with a smaller number of instructions. - MadeChange = true; - continue; } - // Otherwise, merge the 2 blocks in SameTails that are latest in - // MergePotentials; these are at indices 0 and 1 in SameTails. - MachineBasicBlock::iterator BBI1 = (SameTails[0]).second; - MachineBasicBlock::iterator BBI2 = (SameTails[1]).second; - MachineBasicBlock *MBB1 = (SameTails[0]).first->second; - MachineBasicBlock *MBB2 = (SameTails[1]).first->second; - - DOUT << "\nMerging " << MBB1->getNumber() << "," << - MBB2->getNumber() << ", size " << maxCommonTailLength; - - // Neither block is the entire common tail; split the tail of one block - // to make it redundant with the other tail. We cannot jump to the - // entry block, so if one block is the entry block, split the other one. - - // The second half of the split block will remain in SameTails, and will - // consist entirely of common code. Thus in the case where there are - // multiple blocks that would all need to be split, the next iteration of - // the outer loop will handle all the rest of them. - - // Decide whether we want to split MBB1 or MBB2. - if (ShouldSplitFirstBlock(MBB1, BBI1, MBB2, BBI2, PredBB)) { - MBB1 = SplitMBBAt(*MBB1, BBI1); - BBI1 = MBB1->begin(); - SameTails[0].first->second = MBB1; - } else { - MBB2 = SplitMBBAt(*MBB2, BBI2); - BBI2 = MBB2->begin(); - SameTails[1].first->second = MBB2; - } - - if (MBB2->begin() == BBI2 && MBB2 != Entry) { - // Hack the end off MBB1, making it jump to MBB2 instead. - ReplaceTailWithBranchTo(BBI1, MBB2); - // This modifies MBB1, so remove it from the worklist. - MergePotentials.erase(SameTails[0].first); - } else { - assert(MBB1->begin() == BBI1 && MBB1 != Entry && - "Didn't split block correctly?"); - // Hack the end off MBB2, making it jump to MBB1 instead. - ReplaceTailWithBranchTo(BBI2, MBB1); - // This modifies MBB2, so remove it from the worklist. - MergePotentials.erase(SameTails[1].first); + if (commonTailIndex==SameTails.size()) { + // None of the blocks consist entirely of the common tail. + // Split a block so that one does. + commonTailIndex = CreateCommonTailOnlyBlock(PredBB, maxCommonTailLength); } + + MachineBasicBlock *MBB = SameTails[commonTailIndex].first->second; + // MBB is common tail. Adjust all other BB's to jump to this one. + // Traversal must be forwards so erases work. + DOUT << "\nUsing common tail " << MBB->getNumber() << " for "; + for (unsigned int i=0; isecond->getNumber() << ","; + // Hack the end off BB i, making it jump to BB commonTailIndex instead. + ReplaceTailWithBranchTo(SameTails[i].second, MBB); + // BB i is no longer a predecessor of SuccBB; remove it from the worklist. + MergePotentials.erase(SameTails[i].first); + } + DOUT << "\n"; + // We leave commonTailIndex in the worklist in case there are other blocks + // that match it with a smaller number of instructions. MadeChange = true; } return MadeChange; @@ -782,12 +748,11 @@ if (MergePotentials.size() >= 2) MadeChange |= TryMergeBlocks(I, PredBB); // Reinsert an unconditional branch if needed. - // The 1 below can be either an original single predecessor, or a result - // of removing blocks in TryMergeBlocks. + // The 1 below can occur as a result of removing blocks in TryMergeBlocks. PredBB = prior(I); // this may have been changed in TryMergeBlocks if (MergePotentials.size()==1 && - (MergePotentials.begin())->second != PredBB) - FixTail((MergePotentials.begin())->second, I, TII); + MergePotentials.begin()->second != PredBB) + FixTail(MergePotentials.begin()->second, I, TII); } } return MadeChange; @@ -827,7 +792,8 @@ /// bool BranchFolder::CanFallThrough(MachineBasicBlock *CurBB, bool BranchUnAnalyzable, - MachineBasicBlock *TBB, MachineBasicBlock *FBB, + MachineBasicBlock *TBB, + MachineBasicBlock *FBB, const std::vector &Cond) { MachineFunction::iterator Fallthrough = CurBB; ++Fallthrough; From natebegeman at mac.com Mon May 12 15:33:53 2008 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 12 May 2008 20:33:53 -0000 Subject: [llvm-commits] [llvm] r50998 - /llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200805122033.m4CKXrPZ001366@zion.cs.uiuc.edu> Author: sampo Date: Mon May 12 15:33:52 2008 New Revision: 50998 URL: http://llvm.org/viewvc/llvm-project?rev=50998&view=rev Log: Simplify some checks Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=50998&r1=50997&r2=50998&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon May 12 15:33:52 2008 @@ -818,7 +818,7 @@ if (OpTy->isFloatingPoint()) V = ConstantExpr::getFCmp(Record[3], Op0, Op1); - else if (OpTy->isInteger() || isa(OpTy)) + else if (!isa(OpTy)) V = ConstantExpr::getICmp(Record[3], Op0, Op1); else if (OpTy->isFPOrFPVector()) V = ConstantExpr::getVFCmp(Record[3], Op0, Op1); @@ -1359,10 +1359,10 @@ OpNum+1 != Record.size()) return Error("Invalid CMP record"); - if (LHS->getType()->isInteger() || isa(LHS->getType())) - I = new ICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, RHS); - else if (LHS->getType()->isFloatingPoint()) + if (LHS->getType()->isFloatingPoint()) I = new FCmpInst((FCmpInst::Predicate)Record[OpNum], LHS, RHS); + else if (!isa(LHS->getType())) + I = new ICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, RHS); else if (LHS->getType()->isFPOrFPVector()) I = new VFCmpInst((FCmpInst::Predicate)Record[OpNum], LHS, RHS); else From natebegeman at mac.com Mon May 12 15:34:32 2008 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 12 May 2008 20:34:32 -0000 Subject: [llvm-commits] [llvm] r51000 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86ISelLowering.h X86InstrSSE.td Message-ID: <200805122034.m4CKYXhG001415@zion.cs.uiuc.edu> Author: sampo Date: Mon May 12 15:34:32 2008 New Revision: 51000 URL: http://llvm.org/viewvc/llvm-project?rev=51000&view=rev Log: Initial X86 codegen support for VSETCC. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=51000&r1=50999&r2=51000&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon May 12 15:34:32 2008 @@ -530,6 +530,7 @@ setOperationAction(ISD::ROTL, (MVT::ValueType)VT, Expand); setOperationAction(ISD::ROTR, (MVT::ValueType)VT, Expand); setOperationAction(ISD::BSWAP, (MVT::ValueType)VT, Expand); + setOperationAction(ISD::VSETCC, (MVT::ValueType)VT, Expand); } if (Subtarget->hasMMX()) { @@ -614,6 +615,7 @@ setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v4f32, Custom); setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v4f32, Custom); setOperationAction(ISD::SELECT, MVT::v4f32, Custom); + setOperationAction(ISD::VSETCC, MVT::v4f32, Legal); } if (Subtarget->hasSSE2()) { @@ -639,6 +641,12 @@ setOperationAction(ISD::FSQRT, MVT::v2f64, Legal); setOperationAction(ISD::FNEG, MVT::v2f64, Custom); + setOperationAction(ISD::VSETCC, MVT::v2f64, Legal); + setOperationAction(ISD::VSETCC, MVT::v16i8, Legal); + setOperationAction(ISD::VSETCC, MVT::v8i16, Legal); + setOperationAction(ISD::VSETCC, MVT::v4i32, Legal); + setOperationAction(ISD::VSETCC, MVT::v2i64, Legal); + setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v16i8, Custom); setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v8i16, Custom); setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v8i16, Custom); @@ -686,6 +694,7 @@ setOperationAction(ISD::LOAD, MVT::v2i64, Legal); setOperationAction(ISD::SELECT, MVT::v2f64, Custom); setOperationAction(ISD::SELECT, MVT::v2i64, Custom); + } if (Subtarget->hasSSE41()) { Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=51000&r1=50999&r2=51000&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Mon May 12 15:34:32 2008 @@ -565,7 +565,6 @@ MachineBasicBlock *EmitAtomicMinMaxWithCustomInserter(MachineInstr *BInstr, MachineBasicBlock *BB, unsigned cmovOpc); - }; } Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=51000&r1=50999&r2=51000&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Mon May 12 15:34:32 2008 @@ -161,6 +161,22 @@ return getI32Imm(N->getValue() >> 3); }]>; +def SSE_CC_imm : SDNodeXFormget()) { + default: Val = 0; assert(0 && "Unexpected CondCode"); break; + case ISD::SETOEQ: Val = 0; break; + case ISD::SETOLT: Val = 1; break; + case ISD::SETOLE: Val = 2; break; + case ISD::SETUO: Val = 3; break; + case ISD::SETONE: Val = 4; break; + case ISD::SETOGE: Val = 5; break; + case ISD::SETOGT: Val = 6; break; + case ISD::SETO: Val = 7; break; + } + return getI8Imm(Val); +}]>; + // SHUFFLE_get_shuf_imm xform function: convert vector_shuffle mask to PSHUF*, // SHUFP* etc. imm. def SHUFFLE_get_shuf_imm : SDNodeXForm; + //===----------------------------------------------------------------------===// // SSE scalar FP Instructions //===----------------------------------------------------------------------===// @@ -855,16 +872,20 @@ let Constraints = "$src1 = $dst" in { def CMPPSrri : PSIi8<0xC2, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src, SSECC:$cc), - "cmp${cc}ps\t{$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse_cmp_ps VR128:$src1, - VR128:$src, imm:$cc))]>; + (outs VR128:$dst), (ins VR128:$src1, VR128:$src, SSECC:$cc), + "cmp${cc}ps\t{$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse_cmp_ps VR128:$src1, + VR128:$src, imm:$cc))]>; def CMPPSrmi : PSIi8<0xC2, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src, SSECC:$cc), - "cmp${cc}ps\t{$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse_cmp_ps VR128:$src1, - (load addr:$src), imm:$cc))]>; -} + (outs VR128:$dst), (ins VR128:$src1, f128mem:$src, SSECC:$cc), + "cmp${cc}ps\t{$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse_cmp_ps VR128:$src1, + (load addr:$src), imm:$cc))]>; +} +def : Pat<(v4i32 (vsetcc (v4f32 VR128:$src1), VR128:$src2, cond:$cc)), + (CMPPSrri VR128:$src1, VR128:$src2, (SSE_CC_imm cond:$cc))>; +def : Pat<(v4i32 (vsetcc (v4f32 VR128:$src1), (memop addr:$src2), cond:$cc)), + (CMPPSrmi VR128:$src1, addr:$src2, (SSE_CC_imm cond:$cc))>; // Shuffle and unpack instructions let Constraints = "$src1 = $dst" in { @@ -1675,13 +1696,17 @@ (outs VR128:$dst), (ins VR128:$src1, VR128:$src, SSECC:$cc), "cmp${cc}pd\t{$src, $dst|$dst, $src}", [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1, - VR128:$src, imm:$cc))]>; + VR128:$src, imm:$cc))]>; def CMPPDrmi : PDIi8<0xC2, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, f128mem:$src, SSECC:$cc), "cmp${cc}pd\t{$src, $dst|$dst, $src}", [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1, - (load addr:$src), imm:$cc))]>; + (load addr:$src), imm:$cc))]>; } +def : Pat<(v2i64 (vsetcc (v2f64 VR128:$src1), VR128:$src2, cond:$cc)), + (CMPPDrri VR128:$src1, VR128:$src2, (SSE_CC_imm cond:$cc))>; +def : Pat<(v2i64 (vsetcc (v2f64 VR128:$src1), (memop addr:$src2), cond:$cc)), + (CMPPDrmi VR128:$src1, addr:$src2, (SSE_CC_imm cond:$cc))>; // Shuffle and unpack instructions let Constraints = "$src1 = $dst" in { From isanbard at gmail.com Mon May 12 15:54:34 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 12 May 2008 20:54:34 -0000 Subject: [llvm-commits] [llvm] r51001 - in /llvm/trunk: include/llvm/Target/TargetInstrInfo.h lib/Target/X86/X86InstrInfo.cpp lib/Target/X86/X86InstrInfo.h Message-ID: <200805122054.m4CKsaL7015649@zion.cs.uiuc.edu> Author: void Date: Mon May 12 15:54:26 2008 New Revision: 51001 URL: http://llvm.org/viewvc/llvm-project?rev=51001&view=rev Log: Constify the machine instruction passed into the "is{Trivially,Really}ReMaterializable" methods. Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h llvm/trunk/lib/Target/X86/X86InstrInfo.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.h Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=51001&r1=51000&r2=51001&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Mon May 12 15:54:26 2008 @@ -67,7 +67,7 @@ /// isTriviallyReMaterializable - Return true if the instruction is trivially /// rematerializable, meaning it has no side effects and requires no operands /// that aren't always available. - bool isTriviallyReMaterializable(MachineInstr *MI) const { + bool isTriviallyReMaterializable(const MachineInstr *MI) const { return MI->getDesc().isRematerializable() && isReallyTriviallyReMaterializable(MI); } @@ -81,7 +81,7 @@ /// return false if the instruction has any side effects other than /// producing a value, or if it requres any address registers that are not /// always available. - virtual bool isReallyTriviallyReMaterializable(MachineInstr *MI) const { + virtual bool isReallyTriviallyReMaterializable(const MachineInstr *MI) const { return true; } Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=51001&r1=51000&r2=51001&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Mon May 12 15:54:26 2008 @@ -760,7 +760,8 @@ return TM.getSubtarget().GVRequiresExtraLoad(GV, TM, false); } -bool X86InstrInfo::isReallyTriviallyReMaterializable(MachineInstr *MI) const { +bool +X86InstrInfo::isReallyTriviallyReMaterializable(const MachineInstr *MI) const { switch (MI->getOpcode()) { default: break; case X86::MOV8rm: Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=51001&r1=51000&r2=51001&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Mon May 12 15:54:26 2008 @@ -260,7 +260,7 @@ unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const; unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const; - bool isReallyTriviallyReMaterializable(MachineInstr *MI) const; + bool isReallyTriviallyReMaterializable(const MachineInstr *MI) const; void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, const MachineInstr *Orig) const; From gohman at apple.com Mon May 12 16:31:11 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 12 May 2008 14:31:11 -0700 Subject: [llvm-commits] PATCH for PIC16 target. In-Reply-To: References: Message-ID: On May 8, 2008, at 5:13 AM, Sanjiv.Gupta at microchip.com wrote: > Please find attached files for Microchip's PIC16 backend. > These files are to be placed under a new directory lib/Target/PIC16. > Though the current PIC16 backend can handle few very elementary cases > for code generation, these files enable basic llvm framework for PIC16 > target. > > The code builds on linux/mingw platforms without warnings/errors. > > I will send a separate patch for configure. Ok, I've read through all the files. They look very straight-forward. I have a number of minor comments below, but these files look fine to check in whenever you're ready. Along the way I saw a reference to A5.1.3. Is this in a document that's publically available? Can you put a link to it somewhere? In PIC16RegisterInfo.cpp: > // This file contains the PIC16 implementation of the MRegisterInfo class. The code is right, but the comment still says MRegisterInfo. It should say TargetRegisterInfo. In PIC16TargetMachine.h: > #include "llvm/Target/TargetMachine.h" > #include "llvm/Target/TargetData.h" > #include "PIC16InstrInfo.h" > #include "PIC16Subtarget.h" > #include "PIC16ISelLowering.h" > #include "llvm/Target/TargetFrameInfo.h" Please sort the include-files by subdirectory. > namespace llvm { > > /// PIC16TargetMachine > /// > class PIC16TargetMachine : public LLVMTargetMachine { > PIC16Subtarget Subtarget; > [...] > }; > } // end namespace llvm Watch out for spacing. In PIC16AsmPrinter.cpp: > if (MO1.isRegister()) > { > if(strcmp(TM.getRegisterInfo()->get(MO1.getReg()).Name, "SP")==0) > { LLVM style has the opening brace on the same line as the if. In PIC16InstrInfo.h: > PIC16InstrInfo(PIC16TargetMachine &TM); This misses an explicit keyword. In PIC16RegisterInfo.h: > PIC16RegisterInfo(const TargetInstrInfo &tii); This misses an explicit keyword. In PIC16TargetAsmInfo.h: > PIC16TargetAsmInfo(const PIC16TargetMachine &TM); This misses an explicit keyword. Dan From isanbard at gmail.com Mon May 12 17:15:05 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 12 May 2008 22:15:05 -0000 Subject: [llvm-commits] [llvm] r51004 - /llvm/trunk/lib/CodeGen/PHIElimination.cpp Message-ID: <200805122215.m4CMF5AA004933@zion.cs.uiuc.edu> Author: void Date: Mon May 12 17:15:05 2008 New Revision: 51004 URL: http://llvm.org/viewvc/llvm-project?rev=51004&view=rev Log: Constify isSourceDefinedByImplicitDef function. Otherwise, just formatting changes that don't change functionality. Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=51004&r1=51003&r2=51004&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Mon May 12 17:15:05 2008 @@ -127,11 +127,11 @@ return true; } -static bool isSourceDefinedByImplicitDef(MachineInstr *MPhi, - MachineRegisterInfo *MRI) { +static bool isSourceDefinedByImplicitDef(const MachineInstr *MPhi, + const MachineRegisterInfo *MRI) { for (unsigned i = 1; i != MPhi->getNumOperands(); i += 2) { unsigned SrcReg = MPhi->getOperand(i).getReg(); - MachineInstr *DefMI = MRI->getVRegDef(SrcReg); + const MachineInstr *DefMI = MRI->getVRegDef(SrcReg); if (!DefMI || DefMI->getOpcode() != TargetInstrInfo::IMPLICIT_DEF) return false; } @@ -142,6 +142,7 @@ /// under the assuption that it needs to be lowered in a way that supports /// atomic execution of PHIs. This lowering method is always correct all of the /// time. +/// void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB, MachineBasicBlock::iterator AfterPHIsIt) { // Unlink the PHI node from the basic block, but don't delete the PHI yet. @@ -155,10 +156,9 @@ const TargetRegisterClass *RC = MF.getRegInfo().getRegClass(DestReg); unsigned IncomingReg = MF.getRegInfo().createVirtualRegister(RC); - // Insert a register to register copy in the top of the current block (but + // Insert a register to register copy at the top of the current block (but // after any remaining phi nodes) which copies the new incoming register // into the phi node destination. - // const TargetInstrInfo *TII = MF.getTarget().getInstrInfo(); if (isSourceDefinedByImplicitDef(MPhi, MRI)) // If all sources of a PHI node are implicit_def, just emit an implicit_def @@ -167,7 +167,7 @@ else TII->copyRegToReg(MBB, AfterPHIsIt, DestReg, IncomingReg, RC, RC); - // Update live variable information if there is any... + // Update live variable information if there is any. LiveVariables *LV = getAnalysisToUpdate(); if (LV) { MachineInstr *PHICopy = prior(AfterPHIsIt); @@ -177,15 +177,13 @@ // Add information to LiveVariables to know that the incoming value is // killed. Note that because the value is defined in several places (once - // each for each incoming block), the "def" block and instruction fields - // for the VarInfo is not filled in. - // + // each for each incoming block), the "def" block and instruction fields for + // the VarInfo is not filled in. LV->addVirtualRegisterKilled(IncomingReg, PHICopy); - // Since we are going to be deleting the PHI node, if it is the last use - // of any registers, or if the value itself is dead, we need to move this + // Since we are going to be deleting the PHI node, if it is the last use of + // any registers, or if the value itself is dead, we need to move this // information over to the new copy we just inserted. - // LV->removeVirtualRegistersKilled(MPhi); // If the result is dead, update LV. @@ -197,41 +195,39 @@ LV->getVarInfo(IncomingReg).UsedBlocks[MBB.getNumber()] = true; } - // Adjust the VRegPHIUseCount map to account for the removal of this PHI - // node. + // Adjust the VRegPHIUseCount map to account for the removal of this PHI node. for (unsigned i = 1; i != MPhi->getNumOperands(); i += 2) --VRegPHIUseCount[BBVRegPair(MPhi->getOperand(i + 1).getMBB(), MPhi->getOperand(i).getReg())]; - // Now loop over all of the incoming arguments, changing them to copy into - // the IncomingReg register in the corresponding predecessor basic block. - // + // Now loop over all of the incoming arguments, changing them to copy into the + // IncomingReg register in the corresponding predecessor basic block. SmallPtrSet MBBsInsertedInto; for (int i = NumSrcs - 1; i >= 0; --i) { unsigned SrcReg = MPhi->getOperand(i*2+1).getReg(); assert(TargetRegisterInfo::isVirtualRegister(SrcReg) && "Machine PHI Operands must all be virtual registers!"); - // If source is defined by an implicit def, there is no need to insert - // a copy unless it's the only source. + // If source is defined by an implicit def, there is no need to insert a + // copy unless it's the only source. MachineInstr *DefMI = MRI->getVRegDef(SrcReg); if (DefMI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF) { ImpDefs.insert(DefMI); continue; } - // Get the MachineBasicBlock equivalent of the BasicBlock that is the - // source path the PHI. + // Get the MachineBasicBlock equivalent of the BasicBlock that is the source + // path the PHI. MachineBasicBlock &opBlock = *MPhi->getOperand(i*2+2).getMBB(); // Check to make sure we haven't already emitted the copy for this block. - // This can happen because PHI nodes may have multiple entries for the - // same basic block. + // This can happen because PHI nodes may have multiple entries for the same + // basic block. if (!MBBsInsertedInto.insert(&opBlock)) continue; // If the copy has already been emitted, we're done. - // Find a safe location to insert the copy, this may be the first - // terminator in the block (or end()). + // Find a safe location to insert the copy, this may be the first terminator + // in the block (or end()). MachineBasicBlock::iterator InsertPos = opBlock.getFirstTerminator(); // Insert the copy. @@ -240,26 +236,24 @@ // Now update live variable information if we have it. Otherwise we're done if (!LV) continue; - // We want to be able to insert a kill of the register if this PHI - // (aka, the copy we just inserted) is the last use of the source - // value. Live variable analysis conservatively handles this by - // saying that the value is live until the end of the block the PHI - // entry lives in. If the value really is dead at the PHI copy, there - // will be no successor blocks which have the value live-in. - // - // Check to see if the copy is the last use, and if so, update the - // live variables information so that it knows the copy source - // instruction kills the incoming value. + // We want to be able to insert a kill of the register if this PHI (aka, the + // copy we just inserted) is the last use of the source value. Live + // variable analysis conservatively handles this by saying that the value is + // live until the end of the block the PHI entry lives in. If the value + // really is dead at the PHI copy, there will be no successor blocks which + // have the value live-in. // + // Check to see if the copy is the last use, and if so, update the live + // variables information so that it knows the copy source instruction kills + // the incoming value. LiveVariables::VarInfo &InRegVI = LV->getVarInfo(SrcReg); InRegVI.UsedBlocks[opBlock.getNumber()] = true; - // Loop over all of the successors of the basic block, checking to see - // if the value is either live in the block, or if it is killed in the - // block. Also check to see if this register is in use by another PHI - // node which has not yet been eliminated. If so, it will be killed - // at an appropriate point later. - // + // Loop over all of the successors of the basic block, checking to see if + // the value is either live in the block, or if it is killed in the block. + // Also check to see if this register is in use by another PHI node which + // has not yet been eliminated. If so, it will be killed at an appropriate + // point later. // Is it used by any PHI instructions in this block? bool ValueIsLive = VRegPHIUseCount[BBVRegPair(&opBlock, SrcReg)] != 0; @@ -316,12 +310,11 @@ } } - // Okay, if we now know that the value is not live out of the block, - // we can add a kill marker in this block saying that it kills the incoming - // value! + // Okay, if we now know that the value is not live out of the block, we can + // add a kill marker in this block saying that it kills the incoming value! if (!ValueIsLive) { // In our final twist, we have to decide which instruction kills the - // register. In most cases this is the copy, however, the first + // register. In most cases this is the copy, however, the first // terminator instruction at the end of the block may also use the value. // In this case, we should mark *it* as being the killing block, not the // copy. From dalej at apple.com Mon May 12 17:53:13 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 12 May 2008 22:53:13 -0000 Subject: [llvm-commits] [llvm] r51006 - /llvm/trunk/lib/CodeGen/BranchFolding.cpp Message-ID: <200805122253.m4CMrD8w014161@zion.cs.uiuc.edu> Author: johannes Date: Mon May 12 17:53:12 2008 New Revision: 51006 URL: http://llvm.org/viewvc/llvm-project?rev=51006&view=rev Log: Be more aggressive about tail-merging small blocks if those blocks consist entirely of common instructions; merging will not add an extra branch in this case. Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=51006&r1=51005&r2=51006&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original) +++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Mon May 12 17:53:12 2008 @@ -495,7 +495,18 @@ CurMPIter->second, I->second, TrialBBI1, TrialBBI2); - if (CommonTailLen >= minCommonTailLength) { + // If we will have to split a block, there should be at least + // minCommonTailLength instructions in common; if not, at worst + // we will be replacing a fallthrough into the common tail with a + // branch, which at worst breaks even with falling through into + // the duplicated common tail, so 1 instruction in common is enough. + // We will always pick a block we do not have to split as the common + // tail if there is one. + // (Empty blocks will get forwarded and need not be considered.) + if (CommonTailLen >= minCommonTailLength || + (CommonTailLen > 0 && + (TrialBBI1==CurMPIter->second->begin() || + TrialBBI2==I->second->begin()))) { if (CommonTailLen > maxCommonTailLength) { SameTails.clear(); maxCommonTailLength = CommonTailLen; From dalej at apple.com Mon May 12 17:59:55 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 12 May 2008 22:59:55 -0000 Subject: [llvm-commits] [llvm] r51007 - /llvm/trunk/test/CodeGen/X86/2008-05-12-tailmerge-5.ll Message-ID: <200805122259.m4CMxtVE015970@zion.cs.uiuc.edu> Author: johannes Date: Mon May 12 17:59:44 2008 New Revision: 51007 URL: http://llvm.org/viewvc/llvm-project?rev=51007&view=rev Log: New test for tail merging Added: llvm/trunk/test/CodeGen/X86/2008-05-12-tailmerge-5.ll Added: llvm/trunk/test/CodeGen/X86/2008-05-12-tailmerge-5.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-05-12-tailmerge-5.ll?rev=51007&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-05-12-tailmerge-5.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-05-12-tailmerge-5.ll Mon May 12 17:59:44 2008 @@ -0,0 +1,145 @@ +; RUN: llvm-as < %s | llc | grep abort | count 1 +; Calls to abort should all be merged + +; ModuleID = '5898899.c' +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" +target triple = "x86_64-apple-darwin8" + %struct.BoundaryAlignment = type { [3 x i8], i8, i16, i16, i8, [2 x i8] } + +define void @passing2(i64 %str.0, i64 %str.1, i16 signext %s, i32 %j, i8 signext %c, i16 signext %t, i16 signext %u, i8 signext %d) nounwind { +entry: + %str_addr = alloca %struct.BoundaryAlignment ; <%struct.BoundaryAlignment*> [#uses=7] + %s_addr = alloca i16 ; [#uses=1] + %j_addr = alloca i32 ; [#uses=2] + %c_addr = alloca i8 ; [#uses=2] + %t_addr = alloca i16 ; [#uses=2] + %u_addr = alloca i16 ; [#uses=2] + %d_addr = alloca i8 ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %tmp = bitcast %struct.BoundaryAlignment* %str_addr to { i64, i64 }* ; <{ i64, i64 }*> [#uses=1] + %tmp1 = getelementptr { i64, i64 }* %tmp, i32 0, i32 0 ; [#uses=1] + store i64 %str.0, i64* %tmp1 + %tmp2 = bitcast %struct.BoundaryAlignment* %str_addr to { i64, i64 }* ; <{ i64, i64 }*> [#uses=1] + %tmp3 = getelementptr { i64, i64 }* %tmp2, i32 0, i32 1 ; [#uses=1] + %bc = bitcast i64* %tmp3 to i8* ; [#uses=2] + %byte = trunc i64 %str.1 to i8 ; [#uses=1] + store i8 %byte, i8* %bc + %shft = lshr i64 %str.1, 8 ; [#uses=2] + %Loc = getelementptr i8* %bc, i32 1 ; [#uses=2] + %byte4 = trunc i64 %shft to i8 ; [#uses=1] + store i8 %byte4, i8* %Loc + %shft5 = lshr i64 %shft, 8 ; [#uses=2] + %Loc6 = getelementptr i8* %Loc, i32 1 ; [#uses=2] + %byte7 = trunc i64 %shft5 to i8 ; [#uses=1] + store i8 %byte7, i8* %Loc6 + %shft8 = lshr i64 %shft5, 8 ; [#uses=2] + %Loc9 = getelementptr i8* %Loc6, i32 1 ; [#uses=2] + %byte10 = trunc i64 %shft8 to i8 ; [#uses=1] + store i8 %byte10, i8* %Loc9 + %shft11 = lshr i64 %shft8, 8 ; [#uses=0] + %Loc12 = getelementptr i8* %Loc9, i32 1 ; [#uses=0] + store i16 %s, i16* %s_addr + store i32 %j, i32* %j_addr + store i8 %c, i8* %c_addr + store i16 %t, i16* %t_addr + store i16 %u, i16* %u_addr + store i8 %d, i8* %d_addr + %tmp13 = getelementptr %struct.BoundaryAlignment* %str_addr, i32 0, i32 0 ; <[3 x i8]*> [#uses=1] + %tmp1314 = bitcast [3 x i8]* %tmp13 to i32* ; [#uses=1] + %tmp15 = load i32* %tmp1314, align 4 ; [#uses=1] + %tmp16 = shl i32 %tmp15, 14 ; [#uses=1] + %tmp17 = ashr i32 %tmp16, 23 ; [#uses=1] + %tmp1718 = trunc i32 %tmp17 to i16 ; [#uses=1] + %sextl = shl i16 %tmp1718, 7 ; [#uses=1] + %sextr = ashr i16 %sextl, 7 ; [#uses=2] + %sextl19 = shl i16 %sextr, 7 ; [#uses=1] + %sextr20 = ashr i16 %sextl19, 7 ; [#uses=0] + %sextl21 = shl i16 %sextr, 7 ; [#uses=1] + %sextr22 = ashr i16 %sextl21, 7 ; [#uses=1] + %sextr2223 = sext i16 %sextr22 to i32 ; [#uses=1] + %tmp24 = load i32* %j_addr, align 4 ; [#uses=1] + %tmp25 = icmp ne i32 %sextr2223, %tmp24 ; [#uses=1] + %tmp2526 = zext i1 %tmp25 to i8 ; [#uses=1] + %toBool = icmp ne i8 %tmp2526, 0 ; [#uses=1] + br i1 %toBool, label %bb, label %bb27 + +bb: ; preds = %entry + call void (...)* @abort( ) noreturn nounwind + unreachable + +bb27: ; preds = %entry + %tmp28 = getelementptr %struct.BoundaryAlignment* %str_addr, i32 0, i32 1 ; [#uses=1] + %tmp29 = load i8* %tmp28, align 4 ; [#uses=1] + %tmp30 = load i8* %c_addr, align 1 ; [#uses=1] + %tmp31 = icmp ne i8 %tmp29, %tmp30 ; [#uses=1] + %tmp3132 = zext i1 %tmp31 to i8 ; [#uses=1] + %toBool33 = icmp ne i8 %tmp3132, 0 ; [#uses=1] + br i1 %toBool33, label %bb34, label %bb35 + +bb34: ; preds = %bb27 + call void (...)* @abort( ) noreturn nounwind + unreachable + +bb35: ; preds = %bb27 + %tmp36 = getelementptr %struct.BoundaryAlignment* %str_addr, i32 0, i32 2 ; [#uses=1] + %tmp37 = load i16* %tmp36, align 4 ; [#uses=1] + %tmp38 = shl i16 %tmp37, 7 ; [#uses=1] + %tmp39 = ashr i16 %tmp38, 7 ; [#uses=1] + %sextl40 = shl i16 %tmp39, 7 ; [#uses=1] + %sextr41 = ashr i16 %sextl40, 7 ; [#uses=2] + %sextl42 = shl i16 %sextr41, 7 ; [#uses=1] + %sextr43 = ashr i16 %sextl42, 7 ; [#uses=0] + %sextl44 = shl i16 %sextr41, 7 ; [#uses=1] + %sextr45 = ashr i16 %sextl44, 7 ; [#uses=1] + %tmp46 = load i16* %t_addr, align 2 ; [#uses=1] + %tmp47 = icmp ne i16 %sextr45, %tmp46 ; [#uses=1] + %tmp4748 = zext i1 %tmp47 to i8 ; [#uses=1] + %toBool49 = icmp ne i8 %tmp4748, 0 ; [#uses=1] + br i1 %toBool49, label %bb50, label %bb51 + +bb50: ; preds = %bb35 + call void (...)* @abort( ) noreturn nounwind + unreachable + +bb51: ; preds = %bb35 + %tmp52 = getelementptr %struct.BoundaryAlignment* %str_addr, i32 0, i32 3 ; [#uses=1] + %tmp53 = load i16* %tmp52, align 4 ; [#uses=1] + %tmp54 = shl i16 %tmp53, 7 ; [#uses=1] + %tmp55 = ashr i16 %tmp54, 7 ; [#uses=1] + %sextl56 = shl i16 %tmp55, 7 ; [#uses=1] + %sextr57 = ashr i16 %sextl56, 7 ; [#uses=2] + %sextl58 = shl i16 %sextr57, 7 ; [#uses=1] + %sextr59 = ashr i16 %sextl58, 7 ; [#uses=0] + %sextl60 = shl i16 %sextr57, 7 ; [#uses=1] + %sextr61 = ashr i16 %sextl60, 7 ; [#uses=1] + %tmp62 = load i16* %u_addr, align 2 ; [#uses=1] + %tmp63 = icmp ne i16 %sextr61, %tmp62 ; [#uses=1] + %tmp6364 = zext i1 %tmp63 to i8 ; [#uses=1] + %toBool65 = icmp ne i8 %tmp6364, 0 ; [#uses=1] + br i1 %toBool65, label %bb66, label %bb67 + +bb66: ; preds = %bb51 + call void (...)* @abort( ) noreturn nounwind + unreachable + +bb67: ; preds = %bb51 + %tmp68 = getelementptr %struct.BoundaryAlignment* %str_addr, i32 0, i32 4 ; [#uses=1] + %tmp69 = load i8* %tmp68, align 4 ; [#uses=1] + %tmp70 = load i8* %d_addr, align 1 ; [#uses=1] + %tmp71 = icmp ne i8 %tmp69, %tmp70 ; [#uses=1] + %tmp7172 = zext i1 %tmp71 to i8 ; [#uses=1] + %toBool73 = icmp ne i8 %tmp7172, 0 ; [#uses=1] + br i1 %toBool73, label %bb74, label %bb75 + +bb74: ; preds = %bb67 + call void (...)* @abort( ) noreturn nounwind + unreachable + +bb75: ; preds = %bb67 + br label %return + +return: ; preds = %bb75 + ret void +} + +declare void @abort(...) noreturn nounwind From evan.cheng at apple.com Mon May 12 18:04:08 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 12 May 2008 23:04:08 -0000 Subject: [llvm-commits] [llvm] r51008 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/TargetLowering.cpp lib/Target/X86/README-SSE.txt lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/combine-lds.ll Message-ID: <200805122304.m4CN49MH018589@zion.cs.uiuc.edu> Author: evancheng Date: Mon May 12 18:04:07 2008 New Revision: 51008 URL: http://llvm.org/viewvc/llvm-project?rev=51008&view=rev Log: Xform bitconvert(build_pair(load a, load b)) to a single load if the load locations are at the right offset from each other. Added: llvm/trunk/test/CodeGen/X86/combine-lds.ll Modified: llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp llvm/trunk/lib/Target/X86/README-SSE.txt llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=51008&r1=51007&r2=51008&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Mon May 12 18:04:07 2008 @@ -691,7 +691,7 @@ /// loading 'Bytes' bytes from a location that is 'Dist' units away from the /// location that the 'Base' load is loading from. bool isConsecutiveLoad(SDNode *LD, SDNode *Base, unsigned Bytes, int Dist, - MachineFrameInfo *MFI) const; + const MachineFrameInfo *MFI) const; /// PerformDAGCombine - This method will be invoked for all target nodes and /// for any target-independent nodes that the target has registered with Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=51008&r1=51007&r2=51008&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon May 12 18:04:07 2008 @@ -177,6 +177,7 @@ SDOperand visitSIGN_EXTEND_INREG(SDNode *N); SDOperand visitTRUNCATE(SDNode *N); SDOperand visitBIT_CONVERT(SDNode *N); + SDOperand visitBUILD_PAIR(SDNode *N); SDOperand visitFADD(SDNode *N); SDOperand visitFSUB(SDNode *N); SDOperand visitFMUL(SDNode *N); @@ -217,6 +218,7 @@ ISD::CondCode Cond, bool foldBooleans = true); SDOperand SimplifyNodeWithTwoResults(SDNode *N, unsigned LoOp, unsigned HiOp); + SDOperand CombineConsecutiveLoads(SDNode *N, MVT::ValueType VT); SDOperand ConstantFoldBIT_CONVERTofBUILD_VECTOR(SDNode *, MVT::ValueType); SDOperand BuildSDIV(SDNode *N); SDOperand BuildUDIV(SDNode *N); @@ -710,6 +712,7 @@ case ISD::SIGN_EXTEND_INREG: return visitSIGN_EXTEND_INREG(N); case ISD::TRUNCATE: return visitTRUNCATE(N); case ISD::BIT_CONVERT: return visitBIT_CONVERT(N); + case ISD::BUILD_PAIR: return visitBUILD_PAIR(N); case ISD::FADD: return visitFADD(N); case ISD::FSUB: return visitFSUB(N); case ISD::FMUL: return visitFMUL(N); @@ -3356,6 +3359,40 @@ return ReduceLoadWidth(N); } +static SDNode *getBuildPairElt(SDNode *N, unsigned i) { + SDOperand Elt = N->getOperand(i); + if (Elt.getOpcode() != ISD::MERGE_VALUES) + return Elt.Val; + return Elt.getOperand(Elt.ResNo).Val; +} + +/// CombineConsecutiveLoads - build_pair (load, load) -> load +/// if load locations are consecutive. +SDOperand DAGCombiner::CombineConsecutiveLoads(SDNode *N, MVT::ValueType VT) { + assert(N->getOpcode() == ISD::BUILD_PAIR); + + SDNode *LD1 = getBuildPairElt(N, 0); + if (!ISD::isNON_EXTLoad(LD1) || !LD1->hasOneUse()) + return SDOperand(); + MVT::ValueType LD1VT = LD1->getValueType(0); + SDNode *LD2 = getBuildPairElt(N, 1); + const MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo(); + if (ISD::isNON_EXTLoad(LD2) && + LD2->hasOneUse() && + TLI.isConsecutiveLoad(LD2, LD1, MVT::getSizeInBits(LD1VT)/8, 1, MFI)) { + LoadSDNode *LD = cast(LD1); + unsigned Align = LD->getAlignment(); + unsigned NewAlign = TLI.getTargetMachine().getTargetData()-> + getABITypeAlignment(MVT::getTypeForValueType(VT)); + if ((!AfterLegalize || TLI.isTypeLegal(VT)) && + TLI.isOperationLegal(ISD::LOAD, VT) && NewAlign <= Align) + return DAG.getLoad(VT, LD->getChain(), LD->getBasePtr(), + LD->getSrcValue(), LD->getSrcValueOffset(), + LD->isVolatile(), Align); + } + return SDOperand(); +} + SDOperand DAGCombiner::visitBIT_CONVERT(SDNode *N) { SDOperand N0 = N->getOperand(0); MVT::ValueType VT = N->getValueType(0); @@ -3463,10 +3500,22 @@ return DAG.getNode(ISD::OR, VT, X, Cst); } + + // bitconvert(build_pair(ld, ld)) -> ld iff load locations are consecutive. + if (N0.getOpcode() == ISD::BUILD_PAIR) { + SDOperand CombineLD = CombineConsecutiveLoads(N0.Val, VT); + if (CombineLD.Val) + return CombineLD; + } return SDOperand(); } +SDOperand DAGCombiner::visitBUILD_PAIR(SDNode *N) { + MVT::ValueType VT = N->getValueType(0); + return CombineConsecutiveLoads(N, VT); +} + /// ConstantFoldBIT_CONVERTofBUILD_VECTOR - We know that BV is a build_vector /// node with Constant, ConstantFP or Undef operands. DstEltVT indicates the /// destination element value type. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=51008&r1=51007&r2=51008&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon May 12 18:04:07 2008 @@ -1514,7 +1514,7 @@ /// location that the 'Base' load is loading from. bool TargetLowering::isConsecutiveLoad(SDNode *LD, SDNode *Base, unsigned Bytes, int Dist, - MachineFrameInfo *MFI) const { + const MachineFrameInfo *MFI) const { if (LD->getOperand(0).Val != Base->getOperand(0).Val) return false; MVT::ValueType VT = LD->getValueType(0); Modified: llvm/trunk/lib/Target/X86/README-SSE.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README-SSE.txt?rev=51008&r1=51007&r2=51008&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/README-SSE.txt (original) +++ llvm/trunk/lib/Target/X86/README-SSE.txt Mon May 12 18:04:07 2008 @@ -428,60 +428,6 @@ //===---------------------------------------------------------------------===// -Consider (PR2108): - -#include -__m128i doload64(unsigned long long x) { return _mm_loadl_epi64(&x);} -__m128i doload64_2(unsigned long long *x) { return _mm_loadl_epi64(x);} - -These are very similar routines, but we generate significantly worse code for -the first one on x86-32: - -_doload64: - subl $12, %esp - movl 20(%esp), %eax - movl %eax, 4(%esp) - movl 16(%esp), %eax - movl %eax, (%esp) - movsd (%esp), %xmm0 - addl $12, %esp - ret -_doload64_2: - movl 4(%esp), %eax - movsd (%eax), %xmm0 - ret - -The problem is that the argument lowering logic splits the i64 argument into -2x i32 loads early, the f64 insert doesn't match. Here's a reduced testcase: - -define fastcc double @doload64(i64 %x) nounwind { -entry: - %tmp717 = bitcast i64 %x to double ; [#uses=1] - ret double %tmp717 -} - -compiles to: - -_doload64: - subl $12, %esp - movl 20(%esp), %eax - movl %eax, 4(%esp) - movl 16(%esp), %eax - movl %eax, (%esp) - movsd (%esp), %xmm0 - addl $12, %esp - ret - -instead of movsd from the stack. This is actually not too bad to implement. The -best way to do this is to implement a dag combine that turns -bitconvert(build_pair(load a, load b)) into one load of the right type. The -only trick to this is writing the predicate that determines that a/b are at the -right offset from each other. For the enterprising hacker, InferAlignment is a -helpful place to start poking if interested. - - -//===---------------------------------------------------------------------===// - __m128d test1( __m128d A, __m128d B) { return _mm_shuffle_pd(A, B, 0x3); } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=51008&r1=51007&r2=51008&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon May 12 18:04:07 2008 @@ -6285,13 +6285,7 @@ LD->getAlignment()); } -static SDNode *getBuildPairElt(SDNode *N, unsigned i) { - SDOperand Elt = N->getOperand(i); - if (Elt.getOpcode() != ISD::MERGE_VALUES) - return Elt.Val; - return Elt.getOperand(Elt.ResNo).Val; -} - +/// PerformBuildVectorCombine - build_vector 0,(load i64 / f64) -> movq / movsd. static SDOperand PerformBuildVectorCombine(SDNode *N, SelectionDAG &DAG, const X86Subtarget *Subtarget, const TargetLowering &TLI) { @@ -6312,25 +6306,17 @@ return SDOperand(); // Value must be a load. - MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo(); SDNode *Base = N->getOperand(0).Val; if (!isa(Base)) { - if (Base->getOpcode() == ISD::BIT_CONVERT) - Base = Base->getOperand(0).Val; - if (Base->getOpcode() != ISD::BUILD_PAIR) - return SDOperand(); - SDNode *Pair = Base; - Base = getBuildPairElt(Pair, 0); - if (!ISD::isNON_EXTLoad(Base)) + if (Base->getOpcode() != ISD::BIT_CONVERT) return SDOperand(); - SDNode *NextLD = getBuildPairElt(Pair, 1); - if (!ISD::isNON_EXTLoad(NextLD) || - !TLI.isConsecutiveLoad(NextLD, Base, 4/*32 bits*/, 1, MFI)) + Base = Base->getOperand(0).Val; + if (!isa(Base)) return SDOperand(); } - LoadSDNode *LD = cast(Base); // Transform it into VZEXT_LOAD addr. + LoadSDNode *LD = cast(Base); return DAG.getNode(X86ISD::VZEXT_LOAD, VT, LD->getChain(), LD->getBasePtr()); } Added: llvm/trunk/test/CodeGen/X86/combine-lds.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/combine-lds.ll?rev=51008&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/combine-lds.ll (added) +++ llvm/trunk/test/CodeGen/X86/combine-lds.ll Mon May 12 18:04:07 2008 @@ -0,0 +1,7 @@ +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movsd +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep mov | count 1 + +define fastcc double @doload64(i64 %x) nounwind { + %tmp717 = bitcast i64 %x to double + ret double %tmp717 +} From natebegeman at mac.com Mon May 12 18:09:44 2008 From: natebegeman at mac.com (Nate Begeman) Date: Mon, 12 May 2008 23:09:44 -0000 Subject: [llvm-commits] [llvm] r51009 - in /llvm/trunk/lib: CodeGen/SelectionDAG/LegalizeDAG.cpp Target/X86/X86InstrSSE.td Message-ID: <200805122309.m4CN9igt019796@zion.cs.uiuc.edu> Author: sampo Date: Mon May 12 18:09:43 2008 New Revision: 51009 URL: http://llvm.org/viewvc/llvm-project?rev=51009&view=rev Log: Teach Legalize how to scalarize VSETCC Teach X86 a few more vsetcc patterns. Custom lowering for unsupported ones is next. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=51009&r1=51008&r2=51009&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon May 12 18:09:43 2008 @@ -7117,6 +7117,16 @@ ScalarizeVectorOp(Op.getOperand(1)), ScalarizeVectorOp(Op.getOperand(2))); break; + case ISD::VSETCC: { + SDOperand Op0 = ScalarizeVectorOp(Op.getOperand(0)); + SDOperand Op1 = ScalarizeVectorOp(Op.getOperand(1)); + Result = DAG.getNode(ISD::SETCC, TLI.getSetCCResultType(Op0), Op0, Op1, + Op.getOperand(2)); + Result = DAG.getNode(ISD::SELECT, NewVT, Result, + DAG.getConstant(-1ULL, NewVT), + DAG.getConstant(0ULL, NewVT)); + break; + } } if (TLI.isTypeLegal(NewVT)) Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=51009&r1=51008&r2=51009&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Mon May 12 18:09:43 2008 @@ -1966,6 +1966,33 @@ defm PCMPGTW : PDI_binop_rm_int<0x65, "pcmpgtw", int_x86_sse2_pcmpgt_w>; defm PCMPGTD : PDI_binop_rm_int<0x66, "pcmpgtd", int_x86_sse2_pcmpgt_d>; +def : Pat<(v16i8 (vsetcc (v16i8 VR128:$src1), VR128:$src2, SETEQ)), + (PCMPEQBrr VR128:$src1, VR128:$src2)>; +def : Pat<(v16i8 (vsetcc (v16i8 VR128:$src1), (memop addr:$src2), SETEQ)), + (PCMPEQBrm VR128:$src1, addr:$src2)>; +def : Pat<(v8i16 (vsetcc (v8i16 VR128:$src1), VR128:$src2, SETEQ)), + (PCMPEQWrr VR128:$src1, VR128:$src2)>; +def : Pat<(v8i16 (vsetcc (v8i16 VR128:$src1), (memop addr:$src2), SETEQ)), + (PCMPEQWrm VR128:$src1, addr:$src2)>; +def : Pat<(v4i32 (vsetcc (v4i32 VR128:$src1), VR128:$src2, SETEQ)), + (PCMPEQDrr VR128:$src1, VR128:$src2)>; +def : Pat<(v4i32 (vsetcc (v4i32 VR128:$src1), (memop addr:$src2), SETEQ)), + (PCMPEQDrm VR128:$src1, addr:$src2)>; + +def : Pat<(v16i8 (vsetcc (v16i8 VR128:$src1), VR128:$src2, SETGT)), + (PCMPGTBrr VR128:$src1, VR128:$src2)>; +def : Pat<(v16i8 (vsetcc (v16i8 VR128:$src1), (memop addr:$src2), SETGT)), + (PCMPGTBrm VR128:$src1, addr:$src2)>; +def : Pat<(v8i16 (vsetcc (v8i16 VR128:$src1), VR128:$src2, SETGT)), + (PCMPGTWrr VR128:$src1, VR128:$src2)>; +def : Pat<(v8i16 (vsetcc (v8i16 VR128:$src1), (memop addr:$src2), SETGT)), + (PCMPGTWrm VR128:$src1, addr:$src2)>; +def : Pat<(v4i32 (vsetcc (v4i32 VR128:$src1), VR128:$src2, SETGT)), + (PCMPGTDrr VR128:$src1, VR128:$src2)>; +def : Pat<(v4i32 (vsetcc (v4i32 VR128:$src1), (memop addr:$src2), SETGT)), + (PCMPGTDrm VR128:$src1, addr:$src2)>; + + // Pack instructions defm PACKSSWB : PDI_binop_rm_int<0x63, "packsswb", int_x86_sse2_packsswb_128>; defm PACKSSDW : PDI_binop_rm_int<0x6B, "packssdw", int_x86_sse2_packssdw_128>; From isanbard at gmail.com Mon May 12 18:30:33 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 12 May 2008 23:30:33 -0000 Subject: [llvm-commits] [test-suite] r51010 - /test-suite/trunk/Makefile.programs Message-ID: <200805122330.m4CNUYwo001395@zion.cs.uiuc.edu> Author: void Date: Mon May 12 18:30:30 2008 New Revision: 51010 URL: http://llvm.org/viewvc/llvm-project?rev=51010&view=rev Log: Enable MachineLICM for the beta tester. Modified: test-suite/trunk/Makefile.programs Modified: test-suite/trunk/Makefile.programs URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=51010&r1=51009&r2=51010&view=diff ============================================================================== --- test-suite/trunk/Makefile.programs (original) +++ test-suite/trunk/Makefile.programs Mon May 12 18:30:30 2008 @@ -205,9 +205,9 @@ endif#DISABLE_DIFFS ifeq ($(ARCH),PowerPC) -LLCBETAOPTION := -enable-sinking +LLCBETAOPTION := -machine-licm +#-enable-sinking #-coalescer-commute-instrs -#-machine-licm #--enable-tail-merge #--enable-ppc-preinc #-regalloc=local -fast @@ -220,7 +220,8 @@ LLCBETAOPTION := -sched=simple endif ifeq ($(ARCH),x86) -LLCBETAOPTION := -schedule-livein-copies +LLCBETAOPTION := -machine-licm +#-schedule-livein-copies #-align-loops=false #-enable-sinking #-coalescer-commute-instrs From gohman at apple.com Mon May 12 18:38:43 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 12 May 2008 23:38:43 -0000 Subject: [llvm-commits] [llvm] r51011 - /llvm/trunk/docs/LangRef.html Message-ID: <200805122338.m4CNch0x004484@zion.cs.uiuc.edu> Author: djg Date: Mon May 12 18:38:42 2008 New Revision: 51011 URL: http://llvm.org/viewvc/llvm-project?rev=51011&view=rev Log: Fix a malformed %gt; Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=51011&r1=51010&r2=51011&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Mon May 12 18:38:42 2008 @@ -2682,7 +2682,7 @@

        Syntax:
        -  <result> = insertelement <n x <ty>> <val>, <ty> <elt>, i32 <idx>    ; yields <n x <ty>>
        +  <result> = insertelement <n x <ty>> <val>, <ty> <elt>, i32 <idx>    ; yields <n x <ty>>
         
        Overview:
        From gohman at apple.com Mon May 12 18:51:09 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 12 May 2008 23:51:09 -0000 Subject: [llvm-commits] [llvm] r51013 - /llvm/trunk/docs/LangRef.html Message-ID: <200805122351.m4CNp9ss007522@zion.cs.uiuc.edu> Author: djg Date: Mon May 12 18:51:09 2008 New Revision: 51013 URL: http://llvm.org/viewvc/llvm-project?rev=51013&view=rev Log: Initial documentation for first-class aggregates changes. Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=51013&r1=51012&r2=51013&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Mon May 12 18:51:09 2008 @@ -111,6 +111,12 @@
      3. 'shufflevector' Instruction
      +
    11. Aggregate Operations +
        +
      1. 'extractvalue' Instruction
      2. +
      3. 'insertvalue' Instruction
      4. +
      +
    12. Memory Access and Addressing Operations
      1. 'malloc' Instruction
      2. @@ -1030,6 +1036,8 @@ floating point, pointer, vector + structure, + array, @@ -2775,6 +2783,114 @@ + +
        + +

        LLVM supports several instructions for working with aggregate values. +

        + +
        + + + + +
        + +
        Syntax:
        + +
        +  <result> = extractvalue <aggregate type> <val>, <idx>{, <idx>}*
        +
        + +
        Overview:
        + +

        +The 'extractvalue' instruction extracts a value +from an aggregate value. +

        + + +
        Arguments:
        + +

        +The first operand of an 'extractvalue' instruction is a +value of struct or array +type. The operands are constant indicies to specify which value to extract +in the same manner as indicies in a +'getelementptr' instruction. +

        + +
        Semantics:
        + +

        +The result is the value at the position in the aggregate specified by +the index operands. +

        + +
        Example:
        + +
        +  %result = extractvalue {i32, float} %agg, i32 0    ; yields i32
        +
        +
        + + + + + +
        + +
        Syntax:
        + +
        +  <result> = insertvalue <aggregate type> <val>, <ty> <val>, i32 <idx>    ; yields <n x <ty>>
        +
        + +
        Overview:
        + +

        +The 'insertvalue' instruction inserts a value +into a aggregate. +

        + + +
        Arguments:
        + +

        +The first operand of an 'insertvalue' instruction is a +value of struct or array type. +The second operand is a first-class value to insert. +type of the first operand. The following operands are constant indicies +indicating the position at which to insert the value in the same manner as +indicies in a +'getelementptr' instruction. +The value to insert must have the same type as the value identified +by the indicies. + +

        Semantics:
        + +

        +The result is an aggregate of the same type as val. Its +value is that of val except that the value at the position +specified by the indicies is that of elt. +

        + +
        Example:
        + +
        +  %result = insertvalue {i32, float} %agg, i32 1, i32 0    ; yields {i32, float}
        +
        +
        + + + + From kremenek at apple.com Mon May 12 18:57:31 2008 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 12 May 2008 23:57:31 -0000 Subject: [llvm-commits] [llvm] r51015 - /llvm/tags/checker/checker-27/ Message-ID: <200805122357.m4CNvVfG008314@zion.cs.uiuc.edu> Author: kremenek Date: Mon May 12 18:57:31 2008 New Revision: 51015 URL: http://llvm.org/viewvc/llvm-project?rev=51015&view=rev Log: Tagging checker-27. Added: llvm/tags/checker/checker-27/ - copied from r51014, llvm/trunk/ From gohman at apple.com Mon May 12 19:00:26 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 May 2008 00:00:26 -0000 Subject: [llvm-commits] [llvm] r51017 - in /llvm/trunk/lib: Analysis/ Analysis/IPA/ Archive/ Bitcode/Writer/ CodeGen/ CodeGen/SelectionDAG/ ExecutionEngine/Interpreter/ ExecutionEngine/JIT/ Support/ System/Unix/ Target/ Target/ARM/ Target/Alpha/ Target/CBackend/ Target/CellSPU/ Target/CppBackend/ Target/IA64/ Target/MSIL/ Target/Mips/ Target/PowerPC/ Target/Sparc/ Target/X86/ Transforms/Hello/ Transforms/IPO/ Transforms/Instrumentation/ Transforms/Scalar/ Transforms/Utils/ VMCore/ Message-ID: <200805130000.m4D00XFD008734@zion.cs.uiuc.edu> Author: djg Date: Mon May 12 19:00:25 2008 New Revision: 51017 URL: http://llvm.org/viewvc/llvm-project?rev=51017&view=rev Log: Clean up the use of static and anonymous namespaces. This turned up several things that were neither in an anonymous namespace nor static but not intended to be global. Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp llvm/trunk/lib/Analysis/AliasDebugger.cpp llvm/trunk/lib/Analysis/AliasSetTracker.cpp llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/CFGPrinter.cpp llvm/trunk/lib/Analysis/IPA/Andersens.cpp llvm/trunk/lib/Analysis/IPA/CallGraph.cpp llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp llvm/trunk/lib/Analysis/InstCount.cpp llvm/trunk/lib/Analysis/LoadValueNumbering.cpp llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp llvm/trunk/lib/Analysis/ProfileInfo.cpp llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp llvm/trunk/lib/Analysis/ScalarEvolution.cpp llvm/trunk/lib/Analysis/ValueNumbering.cpp llvm/trunk/lib/Archive/ArchiveReader.cpp llvm/trunk/lib/Archive/ArchiveWriter.cpp llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp llvm/trunk/lib/CodeGen/BranchFolding.cpp llvm/trunk/lib/CodeGen/CollectorMetadata.cpp llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/trunk/lib/CodeGen/MachineDominators.cpp llvm/trunk/lib/CodeGen/MachineLICM.cpp llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp llvm/trunk/lib/CodeGen/MachineSink.cpp llvm/trunk/lib/CodeGen/OcamlCollector.cpp llvm/trunk/lib/CodeGen/PHIElimination.cpp llvm/trunk/lib/CodeGen/Passes.cpp llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp llvm/trunk/lib/CodeGen/RegAllocLocal.cpp llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/CodeGen/ShadowStackCollector.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp llvm/trunk/lib/CodeGen/VirtRegMap.cpp llvm/trunk/lib/ExecutionEngine/Interpreter/Interpreter.cpp llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp llvm/trunk/lib/Support/Statistic.cpp llvm/trunk/lib/System/Unix/Unix.h llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp llvm/trunk/lib/Target/CBackend/CBackend.cpp llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp llvm/trunk/lib/Target/MSIL/MSILWriter.cpp llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp llvm/trunk/lib/Target/TargetData.cpp llvm/trunk/lib/Target/TargetMachine.cpp llvm/trunk/lib/Target/X86/X86Subtarget.cpp llvm/trunk/lib/Target/X86/X86TargetMachine.cpp llvm/trunk/lib/Transforms/Hello/Hello.cpp llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp llvm/trunk/lib/Transforms/IPO/IndMemRemoval.cpp llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp llvm/trunk/lib/Transforms/IPO/Inliner.cpp llvm/trunk/lib/Transforms/IPO/Internalize.cpp llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp llvm/trunk/lib/Transforms/IPO/PruneEH.cpp llvm/trunk/lib/Transforms/IPO/RaiseAllocations.cpp llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp llvm/trunk/lib/Transforms/Instrumentation/BlockProfiling.cpp llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp llvm/trunk/lib/Transforms/Instrumentation/RSProfiling.cpp llvm/trunk/lib/Transforms/Scalar/ADCE.cpp llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp llvm/trunk/lib/Transforms/Scalar/CondPropagate.cpp llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp llvm/trunk/lib/Transforms/Scalar/DCE.cpp llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp llvm/trunk/lib/Transforms/Scalar/GCSE.cpp llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp llvm/trunk/lib/Transforms/Scalar/LICM.cpp llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp llvm/trunk/lib/Transforms/Scalar/SCCP.cpp llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp llvm/trunk/lib/Transforms/Utils/LCSSA.cpp llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp llvm/trunk/lib/VMCore/Constants.cpp llvm/trunk/lib/VMCore/PassManager.cpp llvm/trunk/lib/VMCore/Type.cpp llvm/trunk/lib/VMCore/Verifier.cpp Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Mon May 12 19:00:25 2008 @@ -34,9 +34,7 @@ using namespace llvm; // Register the AliasAnalysis interface, providing a nice name to refer to. -namespace { - RegisterAnalysisGroup Z("Alias Analysis"); -} +static RegisterAnalysisGroup Z("Alias Analysis"); char AliasAnalysis::ID = 0; //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp Mon May 12 19:00:25 2008 @@ -21,12 +21,12 @@ #include "llvm/Support/Streams.h" using namespace llvm; -namespace { - static cl::opt - PrintAll("count-aa-print-all-queries", cl::ReallyHidden); - static cl::opt - PrintAllFailures("count-aa-print-all-failed-queries", cl::ReallyHidden); +static cl::opt +PrintAll("count-aa-print-all-queries", cl::ReallyHidden); +static cl::opt +PrintAllFailures("count-aa-print-all-failed-queries", cl::ReallyHidden); +namespace { class VISIBILITY_HIDDEN AliasAnalysisCounter : public ModulePass, public AliasAnalysis { unsigned No, May, Must; @@ -113,13 +113,13 @@ return AliasAnalysis::getModRefInfo(CS1,CS2); } }; - - char AliasAnalysisCounter::ID = 0; - RegisterPass - X("count-aa", "Count Alias Analysis Query Responses", false, true); - RegisterAnalysisGroup Y(X); } +char AliasAnalysisCounter::ID = 0; +static RegisterPass +X("count-aa", "Count Alias Analysis Query Responses", false, true); +static RegisterAnalysisGroup Y(X); + ModulePass *llvm::createAliasAnalysisCounterPass() { return new AliasAnalysisCounter(); } Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Mon May 12 19:00:25 2008 @@ -34,19 +34,18 @@ #include using namespace llvm; -namespace { - static cl::opt - PrintAll("print-all-alias-modref-info", cl::ReallyHidden); +static cl::opt PrintAll("print-all-alias-modref-info", cl::ReallyHidden); - static cl::opt PrintNoAlias("print-no-aliases", cl::ReallyHidden); - static cl::opt PrintMayAlias("print-may-aliases", cl::ReallyHidden); - static cl::opt PrintMustAlias("print-must-aliases", cl::ReallyHidden); - - static cl::opt PrintNoModRef("print-no-modref", cl::ReallyHidden); - static cl::opt PrintMod("print-mod", cl::ReallyHidden); - static cl::opt PrintRef("print-ref", cl::ReallyHidden); - static cl::opt PrintModRef("print-modref", cl::ReallyHidden); +static cl::opt PrintNoAlias("print-no-aliases", cl::ReallyHidden); +static cl::opt PrintMayAlias("print-may-aliases", cl::ReallyHidden); +static cl::opt PrintMustAlias("print-must-aliases", cl::ReallyHidden); + +static cl::opt PrintNoModRef("print-no-modref", cl::ReallyHidden); +static cl::opt PrintMod("print-mod", cl::ReallyHidden); +static cl::opt PrintRef("print-ref", cl::ReallyHidden); +static cl::opt PrintModRef("print-modref", cl::ReallyHidden); +namespace { class VISIBILITY_HIDDEN AAEval : public FunctionPass { unsigned NoAlias, MayAlias, MustAlias; unsigned NoModRef, Mod, Ref, ModRef; @@ -74,12 +73,12 @@ bool runOnFunction(Function &F); bool doFinalization(Module &M); }; - - char AAEval::ID = 0; - static RegisterPass - X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator", false, true); } +char AAEval::ID = 0; +static RegisterPass +X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator", false, true); + FunctionPass *llvm::createAAEvalPass() { return new AAEval(); } static void PrintResults(const char *Msg, bool P, const Value *V1, const Value *V2, Modified: llvm/trunk/lib/Analysis/AliasDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasDebugger.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasDebugger.cpp (original) +++ llvm/trunk/lib/Analysis/AliasDebugger.cpp Mon May 12 19:00:25 2008 @@ -121,11 +121,12 @@ } }; - - char AliasDebugger::ID = 0; - RegisterPass X("debug-aa", "AA use debugger", false, true); - RegisterAnalysisGroup Y(X); } +char AliasDebugger::ID = 0; +static RegisterPass +X("debug-aa", "AA use debugger", false, true); +static RegisterAnalysisGroup Y(X); + Pass *llvm::createAliasDebugger() { return new AliasDebugger(); } Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original) +++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Mon May 12 19:00:25 2008 @@ -585,6 +585,8 @@ return false; } }; - char AliasSetPrinter::ID = 0; - RegisterPass X("print-alias-sets", "Alias Set Printer", false, true); } + +char AliasSetPrinter::ID = 0; +static RegisterPass +X("print-alias-sets", "Alias Set Printer", false, true); Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Mon May 12 19:00:25 2008 @@ -79,15 +79,15 @@ virtual void deleteValue(Value *V) {} virtual void copyValue(Value *From, Value *To) {} }; +} // End of anonymous namespace - // Register this pass... - char NoAA::ID = 0; - RegisterPass - U("no-aa", "No Alias Analysis (always returns 'may' alias)", true, true); +// Register this pass... +char NoAA::ID = 0; +static RegisterPass +U("no-aa", "No Alias Analysis (always returns 'may' alias)", true, true); - // Declare that we implement the AliasAnalysis interface - RegisterAnalysisGroup V(U); -} // End of anonymous namespace +// Declare that we implement the AliasAnalysis interface +static RegisterAnalysisGroup V(U); ImmutablePass *llvm::createNoAAPass() { return new NoAA(); } @@ -124,15 +124,15 @@ const Type *BasePtr2Ty, Value **GEP2Ops, unsigned NumGEP2Ops, unsigned G2Size); }; +} // End of anonymous namespace - // Register this pass... - char BasicAliasAnalysis::ID = 0; - RegisterPass - X("basicaa", "Basic Alias Analysis (default AA impl)", false, true); +// Register this pass... +char BasicAliasAnalysis::ID = 0; +static RegisterPass +X("basicaa", "Basic Alias Analysis (default AA impl)", false, true); - // Declare that we implement the AliasAnalysis interface - RegisterAnalysisGroup Y(X); -} // End of anonymous namespace +// Declare that we implement the AliasAnalysis interface +static RegisterAnalysisGroup Y(X); ImmutablePass *llvm::createBasicAliasAnalysisPass() { return new BasicAliasAnalysis(); Modified: llvm/trunk/lib/Analysis/CFGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFGPrinter.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/CFGPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/CFGPrinter.cpp Mon May 12 19:00:25 2008 @@ -105,11 +105,13 @@ AU.setPreservesAll(); } }; +} - char CFGViewer::ID = 0; - RegisterPass V0("view-cfg", - "View CFG of function", false, true); +char CFGViewer::ID = 0; +static RegisterPass +V0("view-cfg", "View CFG of function", false, true); +namespace { struct VISIBILITY_HIDDEN CFGOnlyViewer : public FunctionPass { static char ID; // Pass identifcation, replacement for typeid CFGOnlyViewer() : FunctionPass((intptr_t)&ID) {} @@ -127,11 +129,14 @@ AU.setPreservesAll(); } }; +} - char CFGOnlyViewer::ID = 0; - RegisterPass V1("view-cfg-only", - "View CFG of function (with no function bodies)", false, true); +char CFGOnlyViewer::ID = 0; +static RegisterPass +V1("view-cfg-only", + "View CFG of function (with no function bodies)", false, true); +namespace { struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass { static char ID; // Pass identification, replacement for typeid CFGPrinter() : FunctionPass((intptr_t)&ID) {} @@ -156,11 +161,13 @@ AU.setPreservesAll(); } }; +} - char CFGPrinter::ID = 0; - RegisterPass P1("print-cfg", - "Print CFG of function to 'dot' file", false, true); +char CFGPrinter::ID = 0; +static RegisterPass +P1("print-cfg", "Print CFG of function to 'dot' file", false, true); +namespace { struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter { static char ID; // Pass identification, replacement for typeid CFGOnlyPrinter() : CFGPrinter((intptr_t)&ID) {} @@ -177,13 +184,13 @@ AU.setPreservesAll(); } }; - - char CFGOnlyPrinter::ID = 0; - RegisterPass - P2("print-cfg-only", - "Print CFG of function to 'dot' file (with no function bodies)", false, true); } +char CFGOnlyPrinter::ID = 0; +static RegisterPass +P2("print-cfg-only", + "Print CFG of function to 'dot' file (with no function bodies)", false, true); + /// viewCFG - This function is meant for use from the debugger. You can just /// say 'call F->viewCFG()' and a ghostview window should pop up from the /// program, displaying the CFG of the current function. This depends on there Modified: llvm/trunk/lib/Analysis/IPA/Andersens.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/Andersens.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/Andersens.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/Andersens.cpp Mon May 12 19:00:25 2008 @@ -89,14 +89,14 @@ STATISTIC(NumUnified , "Number of variables unified"); STATISTIC(NumErased , "Number of redundant constraints erased"); -namespace { - const unsigned SelfRep = (unsigned)-1; - const unsigned Unvisited = (unsigned)-1; - // Position of the function return node relative to the function node. - const unsigned CallReturnPos = 1; - // Position of the function call node relative to the function node. - const unsigned CallFirstArgPos = 2; +static const unsigned SelfRep = (unsigned)-1; +static const unsigned Unvisited = (unsigned)-1; +// Position of the function return node relative to the function node. +static const unsigned CallReturnPos = 1; +// Position of the function call node relative to the function node. +static const unsigned CallFirstArgPos = 2; +namespace { struct BitmapKeyInfo { static inline SparseBitVector<> *getEmptyKey() { return reinterpret_cast *>(-1); @@ -608,16 +608,15 @@ PrintPointsToGraph(); } }; +} - char Andersens::ID = 0; - RegisterPass X("anders-aa", - "Andersen's Interprocedural Alias Analysis", false, - true); - RegisterAnalysisGroup Y(X); +char Andersens::ID = 0; +static RegisterPass +X("anders-aa", "Andersen's Interprocedural Alias Analysis", false, true); +static RegisterAnalysisGroup Y(X); - // Initialize Timestamp Counter (static). - unsigned Andersens::Node::Counter = 0; -} +// Initialize Timestamp Counter (static). +unsigned Andersens::Node::Counter = 0; ModulePass *llvm::createAndersensPass() { return new Andersens(); } Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Mon May 12 19:00:25 2008 @@ -190,12 +190,13 @@ } }; -RegisterAnalysisGroup X("Call Graph"); -RegisterPass Y("basiccg", "Basic CallGraph Construction", false, true); -RegisterAnalysisGroup Z(Y); - } //End anonymous namespace +static RegisterAnalysisGroup X("Call Graph"); +static RegisterPass +Y("basiccg", "Basic CallGraph Construction", false, true); +static RegisterAnalysisGroup Z(Y); + char CallGraph::ID = 0; char BasicCallGraph::ID = 0; Modified: llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp Mon May 12 19:00:25 2008 @@ -27,6 +27,8 @@ // /// CGPassManager manages FPPassManagers and CalLGraphSCCPasses. +namespace { + class CGPassManager : public ModulePass, public PMDataManager { public: @@ -73,6 +75,8 @@ } }; +} + char CGPassManager::ID = 0; /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. Modified: llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp Mon May 12 19:00:25 2008 @@ -146,14 +146,13 @@ GlobalValue *OkayStoreDest = 0); bool AnalyzeIndirectGlobalMemory(GlobalValue *GV); }; - - char GlobalsModRef::ID = 0; - RegisterPass X("globalsmodref-aa", - "Simple mod/ref analysis for globals", false, - true); - RegisterAnalysisGroup Y(X); } +char GlobalsModRef::ID = 0; +static RegisterPass +X("globalsmodref-aa", "Simple mod/ref analysis for globals", false, true); +static RegisterAnalysisGroup Y(X); + Pass *llvm::createGlobalsModRefPass() { return new GlobalsModRef(); } /// getUnderlyingObject - This traverses the use chain to figure out what object Modified: llvm/trunk/lib/Analysis/InstCount.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstCount.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/InstCount.cpp (original) +++ llvm/trunk/lib/Analysis/InstCount.cpp Mon May 12 19:00:25 2008 @@ -62,12 +62,12 @@ virtual void print(std::ostream &O, const Module *M) const {} }; - - char InstCount::ID = 0; - RegisterPass X("instcount", - "Counts the various types of Instructions", false, true); } +char InstCount::ID = 0; +static RegisterPass +X("instcount", "Counts the various types of Instructions", false, true); + FunctionPass *llvm::createInstCountPass() { return new InstCount(); } // InstCount::run - This is the main Analysis entry point for a Modified: llvm/trunk/lib/Analysis/LoadValueNumbering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoadValueNumbering.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LoadValueNumbering.cpp (original) +++ llvm/trunk/lib/Analysis/LoadValueNumbering.cpp Mon May 12 19:00:25 2008 @@ -82,14 +82,15 @@ void getCallEqualNumberNodes(CallInst *CI, std::vector &RetVals) const; }; +} - char LoadVN::ID = 0; - // Register this pass... - RegisterPass X("load-vn", "Load Value Numbering", false, true); +char LoadVN::ID = 0; +// Register this pass... +static RegisterPass +X("load-vn", "Load Value Numbering", false, true); - // Declare that we implement the ValueNumbering interface - RegisterAnalysisGroup Y(X); -} +// Declare that we implement the ValueNumbering interface +static RegisterAnalysisGroup Y(X); FunctionPass *llvm::createLoadValueNumberingPass() { return new LoadVN(); } Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Mon May 12 19:00:25 2008 @@ -28,14 +28,12 @@ using namespace llvm; -namespace { - // Control the calculation of non-local dependencies by only examining the - // predecessors if the basic block has less than X amount (50 by default). - static cl::opt - PredLimit("nonlocaldep-threshold", cl::Hidden, cl::init(50), - cl::desc("Control the calculation of non-local" - "dependencies (default = 50)")); -} +// Control the calculation of non-local dependencies by only examining the +// predecessors if the basic block has less than X amount (50 by default). +static cl::opt +PredLimit("nonlocaldep-threshold", cl::Hidden, cl::init(50), + cl::desc("Control the calculation of non-local" + "dependencies (default = 50)")); STATISTIC(NumCacheNonlocal, "Number of cached non-local responses"); STATISTIC(NumUncacheNonlocal, "Number of uncached non-local responses"); Modified: llvm/trunk/lib/Analysis/ProfileInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfo.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileInfo.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileInfo.cpp Mon May 12 19:00:25 2008 @@ -21,9 +21,7 @@ using namespace llvm; // Register the ProfileInfo interface, providing a nice name to refer to. -namespace { - RegisterAnalysisGroup Z("Profile Information"); -} +static RegisterAnalysisGroup Z("Profile Information"); char ProfileInfo::ID = 0; ProfileInfo::~ProfileInfo() {} @@ -89,14 +87,14 @@ static char ID; // Class identification, replacement for typeinfo NoProfileInfo() : ImmutablePass((intptr_t)&ID) {} }; +} // End of anonymous namespace - char NoProfileInfo::ID = 0; - // Register this pass... - RegisterPass - X("no-profile", "No Profile Information", false, true); +char NoProfileInfo::ID = 0; +// Register this pass... +static RegisterPass +X("no-profile", "No Profile Information", false, true); - // Declare that we implement the ProfileInfo interface - RegisterAnalysisGroup Y(X); -} // End of anonymous namespace +// Declare that we implement the ProfileInfo interface +static RegisterAnalysisGroup Y(X); ImmutablePass *llvm::createNoProfileInfoPass() { return new NoProfileInfo(); } Modified: llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp Mon May 12 19:00:25 2008 @@ -23,12 +23,12 @@ #include "llvm/Support/Streams.h" using namespace llvm; -namespace { - static cl::opt - ProfileInfoFilename("profile-info-file", cl::init("llvmprof.out"), - cl::value_desc("filename"), - cl::desc("Profile file loaded by -profile-loader")); +static cl::opt +ProfileInfoFilename("profile-info-file", cl::init("llvmprof.out"), + cl::value_desc("filename"), + cl::desc("Profile file loaded by -profile-loader")); +namespace { class VISIBILITY_HIDDEN LoaderPass : public ModulePass, public ProfileInfo { std::string Filename; public: @@ -49,13 +49,13 @@ /// run - Load the profile information from the specified file. virtual bool runOnModule(Module &M); }; +} // End of anonymous namespace - char LoaderPass::ID = 0; - RegisterPass - X("profile-loader", "Load profile information from llvmprof.out", false, true); +char LoaderPass::ID = 0; +static RegisterPass +X("profile-loader", "Load profile information from llvmprof.out", false, true); - RegisterAnalysisGroup Y(X); -} // End of anonymous namespace +static RegisterAnalysisGroup Y(X); ModulePass *llvm::createProfileLoaderPass() { return new LoaderPass(); } Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon May 12 19:00:25 2008 @@ -95,16 +95,14 @@ STATISTIC(NumBruteForceTripCountsComputed, "Number of loops with trip counts computed by force"); -cl::opt +static cl::opt MaxBruteForceIterations("scalar-evolution-max-iterations", cl::ReallyHidden, cl::desc("Maximum number of iterations SCEV will " "symbolically execute a constant derived loop"), cl::init(100)); -namespace { - RegisterPass - R("scalar-evolution", "Scalar Evolution Analysis", false, true); -} +static RegisterPass +R("scalar-evolution", "Scalar Evolution Analysis", false, true); char ScalarEvolution::ID = 0; //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/Analysis/ValueNumbering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueNumbering.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ValueNumbering.cpp (original) +++ llvm/trunk/lib/Analysis/ValueNumbering.cpp Mon May 12 19:00:25 2008 @@ -24,7 +24,7 @@ char ValueNumbering::ID = 0; // Register the ValueNumbering interface, providing a nice name to refer to. -static RegisterAnalysisGroup X("Value Numbering"); +static RegisterAnalysisGroup V("Value Numbering"); /// ValueNumbering destructor: DO NOT move this to the header file for /// ValueNumbering or else clients of the ValueNumbering class may not depend on @@ -64,15 +64,17 @@ virtual void getEqualNumberNodes(Value *V1, std::vector &RetVals) const; }; +} - char BasicVN::ID = 0; - // Register this pass... - RegisterPass - X("basicvn", "Basic Value Numbering (default GVN impl)", false, true); +char BasicVN::ID = 0; +// Register this pass... +static RegisterPass +X("basicvn", "Basic Value Numbering (default GVN impl)", false, true); - // Declare that we implement the ValueNumbering interface - RegisterAnalysisGroup Y(X); +// Declare that we implement the ValueNumbering interface +static RegisterAnalysisGroup Y(X); +namespace { /// BVNImpl - Implement BasicVN in terms of a visitor class that /// handles the different types of instructions as appropriate. /// Modified: llvm/trunk/lib/Archive/ArchiveReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/ArchiveReader.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Archive/ArchiveReader.cpp (original) +++ llvm/trunk/lib/Archive/ArchiveReader.cpp Mon May 12 19:00:25 2008 @@ -19,7 +19,7 @@ using namespace llvm; /// Read a variable-bit-rate encoded unsigned integer -inline unsigned readInteger(const char*&At, const char*End){ +static inline unsigned readInteger(const char*&At, const char*End) { unsigned Shift = 0; unsigned Result = 0; Modified: llvm/trunk/lib/Archive/ArchiveWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/ArchiveWriter.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Archive/ArchiveWriter.cpp (original) +++ llvm/trunk/lib/Archive/ArchiveWriter.cpp Mon May 12 19:00:25 2008 @@ -25,7 +25,7 @@ // Write an integer using variable bit rate encoding. This saves a few bytes // per entry in the symbol table. -inline void writeInteger(unsigned num, std::ofstream& ARFile) { +static inline void writeInteger(unsigned num, std::ofstream& ARFile) { while (1) { if (num < 0x80) { // done? ARFile << (unsigned char)num; @@ -41,7 +41,7 @@ // Compute how many bytes are taken by a given VBR encoded value. This is needed // to pre-compute the size of the symbol table. -inline unsigned numVbrBytes(unsigned num) { +static inline unsigned numVbrBytes(unsigned num) { // Note that the following nested ifs are somewhat equivalent to a binary // search. We split it in half by comparing against 2^14 first. This allows Modified: llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp Mon May 12 19:00:25 2008 @@ -114,19 +114,21 @@ } // Optimize constant ordering. -struct CstSortPredicate { - ValueEnumerator &VE; - CstSortPredicate(ValueEnumerator &ve) : VE(ve) {} - bool operator()(const std::pair &LHS, - const std::pair &RHS) { - // Sort by plane. - if (LHS.first->getType() != RHS.first->getType()) - return VE.getTypeID(LHS.first->getType()) < - VE.getTypeID(RHS.first->getType()); - // Then by frequency. - return LHS.second > RHS.second; - } -}; +namespace { + struct CstSortPredicate { + ValueEnumerator &VE; + explicit CstSortPredicate(ValueEnumerator &ve) : VE(ve) {} + bool operator()(const std::pair &LHS, + const std::pair &RHS) { + // Sort by plane. + if (LHS.first->getType() != RHS.first->getType()) + return VE.getTypeID(LHS.first->getType()) < + VE.getTypeID(RHS.first->getType()); + // Then by frequency. + return LHS.second > RHS.second; + } + }; +} /// OptimizeConstants - Reorder constant pool for denser encoding. void ValueEnumerator::OptimizeConstants(unsigned CstStart, unsigned CstEnd) { Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original) +++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Mon May 12 19:00:25 2008 @@ -38,13 +38,13 @@ STATISTIC(NumTailMerge , "Number of block tails merged"); static cl::opt FlagEnableTailMerge("enable-tail-merge", cl::init(cl::BOU_UNSET), cl::Hidden); -namespace { - // Throttle for huge numbers of predecessors (compile speed problems) - static cl::opt - TailMergeThreshold("tail-merge-threshold", - cl::desc("Max number of predecessors to consider tail merging"), - cl::init(100), cl::Hidden); +// Throttle for huge numbers of predecessors (compile speed problems) +static cl::opt +TailMergeThreshold("tail-merge-threshold", + cl::desc("Max number of predecessors to consider tail merging"), + cl::init(100), cl::Hidden); +namespace { struct VISIBILITY_HIDDEN BranchFolder : public MachineFunctionPass { static char ID; explicit BranchFolder(bool defaultEnableTailMerge) : Modified: llvm/trunk/lib/CodeGen/CollectorMetadata.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CollectorMetadata.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/CollectorMetadata.cpp (original) +++ llvm/trunk/lib/CodeGen/CollectorMetadata.cpp Mon May 12 19:00:25 2008 @@ -51,11 +51,11 @@ bool doFinalization(Module &M); }; - RegisterPass - X("collector-metadata", "Create Garbage Collector Module Metadata"); - } +static RegisterPass +X("collector-metadata", "Create Garbage Collector Module Metadata"); + // ----------------------------------------------------------------------------- CollectorMetadata::CollectorMetadata(const Function &F, Collector &C) Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Mon May 12 19:00:25 2008 @@ -36,16 +36,14 @@ #include using namespace llvm; -namespace { - // Hidden options for help debugging. - static cl::opt DisableReMat("disable-rematerialization", - cl::init(false), cl::Hidden); - - static cl::opt SplitAtBB("split-intervals-at-bb", - cl::init(true), cl::Hidden); - static cl::opt SplitLimit("split-limit", - cl::init(-1), cl::Hidden); -} +// Hidden options for help debugging. +static cl::opt DisableReMat("disable-rematerialization", + cl::init(false), cl::Hidden); + +static cl::opt SplitAtBB("split-intervals-at-bb", + cl::init(true), cl::Hidden); +static cl::opt SplitLimit("split-limit", + cl::init(-1), cl::Hidden); STATISTIC(numIntervals, "Number of original intervals"); STATISTIC(numIntervalsAfter, "Number of intervals after coalescing"); @@ -53,9 +51,7 @@ STATISTIC(numSplits , "Number of intervals split"); char LiveIntervals::ID = 0; -namespace { - RegisterPass X("liveintervals", "Live Interval Analysis"); -} +static RegisterPass X("liveintervals", "Live Interval Analysis"); void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); @@ -1078,20 +1074,22 @@ /// RewriteInfo - Keep track of machine instrs that will be rewritten /// during spilling. -struct RewriteInfo { - unsigned Index; - MachineInstr *MI; - bool HasUse; - bool HasDef; - RewriteInfo(unsigned i, MachineInstr *mi, bool u, bool d) - : Index(i), MI(mi), HasUse(u), HasDef(d) {} -}; - -struct RewriteInfoCompare { - bool operator()(const RewriteInfo &LHS, const RewriteInfo &RHS) const { - return LHS.Index < RHS.Index; - } -}; +namespace { + struct RewriteInfo { + unsigned Index; + MachineInstr *MI; + bool HasUse; + bool HasDef; + RewriteInfo(unsigned i, MachineInstr *mi, bool u, bool d) + : Index(i), MI(mi), HasUse(u), HasDef(d) {} + }; + + struct RewriteInfoCompare { + bool operator()(const RewriteInfo &LHS, const RewriteInfo &RHS) const { + return LHS.Index < RHS.Index; + } + }; +} void LiveIntervals:: rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit, Modified: llvm/trunk/lib/CodeGen/MachineDominators.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineDominators.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineDominators.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineDominators.cpp Mon May 12 19:00:25 2008 @@ -22,9 +22,7 @@ char MachineDominatorTree::ID = 0; -namespace { - RegisterPass - E("machinedomtree", "MachineDominator Tree Construction", true); -} +static RegisterPass +E("machinedomtree", "MachineDominator Tree Construction", true); const PassInfo *llvm::MachineDominatorsID = E.getPassInfo(); Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Mon May 12 19:00:25 2008 @@ -150,12 +150,12 @@ /// void Hoist(MachineInstr &MI); }; - - char MachineLICM::ID = 0; - RegisterPass X("machine-licm", - "Machine Loop Invariant Code Motion"); } // end anonymous namespace +char MachineLICM::ID = 0; +static RegisterPass +X("machine-licm", "Machine Loop Invariant Code Motion"); + FunctionPass *llvm::createMachineLICMPass() { return new MachineLICM(); } /// Hoist expressions out of the specified loop. Note, alias info for inner loop Modified: llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp Mon May 12 19:00:25 2008 @@ -23,10 +23,8 @@ TEMPLATE_INSTANTIATION(class LoopInfoBase); char MachineLoopInfo::ID = 0; -namespace { - RegisterPass - X("machine-loops", "Machine Natural Loop Construction", true); -} +static RegisterPass +X("machine-loops", "Machine Natural Loop Construction", true); const PassInfo *llvm::MachineLoopInfoID = X.getPassInfo(); Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Mon May 12 19:00:25 2008 @@ -27,9 +27,8 @@ using namespace llvm::dwarf; // Handle the Pass registration stuff necessary to use TargetData's. -namespace { - RegisterPass X("machinemoduleinfo", "Module Information"); -} +static RegisterPass +X("machinemoduleinfo", "Module Information"); char MachineModuleInfo::ID = 0; //===----------------------------------------------------------------------===// @@ -160,6 +159,8 @@ DD->ApplyToFields(this); } +namespace { + //===----------------------------------------------------------------------===// /// DICountVisitor - This DIVisitor counts all the fields in the supplied debug /// the supplied DebugInfoDesc. @@ -479,6 +480,7 @@ } }; +} //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineSink.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineSink.cpp Mon May 12 19:00:25 2008 @@ -50,10 +50,11 @@ bool SinkInstruction(MachineInstr *MI, bool &SawStore); bool AllUsesDominatedByBlock(unsigned Reg, MachineBasicBlock *MBB) const; }; - - char MachineSinking::ID = 0; - RegisterPass X("machine-sink", "Machine code sinking"); } // end anonymous namespace + +char MachineSinking::ID = 0; +static RegisterPass +X("machine-sink", "Machine code sinking"); FunctionPass *llvm::createMachineSinkingPass() { return new MachineSinking(); } Modified: llvm/trunk/lib/CodeGen/OcamlCollector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OcamlCollector.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/OcamlCollector.cpp (original) +++ llvm/trunk/lib/CodeGen/OcamlCollector.cpp Mon May 12 19:00:25 2008 @@ -35,11 +35,11 @@ const TargetAsmInfo &TAI); }; - CollectorRegistry::Add - X("ocaml", "ocaml 3.10-compatible collector"); - } +static CollectorRegistry::Add +X("ocaml", "ocaml 3.10-compatible collector"); + // ----------------------------------------------------------------------------- static void EmitCamlGlobal(const Module &M, std::ostream &OS, AsmPrinter &AP, Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Mon May 12 19:00:25 2008 @@ -73,12 +73,12 @@ // Defs of PHI sources which are implicit_def. SmallPtrSet ImpDefs; }; - - char PNE::ID = 0; - RegisterPass X("phi-node-elimination", - "Eliminate PHI nodes for register allocation"); } +char PNE::ID = 0; +static RegisterPass +X("phi-node-elimination", "Eliminate PHI nodes for register allocation"); + const PassInfo *llvm::PHIEliminationID = X.getPassInfo(); bool PNE::runOnMachineFunction(MachineFunction &Fn) { Modified: llvm/trunk/lib/CodeGen/Passes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/Passes.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/Passes.cpp (original) +++ llvm/trunk/lib/CodeGen/Passes.cpp Mon May 12 19:00:25 2008 @@ -30,14 +30,11 @@ /// RegAlloc command line options. /// //===---------------------------------------------------------------------===// -namespace { - static - cl::opt > - RegAlloc("regalloc", - cl::init(&createLinearScanRegisterAllocator), - cl::desc("Register allocator to use: (default = linearscan)")); -} +static cl::opt > +RegAlloc("regalloc", + cl::init(&createLinearScanRegisterAllocator), + cl::desc("Register allocator to use: (default = linearscan)")); //===---------------------------------------------------------------------===// Modified: llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp Mon May 12 19:00:25 2008 @@ -52,11 +52,11 @@ STATISTIC(NumLoads , "Number of loads added"); STATISTIC(NumFolded, "Number of loads/stores folded into instructions"); -namespace { - static RegisterRegAlloc - bigBlockRegAlloc("bigblock", " Big-block register allocator", - createBigBlockRegisterAllocator); +static RegisterRegAlloc + bigBlockRegAlloc("bigblock", " Big-block register allocator", + createBigBlockRegisterAllocator); +namespace { /// VRegKeyInfo - Defines magic values required to use VirtRegs as DenseMap /// keys. struct VRegKeyInfo { Modified: llvm/trunk/lib/CodeGen/RegAllocLocal.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLocal.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocLocal.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocLocal.cpp Mon May 12 19:00:25 2008 @@ -37,12 +37,11 @@ STATISTIC(NumStores, "Number of stores added"); STATISTIC(NumLoads , "Number of loads added"); -namespace { - static RegisterRegAlloc - localRegAlloc("local", " local register allocator", - createLocalRegisterAllocator); - +static RegisterRegAlloc + localRegAlloc("local", " local register allocator", + createLocalRegisterAllocator); +namespace { class VISIBILITY_HIDDEN RALocal : public MachineFunctionPass { public: static char ID; Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original) +++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Mon May 12 19:00:25 2008 @@ -22,9 +22,7 @@ using namespace llvm; // Register the RegisterCoalescer interface, providing a nice name to refer to. -namespace { - RegisterAnalysisGroup Z("Register Coalescer"); -} +static RegisterAnalysisGroup Z("Register Coalescer"); char RegisterCoalescer::ID = 0; // RegisterCoalescer destructor: DO NOT move this to the header file Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon May 12 19:00:25 2008 @@ -318,7 +318,7 @@ /// AddNodeIDValueTypes - Value type lists are intern'd so we can represent them /// solely with their pointer. -void AddNodeIDValueTypes(FoldingSetNodeID &ID, SDVTList VTList) { +static void AddNodeIDValueTypes(FoldingSetNodeID &ID, SDVTList VTList) { ID.AddPointer(VTList.VTs); } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon May 12 19:00:25 2008 @@ -74,18 +74,16 @@ /// ISHeuristic command line option for instruction schedulers. /// //===---------------------------------------------------------------------===// -namespace { - static cl::opt > - ISHeuristic("pre-RA-sched", - cl::init(&createDefaultScheduler), - cl::desc("Instruction schedulers available (before register" - " allocation):")); - - static RegisterScheduler - defaultListDAGScheduler("default", " Best scheduler for the target", - createDefaultScheduler); -} // namespace +static cl::opt > +ISHeuristic("pre-RA-sched", + cl::init(&createDefaultScheduler), + cl::desc("Instruction schedulers available (before register" + " allocation):")); + +static RegisterScheduler +defaultListDAGScheduler("default", " Best scheduler for the target", + createDefaultScheduler); namespace { struct SDISelAsmOperandInfo; } Modified: llvm/trunk/lib/CodeGen/ShadowStackCollector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ShadowStackCollector.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ShadowStackCollector.cpp (original) +++ llvm/trunk/lib/CodeGen/ShadowStackCollector.cpp Mon May 12 19:00:25 2008 @@ -66,11 +66,14 @@ static GetElementPtrInst *CreateGEP(IRBuilder &B, Value *BasePtr, int Idx1, int Idx2, const char *Name); }; + +} - CollectorRegistry::Add - Y("shadow-stack", - "Very portable collector for uncooperative code generators"); +static CollectorRegistry::Add +Y("shadow-stack", + "Very portable collector for uncooperative code generators"); +namespace { /// EscapeEnumerator - This is a little algorithm to find all escape points /// from a function so that "finally"-style code can be inserted. In addition /// to finding the existing return and unwind instructions, it also (if Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Mon May 12 19:00:25 2008 @@ -42,23 +42,21 @@ STATISTIC(numAborts , "Number of times interval joining aborted"); char SimpleRegisterCoalescing::ID = 0; -namespace { - static cl::opt - EnableJoining("join-liveintervals", - cl::desc("Coalesce copies (default=true)"), - cl::init(true)); - - static cl::opt - NewHeuristic("new-coalescer-heuristic", - cl::desc("Use new coalescer heuristic"), - cl::init(false)); +static cl::opt +EnableJoining("join-liveintervals", + cl::desc("Coalesce copies (default=true)"), + cl::init(true)); + +static cl::opt +NewHeuristic("new-coalescer-heuristic", + cl::desc("Use new coalescer heuristic"), + cl::init(false)); - RegisterPass - X("simple-register-coalescing", "Simple Register Coalescing"); +static RegisterPass +X("simple-register-coalescing", "Simple Register Coalescing"); - // Declare that we implement the RegisterCoalescer interface - RegisterAnalysisGroup V(X); -} +// Declare that we implement the RegisterCoalescer interface +static RegisterAnalysisGroup V(X); const PassInfo *llvm::SimpleRegisterCoalescingID = X.getPassInfo(); Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Mon May 12 19:00:25 2008 @@ -140,12 +140,13 @@ SmallPtrSet& v); void mergeLiveIntervals(unsigned primary, unsigned secondary, unsigned VN); }; - - char StrongPHIElimination::ID = 0; - RegisterPass X("strong-phi-node-elimination", - "Eliminate PHI nodes for register allocation, intelligently"); } +char StrongPHIElimination::ID = 0; +static RegisterPass +X("strong-phi-node-elimination", + "Eliminate PHI nodes for register allocation, intelligently"); + const PassInfo *llvm::StrongPHIEliminationID = X.getPassInfo(); /// computeDFS - Computes the DFS-in and DFS-out numbers of the dominator tree @@ -192,6 +193,8 @@ } } +namespace { + /// PreorderSorter - a helper class that is used to sort registers /// according to the preorder number of their defining blocks class PreorderSorter { @@ -219,6 +222,8 @@ } }; +} + /// computeDomForest - compute the subforest of the DomTree corresponding /// to the defining blocks of the registers in question std::vector Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Mon May 12 19:00:25 2008 @@ -75,12 +75,12 @@ /// runOnMachineFunction - Pass entry point. bool runOnMachineFunction(MachineFunction&); }; - - char TwoAddressInstructionPass::ID = 0; - RegisterPass - X("twoaddressinstruction", "Two-Address instruction pass"); } +char TwoAddressInstructionPass::ID = 0; +static RegisterPass +X("twoaddressinstruction", "Two-Address instruction pass"); + const PassInfo *llvm::TwoAddressInstructionPassID = X.getPassInfo(); /// Sink3AddrInstruction - A two-address instruction has been converted to a Modified: llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp (original) +++ llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Mon May 12 19:00:25 2008 @@ -38,10 +38,10 @@ static char ID; // Pass identification, replacement for typeid UnreachableBlockElim() : FunctionPass((intptr_t)&ID) {} }; - char UnreachableBlockElim::ID = 0; - RegisterPass - X("unreachableblockelim", "Remove unreachable blocks from the CFG"); } +char UnreachableBlockElim::ID = 0; +static RegisterPass +X("unreachableblockelim", "Remove unreachable blocks from the CFG"); FunctionPass *llvm::createUnreachableBlockEliminationPass() { return new UnreachableBlockElim(); Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/VirtRegMap.cpp (original) +++ llvm/trunk/lib/CodeGen/VirtRegMap.cpp Mon May 12 19:00:25 2008 @@ -48,17 +48,17 @@ namespace { enum SpillerName { simple, local }; - - static cl::opt - SpillerOpt("spiller", - cl::desc("Spiller to use: (default: local)"), - cl::Prefix, - cl::values(clEnumVal(simple, " simple spiller"), - clEnumVal(local, " local spiller"), - clEnumValEnd), - cl::init(local)); } +static cl::opt +SpillerOpt("spiller", + cl::desc("Spiller to use: (default: local)"), + cl::Prefix, + cl::values(clEnumVal(simple, " simple spiller"), + clEnumVal(local, " local spiller"), + clEnumValEnd), + cl::init(local)); + //===----------------------------------------------------------------------===// // VirtRegMap implementation //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/ExecutionEngine/Interpreter/Interpreter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Interpreter/Interpreter.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/Interpreter/Interpreter.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/Interpreter/Interpreter.cpp Mon May 12 19:00:25 2008 @@ -21,10 +21,14 @@ #include using namespace llvm; +namespace { + static struct RegisterInterp { RegisterInterp() { Interpreter::Register(); } } InterpRegistrator; +} + namespace llvm { void LinkInInterpreter() { } Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Mon May 12 19:00:25 2008 @@ -52,10 +52,14 @@ extern void *__dso_handle __attribute__ ((__visibility__ ("hidden"))); #endif +namespace { + static struct RegisterJIT { RegisterJIT() { JIT::Register(); } } JITRegistrator; +} + namespace llvm { void LinkInJIT() { } Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp Mon May 12 19:00:25 2008 @@ -172,6 +172,8 @@ return LSize < RSize; } +namespace { + struct KeyInfo { static inline unsigned getEmptyKey() { return -1U; } static inline unsigned getTombstoneKey() { return -2U; } @@ -205,6 +207,8 @@ unsigned Action; }; +} + unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF, unsigned char* StartFunction, unsigned char* EndFunction) const { Modified: llvm/trunk/lib/Support/Statistic.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Statistic.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Support/Statistic.cpp (original) +++ llvm/trunk/lib/Support/Statistic.cpp Mon May 12 19:00:25 2008 @@ -70,6 +70,8 @@ Initialized = true; } +namespace { + struct NameCompare { bool operator()(const Statistic *LHS, const Statistic *RHS) const { int Cmp = std::strcmp(LHS->getName(), RHS->getName()); @@ -80,6 +82,8 @@ } }; +} + // Print information when destroyed, iff command line option is specified. StatisticInfo::~StatisticInfo() { // Statistics not enabled? Modified: llvm/trunk/lib/System/Unix/Unix.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Unix.h?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/System/Unix/Unix.h (original) +++ llvm/trunk/lib/System/Unix/Unix.h Mon May 12 19:00:25 2008 @@ -70,7 +70,7 @@ /// 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 bool MakeErrMsg( +static inline bool MakeErrMsg( std::string* ErrMsg, const std::string& prefix, int errnum = -1) { if (!ErrMsg) return true; Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Mon May 12 19:00:25 2008 @@ -27,11 +27,9 @@ static cl::opt DisableIfConversion("disable-arm-if-conversion",cl::Hidden, cl::desc("Disable if-conversion pass")); -namespace { - // Register the target. - RegisterTarget X("arm", " ARM"); - RegisterTarget Y("thumb", " Thumb"); -} +// Register the target. +static RegisterTarget X("arm", " ARM"); +static RegisterTarget Y("thumb", " Thumb"); /// ThumbTargetMachine - Create an Thumb architecture model. /// Modified: llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp Mon May 12 19:00:25 2008 @@ -20,10 +20,8 @@ using namespace llvm; -namespace { - // Register the targets - RegisterTarget X("alpha", " Alpha (incomplete)"); -} +// Register the targets +static RegisterTarget X("alpha", " Alpha (incomplete)"); const TargetAsmInfo *AlphaTargetMachine::createTargetAsmInfo() const { return new AlphaTargetAsmInfo(*this); Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Mon May 12 19:00:25 2008 @@ -47,10 +47,10 @@ #include using namespace llvm; -namespace { - // Register the target. - RegisterTarget X("c", " C backend"); +// Register the target. +static RegisterTarget X("c", " C backend"); +namespace { /// CBackendNameAllUsedStructsAndMergeFunctions - This pass inserts names for /// any unnamed structure types that are used by the program, and merges /// external functions with the same name. Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp Mon May 12 19:00:25 2008 @@ -214,6 +214,8 @@ } } +namespace { + //===--------------------------------------------------------------------===// /// SPUDAGToDAGISel - Cell SPU-specific code to select SPU machine /// instructions for SelectionDAG operations. @@ -336,6 +338,8 @@ #include "SPUGenDAGISel.inc" }; +} + /// InstructionSelectBasicBlock - This callback is invoked by /// SelectionDAGISel when it has created a SelectionDAG for us to codegen. void Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Mon May 12 19:00:25 2008 @@ -70,10 +70,10 @@ cl::desc("Specify the name of the thing to generate"), cl::init("!bad!")); -namespace { - // Register the target. - RegisterTarget X("cpp", " C++ backend"); +// Register the target. +static RegisterTarget X("cpp", " C++ backend"); +namespace { typedef std::vector TypeList; typedef std::map TypeMap; typedef std::map ValueMap; Modified: llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp Mon May 12 19:00:25 2008 @@ -26,9 +26,7 @@ extern "C" int IA64TargetMachineModule; int IA64TargetMachineModule = 0; -namespace { - RegisterTarget X("ia64", " IA-64 (Itanium)"); -} +static RegisterTarget X("ia64", " IA-64 (Itanium)"); const TargetAsmInfo *IA64TargetMachine::createTargetAsmInfo() const { return new IA64TargetAsmInfo(*this); Modified: llvm/trunk/lib/Target/MSIL/MSILWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSIL/MSILWriter.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSIL/MSILWriter.cpp (original) +++ llvm/trunk/lib/Target/MSIL/MSILWriter.cpp Mon May 12 19:00:25 2008 @@ -46,7 +46,7 @@ } -RegisterTarget X("msil", " MSIL backend"); +static RegisterTarget X("msil", " MSIL backend"); bool MSILModule::runOnModule(Module &M) { ModulePtr = &M; Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp Mon May 12 19:00:25 2008 @@ -19,10 +19,8 @@ #include "llvm/Target/TargetMachineRegistry.h" using namespace llvm; -namespace { - // Register the target. - RegisterTarget X("mips", " Mips"); -} +// Register the target. +static RegisterTarget X("mips", " Mips"); const TargetAsmInfo *MipsTargetMachine:: createTargetAsmInfo() const Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Mon May 12 19:00:25 2008 @@ -1920,6 +1920,8 @@ DAG.getTargetLoweringInfo().getPointerTy()).Val; } +namespace { + struct TailCallArgumentInfo { SDOperand Arg; SDOperand FrameIdxOp; @@ -1928,6 +1930,8 @@ TailCallArgumentInfo() : FrameIdx(0) {} }; +} + /// StoreTailCallArgumentsToStackSlot - Stores arguments to their stack slot. static void StoreTailCallArgumentsToStackSlot(SelectionDAG &DAG, Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Mon May 12 19:00:25 2008 @@ -19,13 +19,11 @@ #include "llvm/Target/TargetMachineRegistry.h" using namespace llvm; -namespace { - // Register the targets - RegisterTarget - X("ppc32", " PowerPC 32"); - RegisterTarget - Y("ppc64", " PowerPC 64"); -} +// Register the targets +static RegisterTarget +X("ppc32", " PowerPC 32"); +static RegisterTarget +Y("ppc64", " PowerPC 64"); const TargetAsmInfo *PPCTargetMachine::createTargetAsmInfo() const { if (Subtarget.isDarwin()) Modified: llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp Mon May 12 19:00:25 2008 @@ -18,10 +18,8 @@ #include "llvm/Target/TargetMachineRegistry.h" using namespace llvm; -namespace { - // Register the target. - RegisterTarget X("sparc", " SPARC"); -} +// Register the target. +static RegisterTarget X("sparc", " SPARC"); const TargetAsmInfo *SparcTargetMachine::createTargetAsmInfo() const { return new SparcTargetAsmInfo(*this); Modified: llvm/trunk/lib/Target/TargetData.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetData.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetData.cpp (original) +++ llvm/trunk/lib/Target/TargetData.cpp Mon May 12 19:00:25 2008 @@ -30,11 +30,10 @@ using namespace llvm; // Handle the Pass registration stuff necessary to use TargetData's. -namespace { - // Register the default SparcV9 implementation... - RegisterPass X("targetdata", "Target Data Layout", false, - true); -} + +// Register the default SparcV9 implementation... +static RegisterPass X("targetdata", "Target Data Layout", false, + true); char TargetData::ID = 0; //===----------------------------------------------------------------------===// @@ -318,6 +317,8 @@ : Alignments[BestMatchIdx].PrefAlign; } +namespace { + /// LayoutInfo - The lazy cache of structure layout information maintained by /// TargetData. Note that the struct types must have been free'd before /// llvm_shutdown is called (and thus this is deallocated) because all the @@ -342,8 +343,10 @@ }; typedef DenseMap LayoutInfoTy; -static ManagedStatic LayoutInfo; +} + +static ManagedStatic LayoutInfo; TargetData::~TargetData() { if (LayoutInfo.isConstructed()) { Modified: llvm/trunk/lib/Target/TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/TargetMachine.cpp Mon May 12 19:00:25 2008 @@ -39,117 +39,116 @@ bool RealignStack; unsigned StackAlignment; } -namespace { - static cl::opt PrintCode("print-machineinstrs", - cl::desc("Print generated machine code"), - cl::location(PrintMachineCode), cl::init(false)); - - static cl::opt - DisableFPElim("disable-fp-elim", - cl::desc("Disable frame pointer elimination optimization"), - cl::location(NoFramePointerElim), - cl::init(false)); - static cl::opt - DisableExcessPrecision("disable-excess-fp-precision", - cl::desc("Disable optimizations that may increase FP precision"), - cl::location(NoExcessFPPrecision), - cl::init(false)); - static cl::opt - EnableUnsafeFPMath("enable-unsafe-fp-math", - cl::desc("Enable optimizations that may decrease FP precision"), - cl::location(UnsafeFPMath), - cl::init(false)); - static cl::opt - EnableFiniteOnlyFPMath("enable-finite-only-fp-math", - cl::desc("Enable optimizations that assumes non- NaNs / +-Infs"), - cl::location(FiniteOnlyFPMathOption), - cl::init(false)); - static cl::opt - EnableHonorSignDependentRoundingFPMath(cl::Hidden, - "enable-sign-dependent-rounding-fp-math", - cl::desc("Force codegen to assume rounding mode can change dynamically"), - cl::location(HonorSignDependentRoundingFPMathOption), - cl::init(false)); - - static cl::opt - GenerateSoftFloatCalls("soft-float", - cl::desc("Generate software floating point library calls"), - cl::location(UseSoftFloat), - cl::init(false)); - static cl::opt - DontPlaceZerosInBSS("nozero-initialized-in-bss", - cl::desc("Don't place zero-initialized symbols into bss section"), - cl::location(NoZerosInBSS), - cl::init(false)); - static cl::opt - EnableExceptionHandling("enable-eh", - cl::desc("Emit DWARF exception handling (default if target supports)"), - cl::location(ExceptionHandling), - cl::init(false)); - static cl::opt - EnableUnwindTables("unwind-tables", - cl::desc("Generate unwinding tables for all functions"), - cl::location(UnwindTablesMandatory), - cl::init(false)); - - static cl::opt - DefRelocationModel( - "relocation-model", - cl::desc("Choose relocation model"), - cl::location(RelocationModel), - cl::init(Reloc::Default), - cl::values( - clEnumValN(Reloc::Default, "default", - " Target default relocation model"), - clEnumValN(Reloc::Static, "static", - " Non-relocatable code"), - clEnumValN(Reloc::PIC_, "pic", - " Fully relocatable, position independent code"), - clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic", - " Relocatable external references, non-relocatable code"), - clEnumValEnd)); - static cl::opt - DefCodeModel( - "code-model", - cl::desc("Choose code model"), - cl::location(CMModel), - cl::init(CodeModel::Default), - cl::values( - clEnumValN(CodeModel::Default, "default", - " Target default code model"), - clEnumValN(CodeModel::Small, "small", - " Small code model"), - clEnumValN(CodeModel::Kernel, "kernel", - " Kernel code model"), - clEnumValN(CodeModel::Medium, "medium", - " Medium code model"), - clEnumValN(CodeModel::Large, "large", - " Large code model"), - clEnumValEnd)); - - static cl::opt - EnablePerformTailCallOpt("tailcallopt", - cl::desc("Turn on tail call optimization."), - cl::location(PerformTailCallOpt), - cl::init(false)); - static cl::opt - EnableOptimizeForSize("optimize-size", - cl::desc("Optimize for size."), - cl::location(OptimizeForSize), - cl::init(false)); - - static cl::opt - EnableRealignStack("realign-stack", - cl::desc("Realign stack if needed"), - cl::location(RealignStack), - cl::init(true)); - - static cl::opt - OverrideStackAlignment("stack-alignment", - cl::desc("Override default stack alignment"), - cl::location(StackAlignment), - cl::init(0)); -} + +static cl::opt PrintCode("print-machineinstrs", + cl::desc("Print generated machine code"), + cl::location(PrintMachineCode), cl::init(false)); + +static cl::opt + DisableFPElim("disable-fp-elim", + cl::desc("Disable frame pointer elimination optimization"), + cl::location(NoFramePointerElim), + cl::init(false)); +static cl::opt +DisableExcessPrecision("disable-excess-fp-precision", + cl::desc("Disable optimizations that may increase FP precision"), + cl::location(NoExcessFPPrecision), + cl::init(false)); +static cl::opt +EnableUnsafeFPMath("enable-unsafe-fp-math", + cl::desc("Enable optimizations that may decrease FP precision"), + cl::location(UnsafeFPMath), + cl::init(false)); +static cl::opt +EnableFiniteOnlyFPMath("enable-finite-only-fp-math", + cl::desc("Enable optimizations that assumes non- NaNs / +-Infs"), + cl::location(FiniteOnlyFPMathOption), + cl::init(false)); +static cl::opt +EnableHonorSignDependentRoundingFPMath(cl::Hidden, + "enable-sign-dependent-rounding-fp-math", + cl::desc("Force codegen to assume rounding mode can change dynamically"), + cl::location(HonorSignDependentRoundingFPMathOption), + cl::init(false)); + +static cl::opt +GenerateSoftFloatCalls("soft-float", + cl::desc("Generate software floating point library calls"), + cl::location(UseSoftFloat), + cl::init(false)); +static cl::opt +DontPlaceZerosInBSS("nozero-initialized-in-bss", + cl::desc("Don't place zero-initialized symbols into bss section"), + cl::location(NoZerosInBSS), + cl::init(false)); +static cl::opt +EnableExceptionHandling("enable-eh", + cl::desc("Emit DWARF exception handling (default if target supports)"), + cl::location(ExceptionHandling), + cl::init(false)); +static cl::opt +EnableUnwindTables("unwind-tables", + cl::desc("Generate unwinding tables for all functions"), + cl::location(UnwindTablesMandatory), + cl::init(false)); + +static cl::opt +DefRelocationModel( + "relocation-model", + cl::desc("Choose relocation model"), + cl::location(RelocationModel), + cl::init(Reloc::Default), + cl::values( + clEnumValN(Reloc::Default, "default", + " Target default relocation model"), + clEnumValN(Reloc::Static, "static", + " Non-relocatable code"), + clEnumValN(Reloc::PIC_, "pic", + " Fully relocatable, position independent code"), + clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic", + " Relocatable external references, non-relocatable code"), + clEnumValEnd)); +static cl::opt +DefCodeModel( + "code-model", + cl::desc("Choose code model"), + cl::location(CMModel), + cl::init(CodeModel::Default), + cl::values( + clEnumValN(CodeModel::Default, "default", + " Target default code model"), + clEnumValN(CodeModel::Small, "small", + " Small code model"), + clEnumValN(CodeModel::Kernel, "kernel", + " Kernel code model"), + clEnumValN(CodeModel::Medium, "medium", + " Medium code model"), + clEnumValN(CodeModel::Large, "large", + " Large code model"), + clEnumValEnd)); + +static cl::opt +EnablePerformTailCallOpt("tailcallopt", + cl::desc("Turn on tail call optimization."), + cl::location(PerformTailCallOpt), + cl::init(false)); +static cl::opt +EnableOptimizeForSize("optimize-size", + cl::desc("Optimize for size."), + cl::location(OptimizeForSize), + cl::init(false)); + +static cl::opt +EnableRealignStack("realign-stack", + cl::desc("Realign stack if needed"), + cl::location(RealignStack), + cl::init(true)); + +static cl::opt +OverrideStackAlignment("stack-alignment", + cl::desc("Override default stack alignment"), + cl::location(StackAlignment), + cl::init(0)); //--------------------------------------------------------------------------- // TargetMachine Class Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original) +++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Mon May 12 19:00:25 2008 @@ -19,7 +19,7 @@ #include "llvm/Target/TargetOptions.h" using namespace llvm; -cl::opt +static cl::opt AsmWriterFlavor("x86-asm-syntax", cl::init(X86Subtarget::Unset), cl::desc("Choose style of code to emit from X86 backend:"), cl::values( Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Mon May 12 19:00:25 2008 @@ -30,13 +30,11 @@ extern "C" int X86TargetMachineModule; int X86TargetMachineModule = 0; -namespace { - // Register the target. - RegisterTarget - X("x86", " 32-bit X86: Pentium-Pro and above"); - RegisterTarget - Y("x86-64", " 64-bit X86: EM64T and AMD64"); -} +// Register the target. +static RegisterTarget +X("x86", " 32-bit X86: Pentium-Pro and above"); +static RegisterTarget +Y("x86-64", " 64-bit X86: EM64T and AMD64"); const TargetAsmInfo *X86TargetMachine::createTargetAsmInfo() const { return new X86TargetAsmInfo(*this); Modified: llvm/trunk/lib/Transforms/Hello/Hello.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Hello/Hello.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Hello/Hello.cpp (original) +++ llvm/trunk/lib/Transforms/Hello/Hello.cpp Mon May 12 19:00:25 2008 @@ -36,10 +36,12 @@ return false; } }; +} - char Hello::ID = 0; - RegisterPass X("hello", "Hello World Pass"); +char Hello::ID = 0; +static RegisterPass X("hello", "Hello World Pass"); +namespace { // Hello2 - The second implementation with getAnalysisUsage implemented. struct Hello2 : public FunctionPass { static char ID; // Pass identification, replacement for typeid @@ -58,7 +60,8 @@ AU.setPreservesAll(); }; }; - char Hello2::ID = 0; - RegisterPass Y("hello2", - "Hello World Pass (with getAnalysisUsage implemented)"); } + +char Hello2::ID = 0; +static RegisterPass +Y("hello2", "Hello World Pass (with getAnalysisUsage implemented)"); Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Mon May 12 19:00:25 2008 @@ -77,12 +77,12 @@ /// The maximum number of elements to expand, or 0 for unlimited. unsigned maxElements; }; - - char ArgPromotion::ID = 0; - RegisterPass X("argpromotion", - "Promote 'by reference' arguments to scalars"); } +char ArgPromotion::ID = 0; +static RegisterPass +X("argpromotion", "Promote 'by reference' arguments to scalars"); + Pass *llvm::createArgumentPromotionPass(unsigned maxElements) { return new ArgPromotion(maxElements); } Modified: llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp Mon May 12 19:00:25 2008 @@ -38,11 +38,12 @@ // bool runOnModule(Module &M); }; - - char ConstantMerge::ID = 0; - RegisterPassX("constmerge","Merge Duplicate Global Constants"); } +char ConstantMerge::ID = 0; +static RegisterPass +X("constmerge", "Merge Duplicate Global Constants"); + ModulePass *llvm::createConstantMergePass() { return new ConstantMerge(); } bool ConstantMerge::runOnModule(Module &M) { Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Mon May 12 19:00:25 2008 @@ -97,9 +97,13 @@ void RemoveDeadArgumentsFromFunction(Function *F); }; - char DAE::ID = 0; - RegisterPass X("deadargelim", "Dead Argument Elimination"); +} + +char DAE::ID = 0; +static RegisterPass +X("deadargelim", "Dead Argument Elimination"); +namespace { /// DAH - DeadArgumentHacking pass - Same as dead argument elimination, but /// deletes arguments to functions which are external. This is only for use /// by bugpoint. @@ -107,11 +111,12 @@ static char ID; virtual bool ShouldHackArguments() const { return true; } }; - char DAH::ID = 0; - RegisterPass Y("deadarghaX0r", - "Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)"); } +char DAH::ID = 0; +static RegisterPass +Y("deadarghaX0r", "Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)"); + /// createDeadArgEliminationPass - This pass removes arguments from functions /// which are not used by the body of the function. /// Modified: llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp Mon May 12 19:00:25 2008 @@ -43,10 +43,11 @@ AU.addRequired(); } }; - char DTE::ID = 0; - RegisterPass X("deadtypeelim", "Dead Type Elimination"); } +char DTE::ID = 0; +static RegisterPass X("deadtypeelim", "Dead Type Elimination"); + ModulePass *llvm::createDeadTypeEliminationPass() { return new DTE(); } Modified: llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp Mon May 12 19:00:25 2008 @@ -49,10 +49,11 @@ bool SafeToDestroyConstant(Constant* C); bool RemoveUnusedGlobalValue(GlobalValue &GV); }; - char GlobalDCE::ID = 0; - RegisterPass X("globaldce", "Dead Global Elimination"); } +char GlobalDCE::ID = 0; +static RegisterPass X("globaldce", "Dead Global Elimination"); + ModulePass *llvm::createGlobalDCEPass() { return new GlobalDCE(); } bool GlobalDCE::runOnModule(Module &M) { Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Mon May 12 19:00:25 2008 @@ -68,13 +68,15 @@ bool OptimizeGlobalCtorsList(GlobalVariable *&GCL); bool ProcessInternalGlobal(GlobalVariable *GV,Module::global_iterator &GVI); }; - - char GlobalOpt::ID = 0; - RegisterPass X("globalopt", "Global Variable Optimizer"); } +char GlobalOpt::ID = 0; +static RegisterPass X("globalopt", "Global Variable Optimizer"); + ModulePass *llvm::createGlobalOptimizerPass() { return new GlobalOpt(); } +namespace { + /// GlobalStatus - As we analyze each global, keep track of some information /// about it. If we find out that the address of the global is taken, none of /// this info will be accurate. @@ -129,7 +131,7 @@ HasNonInstructionUser(false), HasPHIUser(false) {} }; - +} /// ConstantIsDead - Return true if the specified constant is (transitively) /// dead. The constant may be used by other constants (e.g. constant arrays and Modified: llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp Mon May 12 19:00:25 2008 @@ -42,10 +42,12 @@ bool PropagateConstantsIntoArguments(Function &F); bool PropagateConstantReturn(Function &F); }; - char IPCP::ID = 0; - RegisterPass X("ipconstprop", "Interprocedural constant propagation"); } +char IPCP::ID = 0; +static RegisterPass +X("ipconstprop", "Interprocedural constant propagation"); + ModulePass *llvm::createIPConstantPropagationPass() { return new IPCP(); } bool IPCP::runOnModule(Module &M) { Modified: llvm/trunk/lib/Transforms/IPO/IndMemRemoval.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/IndMemRemoval.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/IndMemRemoval.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/IndMemRemoval.cpp Mon May 12 19:00:25 2008 @@ -37,10 +37,11 @@ virtual bool runOnModule(Module &M); }; - char IndMemRemPass::ID = 0; - RegisterPass X("indmemrem","Indirect Malloc and Free Removal"); } // end anonymous namespace +char IndMemRemPass::ID = 0; +static RegisterPass +X("indmemrem","Indirect Malloc and Free Removal"); bool IndMemRemPass::runOnModule(Module &M) { //in Theory, all direct calls of malloc and free should be promoted Modified: llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp Mon May 12 19:00:25 2008 @@ -45,10 +45,12 @@ } virtual bool doInitialization(CallGraph &CG); }; - char SimpleInliner::ID = 0; - RegisterPass X("inline", "Function Integration/Inlining"); } +char SimpleInliner::ID = 0; +static RegisterPass +X("inline", "Function Integration/Inlining"); + Pass *llvm::createFunctionInliningPass() { return new SimpleInliner(); } Pass *llvm::createFunctionInliningPass(int Threshold) { Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Mon May 12 19:00:25 2008 @@ -30,11 +30,9 @@ STATISTIC(NumInlined, "Number of functions inlined"); STATISTIC(NumDeleted, "Number of functions deleted because all callers found"); -namespace { - static cl::opt - InlineLimit("inline-threshold", cl::Hidden, cl::init(200), +static cl::opt +InlineLimit("inline-threshold", cl::Hidden, cl::init(200), cl::desc("Control the amount of inlining to perform (default = 200)")); -} Inliner::Inliner(const void *ID) : CallGraphSCCPass((intptr_t)ID), InlineThreshold(InlineLimit) {} Modified: llvm/trunk/lib/Transforms/IPO/Internalize.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Internalize.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Internalize.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Internalize.cpp Mon May 12 19:00:25 2008 @@ -28,20 +28,19 @@ STATISTIC(NumFunctions, "Number of functions internalized"); STATISTIC(NumGlobals , "Number of global vars internalized"); -namespace { - - // APIFile - A file which contains a list of symbols that should not be marked - // external. - static cl::opt - APIFile("internalize-public-api-file", cl::value_desc("filename"), - cl::desc("A file containing list of symbol names to preserve")); - - // APIList - A list of symbols that should not be marked internal. - static cl::list - APIList("internalize-public-api-list", cl::value_desc("list"), - cl::desc("A list of symbol names to preserve"), - cl::CommaSeparated); +// APIFile - A file which contains a list of symbols that should not be marked +// external. +static cl::opt +APIFile("internalize-public-api-file", cl::value_desc("filename"), + cl::desc("A file containing list of symbol names to preserve")); + +// APIList - A list of symbols that should not be marked internal. +static cl::list +APIList("internalize-public-api-list", cl::value_desc("list"), + cl::desc("A list of symbol names to preserve"), + cl::CommaSeparated); +namespace { class VISIBILITY_HIDDEN InternalizePass : public ModulePass { std::set ExternalNames; bool DontInternalize; @@ -52,10 +51,12 @@ void LoadFile(const char *Filename); virtual bool runOnModule(Module &M); }; - char InternalizePass::ID = 0; - RegisterPass X("internalize", "Internalize Global Symbols"); } // end anonymous namespace +char InternalizePass::ID = 0; +static RegisterPass +X("internalize", "Internalize Global Symbols"); + InternalizePass::InternalizePass(bool InternalizeEverything) : ModulePass((intptr_t)&ID), DontInternalize(false){ if (!APIFile.empty()) // If a filename is specified, use it Modified: llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp Mon May 12 19:00:25 2008 @@ -52,22 +52,24 @@ AU.addRequired(); } }; +} - char LoopExtractor::ID = 0; - RegisterPass - X("loop-extract", "Extract loops into new functions"); +char LoopExtractor::ID = 0; +static RegisterPass +X("loop-extract", "Extract loops into new functions"); +namespace { /// SingleLoopExtractor - For bugpoint. struct SingleLoopExtractor : public LoopExtractor { static char ID; // Pass identification, replacement for typeid SingleLoopExtractor() : LoopExtractor(1) {} }; - - char SingleLoopExtractor::ID = 0; - RegisterPass - Y("loop-extract-single", "Extract at most one loop into a new function"); } // End anonymous namespace +char SingleLoopExtractor::ID = 0; +static RegisterPass +Y("loop-extract-single", "Extract at most one loop into a new function"); + // createLoopExtractorPass - This pass extracts all natural loops from the // program into a function if it can. // @@ -146,14 +148,14 @@ } -namespace { - // BlockFile - A file which contains a list of blocks that should not be - // extracted. - static cl::opt - BlockFile("extract-blocks-file", cl::value_desc("filename"), - cl::desc("A file containing list of basic blocks to not extract"), - cl::Hidden); +// BlockFile - A file which contains a list of blocks that should not be +// extracted. +static cl::opt +BlockFile("extract-blocks-file", cl::value_desc("filename"), + cl::desc("A file containing list of basic blocks to not extract"), + cl::Hidden); +namespace { /// BlockExtractorPass - This pass is used by bugpoint to extract all blocks /// from the module into their own functions except for those specified by the /// BlocksToNotExtract list. @@ -173,12 +175,12 @@ bool runOnModule(Module &M); }; - - char BlockExtractorPass::ID = 0; - RegisterPass - XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)"); } +char BlockExtractorPass::ID = 0; +static RegisterPass +XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)"); + // createBlockExtractorPass - This pass extracts all blocks (except those // specified in the argument list) from the functions in the module. // Modified: llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp Mon May 12 19:00:25 2008 @@ -122,11 +122,11 @@ bool runOnModule(Module& M); bool doInitialization(Module& M); }; - - char LowerSetJmp::ID = 0; - RegisterPass X("lowersetjmp", "Lower Set Jump"); } // end anonymous namespace +char LowerSetJmp::ID = 0; +static RegisterPass X("lowersetjmp", "Lower Set Jump"); + // run - Run the transformation on the program. We grab the function // prototypes for longjmp and setjmp. If they are used in the program, // then we can go directly to the places they're at and transform them. Modified: llvm/trunk/lib/Transforms/IPO/PruneEH.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PruneEH.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PruneEH.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PruneEH.cpp Mon May 12 19:00:25 2008 @@ -43,11 +43,12 @@ bool SimplifyFunction(Function *F); void DeleteBasicBlock(BasicBlock *BB); }; - - char PruneEH::ID = 0; - RegisterPass X("prune-eh", "Remove unused exception handling info"); } +char PruneEH::ID = 0; +static RegisterPass +X("prune-eh", "Remove unused exception handling info"); + Pass *llvm::createPruneEHPass() { return new PruneEH(); } Modified: llvm/trunk/lib/Transforms/IPO/RaiseAllocations.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/RaiseAllocations.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/RaiseAllocations.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/RaiseAllocations.cpp Mon May 12 19:00:25 2008 @@ -48,12 +48,11 @@ // bool runOnModule(Module &M); }; - - char RaiseAllocations::ID = 0; - RegisterPass - X("raiseallocs", "Raise allocations from calls to instructions"); } // end anonymous namespace +char RaiseAllocations::ID = 0; +static RegisterPass +X("raiseallocs", "Raise allocations from calls to instructions"); // createRaiseAllocationsPass - The interface to this file... ModulePass *llvm::createRaiseAllocationsPass() { Modified: llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp Mon May 12 19:00:25 2008 @@ -34,12 +34,12 @@ virtual bool runOnModule(Module &M); }; -char StripDeadPrototypesPass::ID = 0; -RegisterPass X("strip-dead-prototypes", - "Strip Unused Function Prototypes"); - } // end anonymous namespace +char StripDeadPrototypesPass::ID = 0; +static RegisterPass +X("strip-dead-prototypes", "Strip Unused Function Prototypes"); + bool StripDeadPrototypesPass::runOnModule(Module &M) { bool MadeChange = false; Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Mon May 12 19:00:25 2008 @@ -46,11 +46,12 @@ AU.setPreservesAll(); } }; - - char StripSymbols::ID = 0; - RegisterPass X("strip", "Strip all symbols from a module"); } +char StripSymbols::ID = 0; +static RegisterPass +X("strip", "Strip all symbols from a module"); + ModulePass *llvm::createStripSymbolsPass(bool OnlyDebugInfo) { return new StripSymbols(OnlyDebugInfo); } Modified: llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp Mon May 12 19:00:25 2008 @@ -58,12 +58,12 @@ void updateCallSites(Function *F, Function *NF); bool nestedStructType(const StructType *STy); }; - - char SRETPromotion::ID = 0; - RegisterPass X("sretpromotion", - "Promote sret arguments to multiple ret values"); } +char SRETPromotion::ID = 0; +static RegisterPass +X("sretpromotion", "Promote sret arguments to multiple ret values"); + Pass *llvm::createStructRetPromotionPass() { return new SRETPromotion(); } Modified: llvm/trunk/lib/Transforms/Instrumentation/BlockProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/BlockProfiling.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/BlockProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/BlockProfiling.cpp Mon May 12 19:00:25 2008 @@ -36,14 +36,14 @@ static char ID; bool runOnModule(Module &M); }; +} - char FunctionProfiler::ID = 0; - - RegisterPass X("insert-function-profiling", - "Insert instrumentation for function profiling"); - RegisterAnalysisGroup XG(X); +char FunctionProfiler::ID = 0; -} +static RegisterPass +X("insert-function-profiling", + "Insert instrumentation for function profiling"); +static RegisterAnalysisGroup XG(X); ModulePass *llvm::createFunctionProfilerPass() { return new FunctionProfiler(); @@ -86,13 +86,13 @@ public: static char ID; }; - - char BlockProfiler::ID = 0; - RegisterPass Y("insert-block-profiling", - "Insert instrumentation for block profiling"); - RegisterAnalysisGroup YG(Y); } +char BlockProfiler::ID = 0; +static RegisterPass +Y("insert-block-profiling", "Insert instrumentation for block profiling"); +static RegisterAnalysisGroup YG(Y); + ModulePass *llvm::createBlockProfilerPass() { return new BlockProfiler(); } bool BlockProfiler::runOnModule(Module &M) { Modified: llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp Mon May 12 19:00:25 2008 @@ -36,12 +36,12 @@ static char ID; // Pass identification, replacement for typeid EdgeProfiler() : ModulePass((intptr_t)&ID) {} }; - - char EdgeProfiler::ID = 0; - RegisterPass X("insert-edge-profiling", - "Insert instrumentation for edge profiling"); } +char EdgeProfiler::ID = 0; +static RegisterPass +X("insert-edge-profiling", "Insert instrumentation for edge profiling"); + ModulePass *llvm::createEdgeProfilerPass() { return new EdgeProfiler(); } bool EdgeProfiler::runOnModule(Module &M) { Modified: llvm/trunk/lib/Transforms/Instrumentation/RSProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/RSProfiling.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/RSProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/RSProfiling.cpp Mon May 12 19:00:25 2008 @@ -55,16 +55,18 @@ enum RandomMeth { GBV, GBVO, HOSTCC }; +} - static cl::opt RandomMethod("profile-randomness", - cl::desc("How to randomly choose to profile:"), - cl::values( - clEnumValN(GBV, "global", "global counter"), - clEnumValN(GBVO, "ra_global", - "register allocated global counter"), - clEnumValN(HOSTCC, "rdcc", "cycle counter"), - clEnumValEnd)); +static cl::opt RandomMethod("profile-randomness", + cl::desc("How to randomly choose to profile:"), + cl::values( + clEnumValN(GBV, "global", "global counter"), + clEnumValN(GBVO, "ra_global", + "register allocated global counter"), + clEnumValN(HOSTCC, "rdcc", "cycle counter"), + clEnumValEnd)); +namespace { /// NullProfilerRS - The basic profiler that does nothing. It is the default /// profiler and thus terminates RSProfiler chains. It is useful for /// measuring framework overhead @@ -81,12 +83,14 @@ AU.setPreservesAll(); } }; +} - static RegisterAnalysisGroup A("Profiling passes"); - static RegisterPass NP("insert-null-profiling-rs", - "Measure profiling framework overhead"); - static RegisterAnalysisGroup NPT(NP); +static RegisterAnalysisGroup A("Profiling passes"); +static RegisterPass NP("insert-null-profiling-rs", + "Measure profiling framework overhead"); +static RegisterAnalysisGroup NPT(NP); +namespace { /// Chooser - Something that chooses when to make a sample of the profiled code class VISIBILITY_HIDDEN Chooser { public: @@ -158,11 +162,12 @@ bool doInitialization(Module &M); virtual void getAnalysisUsage(AnalysisUsage &AU) const; }; - - RegisterPass X("insert-rs-profiling-framework", - "Insert random sampling instrumentation framework"); } +static RegisterPass +X("insert-rs-profiling-framework", + "Insert random sampling instrumentation framework"); + char RSProfilers::ID = 0; char NullProfilerRS::ID = 0; char ProfilerRS::ID = 0; Modified: llvm/trunk/lib/Transforms/Scalar/ADCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ADCE.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ADCE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ADCE.cpp Mon May 12 19:00:25 2008 @@ -106,11 +106,11 @@ markInstructionLive(const_cast(BB->getTerminator())); } }; - - char ADCE::ID = 0; - RegisterPass X("adce", "Aggressive Dead Code Elimination"); } // End of anonymous namespace +char ADCE::ID = 0; +static RegisterPass X("adce", "Aggressive Dead Code Elimination"); + FunctionPass *llvm::createAggressiveDCEPass() { return new ADCE(); } void ADCE::markBlockAlive(BasicBlock *BB) { Modified: llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp Mon May 12 19:00:25 2008 @@ -72,12 +72,12 @@ /// successors. void PlaceBlocks(BasicBlock *BB); }; - - char BlockPlacement::ID = 0; - RegisterPass X("block-placement", - "Profile Guided Basic Block Placement"); } +char BlockPlacement::ID = 0; +static RegisterPass +X("block-placement", "Profile Guided Basic Block Placement"); + FunctionPass *llvm::createBlockPlacementPass() { return new BlockPlacement(); } bool BlockPlacement::runOnFunction(Function &F) { Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Mon May 12 19:00:25 2008 @@ -483,6 +483,7 @@ } } +namespace { /// ExtAddrMode - This is an extended version of TargetLowering::AddrMode which /// holds actual Value*'s for register values. @@ -517,6 +518,8 @@ cerr << *this << "\n"; } +} + static bool TryMatchingScaledValue(Value *ScaleReg, int64_t Scale, const Type *AccessTy, ExtAddrMode &AddrMode, SmallVector &AddrModeInsts, Modified: llvm/trunk/lib/Transforms/Scalar/CondPropagate.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CondPropagate.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/CondPropagate.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/CondPropagate.cpp Mon May 12 19:00:25 2008 @@ -48,10 +48,10 @@ void SimplifyPredecessors(SwitchInst *SI); void RevectorBlockTo(BasicBlock *FromBB, BasicBlock *ToBB); }; - - char CondProp::ID = 0; - RegisterPass X("condprop", "Conditional Propagation"); } + +char CondProp::ID = 0; +static RegisterPass X("condprop", "Conditional Propagation"); FunctionPass *llvm::createCondPropagationPass() { return new CondProp(); Modified: llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp Mon May 12 19:00:25 2008 @@ -43,12 +43,12 @@ AU.setPreservesCFG(); } }; - - char ConstantPropagation::ID = 0; - RegisterPass X("constprop", - "Simple constant propagation"); } +char ConstantPropagation::ID = 0; +static RegisterPass +X("constprop", "Simple constant propagation"); + FunctionPass *llvm::createConstantPropagationPass() { return new ConstantPropagation(); } Modified: llvm/trunk/lib/Transforms/Scalar/DCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DCE.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DCE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DCE.cpp Mon May 12 19:00:25 2008 @@ -52,11 +52,12 @@ AU.setPreservesCFG(); } }; - - char DeadInstElimination::ID = 0; - RegisterPass X("die", "Dead Instruction Elimination"); } +char DeadInstElimination::ID = 0; +static RegisterPass +X("die", "Dead Instruction Elimination"); + Pass *llvm::createDeadInstEliminationPass() { return new DeadInstElimination(); } @@ -76,11 +77,11 @@ AU.setPreservesCFG(); } }; - - char DCE::ID = 0; - RegisterPass Y("dce", "Dead Code Elimination"); } +char DCE::ID = 0; +static RegisterPass Y("dce", "Dead Code Elimination"); + bool DCE::runOnFunction(Function &F) { // Start out with all of the instructions in the worklist... std::vector WorkList; Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Mon May 12 19:00:25 2008 @@ -92,10 +92,11 @@ AU.addPreserved(); } }; - char DSE::ID = 0; - RegisterPass X("dse", "Dead Store Elimination"); } +char DSE::ID = 0; +static RegisterPass X("dse", "Dead Store Elimination"); + FunctionPass *llvm::createDeadStoreEliminationPass() { return new DSE(); } bool DSE::runOnBasicBlock(BasicBlock &BB) { Modified: llvm/trunk/lib/Transforms/Scalar/GCSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GCSE.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GCSE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GCSE.cpp Mon May 12 19:00:25 2008 @@ -52,11 +52,12 @@ AU.addRequired(); } }; - - char GCSE::ID = 0; - RegisterPass X("gcse", "Global Common Subexpression Elimination"); } +char GCSE::ID = 0; +static RegisterPass +X("gcse", "Global Common Subexpression Elimination"); + // createGCSEPass - The public interface to this file... FunctionPass *llvm::createGCSEPass() { return new GCSE(); } Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Mon May 12 19:00:25 2008 @@ -45,6 +45,8 @@ // ValueTable Class //===----------------------------------------------------------------------===// +namespace { + /// This class holds the mapping between values and value numbers. It is used /// as an efficient mechanism to determine the expression-wise equivalence of /// two values. @@ -123,6 +125,7 @@ } }; +} namespace { class VISIBILITY_HIDDEN ValueTable { @@ -596,6 +599,8 @@ return nextValueNumber; } +namespace { + //===----------------------------------------------------------------------===// // ValueNumberedSet Class //===----------------------------------------------------------------------===// @@ -652,6 +657,8 @@ } }; +} + //===----------------------------------------------------------------------===// // GVNPRE Pass //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Mon May 12 19:00:25 2008 @@ -94,11 +94,12 @@ void DeleteTriviallyDeadInstructions(std::set &Insts); }; - - char IndVarSimplify::ID = 0; - RegisterPass X("indvars", "Canonicalize Induction Variables"); } +char IndVarSimplify::ID = 0; +static RegisterPass +X("indvars", "Canonicalize Induction Variables"); + LoopPass *llvm::createIndVarSimplifyPass() { return new IndVarSimplify(); } Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon May 12 19:00:25 2008 @@ -8,8 +8,8 @@ //===----------------------------------------------------------------------===// // // InstructionCombining - Combine instructions to form fewer, simple -// instructions. This pass does not modify the CFG This pass is where algebraic -// simplification happens. +// instructions. This pass does not modify the CFG. This pass is where +// algebraic simplification happens. // // This pass combines things like: // %Y = add i32 %X, 1 @@ -384,11 +384,12 @@ unsigned GetOrEnforceKnownAlignment(Value *V, unsigned PrefAlign = 0); }; - - char InstCombiner::ID = 0; - RegisterPass X("instcombine", "Combine redundant instructions"); } +char InstCombiner::ID = 0; +static RegisterPass +X("instcombine", "Combine redundant instructions"); + // getComplexity: Assign a complexity or rank value to LLVM Values... // 0 -> undef, 1 -> Const, 2 -> Other, 3 -> Arg, 3 -> Unary, 4 -> OtherInst static unsigned getComplexity(Value *V) { @@ -2151,6 +2152,7 @@ return 0; } +namespace { // AddRHS - Implements: X + X --> X << 1 struct AddRHS { @@ -2178,6 +2180,8 @@ } }; +} + static Value *FoldOperationIntoSelectOperand(Instruction &I, Value *SO, InstCombiner *IC) { if (CastInst *CI = dyn_cast(&I)) { @@ -4635,6 +4639,8 @@ return Changed ? &I : 0; } +namespace { + // XorSelf - Implements: X ^ X --> 0 struct XorSelf { Value *RHS; @@ -4645,6 +4651,7 @@ } }; +} Instruction *InstCombiner::visitXor(BinaryOperator &I) { bool Changed = SimplifyCommutative(I); Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Mon May 12 19:00:25 2008 @@ -63,10 +63,12 @@ bool ProcessBranchOnLogical(Value *V, BasicBlock *BB, bool isAnd); bool ProcessBranchOnCompare(CmpInst *Cmp, BasicBlock *BB); }; - char JumpThreading::ID = 0; - RegisterPass X("jump-threading", "Jump Threading"); } +char JumpThreading::ID = 0; +static RegisterPass +X("jump-threading", "Jump Threading"); + // Public interface to the Jump Threading pass FunctionPass *llvm::createJumpThreadingPass() { return new JumpThreading(); } Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Mon May 12 19:00:25 2008 @@ -58,11 +58,11 @@ STATISTIC(NumMovedCalls, "Number of call insts hoisted or sunk"); STATISTIC(NumPromoted , "Number of memory locations promoted to registers"); -namespace { - static cl::opt - DisablePromotion("disable-licm-promotion", cl::Hidden, - cl::desc("Disable memory promotion in LICM pass")); +static cl::opt +DisablePromotion("disable-licm-promotion", cl::Hidden, + cl::desc("Disable memory promotion in LICM pass")); +namespace { struct VISIBILITY_HIDDEN LICM : public LoopPass { static char ID; // Pass identification, replacement for typeid LICM() : LoopPass((intptr_t)&ID) {} @@ -216,11 +216,11 @@ std::vector > &PromotedValues, std::map &Val2AlMap); }; - - char LICM::ID = 0; - RegisterPass X("licm", "Loop Invariant Code Motion"); } +char LICM::ID = 0; +static RegisterPass X("licm", "Loop Invariant Code Motion"); + LoopPass *llvm::createLICMPass() { return new LICM(); } /// Hoist expressions out of the specified loop. Note, alias info for inner Modified: llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp Mon May 12 19:00:25 2008 @@ -52,10 +52,10 @@ AU.addPreservedID(LCSSAID); } }; - - char LoopDeletion::ID = 0; - RegisterPass X ("loop-deletion", "Delete dead loops"); } + +char LoopDeletion::ID = 0; +static RegisterPass X("loop-deletion", "Delete dead loops"); LoopPass* llvm::createLoopDeletionPass() { return new LoopDeletion(); Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Mon May 12 19:00:25 2008 @@ -195,11 +195,12 @@ // Induction variable's final loop exit value operand number in exit condition.. unsigned ExitValueNum; }; - - char LoopIndexSplit::ID = 0; - RegisterPass X ("loop-index-split", "Index Split Loops"); } +char LoopIndexSplit::ID = 0; +static RegisterPass +X("loop-index-split", "Index Split Loops"); + LoopPass *llvm::createLoopIndexSplitPass() { return new LoopIndexSplit(); } Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Mon May 12 19:00:25 2008 @@ -102,10 +102,10 @@ LPPassManager *LPM_Ptr; SmallVector LoopHeaderInfo; }; - - char LoopRotate::ID = 0; - RegisterPass X ("loop-rotate", "Rotate Loops"); } + +char LoopRotate::ID = 0; +static RegisterPass X("loop-rotate", "Rotate Loops"); LoopPass *llvm::createLoopRotatePass() { return new LoopRotate(); } Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon May 12 19:00:25 2008 @@ -194,10 +194,12 @@ Loop *L, bool isOnlyStride); void DeleteTriviallyDeadInstructions(SmallPtrSet &Insts); }; - char LoopStrengthReduce::ID = 0; - RegisterPass X("loop-reduce", "Loop Strength Reduction"); } +char LoopStrengthReduce::ID = 0; +static RegisterPass +X("loop-reduce", "Loop Strength Reduction"); + LoopPass *llvm::createLoopStrengthReducePass(const TargetLowering *TLI) { return new LoopStrengthReduce(TLI); } Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp Mon May 12 19:00:25 2008 @@ -44,17 +44,15 @@ STATISTIC(NumCompletelyUnrolled, "Number of loops completely unrolled"); STATISTIC(NumUnrolled, "Number of loops unrolled (completely or otherwise)"); -namespace { - static cl::opt - UnrollThreshold - ("unroll-threshold", cl::init(100), cl::Hidden, - cl::desc("The cut-off point for automatic loop unrolling")); - - static cl::opt - UnrollCount - ("unroll-count", cl::init(0), cl::Hidden, - cl::desc("Use this unroll count for all loops, for testing purposes")); +static cl::opt +UnrollThreshold("unroll-threshold", cl::init(100), cl::Hidden, + cl::desc("The cut-off point for automatic loop unrolling")); + +static cl::opt +UnrollCount("unroll-count", cl::init(0), cl::Hidden, + cl::desc("Use this unroll count for all loops, for testing purposes")); +namespace { class VISIBILITY_HIDDEN LoopUnroll : public LoopPass { LoopInfo *LI; // The current loop information public: @@ -81,10 +79,11 @@ AU.addPreserved(); } }; - char LoopUnroll::ID = 0; - RegisterPass X("loop-unroll", "Unroll loops"); } +char LoopUnroll::ID = 0; +static RegisterPass X("loop-unroll", "Unroll loops"); + LoopPass *llvm::createLoopUnrollPass() { return new LoopUnroll(); } /// ApproximateLoopSize - Approximate the size of the loop. Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Mon May 12 19:00:25 2008 @@ -54,11 +54,11 @@ STATISTIC(NumTrivial , "Number of unswitches that are trivial"); STATISTIC(NumSimplify, "Number of simplifications of unswitched code"); -namespace { - static cl::opt - Threshold("loop-unswitch-threshold", cl::desc("Max loop size to unswitch"), - cl::init(10), cl::Hidden); +static cl::opt +Threshold("loop-unswitch-threshold", cl::desc("Max loop size to unswitch"), + cl::init(10), cl::Hidden); +namespace { class VISIBILITY_HIDDEN LoopUnswitch : public LoopPass { LoopInfo *LI; // Loop information LPPassManager *LPM; @@ -144,9 +144,9 @@ std::vector &Worklist, Loop *l); void RemoveLoopFromHierarchy(Loop *L); }; - char LoopUnswitch::ID = 0; - RegisterPass X("loop-unswitch", "Unswitch loops"); } +char LoopUnswitch::ID = 0; +static RegisterPass X("loop-unswitch", "Unswitch loops"); LoopPass *llvm::createLoopUnswitchPass(bool Os) { return new LoopUnswitch(Os); @@ -459,11 +459,11 @@ // OrigPreheader is loop pre-header before this pass started // updating CFG. NewPrehader is loops new pre-header. However, after CFG // manipulation, loop L may not exist. So rely on input parameter NewPreheader. -void CloneDomInfo(BasicBlock *NewBB, BasicBlock *Orig, - BasicBlock *NewPreheader, BasicBlock *OrigPreheader, - BasicBlock *OrigHeader, - DominatorTree *DT, DominanceFrontier *DF, - DenseMap &VM) { +static void CloneDomInfo(BasicBlock *NewBB, BasicBlock *Orig, + BasicBlock *NewPreheader, BasicBlock *OrigPreheader, + BasicBlock *OrigHeader, + DominatorTree *DT, DominanceFrontier *DF, + DenseMap &VM) { // If NewBB alreay has found its place in domiantor tree then no need to do // anything. Modified: llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp Mon May 12 19:00:25 2008 @@ -2646,12 +2646,12 @@ } } } - - char PredicateSimplifier::ID = 0; - RegisterPass X("predsimplify", - "Predicate Simplifier"); } +char PredicateSimplifier::ID = 0; +static RegisterPass +X("predsimplify", "Predicate Simplifier"); + FunctionPass *llvm::createPredicateSimplifierPass() { return new PredicateSimplifier(); } Modified: llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Mon May 12 19:00:25 2008 @@ -64,7 +64,7 @@ << "," << Ops[i].Rank; } -namespace { +namespace { class VISIBILITY_HIDDEN Reassociate : public FunctionPass { std::map RankMap; std::map ValueRankMap; @@ -92,11 +92,11 @@ void RemoveDeadBinaryOp(Value *V); }; - - char Reassociate::ID = 0; - RegisterPass X("reassociate", "Reassociate expressions"); } +char Reassociate::ID = 0; +static RegisterPass X("reassociate", "Reassociate expressions"); + // Public interface to the Reassociate pass FunctionPass *llvm::createReassociatePass() { return new Reassociate(); } Modified: llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp Mon May 12 19:00:25 2008 @@ -111,10 +111,11 @@ return false; } }; - - char RegToMem::ID = 0; - RegisterPass X("reg2mem", "Demote all values to stack slots"); } + +char RegToMem::ID = 0; +static RegisterPass +X("reg2mem", "Demote all values to stack slots"); // createDemoteRegisterToMemory - Provide an entry point to create this pass. // Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Mon May 12 19:00:25 2008 @@ -1435,11 +1435,11 @@ AU.setPreservesCFG(); } }; - - char SCCP::ID = 0; - RegisterPass X("sccp", "Sparse Conditional Constant Propagation"); } // end anonymous namespace +char SCCP::ID = 0; +static RegisterPass +X("sccp", "Sparse Conditional Constant Propagation"); // createSCCPPass - This is the public interface to this file... FunctionPass *llvm::createSCCPPass() { @@ -1543,12 +1543,12 @@ IPSCCP() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); }; - - char IPSCCP::ID = 0; - RegisterPass - Y("ipsccp", "Interprocedural Sparse Conditional Constant Propagation"); } // end anonymous namespace +char IPSCCP::ID = 0; +static RegisterPass +Y("ipsccp", "Interprocedural Sparse Conditional Constant Propagation"); + // createIPSCCPPass - This is the public interface to this file... ModulePass *llvm::createIPSCCPPass() { return new IPSCCP(); Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Mon May 12 19:00:25 2008 @@ -124,11 +124,11 @@ unsigned Offset); static Instruction *isOnlyCopiedFromConstantGlobal(AllocationInst *AI); }; - - char SROA::ID = 0; - RegisterPass X("scalarrepl", "Scalar Replacement of Aggregates"); } +char SROA::ID = 0; +static RegisterPass X("scalarrepl", "Scalar Replacement of Aggregates"); + // Public interface to the ScalarReplAggregates pass FunctionPass *llvm::createScalarReplAggregatesPass(signed int Threshold) { return new SROA(Threshold); Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp Mon May 12 19:00:25 2008 @@ -45,10 +45,11 @@ virtual bool runOnFunction(Function &F); }; - char CFGSimplifyPass::ID = 0; - RegisterPass X("simplifycfg", "Simplify the CFG"); } +char CFGSimplifyPass::ID = 0; +static RegisterPass X("simplifycfg", "Simplify the CFG"); + // Public interface to the CFGSimplification pass FunctionPass *llvm::createCFGSimplificationPass() { return new CFGSimplifyPass(); Modified: llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp Mon May 12 19:00:25 2008 @@ -37,10 +37,11 @@ STATISTIC(NumEliminated, "Number of unconditional branches eliminated"); +static cl::opt +Threshold("taildup-threshold", cl::desc("Max block size to tail duplicate"), + cl::init(6), cl::Hidden); + namespace { - cl::opt - Threshold("taildup-threshold", cl::desc("Max block size to tail duplicate"), - cl::init(6), cl::Hidden); class VISIBILITY_HIDDEN TailDup : public FunctionPass { bool runOnFunction(Function &F); public: @@ -51,10 +52,11 @@ inline bool shouldEliminateUnconditionalBranch(TerminatorInst *TI); inline void eliminateUnconditionalBranch(BranchInst *BI); }; - char TailDup::ID = 0; - RegisterPass X("tailduplicate", "Tail Duplication"); } +char TailDup::ID = 0; +static RegisterPass X("tailduplicate", "Tail Duplication"); + // Public interface to the Tail Duplication pass FunctionPass *llvm::createTailDuplicationPass() { return new TailDup(); } Modified: llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp Mon May 12 19:00:25 2008 @@ -80,10 +80,11 @@ bool CanMoveAboveCall(Instruction *I, CallInst *CI); Value *CanTransformAccumulatorRecursion(Instruction *I, CallInst *CI); }; - char TailCallElim::ID = 0; - RegisterPass X("tailcallelim", "Tail Call Elimination"); } +char TailCallElim::ID = 0; +static RegisterPass X("tailcallelim", "Tail Call Elimination"); + // Public interface to the TailCallElimination pass FunctionPass *llvm::createTailCallEliminationPass() { return new TailCallElim(); Modified: llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp Mon May 12 19:00:25 2008 @@ -26,11 +26,9 @@ using namespace llvm; -namespace { - static cl::opt - BasicInlineThreshold("inline-threshold", cl::Hidden, cl::init(200), - cl::desc("Control the amount of basic inlining to perform (default = 200)")); -} +static cl::opt +BasicInlineThreshold("inline-threshold", cl::Hidden, cl::init(200), + cl::desc("Control the amount of basic inlining to perform (default = 200)")); namespace llvm { Modified: llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Mon May 12 19:00:25 2008 @@ -48,12 +48,12 @@ AU.addPreservedID(LoopSimplifyID); } }; - - char BreakCriticalEdges::ID = 0; - RegisterPass X("break-crit-edges", - "Break critical edges in CFG"); } +char BreakCriticalEdges::ID = 0; +static RegisterPass +X("break-crit-edges", "Break critical edges in CFG"); + // Publically exposed interface to pass... const PassInfo *llvm::BreakCriticalEdgesID = X.getPassInfo(); FunctionPass *llvm::createBreakCriticalEdgesPass() { Modified: llvm/trunk/lib/Transforms/Utils/LCSSA.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LCSSA.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LCSSA.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LCSSA.cpp Mon May 12 19:00:25 2008 @@ -94,10 +94,10 @@ return std::binary_search(LoopBlocks.begin(), LoopBlocks.end(), B); } }; - - char LCSSA::ID = 0; - RegisterPass X("lcssa", "Loop-Closed SSA Form Pass"); } + +char LCSSA::ID = 0; +static RegisterPass X("lcssa", "Loop-Closed SSA Form Pass"); LoopPass *llvm::createLCSSAPass() { return new LCSSA(); } const PassInfo *llvm::LCSSAID = X.getPassInfo(); Modified: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Mon May 12 19:00:25 2008 @@ -95,12 +95,12 @@ SmallVectorImpl &SplitPreds, Loop *L); }; - - char LoopSimplify::ID = 0; - RegisterPass - X("loopsimplify", "Canonicalize natural loops", true); } +char LoopSimplify::ID = 0; +static RegisterPass +X("loopsimplify", "Canonicalize natural loops", true); + // Publically exposed interface to pass... const PassInfo *llvm::LoopSimplifyID = X.getPassInfo(); FunctionPass *llvm::createLoopSimplifyPass() { return new LoopSimplify(); } Modified: llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp Mon May 12 19:00:25 2008 @@ -66,12 +66,12 @@ /// bool runOnBasicBlock(BasicBlock &BB); }; - - char LowerAllocations::ID = 0; - RegisterPass - X("lowerallocs", "Lower allocations from instructions to calls"); } +char LowerAllocations::ID = 0; +static RegisterPass +X("lowerallocs", "Lower allocations from instructions to calls"); + // Publically exposed interface to pass... const PassInfo *llvm::LowerAllocationsID = X.getPassInfo(); // createLowerAllocationsPass - Interface to this file... Modified: llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp Mon May 12 19:00:25 2008 @@ -98,12 +98,12 @@ AllocaInst *InvokeNum, SwitchInst *CatchSwitch); bool insertExpensiveEHSupport(Function &F); }; - - char LowerInvoke::ID = 0; - RegisterPass - X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators"); } +char LowerInvoke::ID = 0; +static RegisterPass +X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators"); + const PassInfo *llvm::LowerInvokePassID = X.getPassInfo(); // Public Interface To the LowerInvoke pass. Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Mon May 12 19:00:25 2008 @@ -77,12 +77,12 @@ return CI1->getValue().slt(CI2->getValue()); } }; - - char LowerSwitch::ID = 0; - RegisterPass - X("lowerswitch", "Lower SwitchInst's to branches"); } +char LowerSwitch::ID = 0; +static RegisterPass +X("lowerswitch", "Lower SwitchInst's to branches"); + // Publically exposed interface to pass... const PassInfo *llvm::LowerSwitchID = X.getPassInfo(); // createLowerSwitchPass - Interface to this file... Modified: llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp Mon May 12 19:00:25 2008 @@ -48,11 +48,11 @@ AU.addPreservedID(LowerAllocationsID); } }; - - char PromotePass::ID = 0; - RegisterPass X("mem2reg", "Promote Memory to Register"); } // end of anonymous namespace +char PromotePass::ID = 0; +static RegisterPass X("mem2reg", "Promote Memory to Register"); + bool PromotePass::runOnFunction(Function &F) { std::vector Allocas; Modified: llvm/trunk/lib/VMCore/Constants.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Constants.cpp (original) +++ llvm/trunk/lib/VMCore/Constants.cpp Mon May 12 19:00:25 2008 @@ -1514,6 +1514,8 @@ //---- ConstantExpr::get() implementations... // +namespace { + struct ExprMapKeyType { explicit ExprMapKeyType(unsigned opc, std::vector ops, unsigned short pred = 0) : opcode(opc), predicate(pred), operands(ops) { } @@ -1537,6 +1539,8 @@ } }; +} + namespace llvm { template<> struct ConstantCreator { Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Mon May 12 19:00:25 2008 @@ -360,10 +360,10 @@ } }; -static TimingInfo *TheTimeInfo; - } // End of anon namespace +static TimingInfo *TheTimeInfo; + //===----------------------------------------------------------------------===// // PMTopLevelManager implementation Modified: llvm/trunk/lib/VMCore/Type.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Type.cpp (original) +++ llvm/trunk/lib/VMCore/Type.cpp Mon May 12 19:00:25 2008 @@ -550,6 +550,7 @@ } +namespace { /// TypePromotionGraph and graph traits - this is designed to allow us to do /// efficient SCC processing of type graphs. This is the exact same as @@ -560,6 +561,8 @@ TypePromotionGraph(Type *T) : Ty(T) {} }; +} + namespace llvm { template <> struct GraphTraits { typedef Type NodeType; Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=51017&r1=51016&r2=51017&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Mon May 12 19:00:25 2008 @@ -92,11 +92,14 @@ return false; } }; +} - char PreVerifier::ID = 0; - RegisterPass PreVer("preverify", "Preliminary module verification"); - const PassInfo *PreVerifyID = PreVer.getPassInfo(); +char PreVerifier::ID = 0; +static RegisterPass +PreVer("preverify", "Preliminary module verification"); +static const PassInfo *PreVerifyID = PreVer.getPassInfo(); +namespace { struct VISIBILITY_HIDDEN Verifier : public FunctionPass, InstVisitor { static char ID; // Pass ID, replacement for typeid @@ -305,11 +308,10 @@ Broken = true; } }; - - char Verifier::ID = 0; - RegisterPass X("verify", "Module Verifier"); } // End anonymous namespace +char Verifier::ID = 0; +static RegisterPass X("verify", "Module Verifier"); // Assert - We know that cond should be true, if not print an error message. #define Assert(C, M) \ From dpatel at apple.com Mon May 12 19:02:02 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 13 May 2008 00:02:02 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r51018 - /llvm-gcc-4.2/trunk/gcc/gimplify.c Message-ID: <200805130002.m4D022ko009118@zion.cs.uiuc.edu> Author: dpatel Date: Mon May 12 19:02:01 2008 New Revision: 51018 URL: http://llvm.org/viewvc/llvm-project?rev=51018&view=rev Log: GCC's instruction tables are not initialized. Take conservative action for now. Modified: llvm-gcc-4.2/trunk/gcc/gimplify.c Modified: llvm-gcc-4.2/trunk/gcc/gimplify.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/gimplify.c?rev=51018&r1=51017&r2=51018&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/gimplify.c (original) +++ llvm-gcc-4.2/trunk/gcc/gimplify.c Mon May 12 19:02:01 2008 @@ -5145,6 +5145,10 @@ decl = built_in_decls[base + index + 1]; itype = TREE_TYPE (TREE_TYPE (decl)); +#ifdef ENABLE_LLVM + /* LLVM LOCAL fix me. Add target specific check. */ + return GS_UNHANDLED; +#endif if (optab[TYPE_MODE (itype)] == CODE_FOR_nothing) return GS_UNHANDLED; @@ -5221,6 +5225,10 @@ type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (addr))); itype = TREE_TYPE (TREE_TYPE (cmpxchg)); +#ifdef ENABLE_LLVM + /* LLVM LOCAL fix me. Add target specific check. */ + return GS_UNHANDLED; +#endif if (sync_compare_and_swap[TYPE_MODE (itype)] == CODE_FOR_nothing) return GS_UNHANDLED; From evan.cheng at apple.com Mon May 12 19:54:04 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 13 May 2008 00:54:04 -0000 Subject: [llvm-commits] [llvm] r51019 - in /llvm/trunk: lib/Target/X86/README-SSE.txt lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/vec_set-H.ll Message-ID: <200805130054.m4D0s4BT018226@zion.cs.uiuc.edu> Author: evancheng Date: Mon May 12 19:54:02 2008 New Revision: 51019 URL: http://llvm.org/viewvc/llvm-project?rev=51019&view=rev Log: On x86, it's safe to treat i32 load anyext as a normal i32 load. Ditto for i8 anyext load to i16. Added: llvm/trunk/test/CodeGen/X86/vec_set-H.ll Modified: llvm/trunk/lib/Target/X86/README-SSE.txt llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/README-SSE.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README-SSE.txt?rev=51019&r1=51018&r2=51019&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/README-SSE.txt (original) +++ llvm/trunk/lib/Target/X86/README-SSE.txt Mon May 12 19:54:02 2008 @@ -757,31 +757,6 @@ //===---------------------------------------------------------------------===// -Take the following code: - -#include -__m128i doload64(short x) {return _mm_set_epi16(x,x,x,x,x,x,x,x);} - -LLVM currently generates the following on x86: -doload64: - movzwl 4(%esp), %eax - movd %eax, %xmm0 - punpcklwd %xmm0, %xmm0 - pshufd $0, %xmm0, %xmm0 - ret - -gcc's generated code: -doload64: - movd 4(%esp), %xmm0 - punpcklwd %xmm0, %xmm0 - pshufd $0, %xmm0, %xmm0 - ret - -LLVM should be able to generate the same thing as gcc. This looks like it is -just a matter of matching (scalar_to_vector (load x)) to movd. - -//===---------------------------------------------------------------------===// - LLVM currently generates stack realignment code, when it is not necessary needed. The problem is that we need to know about stack alignment too early, before RA runs. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=51019&r1=51018&r2=51019&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Mon May 12 19:54:02 2008 @@ -229,9 +229,35 @@ }]>; // Helper fragments for loads. +// It's always safe to treat a anyext i16 load as a i32 load. Ditto for +// i8 to i16. +def loadi16 : PatFrag<(ops node:$ptr), (i16 (ld node:$ptr)), [{ + if (LoadSDNode *LD = dyn_cast(N)) { + if (LD->getAddressingMode() != ISD::UNINDEXED) + return false; + ISD::LoadExtType ExtType = LD->getExtensionType(); + if (ExtType == ISD::NON_EXTLOAD) + return true; + if (ExtType == ISD::EXTLOAD) + return LD->getAlignment() >= 16; + } + return false; +}]>; + +def loadi32 : PatFrag<(ops node:$ptr), (i32 (ld node:$ptr)), [{ + if (LoadSDNode *LD = dyn_cast(N)) { + if (LD->getAddressingMode() != ISD::UNINDEXED) + return false; + ISD::LoadExtType ExtType = LD->getExtensionType(); + if (ExtType == ISD::NON_EXTLOAD) + return true; + if (ExtType == ISD::EXTLOAD) + return LD->getAlignment() >= 16; + } + return false; +}]>; + def loadi8 : PatFrag<(ops node:$ptr), (i8 (load node:$ptr))>; -def loadi16 : PatFrag<(ops node:$ptr), (i16 (load node:$ptr))>; -def loadi32 : PatFrag<(ops node:$ptr), (i32 (load node:$ptr))>; def loadi64 : PatFrag<(ops node:$ptr), (i64 (load node:$ptr))>; def loadf32 : PatFrag<(ops node:$ptr), (f32 (load node:$ptr))>; Added: llvm/trunk/test/CodeGen/X86/vec_set-H.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_set-H.ll?rev=51019&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_set-H.ll (added) +++ llvm/trunk/test/CodeGen/X86/vec_set-H.ll Mon May 12 19:54:02 2008 @@ -0,0 +1,15 @@ +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep movz + +define <2 x i64> @doload64(i16 signext %x) nounwind { +entry: + %tmp36 = insertelement <8 x i16> undef, i16 %x, i32 0 ; <<8 x i16>> [#uses=1] + %tmp37 = insertelement <8 x i16> %tmp36, i16 %x, i32 1 ; <<8 x i16>> [#uses=1] + %tmp38 = insertelement <8 x i16> %tmp37, i16 %x, i32 2 ; <<8 x i16>> [#uses=1] + %tmp39 = insertelement <8 x i16> %tmp38, i16 %x, i32 3 ; <<8 x i16>> [#uses=1] + %tmp40 = insertelement <8 x i16> %tmp39, i16 %x, i32 4 ; <<8 x i16>> [#uses=1] + %tmp41 = insertelement <8 x i16> %tmp40, i16 %x, i32 5 ; <<8 x i16>> [#uses=1] + %tmp42 = insertelement <8 x i16> %tmp41, i16 %x, i32 6 ; <<8 x i16>> [#uses=1] + %tmp43 = insertelement <8 x i16> %tmp42, i16 %x, i32 7 ; <<8 x i16>> [#uses=1] + %tmp46 = bitcast <8 x i16> %tmp43 to <2 x i64> ; <<2 x i64>> [#uses=1] + ret <2 x i64> %tmp46 +} From natebegeman at mac.com Mon May 12 20:47:52 2008 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 13 May 2008 01:47:52 -0000 Subject: [llvm-commits] [llvm] r51020 - /llvm/trunk/lib/Target/X86/X86InstrSSE.td Message-ID: <200805130147.m4D1lqKe019723@zion.cs.uiuc.edu> Author: sampo Date: Mon May 12 20:47:52 2008 New Revision: 51020 URL: http://llvm.org/viewvc/llvm-project?rev=51020&view=rev Log: Fix and encoding error in the psrad xmm, imm8 instruction. Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=51020&r1=51019&r2=51020&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Mon May 12 20:47:52 2008 @@ -1916,7 +1916,7 @@ defm PSRAW : PDI_binop_rmi_int<0xE1, 0x71, MRM4r, "psraw", int_x86_sse2_psra_w, int_x86_sse2_psrai_w>; -defm PSRAD : PDI_binop_rmi_int<0xE2, 0x71, MRM4r, "psrad", +defm PSRAD : PDI_binop_rmi_int<0xE2, 0x72, MRM4r, "psrad", int_x86_sse2_psra_d, int_x86_sse2_psrai_d>; // 128-bit logical shifts. From natebegeman at mac.com Mon May 12 20:48:27 2008 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 13 May 2008 01:48:27 -0000 Subject: [llvm-commits] [llvm] r51021 - in /llvm/trunk/lib/Transforms: IPO/ArgumentPromotion.cpp Scalar/DeadStoreElimination.cpp Message-ID: <200805130148.m4D1mRbw019751@zion.cs.uiuc.edu> Author: sampo Date: Mon May 12 20:48:26 2008 New Revision: 51021 URL: http://llvm.org/viewvc/llvm-project?rev=51021&view=rev Log: 80 col / tabs fixes Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=51021&r1=51020&r2=51021&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Mon May 12 20:48:26 2008 @@ -66,7 +66,8 @@ virtual bool runOnSCC(const std::vector &SCC); static char ID; // Pass identification, replacement for typeid - ArgPromotion(unsigned maxElements = 3) : CallGraphSCCPass((intptr_t)&ID), maxElements(maxElements) {} + ArgPromotion(unsigned maxElements = 3) : CallGraphSCCPass((intptr_t)&ID), + maxElements(maxElements) {} private: bool PromoteArguments(CallGraphNode *CGN); @@ -74,8 +75,8 @@ Function *DoPromotion(Function *F, SmallPtrSet &ArgsToPromote, SmallPtrSet &ByValArgsToTransform); - /// The maximum number of elements to expand, or 0 for unlimited. - unsigned maxElements; + /// The maximum number of elements to expand, or 0 for unlimited. + unsigned maxElements; }; } @@ -290,7 +291,7 @@ << Arg->getName() << "' because it would require adding more " << "than " << maxElements << " arguments to the function.\n"; // We limit aggregate promotion to only promoting up to a fixed number - // of elements of the aggregate. + // of elements of the aggregate. return false; } GEPIndices.push_back(Operands); Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=51021&r1=51020&r2=51021&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Mon May 12 20:48:26 2008 @@ -327,8 +327,8 @@ // If we encounter a use of the pointer, it is no longer considered dead if (LoadInst* L = dyn_cast(BBI)) { - // However, if this load is unused and not volatile, we can go ahead and remove it, - // and not have to worry about it making our pointer undead! + // However, if this load is unused and not volatile, we can go ahead and + // remove it, and not have to worry about it making our pointer undead! if (L->use_empty() && !L->isVolatile()) { MD.removeInstruction(L); From gohman at apple.com Mon May 12 21:05:12 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 May 2008 02:05:12 -0000 Subject: [llvm-commits] [llvm] r51022 - in /llvm/trunk: include/llvm/ include/llvm/CodeGen/ include/llvm/Transforms/ lib/CodeGen/ lib/Transforms/Scalar/ lib/Transforms/Utils/ lib/VMCore/ Message-ID: <200805130205.m4D25CQN020353@zion.cs.uiuc.edu> Author: djg Date: Mon May 12 21:05:11 2008 New Revision: 51022 URL: http://llvm.org/viewvc/llvm-project?rev=51022&view=rev Log: Change class' public PassInfo variables to by initialized with the address of the PassInfo directly instead of calling getPassInfo. This eliminates a bunch of dynamic initializations of static data. Also, fold RegisterPassBase into PassInfo, make a bunch of its data members const, and rearrange some code to initialize data members in constructors instead of using setter member functions. Modified: llvm/trunk/include/llvm/CodeGen/Passes.h llvm/trunk/include/llvm/PassSupport.h llvm/trunk/include/llvm/Transforms/Scalar.h llvm/trunk/lib/CodeGen/MachineDominators.cpp llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp llvm/trunk/lib/CodeGen/PHIElimination.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp llvm/trunk/lib/Transforms/Utils/LCSSA.cpp llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp llvm/trunk/lib/VMCore/Pass.cpp llvm/trunk/lib/VMCore/Verifier.cpp Modified: llvm/trunk/include/llvm/CodeGen/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) +++ llvm/trunk/include/llvm/CodeGen/Passes.h Mon May 12 21:05:11 2008 @@ -40,18 +40,18 @@ /// MachineLoopInfo pass - This pass is a loop analysis pass. /// - extern const PassInfo *MachineLoopInfoID; + extern const PassInfo *const MachineLoopInfoID; /// MachineDominators pass - This pass is a machine dominators analysis pass. /// - extern const PassInfo *MachineDominatorsID; + extern const PassInfo *const MachineDominatorsID; /// PHIElimination pass - This pass eliminates machine instruction PHI nodes /// by inserting copy instructions. This destroys SSA information, but is the /// desired input for some register allocators. This pass is "required" by /// these register allocator like this: AU.addRequiredID(PHIEliminationID); /// - extern const PassInfo *PHIEliminationID; + extern const PassInfo *const PHIEliminationID; /// StrongPHIElimination pass - This pass eliminates machine instruction PHI /// nodes by inserting copy instructions. This destroys SSA information, but @@ -59,17 +59,17 @@ /// "required" by these register allocator like this: /// AU.addRequiredID(PHIEliminationID); /// This pass is still in development - extern const PassInfo *StrongPHIEliminationID; + extern const PassInfo *const StrongPHIEliminationID; /// SimpleRegisterCoalescing pass. Aggressively coalesces every register /// copy it can. /// - extern const PassInfo *SimpleRegisterCoalescingID; + extern const PassInfo *const SimpleRegisterCoalescingID; /// TwoAddressInstruction pass - This pass reduces two-address instructions to /// use two operands. This destroys SSA information but it is desired by /// register allocators. - extern const PassInfo *TwoAddressInstructionPassID; + extern const PassInfo *const TwoAddressInstructionPassID; /// Creates a register allocator as the user specified on the command line. /// Modified: llvm/trunk/include/llvm/PassSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassSupport.h (original) +++ llvm/trunk/include/llvm/PassSupport.h Mon May 12 21:05:11 2008 @@ -34,30 +34,43 @@ /// template, defined below. /// class PassInfo { - const char *PassName; // Nice name for Pass - const char *PassArgument; // Command Line argument to run this pass - intptr_t PassID; - bool IsCFGOnlyPass; // Pass only looks at the CFG. - bool IsAnalysis; // True if an analysis pass. - bool IsAnalysisGroup; // True if an analysis group. +public: + typedef Pass* (*NormalCtor_t)(); + +private: + const char *const PassName; // Nice name for Pass + const char *const PassArgument; // Command Line argument to run this pass + const intptr_t PassID; + const bool IsCFGOnlyPass; // Pass only looks at the CFG. + const bool IsAnalysis; // True if an analysis pass. + const bool IsAnalysisGroup; // True if an analysis group. std::vector ItfImpl;// Interfaces implemented by this pass - Pass *(*NormalCtor)(); + NormalCtor_t NormalCtor; public: /// PassInfo ctor - Do not call this directly, this should only be invoked /// through RegisterPass. PassInfo(const char *name, const char *arg, intptr_t pi, - Pass *(*normal)() = 0, bool isCFGOnly = false, bool isAnalysis = false) + NormalCtor_t normal = 0, + bool isCFGOnly = false, bool isAnalysis = false) : PassName(name), PassArgument(arg), PassID(pi), IsCFGOnlyPass(isCFGOnly), IsAnalysis(isAnalysis), IsAnalysisGroup(false), NormalCtor(normal) { + registerPass(); + } + /// PassInfo ctor - Do not call this directly, this should only be invoked + /// through RegisterPass. This version is for use by analysis groups; it + /// does not auto-register the pass. + PassInfo(const char *name, intptr_t pi) + : PassName(name), PassArgument(""), PassID(pi), + IsCFGOnlyPass(false), + IsAnalysis(false), IsAnalysisGroup(true), NormalCtor(0) { } /// getPassName - Return the friendly name for the pass, never returns null /// const char *getPassName() const { return PassName; } - void setPassName(const char *Name) { PassName = Name; } /// getPassArgument - Return the command line option that may be passed to /// 'opt' that will cause this pass to be run. This will return null if there @@ -74,7 +87,6 @@ /// bool isAnalysisGroup() const { return IsAnalysisGroup; } bool isAnalysis() const { return IsAnalysis; } - void SetIsAnalysisGroup() { IsAnalysisGroup = true; } /// isCFGOnlyPass - return true if this pass only looks at the CFG for the /// function. @@ -84,10 +96,10 @@ /// an instance of the pass and returns it. This pointer may be null if there /// is no default constructor for the pass. /// - Pass *(*getNormalCtor() const)() { + NormalCtor_t getNormalCtor() const { return NormalCtor; } - void setNormalCtor(Pass *(*Ctor)()) { + void setNormalCtor(NormalCtor_t Ctor) { NormalCtor = Ctor; } @@ -114,9 +126,23 @@ const std::vector &getInterfacesImplemented() const { return ItfImpl; } + + /// getPassInfo - Deprecated API compaatibility function. This function + /// just returns 'this'. + /// + const PassInfo *getPassInfo() const { + return this; + } + +protected: + void registerPass(); + void unregisterPass(); }; +template +Pass *callDefaultCtor() { return new PassName(); } + //===--------------------------------------------------------------------------- /// RegisterPass template - This template class is used to notify the system /// that a Pass is available for use, and registers it into the internal @@ -134,44 +160,15 @@ /// /// static RegisterPass tmp("passopt", "My Name"); /// -struct RegisterPassBase { - /// getPassInfo - Get the pass info for the registered class... - /// - const PassInfo *getPassInfo() const { return &PIObj; } - - typedef Pass* (*NormalCtor_t)(); - - RegisterPassBase(const char *Name, const char *Arg, intptr_t TI, - NormalCtor_t NormalCtor = 0, bool CFGOnly = false, - bool IsAnalysis = false) - : PIObj(Name, Arg, TI, NormalCtor, CFGOnly, IsAnalysis) { - registerPass(); - } - explicit RegisterPassBase(intptr_t TI) - : PIObj("", "", TI) { - // This ctor may only be used for analysis groups: it does not auto-register - // the pass. - PIObj.SetIsAnalysisGroup(); - } - -protected: - PassInfo PIObj; // The PassInfo object for this pass - void registerPass(); - void unregisterPass(); -}; - -template -Pass *callDefaultCtor() { return new PassName(); } - -template -struct RegisterPass : public RegisterPassBase { +template +struct RegisterPass : public PassInfo { // Register Pass using default constructor... RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false, bool IsAnalysis = false) - : RegisterPassBase(Name, PassArg, intptr_t(&PassName::ID), - RegisterPassBase::NormalCtor_t(callDefaultCtor), - CFGOnly, IsAnalysis) { + : PassInfo(Name, PassArg, intptr_t(&passName::ID), + PassInfo::NormalCtor_t(callDefaultCtor), + CFGOnly, IsAnalysis) { } }; @@ -195,27 +192,27 @@ /// second template argument). The interface should be registered to associate /// a nice name with the interface. /// -class RegisterAGBase : public RegisterPassBase { +class RegisterAGBase : public PassInfo { PassInfo *InterfaceInfo; const PassInfo *ImplementationInfo; bool isDefaultImplementation; protected: - explicit RegisterAGBase(intptr_t InterfaceID, + explicit RegisterAGBase(const char *Name, + intptr_t InterfaceID, intptr_t PassID = 0, bool isDefault = false); - void setGroupName(const char *Name); }; template struct RegisterAnalysisGroup : public RegisterAGBase { - explicit RegisterAnalysisGroup(RegisterPassBase &RPB) - : RegisterAGBase(intptr_t(&Interface::ID), RPB.getPassInfo()->getTypeInfo(), + explicit RegisterAnalysisGroup(PassInfo &RPB) + : RegisterAGBase(RPB.getPassName(), + intptr_t(&Interface::ID), RPB.getTypeInfo(), Default) { } explicit RegisterAnalysisGroup(const char *Name) - : RegisterAGBase(intptr_t(&Interface::ID)) { - setGroupName(Name); + : RegisterAGBase(Name, intptr_t(&Interface::ID)) { } }; Modified: llvm/trunk/include/llvm/Transforms/Scalar.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar.h?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Scalar.h (original) +++ llvm/trunk/include/llvm/Transforms/Scalar.h Mon May 12 21:05:11 2008 @@ -162,7 +162,7 @@ // ret int %Y // FunctionPass *createPromoteMemoryToRegisterPass(); -extern const PassInfo *PromoteMemoryToRegisterID; +extern const PassInfo *const PromoteMemoryToRegisterID; //===----------------------------------------------------------------------===// // @@ -171,7 +171,7 @@ // hacking easier. // FunctionPass *createDemoteRegisterToMemoryPass(); -extern const PassInfo *DemoteRegisterToMemoryID; +extern const PassInfo *const DemoteRegisterToMemoryID; //===----------------------------------------------------------------------===// // @@ -223,7 +223,7 @@ // (set, immediate dominators, tree, and frontier) information. // FunctionPass *createBreakCriticalEdgesPass(); -extern const PassInfo *BreakCriticalEdgesID; +extern const PassInfo *const BreakCriticalEdgesID; //===----------------------------------------------------------------------===// // @@ -234,7 +234,7 @@ // AU.addRequiredID(LoopSimplifyID); // FunctionPass *createLoopSimplifyPass(); -extern const PassInfo *LoopSimplifyID; +extern const PassInfo *const LoopSimplifyID; //===----------------------------------------------------------------------===// // @@ -244,7 +244,7 @@ // AU.addRequiredID(LowerAllocationsID); // Pass *createLowerAllocationsPass(bool LowerMallocArgToInteger = false); -extern const PassInfo *LowerAllocationsID; +extern const PassInfo *const LowerAllocationsID; //===----------------------------------------------------------------------===// // @@ -259,7 +259,7 @@ // chained binary branch instructions. // FunctionPass *createLowerSwitchPass(); -extern const PassInfo *LowerSwitchID; +extern const PassInfo *const LowerSwitchID; //===----------------------------------------------------------------------===// // @@ -272,7 +272,7 @@ // lowering pass. // FunctionPass *createLowerInvokePass(const TargetLowering *TLI = NULL); -extern const PassInfo *LowerInvokePassID; +extern const PassInfo *const LowerInvokePassID; //===----------------------------------------------------------------------===// // @@ -287,7 +287,7 @@ // optimizations. // LoopPass *createLCSSAPass(); -extern const PassInfo *LCSSAID; +extern const PassInfo *const LCSSAID; //===----------------------------------------------------------------------===// // Modified: llvm/trunk/lib/CodeGen/MachineDominators.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineDominators.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineDominators.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineDominators.cpp Mon May 12 21:05:11 2008 @@ -25,4 +25,4 @@ static RegisterPass E("machinedomtree", "MachineDominator Tree Construction", true); -const PassInfo *llvm::MachineDominatorsID = E.getPassInfo(); +const PassInfo *const llvm::MachineDominatorsID = &E; Modified: llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp Mon May 12 21:05:11 2008 @@ -26,7 +26,7 @@ static RegisterPass X("machine-loops", "Machine Natural Loop Construction", true); -const PassInfo *llvm::MachineLoopInfoID = X.getPassInfo(); +const PassInfo *const llvm::MachineLoopInfoID = &X; bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) { releaseMemory(); Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Mon May 12 21:05:11 2008 @@ -79,7 +79,7 @@ static RegisterPass X("phi-node-elimination", "Eliminate PHI nodes for register allocation"); -const PassInfo *llvm::PHIEliminationID = X.getPassInfo(); +const PassInfo *const llvm::PHIEliminationID = &X; bool PNE::runOnMachineFunction(MachineFunction &Fn) { MRI = &Fn.getRegInfo(); Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Mon May 12 21:05:11 2008 @@ -58,7 +58,7 @@ // Declare that we implement the RegisterCoalescer interface static RegisterAnalysisGroup V(X); -const PassInfo *llvm::SimpleRegisterCoalescingID = X.getPassInfo(); +const PassInfo *const llvm::SimpleRegisterCoalescingID = &X; void SimpleRegisterCoalescing::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Mon May 12 21:05:11 2008 @@ -147,7 +147,7 @@ X("strong-phi-node-elimination", "Eliminate PHI nodes for register allocation, intelligently"); -const PassInfo *llvm::StrongPHIEliminationID = X.getPassInfo(); +const PassInfo *const llvm::StrongPHIEliminationID = &X; /// computeDFS - Computes the DFS-in and DFS-out numbers of the dominator tree /// of the given MachineFunction. These numbers are then used in other parts Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Mon May 12 21:05:11 2008 @@ -81,7 +81,7 @@ static RegisterPass X("twoaddressinstruction", "Two-Address instruction pass"); -const PassInfo *llvm::TwoAddressInstructionPassID = X.getPassInfo(); +const PassInfo *const llvm::TwoAddressInstructionPassID = &X; /// Sink3AddrInstruction - A two-address instruction has been converted to a /// three-address instruction to avoid clobbering a register. Try to sink it Modified: llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp Mon May 12 21:05:11 2008 @@ -119,7 +119,7 @@ // createDemoteRegisterToMemory - Provide an entry point to create this pass. // -const PassInfo *llvm::DemoteRegisterToMemoryID = X.getPassInfo(); +const PassInfo *const llvm::DemoteRegisterToMemoryID = &X; FunctionPass *llvm::createDemoteRegisterToMemoryPass() { return new RegToMem(); } Modified: llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Mon May 12 21:05:11 2008 @@ -55,7 +55,7 @@ X("break-crit-edges", "Break critical edges in CFG"); // Publically exposed interface to pass... -const PassInfo *llvm::BreakCriticalEdgesID = X.getPassInfo(); +const PassInfo *const llvm::BreakCriticalEdgesID = &X; FunctionPass *llvm::createBreakCriticalEdgesPass() { return new BreakCriticalEdges(); } Modified: llvm/trunk/lib/Transforms/Utils/LCSSA.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LCSSA.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LCSSA.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LCSSA.cpp Mon May 12 21:05:11 2008 @@ -100,7 +100,7 @@ static RegisterPass X("lcssa", "Loop-Closed SSA Form Pass"); LoopPass *llvm::createLCSSAPass() { return new LCSSA(); } -const PassInfo *llvm::LCSSAID = X.getPassInfo(); +const PassInfo *const llvm::LCSSAID = &X; /// runOnFunction - Process all loops in the function, inner-most out. bool LCSSA::runOnLoop(Loop *L, LPPassManager &LPM) { Modified: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Mon May 12 21:05:11 2008 @@ -102,7 +102,7 @@ X("loopsimplify", "Canonicalize natural loops", true); // Publically exposed interface to pass... -const PassInfo *llvm::LoopSimplifyID = X.getPassInfo(); +const PassInfo *const llvm::LoopSimplifyID = &X; FunctionPass *llvm::createLoopSimplifyPass() { return new LoopSimplify(); } /// runOnFunction - Run down all loops in the CFG (recursively, but we could do Modified: llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp Mon May 12 21:05:11 2008 @@ -73,7 +73,7 @@ X("lowerallocs", "Lower allocations from instructions to calls"); // Publically exposed interface to pass... -const PassInfo *llvm::LowerAllocationsID = X.getPassInfo(); +const PassInfo *const llvm::LowerAllocationsID = &X; // createLowerAllocationsPass - Interface to this file... Pass *llvm::createLowerAllocationsPass(bool LowerMallocArgToInteger) { return new LowerAllocations(LowerMallocArgToInteger); Modified: llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp Mon May 12 21:05:11 2008 @@ -104,7 +104,7 @@ static RegisterPass X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators"); -const PassInfo *llvm::LowerInvokePassID = X.getPassInfo(); +const PassInfo *const llvm::LowerInvokePassID = &X; // Public Interface To the LowerInvoke pass. FunctionPass *llvm::createLowerInvokePass(const TargetLowering *TLI) { Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Mon May 12 21:05:11 2008 @@ -84,7 +84,7 @@ X("lowerswitch", "Lower SwitchInst's to branches"); // Publically exposed interface to pass... -const PassInfo *llvm::LowerSwitchID = X.getPassInfo(); +const PassInfo *const llvm::LowerSwitchID = &X; // createLowerSwitchPass - Interface to this file... FunctionPass *llvm::createLowerSwitchPass() { return new LowerSwitch(); Modified: llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp Mon May 12 21:05:11 2008 @@ -84,7 +84,7 @@ } // Publically exposed interface to pass... -const PassInfo *llvm::PromoteMemoryToRegisterID = X.getPassInfo(); +const PassInfo *const llvm::PromoteMemoryToRegisterID = &X; // createPromoteMemoryToRegister - Provide an entry point to create this pass. // FunctionPass *llvm::createPromoteMemoryToRegisterPass() { Modified: llvm/trunk/lib/VMCore/Pass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Pass.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Pass.cpp (original) +++ llvm/trunk/lib/VMCore/Pass.cpp Mon May 12 21:05:11 2008 @@ -122,7 +122,8 @@ class PassRegistrar { /// PassInfoMap - Keep track of the passinfo object for each registered llvm /// pass. - std::map PassInfoMap; + typedef std::map MapType; + MapType PassInfoMap; /// AnalysisGroupInfo - Keep track of information for each analysis group. struct AnalysisGroupInfo { @@ -137,19 +138,18 @@ public: const PassInfo *GetPassInfo(intptr_t TI) const { - std::map::const_iterator I = PassInfoMap.find(TI); + MapType::const_iterator I = PassInfoMap.find(TI); return I != PassInfoMap.end() ? I->second : 0; } - void RegisterPass(PassInfo &PI) { + void RegisterPass(const PassInfo &PI) { bool Inserted = PassInfoMap.insert(std::make_pair(PI.getTypeInfo(),&PI)).second; assert(Inserted && "Pass registered multiple times!"); } - void UnregisterPass(PassInfo &PI) { - std::map::iterator I = - PassInfoMap.find(PI.getTypeInfo()); + void UnregisterPass(const PassInfo &PI) { + MapType::iterator I = PassInfoMap.find(PI.getTypeInfo()); assert(I != PassInfoMap.end() && "Pass registered but not in map!"); // Remove pass from the map. @@ -157,7 +157,7 @@ } void EnumerateWith(PassRegistrationListener *L) { - for (std::map::const_iterator I = PassInfoMap.begin(), + for (MapType::const_iterator I = PassInfoMap.begin(), E = PassInfoMap.end(); I != E; ++I) L->passEnumerate(I->second); } @@ -206,18 +206,18 @@ return getPassRegistrar()->GetPassInfo(TI); } -void RegisterPassBase::registerPass() { - getPassRegistrar()->RegisterPass(PIObj); +void PassInfo::registerPass() { + getPassRegistrar()->RegisterPass(*this); // Notify any listeners. if (Listeners) for (std::vector::iterator I = Listeners->begin(), E = Listeners->end(); I != E; ++I) - (*I)->passRegistered(&PIObj); + (*I)->passRegistered(this); } -void RegisterPassBase::unregisterPass() { - getPassRegistrar()->UnregisterPass(PIObj); +void PassInfo::unregisterPass() { + getPassRegistrar()->UnregisterPass(*this); } //===----------------------------------------------------------------------===// @@ -226,18 +226,18 @@ // RegisterAGBase implementation // -RegisterAGBase::RegisterAGBase(intptr_t InterfaceID, +RegisterAGBase::RegisterAGBase(const char *Name, intptr_t InterfaceID, intptr_t PassID, bool isDefault) - : RegisterPassBase(InterfaceID), + : PassInfo(Name, InterfaceID), ImplementationInfo(0), isDefaultImplementation(isDefault) { InterfaceInfo = const_cast(Pass::lookupPassInfo(InterfaceID)); if (InterfaceInfo == 0) { // First reference to Interface, register it now. registerPass(); - InterfaceInfo = &PIObj; + InterfaceInfo = this; } - assert(PIObj.isAnalysisGroup() && + assert(isAnalysisGroup() && "Trying to join an analysis group that is a normal pass!"); if (PassID) { @@ -254,11 +254,6 @@ } } -void RegisterAGBase::setGroupName(const char *Name) { - assert(InterfaceInfo->getPassName()[0] == 0 && "Interface Name already set!"); - InterfaceInfo->setPassName(Name); -} - //===----------------------------------------------------------------------===// // PassRegistrationListener implementation Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=51022&r1=51021&r2=51022&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Mon May 12 21:05:11 2008 @@ -97,7 +97,7 @@ char PreVerifier::ID = 0; static RegisterPass PreVer("preverify", "Preliminary module verification"); -static const PassInfo *PreVerifyID = PreVer.getPassInfo(); +static const PassInfo *PreVerifyID = &PreVer; namespace { struct VISIBILITY_HIDDEN From evan.cheng at apple.com Mon May 12 23:00:55 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 12 May 2008 21:00:55 -0700 Subject: [llvm-commits] [llvm] r51020 - /llvm/trunk/lib/Target/X86/X86InstrSSE.td In-Reply-To: <200805130147.m4D1lqKe019723@zion.cs.uiuc.edu> References: <200805130147.m4D1lqKe019723@zion.cs.uiuc.edu> Message-ID: <76C3630A-F369-48FE-BE80-6D307E410A7A@apple.com> Ah, thanks for catching this. This definitely should go into the release branch. Thanks, Evan On May 12, 2008, at 6:47 PM, Nate Begeman wrote: > Author: sampo > Date: Mon May 12 20:47:52 2008 > New Revision: 51020 > > URL: http://llvm.org/viewvc/llvm-project?rev=51020&view=rev > Log: > Fix and encoding error in the psrad xmm, imm8 instruction. > > > Modified: > llvm/trunk/lib/Target/X86/X86InstrSSE.td > > Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=51020&r1=51019&r2=51020&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) > +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Mon May 12 20:47:52 2008 > @@ -1916,7 +1916,7 @@ > > defm PSRAW : PDI_binop_rmi_int<0xE1, 0x71, MRM4r, "psraw", > int_x86_sse2_psra_w, > int_x86_sse2_psrai_w>; > -defm PSRAD : PDI_binop_rmi_int<0xE2, 0x71, MRM4r, "psrad", > +defm PSRAD : PDI_binop_rmi_int<0xE2, 0x72, MRM4r, "psrad", > int_x86_sse2_psra_d, > int_x86_sse2_psrai_d>; > > // 128-bit logical shifts. > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From Sanjiv.Gupta at microchip.com Tue May 13 00:54:55 2008 From: Sanjiv.Gupta at microchip.com (Sanjiv.Gupta at microchip.com) Date: Mon, 12 May 2008 22:54:55 -0700 Subject: [llvm-commits] PATCH for PIC16 target. In-Reply-To: <59215.76.126.208.186.1210349695.squirrel@webmail.apple.com> References: <59215.76.126.208.186.1210349695.squirrel@webmail.apple.com> Message-ID: > How is PIC16 different from existing LLVM targets? > Did you encounter any problems in developing this target for > LLVM? Is there anything in LLVM that you had to work around, > or that poses a challenge for PIC16? > > How is PIC16 similar to existing LLVM targets? Which other > targets is this code based on, or were relevant as examples? > > Thanks, > > Dan Our target is an 8-bit microcontroller with only one 8-bit register which is the accumulator. All arithmetic/load/store operations are 8-bit only. The architecture has two address spaces: program and data. The program memory is divided into 2K pages and the data memory is divided into banks of 128 byte, with only 80 usable bytes, resulting in an non-contiguous data memory. It supports direct data memory access (by specifying the address as part of the instruction) and indirect data and program memory access (in an unorthodox fashion which utilize a 16 bit pointer register). Two classes of registers exist: (8-bit class which is only one accumulator) (16-bit class, which contains one or more 16 bit pointer(s)) You can see that our target bears very little similarity to other targets. Currently the port is very elementary and handles very few source constructs. Below are the few challenges that we faced while using llvm framework. 1. The granularity of llvm operation expansion phase is the largest register size available on the target m/c. So if the target has pointer registers of size greater than data registers (in this case the 16 bit pointer register), the operations on the data are not lowered/legalized to correct granularity (8-bit). For example in our case, LowerOperation() is not called for add:i16. This has been the most challenging problem for us. We have tackled this problem having LLVM to lower to 16 bit, and then by manually expanding the datatypes/operations to 8-bit for basic arithmetic and load/store in PerformDAGCombine() method. 2. Due to non-contiguous data memory, we can not support stack (and no recursion therefore). LLVM framework is inherently stack based and has little or no support for static allocation of locals. We tackled this problem in the frontend by code generating globals for stack vars. 3. Accessing the memory through pointer register is generally inefficient in our architecture. However, the fundamental trend in LLVM (and most other compilers for that matter) for accessing the memory is based on pointers. Luckily we are able to identifying the DAG patterns for different types of memory access and generate the appropriate instructions (so far no problem) 4. Like most other compilers, LLVM likes to have as many registers as possible. This is not the case for our accumulator based architecture. However, we have been able to model our code generation to overcome this problem by viewing register spills as intermediate values in calculations. And this seems to be working for us. As a future improvement, we plan to also implement our own LLVM register allocator to minimize the intermediate values. Although LLVM framework has not been designed to support architectures like ours, in general we think that it provides great features and we are willing to take on the challenges that we face to use LLVM for our compiler development. Most importantly, the friendly and helpful feedbacks that we receive from the LLVM community further encourage us in this endeavor. - Sanjiv From ggreif at gmail.com Tue May 13 02:09:09 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 13 May 2008 07:09:09 -0000 Subject: [llvm-commits] [llvm] r51023 - in /llvm/trunk: include/llvm/InstrTypes.h include/llvm/Instructions.h lib/VMCore/Instructions.cpp Message-ID: <200805130709.m4D799UB025195@zion.cs.uiuc.edu> Author: ggreif Date: Tue May 13 02:09:08 2008 New Revision: 51023 URL: http://llvm.org/viewvc/llvm-project?rev=51023&view=rev Log: Derive GetResultInst from UnaryInstruction, this simplifies code and removes a FIXME. Modified: llvm/trunk/include/llvm/InstrTypes.h llvm/trunk/include/llvm/Instructions.h llvm/trunk/lib/VMCore/Instructions.cpp Modified: llvm/trunk/include/llvm/InstrTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InstrTypes.h?rev=51023&r1=51022&r2=51023&view=diff ============================================================================== --- llvm/trunk/include/llvm/InstrTypes.h (original) +++ llvm/trunk/include/llvm/InstrTypes.h Tue May 13 02:09:08 2008 @@ -85,8 +85,9 @@ //===----------------------------------------------------------------------===// class UnaryInstruction : public Instruction { - void *operator new(size_t, unsigned); // Do not implement - + void *operator new(size_t, unsigned); // Do not implement + UnaryInstruction(const UnaryInstruction&); // Do not implement + protected: UnaryInstruction(const Type *Ty, unsigned iType, Value *V, Instruction *IB = 0) : Instruction(Ty, iType, &Op<0>(), 1, IB) { @@ -116,6 +117,7 @@ I->getOpcode() == Instruction::Free || I->getOpcode() == Instruction::Load || I->getOpcode() == Instruction::VAArg || + I->getOpcode() == Instruction::GetResult || (I->getOpcode() >= CastOpsBegin && I->getOpcode() < CastOpsEnd); } static inline bool classof(const Value *V) { Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=51023&r1=51022&r2=51023&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Tue May 13 02:09:08 2008 @@ -2761,20 +2761,14 @@ /// GetResultInst - This instruction extracts individual result value from /// aggregate value, where aggregate value is returned by CallInst. /// -class GetResultInst : public /*FIXME: Unary*/Instruction { - void *operator new(size_t, unsigned); // DO NOT IMPLEMENT +class GetResultInst : public UnaryInstruction { unsigned Idx; GetResultInst(const GetResultInst &GRI) : - Instruction(GRI.getType(), Instruction::GetResult, &Op<0>(), 1) { - Op<0>().init(GRI.Op<0>(), this); - Idx = GRI.Idx; + UnaryInstruction(GRI.getType(), Instruction::GetResult, GRI.getOperand(0)), + Idx(GRI.Idx) { } public: - // allocate space for exactly one operand - void *operator new(size_t s) { - return User::operator new(s, 1); - } GetResultInst(Value *Aggr, unsigned index, const std::string &Name = "", Instruction *InsertBefore = 0); @@ -2797,9 +2791,6 @@ return Idx; } - /// Provide fast operand accessors - DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); - // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const GetResultInst *) { return true; } static inline bool classof(const Instruction *I) { @@ -2810,14 +2801,6 @@ } }; -// FIXME: these are redundant if GetResultInst < UnaryInstruction -template <> -struct OperandTraits : FixedNumOperandTraits<1> { -}; - -DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GetResultInst, Value) - - } // End llvm namespace #endif Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=51023&r1=51022&r2=51023&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Tue May 13 02:09:08 2008 @@ -2734,14 +2734,12 @@ GetResultInst::GetResultInst(Value *Aggregate, unsigned Index, const std::string &Name, Instruction *InsertBef) - : Instruction(cast(Aggregate->getType())->getElementType(Index), - GetResult, - OperandTraits::op_begin(this), - OperandTraits::operands(this), - InsertBef) { - assert(isValidOperands(Aggregate, Index) && "Invalid GetResultInst operands!"); - Op<0>().init(Aggregate, this); - Idx = Index; + : UnaryInstruction(cast(Aggregate->getType()) + ->getElementType(Index), + GetResult, Aggregate, InsertBef), + Idx(Index) { + assert(isValidOperands(Aggregate, Index) + && "Invalid GetResultInst operands!"); setName(Name); } From evan.cheng at apple.com Tue May 13 03:09:17 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 13 May 2008 01:09:17 -0700 Subject: [llvm-commits] PATCH for PIC16 target. In-Reply-To: References: <59215.76.126.208.186.1210349695.squirrel@webmail.apple.com> Message-ID: <7FABD684-ED18-4770-BDF5-B56AA0255258@apple.com> On May 12, 2008, at 10:54 PM, Sanjiv.Gupta at microchip.com wrote: > > > 4. Like most other compilers, LLVM likes to have as many registers as > possible. This is not the case for our accumulator based architecture. > However, we have been able to model our code generation to overcome > this > problem by viewing register spills as intermediate values in > calculations. And this seems to be working for us. As a future > improvement, we plan to also implement our own LLVM register allocator > to minimize the intermediate values. Very nice. I think a simple allocator for a stack machine would do very well. Look forward to it. > > > Although LLVM framework has not been designed to support architectures > like ours, in general we think that it provides great features and we > are willing to take on the challenges that we face to use LLVM for our > compiler development. Most importantly, the friendly and helpful > feedbacks that we receive from the LLVM community further encourage us > in this endeavor. Great to hear. Thanks. Evan > > > - Sanjiv > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From matthijs at stdin.nl Tue May 13 03:11:01 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 13 May 2008 10:11:01 +0200 Subject: [llvm-commits] [llvm] r51021 - in /llvm/trunk/lib/Transforms: IPO/ArgumentPromotion.cpp Scalar/DeadStoreElimination.cpp In-Reply-To: <200805130148.m4D1mRbw019751@zion.cs.uiuc.edu> References: <200805130148.m4D1mRbw019751@zion.cs.uiuc.edu> Message-ID: <20080513081101.GD2450@katherina.student.utwente.nl> Hi, first of all, thanks for cleanup up the mess of my first patch. I hadn't properly set up my indentation when I contributed it :-). > @@ -74,8 +75,8 @@ > Function *DoPromotion(Function *F, > SmallPtrSet &ArgsToPromote, > SmallPtrSet &ByValArgsToTransform); > - /// The maximum number of elements to expand, or 0 for unlimited. > - unsigned maxElements; > + /// The maximum number of elements to expand, or 0 for unlimited. > + unsigned maxElements; > }; > } AFAICS, those lines need an extra indentation level to line up with the rest. Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080513/a58a95c3/attachment.bin From resistor at mac.com Tue May 13 03:17:23 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 13 May 2008 08:17:23 -0000 Subject: [llvm-commits] [llvm] r51024 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp Message-ID: <200805130817.m4D8HN92011939@zion.cs.uiuc.edu> Author: resistor Date: Tue May 13 03:17:22 2008 New Revision: 51024 URL: http://llvm.org/viewvc/llvm-project?rev=51024&view=rev Log: Add support for non-local CSE of read-only calls. Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=51024&r1=51023&r2=51024&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Tue May 13 03:17:22 2008 @@ -56,8 +56,8 @@ FCMPULT, FCMPULE, FCMPUNE, EXTRACT, INSERT, SHUFFLE, SELECT, TRUNC, ZEXT, SEXT, FPTOUI, FPTOSI, UITOFP, SITOFP, FPTRUNC, FPEXT, - PTRTOINT, INTTOPTR, BITCAST, GEP, CALL, EMPTY, - TOMBSTONE }; + PTRTOINT, INTTOPTR, BITCAST, GEP, CALL, CONSTANT, + EMPTY, TOMBSTONE }; ExpressionOpcode opcode; const Type* type; @@ -147,6 +147,7 @@ Expression create_expression(CastInst* C); Expression create_expression(GetElementPtrInst* G); Expression create_expression(CallInst* C); + Expression create_expression(Constant* C); public: ValueTable() : nextValueNumber(1) { } uint32_t lookup_or_add(Value* V); @@ -391,7 +392,7 @@ Expression ValueTable::create_expression(GetElementPtrInst* G) { Expression e; - + e.firstVN = lookup_or_add(G->getPointerOperand()); e.secondVN = 0; e.thirdVN = 0; @@ -434,26 +435,58 @@ } else if (AA->onlyReadsMemory(C)) { Expression e = create_expression(C); - Instruction* dep = MD->getDependency(C); - - if (dep == MemoryDependenceAnalysis::NonLocal || - !isa(dep)) { + if (expressionNumbering.find(e) == expressionNumbering.end()) { expressionNumbering.insert(std::make_pair(e, nextValueNumber)); valueNumbering.insert(std::make_pair(V, nextValueNumber)); + return nextValueNumber++; + } + + DenseMap deps; + MD->getNonLocalDependency(C, deps); + Value* dep = 0; + + for (DenseMap::iterator I = deps.begin(), + E = deps.end(); I != E; ++I) { + if (I->second == MemoryDependenceAnalysis::None) { + valueNumbering.insert(std::make_pair(V, nextValueNumber)); + + return nextValueNumber++; + } else if (I->second != MemoryDependenceAnalysis::NonLocal) { + if (DT->dominates(I->first, C->getParent())) { + dep = I->second; + } else { + valueNumbering.insert(std::make_pair(V, nextValueNumber)); + + return nextValueNumber++; + } + } + } + if (!dep || !isa(dep)) { + valueNumbering.insert(std::make_pair(V, nextValueNumber)); return nextValueNumber++; } CallInst* cdep = cast(dep); - Expression d_exp = create_expression(cdep); - if (e != d_exp) { - expressionNumbering.insert(std::make_pair(e, nextValueNumber)); + if (cdep->getCalledFunction() != C->getCalledFunction() || + cdep->getNumOperands() != C->getNumOperands()) { + valueNumbering.insert(std::make_pair(V, nextValueNumber)); + return nextValueNumber++; + } else if (!C->getCalledFunction()) { valueNumbering.insert(std::make_pair(V, nextValueNumber)); - return nextValueNumber++; } else { - uint32_t v = expressionNumbering[d_exp]; + for (unsigned i = 1; i < C->getNumOperands(); ++i) { + uint32_t c_vn = lookup_or_add(C->getOperand(i)); + uint32_t cd_vn = lookup_or_add(cdep->getOperand(i)); + if (c_vn != cd_vn) { + valueNumbering.insert(std::make_pair(V, nextValueNumber)); + return nextValueNumber++; + } + } + + uint32_t v = valueNumbering[cdep]; valueNumbering.insert(std::make_pair(V, v)); return v; } From resistor at mac.com Tue May 13 03:17:44 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 13 May 2008 08:17:44 -0000 Subject: [llvm-commits] [llvm] r51025 - /llvm/trunk/test/Transforms/GVN/nonlocal-cse.ll Message-ID: <200805130817.m4D8Hin9011963@zion.cs.uiuc.edu> Author: resistor Date: Tue May 13 03:17:44 2008 New Revision: 51025 URL: http://llvm.org/viewvc/llvm-project?rev=51025&view=rev Log: Add a testcase for non-local CSE of read-only calls. Added: llvm/trunk/test/Transforms/GVN/nonlocal-cse.ll Added: llvm/trunk/test/Transforms/GVN/nonlocal-cse.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/nonlocal-cse.ll?rev=51025&view=auto ============================================================================== --- llvm/trunk/test/Transforms/GVN/nonlocal-cse.ll (added) +++ llvm/trunk/test/Transforms/GVN/nonlocal-cse.ll Tue May 13 03:17:44 2008 @@ -0,0 +1,49 @@ +; RUN: llvm-as < %s | opt -gvn | llvm-dis | grep strlen | count 2 +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i386-apple-darwin9" + +define i32 @test(i32 %g, i8* %P) nounwind { +entry: + %tmp2 = call i32 @strlen( i8* %P ) nounwind readonly ; [#uses=1] + %tmp3 = icmp eq i32 %tmp2, 100 ; [#uses=1] + %tmp34 = zext i1 %tmp3 to i8 ; [#uses=1] + %toBool = icmp ne i8 %tmp34, 0 ; [#uses=1] + br i1 %toBool, label %bb, label %bb6 + +bb: ; preds = %entry + br label %bb27 + +bb6: ; preds = %entry + %tmp8 = add i32 %g, 42 ; [#uses=2] + %tmp10 = call i32 @strlen( i8* %P ) nounwind readonly ; [#uses=1] + %tmp11 = icmp eq i32 %tmp10, 100 ; [#uses=1] + %tmp1112 = zext i1 %tmp11 to i8 ; [#uses=1] + %toBool13 = icmp ne i8 %tmp1112, 0 ; [#uses=1] + br i1 %toBool13, label %bb14, label %bb16 + +bb14: ; preds = %bb6 + br label %bb27 + +bb16: ; preds = %bb6 + %tmp18 = mul i32 %tmp8, 2 ; [#uses=1] + %tmp20 = call i32 @strlen( i8* %P ) nounwind readonly ; [#uses=1] + %tmp21 = icmp eq i32 %tmp20, 100 ; [#uses=1] + %tmp2122 = zext i1 %tmp21 to i8 ; [#uses=1] + %toBool23 = icmp ne i8 %tmp2122, 0 ; [#uses=1] + br i1 %toBool23, label %bb24, label %bb26 + +bb24: ; preds = %bb16 + br label %bb27 + +bb26: ; preds = %bb16 + br label %bb27 + +bb27: ; preds = %bb26, %bb24, %bb14, %bb + %tmp.0 = phi i32 [ 11, %bb26 ], [ %tmp18, %bb24 ], [ %tmp8, %bb14 ], [ %g, %bb ] ; [#uses=1] + br label %return + +return: ; preds = %bb27 + ret i32 %tmp.0 +} + +declare i32 @strlen(i8*) nounwind readonly From baldrick at free.fr Tue May 13 03:16:24 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 May 2008 10:16:24 +0200 Subject: [llvm-commits] [llvm] r51013 - /llvm/trunk/docs/LangRef.html In-Reply-To: <200805122351.m4CNp9ss007522@zion.cs.uiuc.edu> References: <200805122351.m4CNp9ss007522@zion.cs.uiuc.edu> Message-ID: <200805131016.24515.baldrick@free.fr> Hi Dan, > +The 'extractvalue' instruction extracts a value > +from an aggregate value. it may not be clear to people what it means to extract a value... > +The first operand of an 'extractvalue' instruction is a > +value of struct or array > +type. The operands are constant indicies to specify which value to extract > +in the same manner as indicies in a ... so how about explaining that this means extracting a field from a struct and an element from an array. Also, indicies -> indices > +The first operand of an 'insertvalue' instruction is a > +value of struct or array type. > +The second operand is a first-class value to insert. > +type of the first operand. The following operands are constant indicies > +indicating the position at which to insert the value in the same manner as > +indicies in a Likewise. > +The value to insert must have the same type as the value identified > +by the indicies. indicies -> indices. This occurs later on too. Ciao, Duncan. From evan.cheng at apple.com Tue May 13 03:35:04 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 13 May 2008 08:35:04 -0000 Subject: [llvm-commits] [llvm] r51026 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Target/X86/README-SSE.txt lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/extractelement-from-arg.ll test/CodeGen/X86/extractelement-load.ll test/CodeGen/X86/sse-align-12.ll test/CodeGen/X86/vec_extract-sse4.ll Message-ID: <200805130835.m4D8Z4uX012431@zion.cs.uiuc.edu> Author: evancheng Date: Tue May 13 03:35:03 2008 New Revision: 51026 URL: http://llvm.org/viewvc/llvm-project?rev=51026&view=rev Log: Instead of a vector load, shuffle and then extract an element. Load the element from address with an offset. pshufd $1, (%rdi), %xmm0 movd %xmm0, %eax => movl 4(%rdi), %eax Added: llvm/trunk/test/CodeGen/X86/extractelement-load.ll Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/Target/X86/README-SSE.txt llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/test/CodeGen/X86/extractelement-from-arg.ll llvm/trunk/test/CodeGen/X86/sse-align-12.ll llvm/trunk/test/CodeGen/X86/vec_extract-sse4.ll Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=51026&r1=51025&r2=51026&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Tue May 13 03:35:03 2008 @@ -607,6 +607,10 @@ /// isVerifiedDebugInfoDesc - Returns true if the specified SDOperand has /// been verified as a debug information descriptor. bool isVerifiedDebugInfoDesc(SDOperand Op) const; + + /// getShuffleScalarElt - Returns the scalar element that will make up the ith + /// element of the result of the vector shuffle. + SDOperand getShuffleScalarElt(const SDNode *N, unsigned Idx); private: void RemoveNodeFromCSEMaps(SDNode *N); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=51026&r1=51025&r2=51026&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue May 13 03:35:03 2008 @@ -4682,49 +4682,82 @@ } SDOperand DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) { + // (vextract (v4f32 load $addr), c) -> (f32 load $addr+c*size) + // (vextract (v4f32 s2v (f32 load $addr)), c) -> (f32 load $addr+c*size) + // (vextract (v4f32 shuffle (load $addr), <1,u,u,u>), 0) -> (f32 load $addr) + + // Perform only after legalization to ensure build_vector / vector_shuffle + // optimizations have already been done. + if (!AfterLegalize) return SDOperand(); + SDOperand InVec = N->getOperand(0); SDOperand EltNo = N->getOperand(1); - // (vextract (v4f32 s2v (f32 load $addr)), 0) -> (f32 load $addr) - // (vextract (v4i32 bc (v4f32 s2v (f32 load $addr))), 0) -> (i32 load $addr) if (isa(EltNo)) { unsigned Elt = cast(EltNo)->getValue(); bool NewLoad = false; - if (Elt == 0) { - MVT::ValueType VT = InVec.getValueType(); - MVT::ValueType EVT = MVT::getVectorElementType(VT); - MVT::ValueType LVT = EVT; - unsigned NumElts = MVT::getVectorNumElements(VT); - if (InVec.getOpcode() == ISD::BIT_CONVERT) { - MVT::ValueType BCVT = InVec.getOperand(0).getValueType(); - if (!MVT::isVector(BCVT) || - NumElts != MVT::getVectorNumElements(BCVT)) - return SDOperand(); + MVT::ValueType VT = InVec.getValueType(); + MVT::ValueType EVT = MVT::getVectorElementType(VT); + MVT::ValueType LVT = EVT; + if (InVec.getOpcode() == ISD::BIT_CONVERT) { + MVT::ValueType BCVT = InVec.getOperand(0).getValueType(); + if (!MVT::isVector(BCVT) + || (MVT::getSizeInBits(EVT) > + MVT::getSizeInBits(MVT::getVectorElementType(BCVT)))) + return SDOperand(); + InVec = InVec.getOperand(0); + EVT = MVT::getVectorElementType(BCVT); + NewLoad = true; + } + + LoadSDNode *LN0 = NULL; + if (ISD::isNormalLoad(InVec.Val)) + LN0 = cast(InVec); + else if (InVec.getOpcode() == ISD::SCALAR_TO_VECTOR && + InVec.getOperand(0).getValueType() == EVT && + ISD::isNormalLoad(InVec.getOperand(0).Val)) { + LN0 = cast(InVec.getOperand(0)); + } else if (InVec.getOpcode() == ISD::VECTOR_SHUFFLE) { + // (vextract (vector_shuffle (load $addr), v2, <1, u, u, u>), 1) + // => + // (load $addr+1*size) + unsigned Idx = cast(InVec.getOperand(2). + getOperand(Elt))->getValue(); + unsigned NumElems = InVec.getOperand(2).getNumOperands(); + InVec = (Idx < NumElems) ? InVec.getOperand(0) : InVec.getOperand(1); + if (InVec.getOpcode() == ISD::BIT_CONVERT) InVec = InVec.getOperand(0); - EVT = MVT::getVectorElementType(BCVT); - NewLoad = true; + if (ISD::isNormalLoad(InVec.Val)) { + LN0 = cast(InVec); + Elt = (Idx < NumElems) ? Idx : Idx - NumElems; } - if (InVec.getOpcode() == ISD::SCALAR_TO_VECTOR && - InVec.getOperand(0).getValueType() == EVT && - ISD::isNormalLoad(InVec.getOperand(0).Val) && - InVec.getOperand(0).hasOneUse()) { - LoadSDNode *LN0 = cast(InVec.getOperand(0)); - unsigned Align = LN0->getAlignment(); - if (NewLoad) { - // Check the resultant load doesn't need a higher alignment than the - // original load. - unsigned NewAlign = TLI.getTargetMachine().getTargetData()-> - getABITypeAlignment(MVT::getTypeForValueType(LVT)); - if (!TLI.isOperationLegal(ISD::LOAD, LVT) || NewAlign > Align) - return SDOperand(); - Align = NewAlign; - } + } + if (!LN0 || !LN0->hasOneUse()) + return SDOperand(); - return DAG.getLoad(LVT, LN0->getChain(), LN0->getBasePtr(), - LN0->getSrcValue(), LN0->getSrcValueOffset(), - LN0->isVolatile(), Align); - } + unsigned Align = LN0->getAlignment(); + if (NewLoad) { + // Check the resultant load doesn't need a higher alignment than the + // original load. + unsigned NewAlign = TLI.getTargetMachine().getTargetData()-> + getABITypeAlignment(MVT::getTypeForValueType(LVT)); + if (!TLI.isOperationLegal(ISD::LOAD, LVT) || NewAlign > Align) + return SDOperand(); + Align = NewAlign; } + + SDOperand NewPtr = LN0->getBasePtr(); + if (Elt) { + unsigned PtrOff = MVT::getSizeInBits(LVT) * Elt / 8; + MVT::ValueType PtrType = NewPtr.getValueType(); + if (TLI.isBigEndian()) + PtrOff = MVT::getSizeInBits(VT) / 8 - PtrOff; + NewPtr = DAG.getNode(ISD::ADD, PtrType, NewPtr, + DAG.getConstant(PtrOff, PtrType)); + } + return DAG.getLoad(LVT, LN0->getChain(), NewPtr, + LN0->getSrcValue(), LN0->getSrcValueOffset(), + LN0->isVolatile(), Align); } return SDOperand(); } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=51026&r1=51025&r2=51026&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue May 13 03:35:03 2008 @@ -1838,6 +1838,28 @@ } +/// getShuffleScalarElt - Returns the scalar element that will make up the ith +/// element of the result of the vector shuffle. +SDOperand SelectionDAG::getShuffleScalarElt(const SDNode *N, unsigned Idx) { + MVT::ValueType VT = N->getValueType(0); + SDOperand PermMask = N->getOperand(2); + unsigned NumElems = PermMask.getNumOperands(); + SDOperand V = (Idx < NumElems) ? N->getOperand(0) : N->getOperand(1); + Idx %= NumElems; + if (V.getOpcode() == ISD::SCALAR_TO_VECTOR) { + return (Idx == 0) + ? V.getOperand(0) : getNode(ISD::UNDEF, MVT::getVectorElementType(VT)); + } + if (V.getOpcode() == ISD::VECTOR_SHUFFLE) { + SDOperand Elt = PermMask.getOperand(Idx); + if (Elt.getOpcode() == ISD::UNDEF) + return getNode(ISD::UNDEF, MVT::getVectorElementType(VT)); + return getShuffleScalarElt(V.Val,cast(Elt)->getValue()); + } + return SDOperand(); +} + + /// getNode - Gets or creates the specified node. /// SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT) { Modified: llvm/trunk/lib/Target/X86/README-SSE.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README-SSE.txt?rev=51026&r1=51025&r2=51026&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/README-SSE.txt (original) +++ llvm/trunk/lib/Target/X86/README-SSE.txt Tue May 13 03:35:03 2008 @@ -545,35 +545,6 @@ //===---------------------------------------------------------------------===// -These functions should produce the same code: - -#include - -typedef long long __m128i __attribute__ ((__vector_size__ (16))); - -int foo(__m128i* val) { - return __builtin_ia32_vec_ext_v4si(*val, 1); -} -int bar(__m128i* val) { - union vs { - __m128i *_v; - int* _s; - } v = {val}; - return v._s[1]; -} - -We currently produce (with -m64): - -_foo: - pshufd $1, (%rdi), %xmm0 - movd %xmm0, %eax - ret -_bar: - movl 4(%rdi), %eax - ret - -//===---------------------------------------------------------------------===// - We should materialize vector constants like "all ones" and "signbit" with code like: Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=51026&r1=51025&r2=51026&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue May 13 03:35:03 2008 @@ -6182,26 +6182,6 @@ } } -/// getShuffleScalarElt - Returns the scalar element that will make up the ith -/// element of the result of the vector shuffle. -static SDOperand getShuffleScalarElt(SDNode *N, unsigned i, SelectionDAG &DAG) { - MVT::ValueType VT = N->getValueType(0); - SDOperand PermMask = N->getOperand(2); - unsigned NumElems = PermMask.getNumOperands(); - SDOperand V = (i < NumElems) ? N->getOperand(0) : N->getOperand(1); - i %= NumElems; - if (V.getOpcode() == ISD::SCALAR_TO_VECTOR) { - return (i == 0) - ? V.getOperand(0) : DAG.getNode(ISD::UNDEF, MVT::getVectorElementType(VT)); - } else if (V.getOpcode() == ISD::VECTOR_SHUFFLE) { - SDOperand Idx = PermMask.getOperand(i); - if (Idx.getOpcode() == ISD::UNDEF) - return DAG.getNode(ISD::UNDEF, MVT::getVectorElementType(VT)); - return getShuffleScalarElt(V.Val,cast(Idx)->getValue(),DAG); - } - return SDOperand(); -} - /// isGAPlusOffset - Returns true (and the GlobalValue and the offset) if the /// node is a GlobalAddress + offset. bool X86TargetLowering::isGAPlusOffset(SDNode *N, @@ -6240,7 +6220,7 @@ } unsigned Index = cast(Idx)->getValue(); - SDOperand Elt = getShuffleScalarElt(N, Index, DAG); + SDOperand Elt = DAG.getShuffleScalarElt(N, Index); if (!Elt.Val || (Elt.getOpcode() != ISD::UNDEF && !ISD::isNON_EXTLoad(Elt.Val))) return false; Modified: llvm/trunk/test/CodeGen/X86/extractelement-from-arg.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/extractelement-from-arg.ll?rev=51026&r1=51025&r2=51026&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/extractelement-from-arg.ll (original) +++ llvm/trunk/test/CodeGen/X86/extractelement-from-arg.ll Tue May 13 03:35:03 2008 @@ -1,6 +1,6 @@ -; RUN: llvm-as %s -o - | llc -march=x86-64 +; RUN: llvm-as %s -o - | llc -march=x86-64 -mattr=+sse2 -define void @test(float* %R, <4 x float> %X) { +define void @test(float* %R, <4 x float> %X) nounwind { %tmp = extractelement <4 x float> %X, i32 3 store float %tmp, float* %R ret void Added: llvm/trunk/test/CodeGen/X86/extractelement-load.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/extractelement-load.ll?rev=51026&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/extractelement-load.ll (added) +++ llvm/trunk/test/CodeGen/X86/extractelement-load.ll Tue May 13 03:35:03 2008 @@ -0,0 +1,9 @@ +; RUN: llvm-as %s -o - | llc -march=x86 -mattr=+sse2 -mcpu=yonah | not grep movd +; RUN: llvm-as %s -o - | llc -march=x86-64 -mattr=+sse2 -mcpu=yonah | not grep movd + +define i32 @t(<2 x i64>* %val) nounwind { + %tmp2 = load <2 x i64>* %val, align 16 ; <<2 x i64>> [#uses=1] + %tmp3 = bitcast <2 x i64> %tmp2 to <4 x i32> ; <<4 x i32>> [#uses=1] + %tmp4 = extractelement <4 x i32> %tmp3, i32 2 ; [#uses=1] + ret i32 %tmp4 +} Modified: llvm/trunk/test/CodeGen/X86/sse-align-12.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sse-align-12.ll?rev=51026&r1=51025&r2=51026&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/sse-align-12.ll (original) +++ llvm/trunk/test/CodeGen/X86/sse-align-12.ll Tue May 13 03:35:03 2008 @@ -28,8 +28,7 @@ %s = insertelement <4 x float> %r, float %b, i32 3 ret <4 x float> %s } -define <2 x double> @c(<2 x double>* %y) -{ +define <2 x double> @c(<2 x double>* %y) nounwind { %x = load <2 x double>* %y, align 8 %a = extractelement <2 x double> %x, i32 0 %c = extractelement <2 x double> %x, i32 1 @@ -37,8 +36,7 @@ %r = insertelement <2 x double> %p, double %a, i32 1 ret <2 x double> %r } -define <2 x double> @d(<2 x double>* %y, <2 x double> %z) -{ +define <2 x double> @d(<2 x double>* %y, <2 x double> %z) nounwind { %x = load <2 x double>* %y, align 8 %a = extractelement <2 x double> %x, i32 1 %c = extractelement <2 x double> %z, i32 1 Modified: llvm/trunk/test/CodeGen/X86/vec_extract-sse4.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_extract-sse4.ll?rev=51026&r1=51025&r2=51026&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_extract-sse4.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_extract-sse4.ll Tue May 13 03:35:03 2008 @@ -1,29 +1,30 @@ ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse41 -o %t -f -; RUN: grep extractps %t | count 1 -; RUN: grep pextrd %t | count 2 -; RUN: grep pshufd %t | count 1 +; RUN: grep extractps %t | count 1 +; RUN: grep pextrd %t | count 1 +; RUN: not grep pshufd %t +; RUN: not grep movss %t -define void @t1(float* %R, <4 x float>* %P1) { +define void @t1(float* %R, <4 x float>* %P1) nounwind { %X = load <4 x float>* %P1 %tmp = extractelement <4 x float> %X, i32 3 store float %tmp, float* %R ret void } -define float @t2(<4 x float>* %P1) { +define float @t2(<4 x float>* %P1) nounwind { %X = load <4 x float>* %P1 %tmp = extractelement <4 x float> %X, i32 2 ret float %tmp } -define void @t3(i32* %R, <4 x i32>* %P1) { +define void @t3(i32* %R, <4 x i32>* %P1) nounwind { %X = load <4 x i32>* %P1 %tmp = extractelement <4 x i32> %X, i32 3 store i32 %tmp, i32* %R ret void } -define i32 @t4(<4 x i32>* %P1) { +define i32 @t4(<4 x i32>* %P1) nounwind { %X = load <4 x i32>* %P1 %tmp = extractelement <4 x i32> %X, i32 3 ret i32 %tmp From baldrick at free.fr Tue May 13 03:22:03 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 May 2008 10:22:03 +0200 Subject: [llvm-commits] [llvm] r51019 - in /llvm/trunk: lib/Target/X86/README-SSE.txt lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/vec_set-H.ll In-Reply-To: <200805130054.m4D0s4BT018226@zion.cs.uiuc.edu> References: <200805130054.m4D0s4BT018226@zion.cs.uiuc.edu> Message-ID: <200805131022.03193.baldrick@free.fr> Hi Evan, > On x86, it's safe to treat i32 load anyext as a normal i32 load. Ditto for i8 anyext load to i16. if this was loading the last two bytes in a page, then now it will be loading two bytes from the next page, which could trap. Similarly, if this was loading 2 bytes out of i/o registers, it may now be reading 4 bytes out of i/o registers, which could have side effects. Ciao, Duncan. From sanjiv.gupta at microchip.com Tue May 13 04:02:59 2008 From: sanjiv.gupta at microchip.com (Sanjiv Gupta) Date: Tue, 13 May 2008 09:02:59 -0000 Subject: [llvm-commits] [llvm] r51027 - in /llvm/trunk/lib/Target/PIC16: ./ Makefile PIC16.h PIC16.td PIC16AsmPrinter.cpp PIC16CallingConv.td PIC16ConstantPoolValue.cpp PIC16ConstantPoolValue.h PIC16ISelDAGToDAG.cpp PIC16ISelLowering.cpp PIC16ISelLowering.h PIC16InstrFormats.td PIC16InstrInfo.cpp PIC16InstrInfo.h PIC16InstrInfo.td PIC16RegisterInfo.cpp PIC16RegisterInfo.h PIC16RegisterInfo.td PIC16Subtarget.cpp PIC16Subtarget.h PIC16TargetAsmInfo.cpp PIC16TargetAsmInfo.h PIC16TargetMachine.cpp PIC16TargetMachine.h Message-ID: <200805130903.m4D930nv014096@zion.cs.uiuc.edu> Author: sgupta Date: Tue May 13 04:02:57 2008 New Revision: 51027 URL: http://llvm.org/viewvc/llvm-project?rev=51027&view=rev Log: Adding files for Microchip's PIC16 target. A brief description about PIC16: =============================== PIC16 is an 8-bit microcontroller with only one 8-bit register which is the accumulator. All arithmetic/load/store operations are 8-bit only. The architecture has two address spaces: program and data. The program memory is divided into 2K pages and the data memory is divided into banks of 128 byte, with only 80 usable bytes, resulting in an non-contiguous data memory. It supports direct data memory access (by specifying the address as part of the instruction) and indirect data and program memory access (in an unorthodox fashion which utilize a 16 bit pointer register). Two classes of registers exist: (8-bit class which is only one accumulator) (16-bit class, which contains one or more 16 bit pointer(s)) Added: llvm/trunk/lib/Target/PIC16/ llvm/trunk/lib/Target/PIC16/Makefile llvm/trunk/lib/Target/PIC16/PIC16.h llvm/trunk/lib/Target/PIC16/PIC16.td llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp llvm/trunk/lib/Target/PIC16/PIC16CallingConv.td llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.cpp llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.h llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.h llvm/trunk/lib/Target/PIC16/PIC16InstrFormats.td llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.h llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.td llvm/trunk/lib/Target/PIC16/PIC16Subtarget.cpp llvm/trunk/lib/Target/PIC16/PIC16Subtarget.h llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.h llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h Added: llvm/trunk/lib/Target/PIC16/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/Makefile?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/Makefile (added) +++ llvm/trunk/lib/Target/PIC16/Makefile Tue May 13 04:02:57 2008 @@ -0,0 +1,21 @@ +##===- lib/Target/PIC16/Makefile ---------------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## +LEVEL = ../../.. +LIBRARYNAME = LLVMPIC16 +TARGET = PIC16 + +# Make sure that tblgen is run, first thing. +BUILT_SOURCES = PIC16GenRegisterInfo.h.inc PIC16GenRegisterNames.inc \ + PIC16GenRegisterInfo.inc PIC16GenInstrNames.inc \ + PIC16GenInstrInfo.inc PIC16GenAsmWriter.inc \ + PIC16GenDAGISel.inc PIC16GenCallingConv.inc \ + PIC16GenSubtarget.inc + +include $(LEVEL)/Makefile.common + Added: llvm/trunk/lib/Target/PIC16/PIC16.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16.h?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16.h (added) +++ llvm/trunk/lib/Target/PIC16/PIC16.h Tue May 13 04:02:57 2008 @@ -0,0 +1,38 @@ +//===-- PIC16.h - Top-level interface for PIC16 representation --*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file was developed by Bruno Cardoso Lopes and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the entry points for global functions defined in +// the LLVM PIC16 back-end. +// +//===----------------------------------------------------------------------===// + +#ifndef TARGET_PIC16_H +#define TARGET_PIC16_H + +#include + +namespace llvm { + class PIC16TargetMachine; + class FunctionPassManager; + class FunctionPass; + class MachineCodeEmitter; + + FunctionPass *createPIC16ISelDag(PIC16TargetMachine &TM); + FunctionPass *createPIC16CodePrinterPass(std::ostream &OS, + PIC16TargetMachine &TM); +} // end namespace llvm; + +// Defines symbolic names for PIC16 registers. This defines a mapping from +// register name to register number. +#include "PIC16GenRegisterNames.inc" + +// Defines symbolic names for the PIC16 instructions. +#include "PIC16GenInstrNames.inc" + +#endif Added: llvm/trunk/lib/Target/PIC16/PIC16.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16.td?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16.td (added) +++ llvm/trunk/lib/Target/PIC16/PIC16.td Tue May 13 04:02:57 2008 @@ -0,0 +1,46 @@ +//===- PIC16.td - Describe the PIC16 Target Machine -----------*- tblgen -*-==// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// This is the top level entry point for the PIC16 target. +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// Target-independent interfaces +//===----------------------------------------------------------------------===// + +include "../Target.td" + +//===----------------------------------------------------------------------===// +// Descriptions +//===----------------------------------------------------------------------===// + +include "PIC16RegisterInfo.td" +include "PIC16CallingConv.td" +include "PIC16InstrInfo.td" + +def PIC16InstrInfo : InstrInfo { + let TSFlagsFields = []; + let TSFlagsShifts = []; +} + + + +// Not currently supported, but work as SubtargetFeature placeholder. +def FeaturePIC16Old : SubtargetFeature<"pic16old", "IsPIC16Old", "true", + "PIC16 Old ISA Support">; + +//===----------------------------------------------------------------------===// +// PIC16 processors supported. +//===----------------------------------------------------------------------===// + +def : Processor<"generic", NoItineraries, []>; + +def PIC16 : Target { + let InstructionSet = PIC16InstrInfo; +} + Added: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (added) +++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Tue May 13 04:02:57 2008 @@ -0,0 +1,569 @@ +//===-- PIC16AsmPrinter.cpp - PIC16 LLVM assembly writer ------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains a printer that converts from our internal representation +// of machine-dependent LLVM code to PIC16 assembly language. +// +//===----------------------------------------------------------------------===// + +#define DEBUG_TYPE "asm-printer" +#include "PIC16.h" +#include "PIC16TargetMachine.h" +#include "PIC16ConstantPoolValue.h" +#include "PIC16InstrInfo.h" +#include "llvm/Constants.h" +#include "llvm/DerivedTypes.h" +#include "llvm/Module.h" +#include "llvm/ADT/SetVector.h" +#include "llvm/ADT/Statistic.h" +#include "llvm/ADT/StringExtras.h" +#include "llvm/CodeGen/AsmPrinter.h" +#include "llvm/CodeGen/MachineFunctionPass.h" +#include "llvm/CodeGen/MachineConstantPool.h" +#include "llvm/CodeGen/MachineFrameInfo.h" +#include "llvm/CodeGen/MachineInstr.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/Debug.h" +#include "llvm/Support/Mangler.h" +#include "llvm/Support/MathExtras.h" +#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/Target/TargetData.h" +#include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetOptions.h" +#include + +using namespace llvm; + +STATISTIC(EmittedInsts, "Number of machine instrs printed"); + +namespace { + struct VISIBILITY_HIDDEN PIC16AsmPrinter : public AsmPrinter { + PIC16AsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T) + : AsmPrinter(O, TM, T) { + } + + + /// We name each basic block in a Function with a unique number, so + /// that we can consistently refer to them later. This is cleared + /// at the beginning of each call to runOnMachineFunction(). + /// + typedef std::map ValueMapTy; + ValueMapTy NumberForBB; + + /// Keeps the set of GlobalValues that require non-lazy-pointers for + /// indirect access. + std::set GVNonLazyPtrs; + + /// Keeps the set of external function GlobalAddresses that the asm + /// printer should generate stubs for. + std::set FnStubs; + + /// True if asm printer is printing a series of CONSTPOOL_ENTRY. + bool InCPMode; + + virtual const char *getPassName() const { + return "PIC16 Assembly Printer"; + } + + void printOperand(const MachineInstr *MI, int opNum, + const char *Modifier = 0); + + void printSOImmOperand(const MachineInstr *MI, int opNum); + + void printAddrModeOperand(const MachineInstr *MI, int OpNo); + + void printRegisterList(const MachineInstr *MI, int opNum); + void printCPInstOperand(const MachineInstr *MI, int opNum, + const char *Modifier); + + + bool printInstruction(const MachineInstr *MI); // autogenerated. + void emitFunctionStart(MachineFunction &F); + bool runOnMachineFunction(MachineFunction &F); + bool doInitialization(Module &M); + bool doFinalization(Module &M); + + virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV); + + void getAnalysisUsage(AnalysisUsage &AU) const; + + public: + void SwitchToTextSection(const char *NewSection, + const GlobalValue *GV = NULL); + void SwitchToDataSection(const char *NewSection, + const GlobalValue *GV = NULL); + void SwitchToDataOvrSection(const char *NewSection, + const GlobalValue *GV = NULL); + }; +} // end of anonymous namespace + +#include "PIC16GenAsmWriter.inc" + +/// createPIC16CodePrinterPass - Returns a pass that prints the PIC16 +/// assembly code for a MachineFunction to the given output stream, +/// using the given target machine description. This should work +/// regardless of whether the function is in SSA form. +/// +FunctionPass *llvm::createPIC16CodePrinterPass(std::ostream &o, + PIC16TargetMachine &tm) { + return new PIC16AsmPrinter(o, tm, tm.getTargetAsmInfo()); +} + +void PIC16AsmPrinter::getAnalysisUsage(AnalysisUsage &AU) const +{ + // Currently unimplemented. +} + + +void PIC16AsmPrinter :: +EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) +{ + printDataDirective(MCPV->getType()); + + PIC16ConstantPoolValue *ACPV = (PIC16ConstantPoolValue*)MCPV; + GlobalValue *GV = ACPV->getGV(); + std::string Name = GV ? Mang->getValueName(GV) : TAI->getGlobalPrefix(); + if (!GV) + Name += ACPV->getSymbol(); + if (ACPV->isNonLazyPointer()) { + GVNonLazyPtrs.insert(Name); + O << TAI->getPrivateGlobalPrefix() << Name << "$non_lazy_ptr"; + } else if (ACPV->isStub()) { + FnStubs.insert(Name); + O << TAI->getPrivateGlobalPrefix() << Name << "$stub"; + } else + O << Name; + if (ACPV->hasModifier()) O << "(" << ACPV->getModifier() << ")"; + + if (ACPV->getPCAdjustment() != 0) { + O << "-(" << TAI->getPrivateGlobalPrefix() << "PC" + << utostr(ACPV->getLabelId()) + << "+" << (unsigned)ACPV->getPCAdjustment(); + + if (ACPV->mustAddCurrentAddress()) + O << "-."; + + O << ")"; + } + O << "\n"; + + // If the constant pool value is a extern weak symbol, remember to emit + // the weak reference. + if (GV && GV->hasExternalWeakLinkage()) + ExtWeakSymbols.insert(GV); +} + +/// Emit the directives used by ASM on the start of functions +void PIC16AsmPrinter:: emitFunctionStart(MachineFunction &MF) +{ + // Print out the label for the function. + const Function *F = MF.getFunction(); + MachineFrameInfo *FrameInfo = MF.getFrameInfo(); + if (FrameInfo->hasStackObjects()) { + int indexBegin = FrameInfo->getObjectIndexBegin(); + int indexEnd = FrameInfo->getObjectIndexEnd(); + while (indexBegingetParent()->getModuleIdentifier().c_str(), + F); + + O << "\t\t" << CurrentFnName << "_" << indexBegin << " " << "RES" + << " " << FrameInfo->getObjectSize(indexBegin) << "\n" ; + indexBegin++; + } + } + SwitchToTextSection(CurrentFnName.c_str(), F); + O << "_" << CurrentFnName << ":" ; + O << "\n"; +} + + +/// runOnMachineFunction - This uses the printInstruction() +/// method to print assembly for each instruction. +/// +bool PIC16AsmPrinter:: +runOnMachineFunction(MachineFunction &MF) +{ + + // DW.SetModuleInfo(&getAnalysis()); + SetupMachineFunction(MF); + O << "\n"; + + // NOTE: we don't print out constant pools here, they are handled as + // instructions. + O << "\n"; + + // What's my mangled name? + CurrentFnName = Mang->getValueName(MF.getFunction()); + + // Emit the function start directives + emitFunctionStart(MF); + + // Emit pre-function debug information. + // DW.BeginFunction(&MF); + + // Print out code for the function. + for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); + I != E; ++I) { + // Print a label for the basic block. + if (I != MF.begin()) { + printBasicBlockLabel(I, true); + O << '\n'; + } + for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end(); + II != E; ++II) { + // Print the assembly for the instruction. + O << '\t'; + printInstruction(II); + ++EmittedInsts; + } + } + + // Emit post-function debug information. + // DW.EndFunction(); + + // We didn't modify anything. + return false; +} + +void PIC16AsmPrinter:: +printOperand(const MachineInstr *MI, int opNum, const char *Modifier) +{ + const MachineOperand &MO = MI->getOperand(opNum); + const TargetRegisterInfo &RI = *TM.getRegisterInfo(); + + switch (MO.getType()) + { + case MachineOperand::MO_Register: + { + if (TargetRegisterInfo::isPhysicalRegister(MO.getReg())) + O << RI.get(MO.getReg()).Name; + else + assert(0 && "not implemented"); + break; + } + case MachineOperand::MO_Immediate: + { + if (!Modifier || strcmp(Modifier, "no_hash") != 0) + O << "#"; + O << (int)MO.getImm(); + break; + } + case MachineOperand::MO_MachineBasicBlock: + { + printBasicBlockLabel(MO.getMBB()); + return; + } + case MachineOperand::MO_GlobalAddress: + { + O << Mang->getValueName(MO.getGlobal())<<'+'<getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() + << '_' << MO.getIndex(); + break; + } + case MachineOperand::MO_FrameIndex: + { + O << "_" << CurrentFnName + << '+' << MO.getIndex(); + break; + } + case MachineOperand::MO_JumpTableIndex: + { + O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber() + << '_' << MO.getIndex(); + break; + } + default: + { + O << ""; abort (); + break; + } + } // end switch. +} + +static void +printSOImm(std::ostream &O, int64_t V, const TargetAsmInfo *TAI) +{ + assert(V < (1 << 12) && "Not a valid so_imm value!"); + unsigned Imm = V; + + O << Imm; +} + +/// printSOImmOperand - SOImm is 4-bit rotate amount in bits 8-11 with 8-bit +/// immediate in bits 0-7. +void PIC16AsmPrinter:: +printSOImmOperand(const MachineInstr *MI, int OpNum) +{ + const MachineOperand &MO = MI->getOperand(OpNum); + assert(MO.isImmediate() && "Not a valid so_imm value!"); + printSOImm(O, MO.getImm(), TAI); +} + + +void PIC16AsmPrinter:: printAddrModeOperand(const MachineInstr *MI, int Op) +{ + const MachineOperand &MO1 = MI->getOperand(Op); + const MachineOperand &MO2 = MI->getOperand(Op+1); + + if (MO2.isFrameIndex ()) { + printOperand(MI, Op+1); + return; + } + + if (!MO1.isRegister()) { // FIXME: This is for CP entries, but isn't right. + printOperand(MI, Op); + return; + } + + // If this is Stack Slot + if (MO1.isRegister()) { + if(strcmp(TM.getRegisterInfo()->get(MO1.getReg()).Name, "SP")==0) + { + O << CurrentFnName <<"_"<< MO2.getImm(); + return; + } + O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).Name; + O << "+"; + O << MO2.getImm(); + O << "]"; + return; + } + + O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).Name; + O << "]"; +} + + +void PIC16AsmPrinter:: printRegisterList(const MachineInstr *MI, int opNum) +{ + O << "{"; + for (unsigned i = opNum, e = MI->getNumOperands(); i != e; ++i) { + printOperand(MI, i); + if (i != e-1) O << ", "; + } + O << "}"; +} + +void PIC16AsmPrinter:: +printCPInstOperand(const MachineInstr *MI, int OpNo, const char *Modifier) +{ + assert(Modifier && "This operand only works with a modifier!"); + + // There are two aspects to a CONSTANTPOOL_ENTRY operand, the label and the + // data itself. + if (!strcmp(Modifier, "label")) { + unsigned ID = MI->getOperand(OpNo).getImm(); + O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() + << '_' << ID << ":\n"; + } else { + assert(!strcmp(Modifier, "cpentry") && "Unknown modifier for CPE"); + unsigned CPI = MI->getOperand(OpNo).getIndex(); + + const MachineConstantPoolEntry &MCPE = // Chasing pointers is fun? + MI->getParent()->getParent()->getConstantPool()->getConstants()[CPI]; + + if (MCPE.isMachineConstantPoolEntry()) + EmitMachineConstantPoolValue(MCPE.Val.MachineCPVal); + else { + EmitGlobalConstant(MCPE.Val.ConstVal); + // remember to emit the weak reference + if (const GlobalValue *GV = dyn_cast(MCPE.Val.ConstVal)) + if (GV->hasExternalWeakLinkage()) + ExtWeakSymbols.insert(GV); + } + } +} + + +bool PIC16AsmPrinter:: doInitialization(Module &M) +{ + // Emit initial debug information. + // DW.BeginModule(&M); + + bool Result = AsmPrinter::doInitialization(M); + return Result; +} + +bool PIC16AsmPrinter:: doFinalization(Module &M) +{ + const TargetData *TD = TM.getTargetData(); + + for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); + I != E; ++I) { + if (!I->hasInitializer()) // External global require no code + continue; + + if (EmitSpecialLLVMGlobal(I)) { + continue; + } + + std::string name = Mang->getValueName(I); + Constant *C = I->getInitializer(); + const Type *Type = C->getType(); + unsigned Size = TD->getABITypeSize(Type); + unsigned Align = TD->getPreferredAlignmentLog(I); + + const char *VisibilityDirective = NULL; + if (I->hasHiddenVisibility()) + VisibilityDirective = TAI->getHiddenDirective(); + else if (I->hasProtectedVisibility()) + VisibilityDirective = TAI->getProtectedDirective(); + + if (VisibilityDirective) + O << VisibilityDirective << name << "\n"; + + if (C->isNullValue()) { + if (I->hasExternalLinkage()) { + if (const char *Directive = TAI->getZeroFillDirective()) { + O << "\t.globl\t" << name << "\n"; + O << Directive << "__DATA__, __common, " << name << ", " + << Size << ", " << Align << "\n"; + continue; + } + } + + if (!I->hasSection() && + (I->hasInternalLinkage() || I->hasWeakLinkage() || + I->hasLinkOnceLinkage())) { + if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. + if (!NoZerosInBSS && TAI->getBSSSection()) + SwitchToDataSection(M.getModuleIdentifier().c_str(), I); + else + SwitchToDataSection(TAI->getDataSection(), I); + if (TAI->getLCOMMDirective() != NULL) { + if (I->hasInternalLinkage()) { + O << TAI->getLCOMMDirective() << name << "," << Size; + } else + O << TAI->getCOMMDirective() << name << "," << Size; + } else { + if (I->hasInternalLinkage()) + O << "\t.local\t" << name << "\n"; + + O << TAI->getCOMMDirective() <<"\t" << name << " " <<"RES"<< " " + << Size; + O << "\n\t\tGLOBAL" <<" "<< name; + if (TAI->getCOMMDirectiveTakesAlignment()) + O << "," << (TAI->getAlignmentIsInBytes() ? (1 << Align) : Align); + } + continue; + } + } + + switch (I->getLinkage()) + { + case GlobalValue::AppendingLinkage: + { + // FIXME: appending linkage variables should go into a section of + // their name or something. For now, just emit them as external. + // Fall through + } + case GlobalValue::ExternalLinkage: + { + O << "\t.globl " << name << "\n"; + // FALL THROUGH + } + case GlobalValue::InternalLinkage: + { + if (I->isConstant()) { + const ConstantArray *CVA = dyn_cast(C); + if (TAI->getCStringSection() && CVA && CVA->isCString()) { + SwitchToDataSection(TAI->getCStringSection(), I); + break; + } + } + break; + } + default: + { + assert(0 && "Unknown linkage type!"); + break; + } + } // end switch. + + EmitAlignment(Align, I); + O << name << ":\t\t\t\t" << TAI->getCommentString() << " " << I->getName() + << "\n"; + + // If the initializer is a extern weak symbol, remember to emit the weak + // reference! + if (const GlobalValue *GV = dyn_cast(C)) + if (GV->hasExternalWeakLinkage()) + ExtWeakSymbols.insert(GV); + + EmitGlobalConstant(C); + O << '\n'; + } // end for. + + O << "\n "<< "END"; + return AsmPrinter::doFinalization(M); +} + +void PIC16AsmPrinter:: +SwitchToTextSection(const char *NewSection, const GlobalValue *GV) +{ + O << "\n"; + if (NewSection && *NewSection) { + std::string codeSection = "code_"; + codeSection += NewSection; + codeSection += " "; + codeSection += "CODE"; + AsmPrinter::SwitchToTextSection(codeSection.c_str(),GV); + } + else + AsmPrinter::SwitchToTextSection(NewSection,GV); +} + +void PIC16AsmPrinter:: +SwitchToDataSection(const char *NewSection, const GlobalValue *GV) +{ + //Need to append index for page + O << "\n"; + if (NewSection && *NewSection) { + std::string dataSection ="udata_"; + dataSection+=NewSection; + if (dataSection.substr(dataSection.length()-2).compare(".o") == 0) { + dataSection = dataSection.substr(0,dataSection.length()-2); + } + dataSection += " "; + dataSection += "UDATA"; + AsmPrinter::SwitchToDataSection(dataSection.c_str(),GV); + } + else + AsmPrinter::SwitchToDataSection(NewSection,GV); +} + +void PIC16AsmPrinter:: +SwitchToDataOvrSection(const char *NewSection, const GlobalValue *GV) +{ + O << "\n"; + if (NewSection && *NewSection) { + std::string dataSection = "frame_"; + dataSection += NewSection; + if (dataSection.substr(dataSection.length()-2).compare(".o") == 0) { + dataSection = dataSection.substr(0,dataSection.length()-2); + } + dataSection += "_"; + dataSection += CurrentFnName; + dataSection += " "; + dataSection += "UDATA_OVR"; + AsmPrinter::SwitchToDataSection(dataSection.c_str(),GV); + } + else + AsmPrinter::SwitchToDataSection(NewSection,GV); +} Added: llvm/trunk/lib/Target/PIC16/PIC16CallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16CallingConv.td?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16CallingConv.td (added) +++ llvm/trunk/lib/Target/PIC16/PIC16CallingConv.td Tue May 13 04:02:57 2008 @@ -0,0 +1,17 @@ +//===- PIC16CallingConv.td - Calling Conventions Sparc -----*- tablegen -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This describes the calling conventions for the PIC16 architectures. +// +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// Return Value Calling Conventions +//===----------------------------------------------------------------------===// + Added: llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.cpp?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.cpp (added) +++ llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.cpp Tue May 13 04:02:57 2008 @@ -0,0 +1,88 @@ +//===- PIC16ConstantPoolValue.cpp - PIC16 constantpool value --------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements the PIC16 specific constantpool value class. +// +//===----------------------------------------------------------------------===// + +#include "PIC16ConstantPoolValue.h" +#include "llvm/ADT/FoldingSet.h" +#include "llvm/GlobalValue.h" +#include "llvm/Type.h" +using namespace llvm; + +PIC16ConstantPoolValue::PIC16ConstantPoolValue(GlobalValue *gv, unsigned id, + PIC16CP::PIC16CPKind k, + unsigned char PCAdj, + const char *Modif, bool AddCA) + : MachineConstantPoolValue((const Type*)gv->getType()), + GV(gv), S(NULL), LabelId(id), Kind(k), PCAdjust(PCAdj), + Modifier(Modif), AddCurrentAddress(AddCA) {} + +PIC16ConstantPoolValue::PIC16ConstantPoolValue(const char *s, unsigned id, + PIC16CP::PIC16CPKind k, + unsigned char PCAdj, + const char *Modif, bool AddCA) + : MachineConstantPoolValue((const Type*)Type::Int32Ty), + GV(NULL), S(s), LabelId(id), Kind(k), PCAdjust(PCAdj), + Modifier(Modif), AddCurrentAddress(AddCA) {} + +PIC16ConstantPoolValue::PIC16ConstantPoolValue(GlobalValue *gv, + PIC16CP::PIC16CPKind k, + const char *Modif) + : MachineConstantPoolValue((const Type*)Type::Int32Ty), + GV(gv), S(NULL), LabelId(0), Kind(k), PCAdjust(0), + Modifier(Modif) {} + +int PIC16ConstantPoolValue::getExistingMachineCPValue(MachineConstantPool *CP, + unsigned Alignment) { + unsigned AlignMask = (1 << Alignment)-1; + const std::vector Constants = CP->getConstants(); + for (unsigned i = 0, e = Constants.size(); i != e; ++i) { + if (Constants[i].isMachineConstantPoolEntry() && + (Constants[i].Offset & AlignMask) == 0) { + PIC16ConstantPoolValue *CPV = + (PIC16ConstantPoolValue *)Constants[i].Val.MachineCPVal; + if (CPV->GV == GV && + CPV->S == S && + CPV->LabelId == LabelId && + CPV->Kind == Kind && + CPV->PCAdjust == PCAdjust) + return i; + } + } + + return -1; +} + +void +PIC16ConstantPoolValue::AddSelectionDAGCSEId(FoldingSetNodeID &ID) { + ID.AddPointer(GV); + ID.AddPointer(S); + ID.AddInteger(LabelId); + ID.AddInteger((unsigned)Kind); + ID.AddInteger(PCAdjust); +} + +void PIC16ConstantPoolValue::print(std::ostream &O) const { + if (GV) + O << GV->getName(); + else + O << S; + if (isNonLazyPointer()) O << "$non_lazy_ptr"; + else if (isStub()) O << "$stub"; + if (Modifier) O << "(" << Modifier << ")"; + if (PCAdjust != 0) { + O << "-(LPIC" << LabelId << "+" + << (unsigned)PCAdjust; + if (AddCurrentAddress) + O << "-."; + O << ")"; + } +} Added: llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.h?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.h (added) +++ llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.h Tue May 13 04:02:57 2008 @@ -0,0 +1,75 @@ +//===- PIC16ConstantPoolValue.h - PIC16 constantpool value ------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements the PIC16 specific constantpool value class. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_TARGET_PIC16_CONSTANTPOOLVALUE_H +#define LLVM_TARGET_PIC16_CONSTANTPOOLVALUE_H + +#include "llvm/CodeGen/MachineConstantPool.h" + +namespace llvm { + +namespace PIC16CP { + enum PIC16CPKind { + CPValue, + CPNonLazyPtr, + CPStub + }; +} + +/// PIC16ConstantPoolValue - PIC16 specific constantpool value. This is used to +/// represent PC relative displacement between the address of the load +/// instruction and the global value being loaded, i.e. (&GV-(LPIC+8)). +class PIC16ConstantPoolValue : public MachineConstantPoolValue { + GlobalValue *GV; // GlobalValue being loaded. + const char *S; // ExtSymbol being loaded. + unsigned LabelId; // Label id of the load. + PIC16CP::PIC16CPKind Kind; // non_lazy_ptr or stub? + unsigned char PCAdjust; // Extra adjustment if constantpool is pc relative. + // 8 for PIC16 + const char *Modifier; // GV modifier i.e. (&GV(modifier)-(LPIC+8)) + bool AddCurrentAddress; + +public: + PIC16ConstantPoolValue(GlobalValue *gv, unsigned id, + PIC16CP::PIC16CPKind Kind = PIC16CP::CPValue, + unsigned char PCAdj = 0, const char *Modifier = NULL, + bool AddCurrentAddress = false); + PIC16ConstantPoolValue(const char *s, unsigned id, + PIC16CP::PIC16CPKind Kind = PIC16CP::CPValue, + unsigned char PCAdj = 0, const char *Modifier = NULL, + bool AddCurrentAddress = false); + PIC16ConstantPoolValue(GlobalValue *GV, PIC16CP::PIC16CPKind Kind, + const char *Modifier); + + + GlobalValue *getGV() const { return GV; } + const char *getSymbol() const { return S; } + const char *getModifier() const { return Modifier; } + bool hasModifier() const { return Modifier != NULL; } + bool mustAddCurrentAddress() const { return AddCurrentAddress; } + unsigned getLabelId() const { return LabelId; } + bool isNonLazyPointer() const { return Kind == PIC16CP::CPNonLazyPtr; } + bool isStub() const { return Kind == PIC16CP::CPStub; } + unsigned char getPCAdjustment() const { return PCAdjust; } + + virtual int getExistingMachineCPValue(MachineConstantPool *CP, + unsigned Alignment); + + virtual void AddSelectionDAGCSEId(FoldingSetNodeID &ID); + + virtual void print(std::ostream &O) const; +}; + +} + +#endif Added: llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp (added) +++ llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp Tue May 13 04:02:57 2008 @@ -0,0 +1,291 @@ +//===-- PIC16ISelDAGToDAG.cpp - A dag to dag inst selector for PIC16 ------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines an instruction selector for the PIC16 target. +// +//===----------------------------------------------------------------------===// + +#define DEBUG_TYPE "pic16-isel" + +#include "PIC16.h" +#include "PIC16ISelLowering.h" +#include "PIC16RegisterInfo.h" +#include "PIC16Subtarget.h" +#include "PIC16TargetMachine.h" +#include "llvm/GlobalValue.h" +#include "llvm/Instructions.h" +#include "llvm/Intrinsics.h" +#include "llvm/Type.h" +#include "llvm/CodeGen/MachineConstantPool.h" +#include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineFrameInfo.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" +#include "llvm/CodeGen/SelectionDAGISel.h" +#include "llvm/CodeGen/SelectionDAGNodes.h" +#include "llvm/Support/CFG.h" +#include "llvm/Support/Compiler.h" +#include "llvm/Support/Debug.h" +#include "llvm/Target/TargetMachine.h" +#include +#include + +using namespace llvm; + +//===----------------------------------------------------------------------===// +// Instruction Selector Implementation +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// PIC16DAGToDAGISel - PIC16 specific code to select PIC16 machine +// instructions for SelectionDAG operations. +//===----------------------------------------------------------------------===// +namespace { + +class VISIBILITY_HIDDEN PIC16DAGToDAGISel : public SelectionDAGISel { + + /// TM - Keep a reference to PIC16TargetMachine. + PIC16TargetMachine &TM; + + /// PIC16Lowering - This object fully describes how to lower LLVM code to an + /// PIC16-specific SelectionDAG. + PIC16TargetLowering PIC16Lowering; + + /// Subtarget - Keep a pointer to the PIC16Subtarget around so that we can + /// make the right decision when generating code for different targets. + //TODO: add initialization on constructor + //const PIC16Subtarget *Subtarget; + +public: + PIC16DAGToDAGISel(PIC16TargetMachine &tm) : + SelectionDAGISel(PIC16Lowering), + TM(tm), PIC16Lowering(*TM.getTargetLowering()) {} + + virtual void InstructionSelectBasicBlock(SelectionDAG &SD); + + // Pass Name + virtual const char *getPassName() const { + return "PIC16 DAG->DAG Pattern Instruction Selection"; + } + +private: + // Include the pieces autogenerated from the target description. + #include "PIC16GenDAGISel.inc" + + SDNode *Select(SDOperand N); + + // Select addressing mode. currently assume base + offset addr mode. + bool SelectAM(SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset); + bool SelectDirectAM(SDOperand Op, SDOperand N, SDOperand &Base, + SDOperand &Offset); + bool StoreInDirectAM(SDOperand Op, SDOperand N, SDOperand &fsr); + bool LoadFSR(SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset); + bool LoadNothing(SDOperand Op, SDOperand N, SDOperand &Base, + SDOperand &Offset); + + // getI8Imm - Return a target constant with the specified + // value, of type i8. + inline SDOperand getI8Imm(unsigned Imm) { + return CurDAG->getTargetConstant(Imm, MVT::i8); + } + + + #ifndef NDEBUG + unsigned Indent; + #endif +}; + +} + +/// InstructionSelectBasicBlock - This callback is invoked by +/// SelectionDAGISel when it has created a SelectionDAG for us to codegen. +void PIC16DAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &SD) +{ + DEBUG(BB->dump()); + // Codegen the basic block. + #ifndef NDEBUG + DOUT << "===== Instruction selection begins:\n"; + Indent = 0; + #endif + + // Select target instructions for the DAG. + SD.setRoot(SelectRoot(SD.getRoot())); + + #ifndef NDEBUG + DOUT << "===== Instruction selection ends:\n"; + #endif + + SD.RemoveDeadNodes(); + + // Emit machine code to BB. + ScheduleAndEmitDAG(SD); +} + + +bool PIC16DAGToDAGISel:: +SelectDirectAM (SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset) +{ + GlobalAddressSDNode *GA; + ConstantSDNode *GC; + + // if Address is FI, get the TargetFrameIndex. + if (FrameIndexSDNode *FIN = dyn_cast(N)) { + cout << "--------- its frame Index\n"; + Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32); + Offset = CurDAG->getTargetConstant(0, MVT::i32); + return true; + } + + if (N.getOpcode() == ISD::GlobalAddress) { + GA = dyn_cast(N); + Offset = CurDAG->getTargetConstant((unsigned char)GA->getOffset(), MVT::i8); + Base = CurDAG->getTargetGlobalAddress(GA->getGlobal(), MVT::i16, + GA->getOffset()); + return true; + } + + if (N.getOpcode() == ISD::ADD) { + GC = dyn_cast(N.getOperand(1)); + Offset = CurDAG->getTargetConstant((unsigned char)GC->getValue(), MVT::i8); + if ((GA = dyn_cast(N.getOperand(0)))) { + Base = CurDAG->getTargetGlobalAddress(GA->getGlobal(), MVT::i16, + GC->getValue()); + return true; + } + else if (FrameIndexSDNode *FIN + = dyn_cast(N.getOperand(0))) { + Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32); + return true; + } + } + + return false; +} + + +//FIXME: must also account for preinc/predec/postinc/postdec +bool PIC16DAGToDAGISel:: +StoreInDirectAM (SDOperand Op, SDOperand N, SDOperand &fsr) +{ + RegisterSDNode *Reg; + if (N.getOpcode() == ISD::LOAD) { + LoadSDNode *LD = dyn_cast(N); + if (LD) { + fsr = LD->getBasePtr(); + } + else if (isa(N.Val)) { + //FIXME an attempt to retrieve the register number + //but does not work + cout << "this is a register\n"; + Reg = dyn_cast(N.Val); + fsr = CurDAG->getRegister(Reg->getReg(),MVT::i16); + } + else { + cout << "this is not a register\n"; + // FIXME must use whatever load is using + fsr = CurDAG->getRegister(1,MVT::i16); + } + return true; + } + return false; +} + +bool PIC16DAGToDAGISel:: +LoadFSR (SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset) +{ + GlobalAddressSDNode *GA; + + if (N.getOpcode() == ISD::GlobalAddress) { + GA = dyn_cast(N); + Offset = CurDAG->getTargetConstant((unsigned char)GA->getOffset(), MVT::i8); + Base = CurDAG->getTargetGlobalAddress(GA->getGlobal(), MVT::i16, + GA->getOffset()); + return true; + } + else if (N.getOpcode() == PIC16ISD::Package) { + CurDAG->setGraphColor(Op.Val, "blue"); + CurDAG->viewGraph(); + } + + return false; +} + +//don't thake this seriously, it will change +bool PIC16DAGToDAGISel:: +LoadNothing (SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset) +{ + GlobalAddressSDNode *GA; + if (N.getOpcode() == ISD::GlobalAddress) { + GA = dyn_cast(N); + cout << "==========" << GA->getOffset() << "\n"; + Offset = CurDAG->getTargetConstant((unsigned char)GA->getOffset(), MVT::i8); + Base = CurDAG->getTargetGlobalAddress(GA->getGlobal(), MVT::i16, + GA->getOffset()); + return true; + } + + return false; +} + + +/// Select instructions not customized! Used for +/// expanded, promoted and normal instructions +SDNode* PIC16DAGToDAGISel::Select(SDOperand N) +{ + SDNode *Node = N.Val; + unsigned Opcode = Node->getOpcode(); + + // Dump information about the Node being selected + #ifndef NDEBUG + DOUT << std::string(Indent, ' ') << "Selecting: "; + DEBUG(Node->dump(CurDAG)); + DOUT << "\n"; + Indent += 2; + #endif + + // If we have a custom node, we already have selected! + if (Opcode >= ISD::BUILTIN_OP_END && Opcode < PIC16ISD::FIRST_NUMBER) { + #ifndef NDEBUG + DOUT << std::string(Indent-2, ' ') << "== "; + DEBUG(Node->dump(CurDAG)); + DOUT << "\n"; + Indent -= 2; + #endif + return NULL; + } + + /// + // Instruction Selection not handled by custom or by the + // auto-generated tablegen selection should be handled here. + /// + switch(Opcode) { + default: break; + } + + // Select the default instruction. + SDNode *ResNode = SelectCode(N); + + #ifndef NDEBUG + DOUT << std::string(Indent-2, ' ') << "=> "; + if (ResNode == NULL || ResNode == N.Val) + DEBUG(N.Val->dump(CurDAG)); + else + DEBUG(ResNode->dump(CurDAG)); + DOUT << "\n"; + Indent -= 2; + #endif + + return ResNode; +} + +/// createPIC16ISelDag - This pass converts a legalized DAG into a +/// PIC16-specific DAG, ready for instruction scheduling. +FunctionPass *llvm::createPIC16ISelDag(PIC16TargetMachine &TM) { + return new PIC16DAGToDAGISel(TM); +} + Added: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp (added) +++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Tue May 13 04:02:57 2008 @@ -0,0 +1,801 @@ +//===-- PIC16ISelLowering.cpp - PIC16 DAG Lowering Implementation ---------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the interfaces that PIC16 uses to lower LLVM code into a +// selection DAG. +// +//===----------------------------------------------------------------------===// + +#define DEBUG_TYPE "pic16-lower" + +#include "PIC16ISelLowering.h" +#include "PIC16TargetMachine.h" +#include "llvm/DerivedTypes.h" +#include "llvm/Function.h" +#include "llvm/Intrinsics.h" +#include "llvm/CallingConv.h" +#include "llvm/CodeGen/CallingConvLower.h" +#include "llvm/CodeGen/MachineFrameInfo.h" +#include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" +#include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/SelectionDAGISel.h" +#include "llvm/CodeGen/ValueTypes.h" +#include "llvm/Support/Debug.h" +#include +#include + +using namespace llvm; + +const char *PIC16TargetLowering:: getTargetNodeName(unsigned Opcode) const +{ + switch (Opcode) + { + case PIC16ISD::Hi : return "PIC16ISD::Hi"; + case PIC16ISD::Lo : return "PIC16ISD::Lo"; + case PIC16ISD::Package : return "PIC16ISD::Package"; + case PIC16ISD::Wrapper : return "PIC16ISD::Wrapper"; + case PIC16ISD::SetBank : return "PIC16ISD::SetBank"; + case PIC16ISD::SetPage : return "PIC16ISD::SetPage"; + case PIC16ISD::Branch : return "PIC16ISD::Branch"; + case PIC16ISD::Cmp : return "PIC16ISD::Cmp"; + case PIC16ISD::BTFSS : return "PIC16ISD::BTFSS"; + case PIC16ISD::BTFSC : return "PIC16ISD::BTFSC"; + case PIC16ISD::XORCC : return "PIC16ISD::XORCC"; + case PIC16ISD::SUBCC : return "PIC16ISD::SUBCC"; + default : return NULL; + } +} + +PIC16TargetLowering:: +PIC16TargetLowering(PIC16TargetMachine &TM): TargetLowering(TM) +{ + // PIC16 does not have i1 type, so use i8 for + // setcc operations results (slt, sgt, ...). + // setSetCCResultType(MVT::i8); + // setSetCCResultContents(ZeroOrOneSetCCResult); + + // Set up the register classes + addRegisterClass(MVT::i8, PIC16::CPURegsRegisterClass); + addRegisterClass(MVT::i16, PIC16::PTRRegsRegisterClass); + // Custom + + // Load extented operations for i1 types must be promoted + setLoadXAction(ISD::EXTLOAD, MVT::i1, Promote); + setLoadXAction(ISD::ZEXTLOAD, MVT::i1, Promote); + setLoadXAction(ISD::SEXTLOAD, MVT::i1, Promote); + + // Store operations for i1 types must be promoted + // setStoreXAction(MVT::i1, Promote); + // setStoreXAction(MVT::i8, Legal); + // setStoreXAction(MVT::i16, Custom); + // setStoreXAction(MVT::i32, Expand); + + // setOperationAction(ISD::BUILD_PAIR, MVT::i32, Expand); + // setOperationAction(ISD::BUILD_PAIR, MVT::i16, Expand); + + setOperationAction(ISD::ADD, MVT::i1, Promote); + setOperationAction(ISD::ADD, MVT::i8, Legal); + setOperationAction(ISD::ADD, MVT::i16, Custom); + setOperationAction(ISD::ADD, MVT::i32, Expand); + setOperationAction(ISD::ADD, MVT::i64, Expand); + + setOperationAction(ISD::SUB, MVT::i1, Promote); + setOperationAction(ISD::SUB, MVT::i8, Legal); + setOperationAction(ISD::SUB, MVT::i16, Custom); + setOperationAction(ISD::SUB, MVT::i32, Expand); + setOperationAction(ISD::SUB, MVT::i64, Expand); + + setOperationAction(ISD::ADDC, MVT::i1, Promote); + setOperationAction(ISD::ADDC, MVT::i8, Legal); + setOperationAction(ISD::ADDC, MVT::i16, Custom); + setOperationAction(ISD::ADDC, MVT::i32, Expand); + setOperationAction(ISD::ADDC, MVT::i64, Expand); + + setOperationAction(ISD::ADDE, MVT::i1, Promote); + setOperationAction(ISD::ADDE, MVT::i8, Legal); + setOperationAction(ISD::ADDE, MVT::i16, Custom); + setOperationAction(ISD::ADDE, MVT::i32, Expand); + setOperationAction(ISD::ADDE, MVT::i64, Expand); + + setOperationAction(ISD::SUBC, MVT::i1, Promote); + setOperationAction(ISD::SUBC, MVT::i8, Legal); + setOperationAction(ISD::SUBC, MVT::i16, Custom); + setOperationAction(ISD::SUBC, MVT::i32, Expand); + setOperationAction(ISD::SUBC, MVT::i64, Expand); + + setOperationAction(ISD::SUBE, MVT::i1, Promote); + setOperationAction(ISD::SUBE, MVT::i8, Legal); + setOperationAction(ISD::SUBE, MVT::i16, Custom); + setOperationAction(ISD::SUBE, MVT::i32, Expand); + setOperationAction(ISD::SUBE, MVT::i64, Expand); + + // PIC16 does not have these NodeTypes below. + setOperationAction(ISD::SETCC, MVT::i1, Expand); + setOperationAction(ISD::SETCC, MVT::i8, Expand); + setOperationAction(ISD::SETCC, MVT::Other, Expand); + setOperationAction(ISD::SELECT_CC, MVT::i1, Custom); + setOperationAction(ISD::SELECT_CC, MVT::i8, Custom); + + setOperationAction(ISD::BRCOND, MVT::i1, Expand); + setOperationAction(ISD::BRCOND, MVT::i8, Expand); + setOperationAction(ISD::BRCOND, MVT::Other, Expand); + setOperationAction(ISD::BR_CC, MVT::i1, Custom); + setOperationAction(ISD::BR_CC, MVT::i8, Custom); + + setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand); + + + // Do we really need to Custom lower the GA ?? + // setOperationAction(ISD::GlobalAddress, MVT::i16, Custom); + setOperationAction(ISD::GlobalAddress, MVT::i8, Custom); + setOperationAction(ISD::RET, MVT::Other, Custom); + + // PIC16 not supported intrinsics. + // setOperationAction(ISD::MEMMOVE, MVT::Other, Expand); + // setOperationAction(ISD::MEMSET, MVT::Other, Expand); + // setOperationAction(ISD::MEMCPY, MVT::Other, Expand); + + setOperationAction(ISD::CTPOP, MVT::i32, Expand); + setOperationAction(ISD::CTTZ , MVT::i32, Expand); + setOperationAction(ISD::CTLZ , MVT::i32, Expand); + setOperationAction(ISD::ROTL , MVT::i32, Expand); + setOperationAction(ISD::ROTR , MVT::i32, Expand); + setOperationAction(ISD::BSWAP, MVT::i32, Expand); + + setOperationAction(ISD::SHL_PARTS, MVT::i32, Expand); + setOperationAction(ISD::SRA_PARTS, MVT::i32, Expand); + setOperationAction(ISD::SRL_PARTS, MVT::i32, Expand); + + // We don't have line number support yet. + setOperationAction(ISD::LOCATION, MVT::Other, Expand); + setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); + setOperationAction(ISD::LABEL, MVT::Other, Expand); + + // Use the default for now + setOperationAction(ISD::STACKSAVE, MVT::Other, Expand); + setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand); + + setOperationAction(ISD::LOAD, MVT::i1, Promote); + setOperationAction(ISD::LOAD, MVT::i8, Legal); + // setOperationAction(ISD::LOAD, MVT::i16, Expand); + // setOperationAction(ISD::LOAD, MVT::i32, Expand); + + setTargetDAGCombine(ISD::LOAD); + setTargetDAGCombine(ISD::STORE); + setTargetDAGCombine(ISD::ADDE); + setTargetDAGCombine(ISD::ADDC); + setTargetDAGCombine(ISD::ADD); + setTargetDAGCombine(ISD::SUBE); + setTargetDAGCombine(ISD::SUBC); + setTargetDAGCombine(ISD::SUB); + + // We must find a way to get rid of Package nodes in the map + // setTargetDAGCombine(PIC16ISD::Package); + + // getValueTypeActions().setTypeAction((MVT::ValueType)MVT::i16, Expand); + + setStackPointerRegisterToSaveRestore(PIC16::STKPTR); + computeRegisterProperties(); +} + + +SDOperand PIC16TargetLowering:: LowerOperation(SDOperand Op, SelectionDAG &DAG) +{ + SDVTList VTList16 = DAG.getVTList(MVT::i16, MVT::i16, MVT::Other); + switch (Op.getOpcode()) + { + case ISD::STORE: + cout << "reduce store\n"; + break; + case ISD::FORMAL_ARGUMENTS: + cout<<"==== lowering formal args\n"; + return LowerFORMAL_ARGUMENTS(Op, DAG); + case ISD::GlobalAddress: + cout<<"==== lowering GA\n"; + return LowerGlobalAddress(Op, DAG); + case ISD::RET: + cout<<"==== lowering ret\n"; + return LowerRET(Op, DAG); + case ISD::FrameIndex: + cout<<"==== lowering frame index\n"; + return LowerFrameIndex(Op, DAG); + case ISD::ADDE: + cout <<"==== lowering adde\n"; + break; + case ISD::LOAD: + case ISD::ADD: + break; + case ISD::BR_CC: + cout << "==== lowering BR_CC\n"; + return LowerBR_CC(Op, DAG); + } //end swithch + return SDOperand(); +} + + +//===----------------------------------------------------------------------===// +// Lower helper functions +//===----------------------------------------------------------------------===// + + +SDOperand +PIC16TargetLowering::LowerBR_CC(SDOperand Op, SelectionDAG &DAG) +{ + MVT::ValueType VT = Op.getValueType(); + SDOperand Chain = Op.getOperand(0); + ISD::CondCode CC = cast(Op.getOperand(1))->get(); + SDOperand LHS = Op.getOperand(2); + SDOperand RHS = Op.getOperand(3); + SDOperand JumpVal = Op.getOperand(4); + SDOperand Result; + unsigned cmpOpcode; + unsigned branchOpcode; + SDOperand branchOperand; + + SDOperand StatusReg = DAG.getRegister(PIC16::STATUSREG,MVT::i8); + SDOperand CPUReg = DAG.getRegister(PIC16::WREG,MVT::i8); + switch(CC) + { + default: + assert(0 && "This condition code is not handled yet!!"); + abort(); + case ISD::SETNE: + { + cout << "setne\n"; + cmpOpcode = PIC16ISD::XORCC; + branchOpcode = PIC16ISD::BTFSS; + branchOperand = DAG.getConstant(2,MVT::i8); + break; + } + case ISD::SETEQ: + { + cout << "seteq\n"; + cmpOpcode = PIC16ISD::XORCC; + branchOpcode = PIC16ISD::BTFSC; + branchOperand = DAG.getConstant(2,MVT::i8); + break; + } + case ISD::SETGT: + { + assert(0 && "Greater Than condition code is not handled yet!!"); + abort(); + } + case ISD::SETGE: + { + cout << "setge\n"; + cmpOpcode = PIC16ISD::SUBCC; + branchOpcode = PIC16ISD::BTFSS; + branchOperand = DAG.getConstant(1, MVT::i8); + break; + } + case ISD::SETLT: + { + cout << "setlt\n"; + cmpOpcode = PIC16ISD::SUBCC; + branchOpcode = PIC16ISD::BTFSC; + branchOperand = DAG.getConstant(1,MVT::i8); + break; + } + case ISD::SETLE: + { + assert(0 && "Less Than Equal condition code is not handled yet!!"); + abort(); + } + } // End of Switch + + SDVTList VTList = DAG.getVTList(MVT::i8, MVT::Flag); + SDOperand CmpValue = DAG.getNode(cmpOpcode, VTList, LHS, RHS).getValue(1); + // SDOperand CCOper = DAG.getConstant(CC,MVT::i8); + // Result = DAG.getNode(branchOpcode,VT, Chain, JumpVal, CCOper, StatusReg, + // CmpValue); + Result = DAG.getNode(branchOpcode, VT, Chain, JumpVal, branchOperand, + StatusReg, CmpValue); + return Result; + + // return SDOperand(); +} + + +//===----------------------------------------------------------------------===// +// Misc Lower Operation implementation +//===----------------------------------------------------------------------===// +// Create a constant pool entry for global value and wrap it in a wrapper node. +SDOperand +PIC16TargetLowering::LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG) +{ + MVT::ValueType PtrVT = getPointerTy(); + GlobalAddressSDNode *GSDN = cast(Op); + GlobalValue *GV = GSDN->getGlobal(); + + //for now only do the ram. + SDOperand CPAddr = DAG.getTargetConstantPool(GV, PtrVT, 2); + SDOperand CPBank = DAG.getNode(PIC16ISD::SetBank, MVT::i8, CPAddr); + CPAddr = DAG.getNode(PIC16ISD::Wrapper, MVT::i8, CPAddr,CPBank); + + return CPAddr; +} + +SDOperand +PIC16TargetLowering::LowerRET(SDOperand Op, SelectionDAG &DAG) +{ + switch(Op.getNumOperands()) + { + default: + assert(0 && "Do not know how to return this many arguments!"); + abort(); + case 1: + return SDOperand(); // ret void is legal + } +} + +SDOperand +PIC16TargetLowering::LowerFrameIndex(SDOperand N, SelectionDAG &DAG) +{ + if (FrameIndexSDNode *FIN = dyn_cast(N)) { + return DAG.getTargetFrameIndex(FIN->getIndex(), MVT::i32); + } + + return N; +} + +SDOperand +PIC16TargetLowering::LowerLOAD(SDNode *N, + SelectionDAG &DAG, + DAGCombinerInfo &DCI) const +{ + SDOperand Outs[2]; + SDOperand TF; //TokenFactor + SDOperand OutChains[2]; + SDOperand Chain = N->getOperand(0); + SDOperand Src = N->getOperand(1); + SDOperand retVal; + SDVTList VTList; + + // If this load is directly stored, replace the load value with the stored + // value. + // TODO: Handle store large -> read small portion. + // TODO: Handle TRUNCSTORE/LOADEXT + LoadSDNode *LD = cast(N); + SDOperand Ptr = LD->getBasePtr(); + if (LD->getExtensionType() == ISD::NON_EXTLOAD) { + if (ISD::isNON_TRUNCStore(Chain.Val)) { + StoreSDNode *PrevST = cast(Chain); + if (PrevST->getBasePtr() == Ptr && + PrevST->getValue().getValueType() == N->getValueType(0)) + return DCI.CombineTo(N, Chain.getOperand(1), Chain); + } + } + + if (N->getValueType(0) != MVT::i16) + return SDOperand(); + + SDOperand toWorklist; + Outs[0] = DAG.getLoad(MVT::i8, Chain, Src, NULL, 0); + toWorklist = DAG.getNode(ISD::ADD, MVT::i16, Src, + DAG.getConstant(1, MVT::i16)); + Outs[1] = DAG.getLoad(MVT::i8, Chain, toWorklist, NULL, 0); + // Add to worklist may not be needed. + // It is meant to merge sequences of add with constant into one. + DCI.AddToWorklist(toWorklist.Val); + + // Create the tokenfactors and carry it on to the build_pair node + OutChains[0] = Outs[0].getValue(1); + OutChains[1] = Outs[1].getValue(1); + TF = DAG.getNode(ISD::TokenFactor, MVT::Other, &OutChains[0], 2); + + VTList = DAG.getVTList(MVT::i16, MVT::Flag); + retVal = DAG.getNode (PIC16ISD::Package, VTList, &Outs[0], 2); + + DCI.CombineTo (N, retVal, TF); + + return retVal; +} + +SDOperand +PIC16TargetLowering::LowerADDSUB(SDNode *N, SelectionDAG &DAG, + DAGCombinerInfo &DCI) const +{ + bool changed = false; + int i; + SDOperand LoOps[3], HiOps[3]; + SDOperand OutOps[3]; //[0]:left, [1]:right, [2]:carry + SDOperand InOp[2]; + SDOperand retVal; + SDOperand as1,as2; + SDVTList VTList; + unsigned AS,ASE,ASC; + + InOp[0] = N->getOperand(0); + InOp[1] = N->getOperand(1); + + switch (N->getOpcode()) + { + case ISD::ADD: + if (InOp[0].getOpcode() == ISD::Constant && + InOp[1].getOpcode() == ISD::Constant) { + ConstantSDNode *CST0 = dyn_cast(InOp[0]); + ConstantSDNode *CST1 = dyn_cast(InOp[1]); + return DAG.getConstant(CST0->getValue() + CST1->getValue(), MVT::i16); + } + case ISD::ADDE: + case ISD::ADDC: + AS = ISD::ADD; + ASE = ISD::ADDE; + ASC = ISD::ADDC; + break; + case ISD::SUB: + if (InOp[0].getOpcode() == ISD::Constant && + InOp[1].getOpcode() == ISD::Constant) { + ConstantSDNode *CST0 = dyn_cast(InOp[0]); + ConstantSDNode *CST1 = dyn_cast(InOp[1]); + return DAG.getConstant(CST0->getValue() - CST1->getValue(), MVT::i16); + } + case ISD::SUBE: + case ISD::SUBC: + AS = ISD::SUB; + ASE = ISD::SUBE; + ASC = ISD::SUBC; + break; + } + + assert ((N->getValueType(0) == MVT::i16) + && "expecting an MVT::i16 node for lowering"); + assert ((N->getOperand(0).getValueType() == MVT::i16) + && (N->getOperand(1).getValueType() == MVT::i16) + && "both inputs to addx/subx:i16 must be i16"); + + for (i = 0; i < 2; i++) { + if (InOp[i].getOpcode() == ISD::GlobalAddress) { + //we don't want to lower subs/adds with global address (at least not yet) + return SDOperand(); + } + else if (InOp[i].getOpcode() == ISD::Constant) { + changed = true; + ConstantSDNode *CST = dyn_cast(InOp[i]); + LoOps[i] = DAG.getConstant(CST->getValue() & 0xFF, MVT::i8); + HiOps[i] = DAG.getConstant(CST->getValue() >> 8, MVT::i8); + } + else if (InOp[i].getOpcode() == PIC16ISD::Package) { + LoOps[i] = InOp[i].getOperand(0); + HiOps[i] = InOp[i].getOperand(1); + } + else if (InOp[i].getOpcode() == ISD::LOAD) { + changed = true; + // LowerLOAD returns a Package node or it may combine and return + // anything else + SDOperand lowered = LowerLOAD(InOp[i].Val, DAG, DCI); + + // So If LowerLOAD returns something other than Package, + // then just call ADD again + if (lowered.getOpcode() != PIC16ISD::Package) + return LowerADDSUB(N, DAG, DCI); + + LoOps[i] = lowered.getOperand(0); + HiOps[i] = lowered.getOperand(1); + } + else if ((InOp[i].getOpcode() == ISD::ADD) || + (InOp[i].getOpcode() == ISD::ADDE) || + (InOp[i].getOpcode() == ISD::ADDC) || + (InOp[i].getOpcode() == ISD::SUB) || + (InOp[i].getOpcode() == ISD::SUBE) || + (InOp[i].getOpcode() == ISD::SUBC)) { + changed = true; + //must call LowerADDSUB recursively here.... + //LowerADDSUB returns a Package node + SDOperand lowered = LowerADDSUB(InOp[i].Val, DAG, DCI); + + LoOps[i] = lowered.getOperand(0); + HiOps[i] = lowered.getOperand(1); + } + else if (InOp[i].getOpcode() == ISD::SIGN_EXTEND) { + //FIXME: I am just zero extending. for now. + changed = true; + LoOps[i] = InOp[i].getOperand(0); + HiOps[i] = DAG.getConstant(0, MVT::i8); + } + else { + DAG.setGraphColor(N, "blue"); + DAG.viewGraph(); + assert (0 && "not implemented yet"); + } + } //end for + + assert (changed && "nothing changed while lowering SUBx/ADDx"); + + VTList = DAG.getVTList(MVT::i8, MVT::Flag); + if (N->getOpcode() == ASE) { + //we must take in the existing carry + //if this node is part of an existing subx/addx sequence + LoOps[2] = N->getOperand(2).getValue(1); + as1 = DAG.getNode (ASE, VTList, LoOps, 3); + } + else { + as1 = DAG.getNode (ASC, VTList, LoOps, 2); + } + HiOps[2] = as1.getValue(1); + as2 = DAG.getNode (ASE, VTList, HiOps, 3); + //we must build a pair that also provides the carry from sube/adde + OutOps[0] = as1; + OutOps[1] = as2; + OutOps[2] = as2.getValue(1); + //breaking an original i16 so lets make the Package also an i16 + if (N->getOpcode() == ASE) { + VTList = DAG.getVTList(MVT::i16, MVT::Flag); + retVal = DAG.getNode (PIC16ISD::Package, VTList, OutOps, 3); + DCI.CombineTo (N, retVal, OutOps[2]); + } + else if (N->getOpcode() == ASC) { + VTList = DAG.getVTList(MVT::i16, MVT::Flag); + retVal = DAG.getNode (PIC16ISD::Package, VTList, OutOps, 2); + DCI.CombineTo (N, retVal, OutOps[2]); + } + else if (N->getOpcode() == AS) { + VTList = DAG.getVTList(MVT::i16); + retVal = DAG.getNode (PIC16ISD::Package, VTList, OutOps, 2); + DCI.CombineTo (N, retVal); + } + + return retVal; +} + + +//===----------------------------------------------------------------------===// +// Calling Convention Implementation +// +// The lower operations present on calling convention works on this order: +// LowerCALL (virt regs --> phys regs, virt regs --> stack) +// LowerFORMAL_ARGUMENTS (phys --> virt regs, stack --> virt regs) +// LowerRET (virt regs --> phys regs) +// LowerCALL (phys regs --> virt regs) +// +//===----------------------------------------------------------------------===// + +#include "PIC16GenCallingConv.inc" + +//===----------------------------------------------------------------------===// +// CALL Calling Convention Implementation +//===----------------------------------------------------------------------===// + + +//===----------------------------------------------------------------------===// +// FORMAL_ARGUMENTS Calling Convention Implementation +//===----------------------------------------------------------------------===// +SDOperand PIC16TargetLowering:: +LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG) +{ + SmallVector ArgValues; + SDOperand Root = Op.getOperand(0); + + // Return the new list of results. + // Just copy right now. + ArgValues.push_back(Root); + + return DAG.getNode(ISD::MERGE_VALUES, Op.Val->getVTList(), &ArgValues[0], + ArgValues.size()).getValue(Op.ResNo); +} + + +//===----------------------------------------------------------------------===// +// Return Value Calling Convention Implementation +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// PIC16 Inline Assembly Support +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// Target Optimization Hooks +//===----------------------------------------------------------------------===// + +SDOperand PIC16TargetLowering::PerformDAGCombine(SDNode *N, + DAGCombinerInfo &DCI) const +{ + int i; + ConstantSDNode *CST; + SelectionDAG &DAG = DCI.DAG; + + switch (N->getOpcode()) + { + default: break; + case PIC16ISD::Package : + cout <<"==== combining PIC16ISD::Package\n"; + return SDOperand(); + case ISD::ADD : + case ISD::SUB : + if ((N->getOperand(0).getOpcode() == ISD::GlobalAddress) || + (N->getOperand(0).getOpcode() == ISD::FrameIndex)) { + //do not touch pointer adds + return SDOperand (); + } + case ISD::ADDE : + case ISD::ADDC : + case ISD::SUBE : + case ISD::SUBC : + if (N->getValueType(0) == MVT::i16) { + SDOperand retVal = LowerADDSUB(N, DAG,DCI); + // LowerADDSUB has already combined the result, + // so we just return nothing to avoid assertion failure from llvm + // if N has been deleted already + return SDOperand(); + } + else if (N->getValueType(0) == MVT::i8) { + //sanity check .... + for (int i=0; i<2; i++) { + if (N->getOperand (i).getOpcode() == PIC16ISD::Package) { + assert (0 && + "don't want to have PIC16ISD::Package as intput to add:i8"); + } + } + } + break; + case ISD::STORE : + { + SDOperand Chain = N->getOperand(0); + SDOperand Src = N->getOperand(1); + SDOperand Dest = N->getOperand(2); + unsigned int DstOff = 0; + int NUM_STORES; + SDOperand Stores[6]; + + + // if source operand is expected to be extended to + // some higher type then - remove this extension + // SDNode and do the extension manually + if ((Src.getOpcode() == ISD::ANY_EXTEND) || + (Src.getOpcode() == ISD::SIGN_EXTEND) || + (Src.getOpcode() == ISD::ZERO_EXTEND)) { + Src = Src.Val->getOperand(0); + Stores[0] = DAG.getStore(Chain, Src, Dest, NULL,0); + return Stores[0]; + } + + switch(Src.getValueType()) + { + case MVT::i8: + break; + case MVT::i16: + NUM_STORES = 2; + break; + case MVT::i32: + NUM_STORES = 4; + break; + case MVT::i64: + NUM_STORES = 8; + break; + } + + if (isa(Dest) && isa(Src) && + (Src.getValueType() != MVT::i8)) { + //create direct addressing a = b + Chain = Src.getOperand(0); + for (i=0; i(Dest) && isa(Src) + && (Src.getValueType() != MVT::i8)) + { + //create direct addressing a = CONST + CST = dyn_cast(Src); + for (i = 0; i < NUM_STORES; i++) { + SDOperand CNST = DAG.getConstant(CST->getValue() >> i*8, MVT::i8); + SDOperand ADN = DAG.getNode(ISD::ADD, MVT::i16, Dest, + DAG.getConstant(DstOff, MVT::i16)); + Stores[i] = DAG.getStore(Chain, CNST, ADN, NULL, 0); + Chain = Stores[i]; + DstOff += 1; + } + + Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &Stores[0], i); + return Chain; + } + else if (isa(Dest) && isa(Src) + && (Src.getValueType() != MVT::i8)) { + //create indirect addressing + CST = dyn_cast(Src); + Chain = Dest.getOperand(0); + SDOperand Load; + Load = DAG.getLoad(MVT::i16, Chain,Dest.getOperand(1), NULL, 0); + Chain = Load.getValue(1); + for (i=0; igetValue() >> i*8, MVT::i8); + Stores[i] = DAG.getStore(Chain, CNST, Load, NULL, 0); + Chain = Stores[i]; + DstOff += 1; + } + + Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &Stores[0], i); + return Chain; + } + else if (isa(Dest) && isa(Src)) { + // GlobalAddressSDNode *GAD = dyn_cast(Src); + return SDOperand(); + } + else if (Src.getOpcode() == PIC16ISD::Package) { + StoreSDNode *st = dyn_cast(N); + SDOperand toWorkList, retVal; + Chain = N->getOperand(0); + + if (st->isTruncatingStore()) { + retVal = DAG.getStore(Chain, Src.getOperand(0), Dest, NULL, 0); + } + else { + toWorkList = DAG.getNode(ISD::ADD, MVT::i16, Dest, + DAG.getConstant(1, MVT::i16)); + Stores[1] = DAG.getStore(Chain, Src.getOperand(0), Dest, NULL, 0); + Stores[0] = DAG.getStore(Chain, Src.getOperand(1), toWorkList, NULL, 0); + + // We want to merge sequence of add with constant to one add and a + // constant, so add the ADD node to worklist to have llvm do that + // automatically. + DCI.AddToWorklist(toWorkList.Val); + + // We don't need the Package so add to worklist so llvm deletes it + DCI.AddToWorklist(Src.Val); + retVal = DAG.getNode(ISD::TokenFactor, MVT::Other, &Stores[0], 2); + } + + return retVal; + } + else if (Src.getOpcode() == ISD::TRUNCATE) { + } + else { + // DAG.setGraphColor(N, "blue"); + // DAG.viewGraph(); + // assert (0 && "input to store not implemented yet"); + } + } //end ISD::STORE + + break; + case ISD::LOAD : + { + SDOperand Ptr = N->getOperand(1); + if (Ptr.getOpcode() == PIC16ISD::Package) { + // DAG.setGraphColor(N, "blue"); + // DAG.viewGraph(); + // Here we must make so that: + // Ptr.getOperand(0) --> fsrl + // Ptr.getOperand(1) --> fsrh + assert (0 && "not implemented yet"); + } + //return SDOperand(); + //break; + } + }//end switch + + return SDOperand(); +} + +//===----------------------------------------------------------------------===// +// Utility functions +//===----------------------------------------------------------------------===// +const SDOperand *PIC16TargetLowering:: +findLoadi8(const SDOperand &Src, SelectionDAG &DAG) const +{ + unsigned int i; + if ((Src.getOpcode() == ISD::LOAD) && (Src.getValueType() == MVT::i8)) + return &Src; + for (i=0; i NodeMap_t; + + explicit PIC16TargetLowering(PIC16TargetMachine &TM); + + /// LowerOperation - Provide custom lowering hooks for some operations. + virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG); + + SDOperand LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG); + SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG); + SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG); + SDOperand LowerFrameIndex(SDOperand Op, SelectionDAG &DAG); + SDOperand LowerBR_CC(SDOperand Op, SelectionDAG &DAG); + + SDOperand RemoveHiLo(SDNode *, SelectionDAG &DAG, + DAGCombinerInfo &DCI) const; + SDOperand LowerADDSUB(SDNode *, SelectionDAG &DAG, + DAGCombinerInfo &DCI) const; + SDOperand LowerLOAD(SDNode *, SelectionDAG &DAG, + DAGCombinerInfo &DCI) const; + + /// getTargetNodeName - This method returns the name of a target specific + // DAG node. + virtual const char *getTargetNodeName(unsigned Opcode) const; + virtual SDOperand PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const; + + // utility function. + const SDOperand *findLoadi8(const SDOperand &Src, SelectionDAG &DAG) const; + }; +} // namespace llvm + +#endif // PIC16ISELLOWERING_H Added: llvm/trunk/lib/Target/PIC16/PIC16InstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16InstrFormats.td?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16InstrFormats.td (added) +++ llvm/trunk/lib/Target/PIC16/PIC16InstrFormats.td Tue May 13 04:02:57 2008 @@ -0,0 +1,112 @@ +//===- PIC16RegisterInfo.td - PIC16 Register defs ------------*- tblgen -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// Describe PIC16 instructions format +// +// All the possible PIC16 fields are: +// +// opcode - operation code. +// f - 7-bit register file address. +// d - 1-bit direction specifier +// k - 8/11 bit literals +// b - 3 bits bit num specifier +// +//===----------------------------------------------------------------------===// + +// Generic PIC16 Format +class PIC16Inst pattern> + : Instruction +{ + field bits<14> Inst; + + let Namespace = "PIC16"; + + dag OutOperandList = outs; + dag InOperandList = ins; + + let AsmString = asmstr; + let Pattern = pattern; +} + + +//===----------------------------------------------------------------------===// +// Byte Oriented instruction class in PIC16 : <|opcode|d|f|> +//===----------------------------------------------------------------------===// + +class ByteFormat op, dag outs, dag ins, string asmstr, + list pattern> + :PIC16Inst +{ + bits<1> d; + bits<7> f; + + let Inst{13-8} = op; + + let Inst{7} = d; + let Inst{6-0} = f; +} + +//===----------------------------------------------------------------------===// +// Bit Oriented instruction class in PIC16 : <|opcode|b|f|> +//===----------------------------------------------------------------------===// + +class BitFormat op, dag outs, dag ins, string asmstr, list pattern> + : PIC16Inst +{ + bits<3> b; + bits<7> f; + + let Inst{13-10} = op; + + let Inst{9-7} = b; + let Inst{6-0} = f; +} + +//===----------------------------------------------------------------------===// +// Literal Format instruction class in PIC16 : <|opcode|k|> +//===----------------------------------------------------------------------===// + +class LiteralFormat op, dag outs, dag ins, string asmstr, + list pattern> + : PIC16Inst +{ + bits<8> k; + + + let Inst{13-8} = op; + + let Inst{7-0} = k; +} + +//===----------------------------------------------------------------------===// +// Control Format instruction class in PIC16 : <|opcode|k|> +//===----------------------------------------------------------------------===// + +class ControlFormat op, dag outs, dag ins, string asmstr, + list pattern> + :PIC16Inst +{ + bits<11> k; + + + let Inst{13-11} = op; + + let Inst{10-0} = k; +} + +//===----------------------------------------------------------------------===// +// Pseudo instruction class in PIC16 +//===----------------------------------------------------------------------===// + +class Pseudo op, dag outs, dag ins, string asmstr, list pattern>: + PIC16Inst +{ + let Inst{13-6} = op; +} Added: llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp (added) +++ llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp Tue May 13 04:02:57 2008 @@ -0,0 +1,143 @@ +//===- PIC16InstrInfo.cpp - PIC16 Instruction Information -----------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the PIC16 implementation of the TargetInstrInfo class. +// +//===----------------------------------------------------------------------===// + +#include "PIC16.h" +#include "PIC16InstrInfo.h" +#include "llvm/Function.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" +#include "PIC16GenInstrInfo.inc" + +using namespace llvm; + +// TODO: Add the subtarget support on this constructor. +PIC16InstrInfo::PIC16InstrInfo(PIC16TargetMachine &tm) + : TargetInstrInfoImpl(PIC16Insts, array_lengthof(PIC16Insts)), + TM(tm), RI(*this) {} + +static bool isZeroImm(const MachineOperand &op) { + return op.isImmediate() && op.getImm() == 0; +} + + +/// isLoadFromStackSlot - If the specified machine instruction is a direct +/// load from a stack slot, return the virtual or physical register number of +/// the destination along with the FrameIndex of the loaded stack slot. If +/// not, return 0. This predicate must return 0 if the instruction has +/// any side effects other than loading from the stack slot. +unsigned PIC16InstrInfo:: +isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const +{ + if (MI->getOpcode() == PIC16::MOVF) { + if ((MI->getOperand(2).isFrameIndex()) && // is a stack slot + (MI->getOperand(1).isImmediate()) && // the imm is zero + (isZeroImm(MI->getOperand(1)))) { + FrameIndex = MI->getOperand(2).getIndex(); + return MI->getOperand(0).getReg(); + } + } + + return 0; +} + +/// isStoreToStackSlot - If the specified machine instruction is a direct +/// store to a stack slot, return the virtual or physical register number of +/// the source reg along with the FrameIndex of the loaded stack slot. If +/// not, return 0. This predicate must return 0 if the instruction has +/// any side effects other than storing to the stack slot. +unsigned PIC16InstrInfo:: +isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const +{ + if (MI->getOpcode() == PIC16::MOVWF) { + if ((MI->getOperand(0).isFrameIndex()) && // is a stack slot + (MI->getOperand(1).isImmediate()) && // the imm is zero + (isZeroImm(MI->getOperand(1)))) { + FrameIndex = MI->getOperand(0).getIndex(); + return MI->getOperand(2).getReg(); + } + } + return 0; +} + +void PIC16InstrInfo:: +storeRegToStackSlot(MachineBasicBlock &MBB, + MachineBasicBlock::iterator I, + unsigned SrcReg, bool isKill, int FI, + const TargetRegisterClass *RC) const { + const Function *Func = MBB.getParent()->getFunction(); + const std::string FuncName = Func->getName(); + + char *tmpName = new char [strlen(FuncName.c_str()) + 6]; + sprintf(tmpName, "%s_tmp_%d",FuncName.c_str(),FI); + + if (RC == PIC16::CPURegsRegisterClass) { + //src is always WREG. + BuildMI(MBB, I, this->get(PIC16::MOVWF)) + .addReg(SrcReg,false,false,true,true) + .addExternalSymbol(tmpName) // the current printer expects 3 operands, + .addExternalSymbol(tmpName); // all we need is actually one, + // so we repeat. + } + else + assert(0 && "Can't store this register to stack slot"); +} + +void PIC16InstrInfo:: +loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, + unsigned DestReg, int FI, + const TargetRegisterClass *RC) const +{ + const Function *Func = MBB.getParent()->getFunction(); + const std::string FuncName = Func->getName(); + + char *tmpName = new char [strlen(FuncName.c_str()) + 6]; + sprintf(tmpName, "%s_tmp_%d",FuncName.c_str(),FI); + + if (RC == PIC16::CPURegsRegisterClass) + BuildMI(MBB, I, this->get(PIC16::MOVF), DestReg) + .addExternalSymbol(tmpName) // the current printer expects 3 operands, + .addExternalSymbol(tmpName); // all we need is actually one,so we repeat. + else + assert(0 && "Can't load this register from stack slot"); +} + +/// InsertBranch - Insert a branch into the end of the specified +/// MachineBasicBlock. This operands to this method are the same as those +/// returned by AnalyzeBranch. This is invoked in cases where AnalyzeBranch +/// returns success and when an unconditional branch (TBB is non-null, FBB is +/// null, Cond is empty) needs to be inserted. It returns the number of +/// instructions inserted. +unsigned PIC16InstrInfo:: +InsertBranch(MachineBasicBlock &MBB, + MachineBasicBlock *TBB, MachineBasicBlock *FBB, + const std::vector &Cond) const +{ + // Shouldn't be a fall through. + assert(TBB && "InsertBranch must not be told to insert a fallthrough"); + + if (FBB == 0) { // One way branch. + if (Cond.empty()) { + // Unconditional branch? + BuildMI(&MBB, get(PIC16::GOTO)).addMBB(TBB); + } + return 1; + } + + // TODO: If the there are some conditions specified then conditional branch + // should be generated. + // For the time being no instruction is being generated therefore + // returning NULL. + return 0; +} + Added: llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.h?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.h (added) +++ llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.h Tue May 13 04:02:57 2008 @@ -0,0 +1,78 @@ +//===- PIC16InstrInfo.h - PIC16 Instruction Information----------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the niversity of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the PIC16 implementation of the TargetInstrInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef PIC16INSTRUCTIONINFO_H +#define PIC16INSTRUCTIONINFO_H + +#include "PIC16.h" +#include "PIC16RegisterInfo.h" +#include "llvm/Target/TargetInstrInfo.h" + +namespace llvm { + + +class PIC16InstrInfo : public TargetInstrInfoImpl +{ + PIC16TargetMachine &TM; + const PIC16RegisterInfo RI; +public: + explicit PIC16InstrInfo(PIC16TargetMachine &TM); + + /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As + /// such, whenever a client has an instance of instruction info, it should + /// always be able to get register info as well (through this method). + /// + virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; } + + + /// isLoadFromStackSlot - If the specified machine instruction is a direct + /// load from a stack slot, return the virtual or physical register number of + /// the destination along with the FrameIndex of the loaded stack slot. If + /// not, return 0. This predicate must return 0 if the instruction has + /// any side effects other than loading from the stack slot. + virtual unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const; + + /// isStoreToStackSlot - If the specified machine instruction is a direct + /// store to a stack slot, return the virtual or physical register number of + /// the source reg along with the FrameIndex of the loaded stack slot. If + /// not, return 0. This predicate must return 0 if the instruction has + /// any side effects other than storing to the stack slot. + virtual unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const; + + /// Used for spilling a register + void storeRegToStackSlot(MachineBasicBlock &MBB, + MachineBasicBlock::iterator MI, + unsigned SrcReg, bool isKill, int FrameIndex, + const TargetRegisterClass *RC) const; + + + void loadRegFromStackSlot(MachineBasicBlock &MBB, + MachineBasicBlock::iterator MI, + unsigned DestReg, int FrameIndex, + const TargetRegisterClass *RC) const; + + /// InsertBranch - Insert a branch into the end of the specified + /// MachineBasicBlock. This operands to this method are the same as those + /// returned by AnalyzeBranch. This is invoked in cases where AnalyzeBranch + /// returns success and when an unconditional branch (TBB is non-null, FBB is + /// null, Cond is empty) needs to be inserted. It returns the number of + /// instructions inserted. + virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, + MachineBasicBlock *FBB, + const std::vector &Cond) const ; + +}; + +} // namespace llvm + +#endif Added: llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td (added) +++ llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td Tue May 13 04:02:57 2008 @@ -0,0 +1,302 @@ +//===- PIC16InstrInfo.td - PIC16 Register defs ----------------*- tblgen-*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// Instruction format superclass +//===----------------------------------------------------------------------===// + +include "PIC16InstrFormats.td" + +//===----------------------------------------------------------------------===// +// PIC16 profiles and nodes +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// PIC16 addressing mode. +//===----------------------------------------------------------------------===// +// It matches address of globals as well as the stack slots +// that are created for locals and temporaries. This addressing mode +// converts the GlobalAddress and FrameIndex nodes to TargetGlobalAddress +// and TargetFrameIndex nodes. +def diraddrmode : ComplexPattern; +def dirloadmode : ComplexPattern; +def indirloadmode : ComplexPattern; + + +// Address operand. +def mem : Operand { + let PrintMethod = "printAddrModeOperand"; + let MIOperandInfo = (ops i16imm, PTRRegs); +} + +// Instruction operand types +def simm8 : Operand; + + +// These are target-independent nodes, but have target-specific formats. +def SDT_PIC16CallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i8> ]>; +def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_PIC16CallSeq, + [SDNPHasChain, SDNPOutFlag]>; +def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_PIC16CallSeq, + [SDNPHasChain, SDNPOutFlag]>; + +def PIC16Wrapper : SDNode<"PIC16ISD::Wrapper", SDTIntUnaryOp>; + +// so_imm_XFORM - Return a so_imm value packed into the format described for +// so_imm def below. +def so_imm_XFORM : SDNodeXFormgetTargetConstant((int8_t)N->getValue(), MVT::i32); +}]>; + +def so_imm : Operand, + PatLeaf<(imm), [{}]> { + let PrintMethod = "printSOImmOperand"; +} + + + +// PIC16 Address Mode! SDNode frameindex could possibily be a match +// since load and store instructions from stack used it. +def addr : Operand; + +// Arithmetic 2 register operands +class ArithI op, string instr_asm, SDNode OpNode, + Operand Od> : + LiteralFormat< op, + (outs CPURegs:$dst), + (ins CPURegs:$b, Od:$c), + !strconcat(instr_asm, " $c"), + [(set CPURegs:$dst, (OpNode CPURegs:$b, Od:$c))]>; + +// Memory Load/Store +class LoadDirect op, string instr_asm, PatFrag OpNode>: + ByteFormat< op, + (outs CPURegs:$dst), + (ins mem:$addr), + !strconcat(instr_asm, " $addr"), + [(set CPURegs:$dst, (OpNode diraddrmode:$addr))]>; + +class LoadInDirect op, string instr_asm, PatFrag OpNode>: + ByteFormat< op, + (outs PTRRegs:$dst), + (ins mem:$addr), + !strconcat(instr_asm, " $addr, $dst"), + [(set PTRRegs:$dst, (OpNode indirloadmode:$addr))]>; + +class StoreDirect op, string instr_asm, PatFrag OpNode>: + ByteFormat< op, + (outs), + (ins CPURegs:$src, mem:$addr), + !strconcat(instr_asm, " $addr"), + [(OpNode CPURegs:$src, diraddrmode:$addr)]>; + +class StoreInDirect op, string instr_asm, PatFrag OpNode>: + ByteFormat< op, + (outs), + (ins CPURegs:$src, PTRRegs:$fsr), + !strconcat(instr_asm, " $fsr"), + [(OpNode CPURegs:$src, PTRRegs:$fsr)]>; + +// Move +class MovLit op, string instr_asm>: + LiteralFormat< op, + (outs CPURegs:$dst), + (ins i8imm:$src), + !strconcat(instr_asm, " $src"), + [(set CPURegs:$dst, imm:$src)]>; + + +// Arithmetic with memory store. +// Arithmetic instrunctions involving W and memory location. +// Since W is implicit, we only print the memory operand. +class Arith1M op, string instr_asm, SDNode OpNode>: + ByteFormat< op, + (outs), + (ins CPURegs:$b, mem:$dst), + !strconcat(instr_asm, " $dst"), + [(store (OpNode (load diraddrmode:$dst), CPURegs:$b), diraddrmode:$dst), + (store (OpNode CPURegs:$b, (load diraddrmode:$dst)), diraddrmode:$dst)]>; + +// Arithmetic with memory load. +// Arithmetic instrunctions involving W and memory location. +// Since W is implicit, we only print the memory operand. +class Arith1R op, string instr_asm, SDNode OpNode>: + ByteFormat< op, + (outs CPURegs:$dst), + (ins mem:$src1, CPURegs:$src2), + !strconcat(instr_asm, " $src1"), + [(set CPURegs:$dst, (OpNode (load diraddrmode:$src1), CPURegs:$src2))]>; + +// Arithmetic with memory load. +// Arithmetic instrunctions involving W and memory location. +// Since W is implicit, we only print the memory operand. +class Arith2R op, string instr_asm, SDNode OpNode>: + ByteFormat< op, + (outs CPURegs:$dst), + (ins mem:$src1, CPURegs:$src2), + !strconcat(instr_asm, " $src1"), + [(set CPURegs:$dst, (OpNode CPURegs:$src2, (load diraddrmode:$src1)))]>; + +//===----------------------------------------------------------------------===// +// Instruction definition +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// PIC16I Instructions +//===----------------------------------------------------------------------===// + +// Arithmetic + +// ADDiu just accept 16-bit immediates but we handle this on Pat's. +// immZExt32 is used here so it can match GlobalAddress immediates. +// def ADDLW : ArithI<0x09, "addlw", add, so_imm>; + +let isReMaterializable = 1 in { +def MOVLW : MovLit<0x24, "movlw">; +} + +// Load/Store +def LFSR1 : LoadInDirect <0x4, "lfsr", load>; + +let isReMaterializable = 1 in { +def MOVF : LoadDirect <0x23, "movf", load>; +} + +def MOVWF : StoreDirect <0x2b, "movwf", store>; + +def MOVFSRINC : StoreInDirect <0x5, "movfsrinc", store>; + +def RETURN : ControlFormat<0x03, (outs), (ins), "return", []>; + +def ADDWF : Arith1M<0x01, "addwf", add>; +def ADDFW : Arith1R<0x02, "addfw", add>; + +def ADDWFE : Arith1M<0x03, "addwfe", adde>; +def ADDFWE : Arith1R<0x04, "addfwe", adde>; + +def ADDWFC : Arith1M<0x05, "addwfc", addc>; +def ADDFWC : Arith1R<0x06, "addfwc", addc>; + +def SUBWF : Arith1M<0x07, "subwf", sub>; +def SUBFW : Arith1R<0x08, "subfw", sub>; + +def SUBWFE : Arith1M<0x09, "subwfe", sube>; +def SUBFWE : Arith1R<0x0a, "subfwe", sube>; + +def SUBWFC : Arith1M<0x0b, "subwfc", subc>; +def SUBFWC : Arith1R<0x0d, "subfwc", subc>; + +def SUBRFW : Arith2R<0x08, "subfw", sub>; + +def SUBRFWE : Arith2R<0x0a, "subfwe", sube>; + +def SUBRFWC : Arith2R<0x0d, "subfwc", subc>; + +def brtarget : Operand; + +class UncondJump< bits<4> op, string instr_asm>: + BitFormat< op, + (outs), + (ins brtarget:$target), + !strconcat(instr_asm, " $target"), + [(br bb:$target)]>; + +def GOTO : UncondJump<0x1, "goto">; + +class LogicM op, string instr_asm, SDNode OpNode> : + ByteFormat< op, + (outs), + (ins CPURegs:$b, mem:$dst), + !strconcat(instr_asm, " $dst"), + [(store (OpNode (load diraddrmode:$dst), CPURegs:$b), diraddrmode:$dst)]>; + +class LogicR op, string instr_asm, SDNode OpNode> : + ByteFormat< op, + (outs CPURegs:$dst), + (ins CPURegs:$b, mem:$c), + !strconcat(instr_asm, " $c"), + [(set CPURegs:$dst, (OpNode (load diraddrmode:$c), CPURegs:$b))]>; + +class LogicI op, string instr_asm, SDNode OpNode, Operand Od> : + LiteralFormat< op, + (outs CPURegs:$dst), + (ins CPURegs:$b, Od:$c), + !strconcat(instr_asm, " $c"), + [(set CPURegs:$dst, (OpNode CPURegs:$b, Od:$c ))]>; + +def XORWF : LogicM<0x1,"xorwf",xor>; +def XORFW : LogicR<0x1,"xorfw",xor>; +def XORLW : LogicI<0x1,"xorlw",xor, so_imm>; + +def ANDWF : LogicM<0x1,"andwf",and>; +def ANDFW : LogicR<0x1,"andfw",and>; +def ANDLW : LogicI<0x1,"andlw",and, so_imm>; + +def IORWF : LogicM<0x1,"iorwf",or>; +def IORFW : LogicR<0x1,"iorfw",or>; +def IORLW : LogicI<0x1,"iorlw",or, so_imm>; + + +/* For comparison before branch */ +def SDT_PIC16Cmp : SDTypeProfile<1, 3, [SDTCisSameAs<0,1>]>; +def SDTIntBinOpPIC16 : SDTypeProfile<1, 2, [SDTCisSameAs<0,1>, + SDTCisSameAs<1,2>, SDTCisInt<1>]>; + +def PIC16Cmp : SDNode<"PIC16ISD::Cmp",SDTIntBinOpPIC16, [SDNPOutFlag]>; +def PIC16XORCC : SDNode<"PIC16ISD::XORCC",SDTIntBinOpPIC16, [SDNPOutFlag]>; +def PIC16SUBCC : SDNode<"PIC16ISD::SUBCC",SDTIntBinOpPIC16, [SDNPOutFlag]>; + +def XORFWCC : LogicR<0x1,"xorfw",PIC16XORCC>; +def XORLWCC : LogicI<0x1,"xorlw",PIC16XORCC, so_imm>; +def SUBFWCC : Arith1R<0x1,"subfw",PIC16SUBCC>; +def SUBLWCC : ArithI<0x1,"sublw",PIC16SUBCC, so_imm>; + + +/* For branch conditions */ +def SDT_PIC16Branch : SDTypeProfile<0, 3, [SDTCisVT<0, OtherVT>, + SDTCisVT<1,i8>, SDTCisVT<2,i8>]>; + +def PIC16Branch : SDNode<"PIC16ISD::Branch",SDT_PIC16Branch, + [SDNPHasChain, SDNPInFlag]>; + +def PIC16BTFSS : SDNode<"PIC16ISD::BTFSS",SDT_PIC16Branch, + [SDNPHasChain, SDNPInFlag]>; + +def PIC16BTFSC : SDNode<"PIC16ISD::BTFSC",SDT_PIC16Branch, + [SDNPHasChain, SDNPInFlag]>; + +class InstrBitTestCC op, string instr_asm,SDNode OpNode>: + BitFormat< op, + (outs), + (ins brtarget:$target ,so_imm:$i, STATUSRegs:$s ), + !strconcat(instr_asm, " $s, $i, $target"), + [(OpNode bb:$target, so_imm:$i, STATUSRegs:$s )]>; + +def BTFSS : InstrBitTestCC<0x1,"btfss",PIC16BTFSS>; +def BTFSC : InstrBitTestCC<0x1,"btfsc",PIC16BTFSC>; + + +//===----------------------------------------------------------------------===// +// Pseudo instructions +//===----------------------------------------------------------------------===// + +let Defs = [STKPTR], Uses = [STKPTR] in { +def ADJCALLSTACKDOWN : Pseudo<255, (outs), (ins i8imm:$amt), + "!ADJCALLSTACKDOWN $amt", + [(callseq_start imm:$amt)]>; +def ADJCALLSTACKUP : Pseudo<254, (outs), (ins i8imm:$amt), + "!ADJCALLSTACKUP $amt", + [(callseq_end imm:$amt)]>; +} + + +//===----------------------------------------------------------------------===// +// Arbitrary patterns that map to one or more instructions +//===----------------------------------------------------------------------===// +def : Pat<(ret), (RETURN)>; Added: llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp (added) +++ llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp Tue May 13 04:02:57 2008 @@ -0,0 +1,223 @@ +//===- PIC16RegisterInfo.cpp - PIC16 Register Information -----------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the PIC16 implementation of the TargetRegisterInfo class. +// +//===----------------------------------------------------------------------===// + +#define DEBUG_TYPE "pic16-reg-info" + +#include "PIC16.h" +#include "PIC16RegisterInfo.h" +#include "llvm/Constants.h" +#include "llvm/Function.h" +#include "llvm/Type.h" +#include "llvm/ADT/BitVector.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/CodeGen/MachineFrameInfo.h" +#include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" +#include "llvm/CodeGen/MachineLocation.h" +#include "llvm/CodeGen/ValueTypes.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/Debug.h" +#include "llvm/Target/TargetFrameInfo.h" +#include "llvm/Target/TargetInstrInfo.h" +#include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetOptions.h" + +using namespace llvm; + +// TODO: add subtarget support +PIC16RegisterInfo::PIC16RegisterInfo(const TargetInstrInfo &tii) + : PIC16GenRegisterInfo(PIC16::ADJCALLSTACKDOWN, PIC16::ADJCALLSTACKUP), + TII(tii) {} + +/// getRegisterNumbering - Given the enum value for some register, e.g. +/// PIC16::RA, return the number that it corresponds to (e.g. 31). +unsigned PIC16RegisterInfo:: +getRegisterNumbering(unsigned RegEnum) +{ + assert (RegEnum <= 31 && "Unknown register number!"); + return RegEnum; +} + +void PIC16RegisterInfo:: +copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, + unsigned DestReg, unsigned SrcReg, + const TargetRegisterClass *RC) const +{ + return; +} + +void PIC16RegisterInfo::reMaterialize(MachineBasicBlock &MBB, + MachineBasicBlock::iterator I, + unsigned DestReg, + const MachineInstr *Orig) const +{ + MachineInstr *MI = Orig->clone(); + MI->getOperand(0).setReg(DestReg); + MBB.insert(I, MI); +} + +MachineInstr *PIC16RegisterInfo:: +foldMemoryOperand(MachineInstr* MI, unsigned OpNum, int FI) const +{ + MachineInstr *NewMI = NULL; + + return NewMI; +} + +//===----------------------------------------------------------------------===// +// +// Callee Saved Registers methods +// +//===----------------------------------------------------------------------===// + +/// PIC16 Callee Saved Registers +const unsigned* PIC16RegisterInfo:: +getCalleeSavedRegs(const MachineFunction *MF) const +{ + // PIC16 calle-save register range is $16-$26(s0-s7) + static const unsigned CalleeSavedRegs[] = { 0 }; + return CalleeSavedRegs; +} + +/// PIC16 Callee Saved Register Classes +const TargetRegisterClass* const* +PIC16RegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const +{ + static const TargetRegisterClass * const CalleeSavedRegClasses[] = { 0 }; + return CalleeSavedRegClasses; +} + +BitVector PIC16RegisterInfo:: +getReservedRegs(const MachineFunction &MF) const +{ + BitVector Reserved(getNumRegs()); + return Reserved; +} + +//===----------------------------------------------------------------------===// +// +// Stack Frame Processing methods +// +----------------------------+ +// +// FIXME: Add stack layout description here. +// +// +//===----------------------------------------------------------------------===// + +// hasFP - Return true if the specified function should have a dedicated frame +// pointer register. This is true if the function has variable sized allocas or +// if frame pointer elimination is disabled. +bool PIC16RegisterInfo:: +hasFP(const MachineFunction &MF) const { + return false; +} + +// This function eliminate ADJCALLSTACKDOWN, +// ADJCALLSTACKUP pseudo instructions +void PIC16RegisterInfo:: +eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, + MachineBasicBlock::iterator I) const { + // Simply discard ADJCALLSTACKDOWN, ADJCALLSTACKUP instructions. + MBB.erase(I); +} + +// FrameIndex represent objects inside a abstract stack. +// We must replace FrameIndex with an stack/frame pointer +// direct reference. +void PIC16RegisterInfo:: +eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, + RegScavenger *RS) const +{ + MachineInstr &MI = *II; + MachineFunction &MF = *MI.getParent()->getParent(); + + unsigned i = 0; + while (!MI.getOperand(i).isFrameIndex()) { + ++i; + assert(i < MI.getNumOperands() && + "Instr doesn't have FrameIndex operand!"); + } + + int FrameIndex = MI.getOperand(i).getIndex(); + int stackSize = MF.getFrameInfo()->getStackSize(); + int spOffset = MF.getFrameInfo()->getObjectOffset(FrameIndex); + + #ifndef NDEBUG + DOUT << "\nFunction : " << MF.getFunction()->getName() << "\n"; + DOUT << "<--------->\n"; + MI.print(DOUT); + DOUT << "FrameIndex : " << FrameIndex << "\n"; + DOUT << "spOffset : " << spOffset << "\n"; + DOUT << "stackSize : " << stackSize << "\n"; + #endif + + // as explained on LowerFORMAL_ARGUMENTS, detect negative offsets + // and adjust SPOffsets considering the final stack size. + int Offset = ((spOffset < 0) ? (stackSize + (-(spOffset+4))) : (spOffset)); + //Offset += MI.getOperand(i+1).getImm(); + + #ifndef NDEBUG + DOUT << "Offset : " << Offset << "\n"; + DOUT << "<--------->\n"; + #endif + + // MI.getOperand(i+1).ChangeToImmediate(Offset); + MI.getOperand(i).ChangeToRegister(getFrameRegister(MF),false); +} + +void PIC16RegisterInfo:: +emitPrologue(MachineFunction &MF) const +{ +} + +void PIC16RegisterInfo:: +emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const +{ +} + +void PIC16RegisterInfo:: +processFunctionBeforeFrameFinalized(MachineFunction &MF) const { +} + +unsigned PIC16RegisterInfo:: +getRARegister() const { + assert(0 && "What is the return address register"); + return 0; +} + +unsigned PIC16RegisterInfo:: +getFrameRegister(MachineFunction &MF) const { + return PIC16::STKPTR; +} + +unsigned PIC16RegisterInfo:: +getEHExceptionRegister() const { + assert(0 && "What is the exception register"); + return 0; +} + +unsigned PIC16RegisterInfo:: +getEHHandlerRegister() const { + assert(0 && "What is the exception handler register"); + return 0; +} + +int PIC16RegisterInfo:: +getDwarfRegNum(unsigned RegNum, bool isEH) const { + assert(0 && "What is the dwarf register number"); + return -1; +} + + +#include "PIC16GenRegisterInfo.inc" + Added: llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h (added) +++ llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h Tue May 13 04:02:57 2008 @@ -0,0 +1,86 @@ +//===- PIC16RegisterInfo.h - PIC16 Register Information Impl ----*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the PIC16 implementation of the TargetRegisterInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef PIC16REGISTERINFO_H +#define PIC16REGISTERINFO_H + +#include "PIC16GenRegisterInfo.h.inc" +#include "llvm/Target/TargetRegisterInfo.h" + +namespace llvm { + +// Forward Declarations. +class TargetInstrInfo; +class Type; + +struct PIC16RegisterInfo : public PIC16GenRegisterInfo { + const TargetInstrInfo &TII; + + explicit PIC16RegisterInfo(const TargetInstrInfo &tii); + + /// getRegisterNumbering - Given the enum value for some register, e.g. + /// PIC16::RA, return the number that it corresponds to (e.g. 31). + static unsigned getRegisterNumbering(unsigned RegEnum); + + void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, + unsigned DestReg, const MachineInstr *Orig) const; + + MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum, + int FrameIndex) const; + + MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum, + MachineInstr* LoadMI) const { + return 0; + } + + void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, + unsigned DestReg, unsigned SrcReg, + const TargetRegisterClass *RC) const; + + + const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const; + + const TargetRegisterClass* const* + getCalleeSavedRegClasses(const MachineFunction* MF = 0) const; + + BitVector getReservedRegs(const MachineFunction &MF) const; + + bool hasFP(const MachineFunction &MF) const; + + void eliminateCallFramePseudoInstr(MachineFunction &MF, + MachineBasicBlock &MBB, + MachineBasicBlock::iterator I) const; + + /// Stack Frame Processing Methods. + void eliminateFrameIndex(MachineBasicBlock::iterator II, + int SPAdj, RegScavenger *RS = NULL) const; + + void processFunctionBeforeFrameFinalized(MachineFunction &MF) const; + + void emitPrologue(MachineFunction &MF) const; + void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; + + /// Debug information queries. + unsigned getRARegister() const; + unsigned getFrameRegister(MachineFunction &MF) const; + + /// Exception handling queries. + unsigned getEHExceptionRegister() const; + unsigned getEHHandlerRegister() const; + + int getDwarfRegNum(unsigned RegNum, bool isEH) const; +}; + +} // end namespace llvm + +#endif Added: llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.td?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.td (added) +++ llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.td Tue May 13 04:02:57 2008 @@ -0,0 +1,84 @@ +//===- PIC16RegisterInfo.td - PIC16 Register defs ------------*- tblgen -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// Declarations that describe the PIC16 register file +//===----------------------------------------------------------------------===// + +// We have banks of 32 registers each. +class PIC16Reg : Register { + field bits<5> Num; + let Namespace = "PIC16"; +} + +// PIC16 CPU Registers +class PIC16GPRReg num, string n> : PIC16Reg { + let Num = num; +} + +// CPU GPR Registers +def FSR0 : PIC16GPRReg< 0, "FSR0">, DwarfRegNum<[0]>; +def FSR1 : PIC16GPRReg< 1, "FSR1">, DwarfRegNum<[1]>; + +// CPU Registers Class +def PTRRegs : RegisterClass<"PIC16", [i16], 8, + [FSR0, FSR1]> +{ + let MethodProtos = [{ + iterator allocation_order_end(const MachineFunction &MF) const; + }]; + let MethodBodies = [{ + PTRRegsClass::iterator + PTRRegsClass::allocation_order_end(const MachineFunction &MF) const { + return end(); + } + }]; +} + +def WREG : PIC16GPRReg< 0, "WREG">, DwarfRegNum<[0]>; + +// CPU Registers Class +def CPURegs : RegisterClass<"PIC16", [i8], 8, + [WREG]> +{ + let MethodProtos = [{ + iterator allocation_order_end(const MachineFunction &MF) const; + }]; + let MethodBodies = [{ + CPURegsClass::iterator + CPURegsClass::allocation_order_end(const MachineFunction &MF) const { + return end(); + } + }]; +} + +def STATUSREG : PIC16GPRReg<2, "STATUS">, DwarfRegNum<[0]>; + +// STATUS Registers Class +def STATUSRegs : RegisterClass<"PIC16", [i8], 8, + [STATUSREG]>; + + +// Dummy stack pointer. +def STKPTR : PIC16GPRReg< 0, "SP">, DwarfRegNum<[0]>; + +// CPU Registers Class +def STKRegs : RegisterClass<"PIC16", [i8], 8, + [STKPTR]> +{ + let MethodProtos = [{ + iterator allocation_order_end(const MachineFunction &MF) const; + }]; + let MethodBodies = [{ + STKRegsClass::iterator + STKRegsClass::allocation_order_end(const MachineFunction &MF) const { + return end(); + } + }]; +} Added: llvm/trunk/lib/Target/PIC16/PIC16Subtarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16Subtarget.cpp?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16Subtarget.cpp (added) +++ llvm/trunk/lib/Target/PIC16/PIC16Subtarget.cpp Tue May 13 04:02:57 2008 @@ -0,0 +1,27 @@ +//===- PIC16Subtarget.cpp - PIC16 Subtarget Information -------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements the PIC16 specific subclass of TargetSubtarget. +// +//===----------------------------------------------------------------------===// + +#include "PIC16Subtarget.h" +#include "PIC16.h" +#include "PIC16GenSubtarget.inc" +using namespace llvm; + +PIC16Subtarget::PIC16Subtarget(const TargetMachine &TM, const Module &M, + const std::string &FS) + :IsPIC16Old(false) +{ + std::string CPU = "generic"; + + // Parse features string. + ParseSubtargetFeatures(FS, CPU); +} Added: llvm/trunk/lib/Target/PIC16/PIC16Subtarget.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16Subtarget.h?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16Subtarget.h (added) +++ llvm/trunk/lib/Target/PIC16/PIC16Subtarget.h Tue May 13 04:02:57 2008 @@ -0,0 +1,41 @@ +//=====-- PIC16Subtarget.h - Define Subtarget for the PIC16 ---*- C++ -*--====// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file declares the PIC16 specific subclass of TargetSubtarget. +// +//===----------------------------------------------------------------------===// + +#ifndef PIC16SUBTARGET_H +#define PIC16SUBTARGET_H + +#include "llvm/Target/TargetSubtarget.h" +#include "llvm/Target/TargetMachine.h" + +#include + +namespace llvm { +class Module; + +class PIC16Subtarget : public TargetSubtarget { + bool IsPIC16Old; + +public: + /// This constructor initializes the data members to match that + /// of the specified module. + /// + PIC16Subtarget(const TargetMachine &TM, const Module &M, + const std::string &FS); + + /// ParseSubtargetFeatures - Parses features string setting specified + /// subtarget options. Definition of function is auto generated by tblgen. + void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU); +}; +} // End llvm namespace + +#endif Added: llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp (added) +++ llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp Tue May 13 04:02:57 2008 @@ -0,0 +1,26 @@ +//===-- PIC16TargetAsmInfo.cpp - PIC16 asm properties ---------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declarations of the PIC16TargetAsmInfo properties. +// +//===----------------------------------------------------------------------===// + +#include "PIC16TargetAsmInfo.h" + +using namespace llvm; + +PIC16TargetAsmInfo:: +PIC16TargetAsmInfo(const PIC16TargetMachine &TM) +{ + Data16bitsDirective = "\t.half\t"; + Data32bitsDirective = "\t.word\t"; + CommentString = ";"; + COMMDirective = "\t"; + COMMDirectiveTakesAlignment = 0; +} Added: llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.h?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.h (added) +++ llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.h Tue May 13 04:02:57 2008 @@ -0,0 +1,30 @@ +//=====-- PIC16TargetAsmInfo.h - PIC16 asm properties ---------*- C++ -*--====// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the PIC16TargetAsmInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef PIC16TARGETASMINFO_H +#define PIC16TARGETASMINFO_H + +#include "llvm/Target/TargetAsmInfo.h" + +namespace llvm { + + // Forward declaration. + class PIC16TargetMachine; + + struct PIC16TargetAsmInfo : public TargetAsmInfo { + PIC16TargetAsmInfo(const PIC16TargetMachine &TM); + }; + +} // namespace llvm + +#endif Added: llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp (added) +++ llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp Tue May 13 04:02:57 2008 @@ -0,0 +1,72 @@ +//===-- PIC16TargetMachine.cpp - Define TargetMachine for PIC16 -----------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Top-level implementation for the PIC16 target. +// +//===----------------------------------------------------------------------===// + +#include "PIC16.h" +#include "PIC16TargetMachine.h" +#include "PIC16TargetAsmInfo.h" +#include "llvm/Module.h" +#include "llvm/PassManager.h" +#include "llvm/Target/TargetMachineRegistry.h" +#include "llvm/Target/TargetAsmInfo.h" + +using namespace llvm; + +namespace { + // Register the targets + RegisterTarget X("pic16", " PIC16 14-bit"); +} + +PIC16TargetMachine:: +PIC16TargetMachine(const Module &M, const std::string &FS) : + Subtarget(*this, M, FS), DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"), + InstrInfo(*this), TLInfo(*this), + FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0) { } + + +const TargetAsmInfo *PIC16TargetMachine:: +createTargetAsmInfo() const +{ + return new PIC16TargetAsmInfo(*this); +} + +//===----------------------------------------------------------------------===// +// Pass Pipeline Configuration +//===----------------------------------------------------------------------===// + +bool PIC16TargetMachine:: +addInstSelector(PassManagerBase &PM, bool Fast) +{ + // Install an instruction selector. + PM.add(createPIC16ISelDag(*this)); + return false; +} + +bool PIC16TargetMachine:: +addPrologEpilogInserter(PassManagerBase &PM, bool Fast) +{ + return false; +} + +bool PIC16TargetMachine:: addPreEmitPass(PassManagerBase &PM, bool Fast) +{ + return true; +} + +bool PIC16TargetMachine:: +addAssemblyEmitter(PassManagerBase &PM, bool Fast, std::ostream &Out) +{ + // Output assembly language. + PM.add(createPIC16CodePrinterPass(Out, *this)); + return false; +} + Added: llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h?rev=51027&view=auto ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h (added) +++ llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h Tue May 13 04:02:57 2008 @@ -0,0 +1,61 @@ +//===-- PIC16TargetMachine.h - Define TargetMachine for PIC16 ---*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file declares the PIC16 specific subclass of TargetMachine. +// +//===----------------------------------------------------------------------===// + + +#ifndef PIC16_TARGETMACHINE_H +#define PIC16_TARGETMACHINE_H + +#include "PIC16InstrInfo.h" +#include "PIC16ISelLowering.h" +#include "PIC16Subtarget.h" +#include "llvm/Target/TargetData.h" +#include "llvm/Target/TargetFrameInfo.h" +#include "llvm/Target/TargetMachine.h" + +namespace llvm { + +/// PIC16TargetMachine +/// +class PIC16TargetMachine : public LLVMTargetMachine { + PIC16Subtarget Subtarget; + const TargetData DataLayout; // Calculates type size & alignment + PIC16InstrInfo InstrInfo; + PIC16TargetLowering TLInfo; + TargetFrameInfo FrameInfo; + +protected: + virtual const TargetAsmInfo *createTargetAsmInfo() const; + +public: + PIC16TargetMachine(const Module &M, const std::string &FS); + + virtual const TargetFrameInfo *getFrameInfo() const + { return &FrameInfo; } + virtual const PIC16InstrInfo *getInstrInfo() const + { return &InstrInfo; } + virtual const TargetData *getTargetData() const + { return &DataLayout; } + virtual PIC16TargetLowering *getTargetLowering() const + { return const_cast(&TLInfo); } + virtual const TargetRegisterInfo *getRegisterInfo() const + { return &InstrInfo.getRegisterInfo(); } + + virtual bool addInstSelector(PassManagerBase &PM, bool Fast); + virtual bool addPrologEpilogInserter(PassManagerBase &PM, bool Fast); + virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); + virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, + std::ostream &Out); +}; +} // end namespace llvm + +#endif From ggreif at gmail.com Tue May 13 04:35:27 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 13 May 2008 09:35:27 -0000 Subject: [llvm-commits] [llvm] r51030 - /llvm/branches/ggreif/use-diet/ Message-ID: <200805130935.m4D9ZRxL015074@zion.cs.uiuc.edu> Author: ggreif Date: Tue May 13 04:35:27 2008 New Revision: 51030 URL: http://llvm.org/viewvc/llvm-project?rev=51030&view=rev Log: remove branch, as it has been merged Removed: llvm/branches/ggreif/use-diet/ From Sanjiv.Gupta at microchip.com Tue May 13 04:16:01 2008 From: Sanjiv.Gupta at microchip.com (Sanjiv.Gupta at microchip.com) Date: Tue, 13 May 2008 02:16:01 -0700 Subject: [llvm-commits] PATCH to configure PIC16 Message-ID: Attached is that patch for configuring PIC16 backend. Let me know if it looks okay to commit. - Sanjiv -------------- next part -------------- A non-text attachment was scrubbed... Name: patch.configure.pic16 Type: application/octet-stream Size: 1865 bytes Desc: patch.configure.pic16 Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080513/7ead7f69/attachment.obj From ggreif at gmail.com Tue May 13 04:37:01 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 13 May 2008 09:37:01 -0000 Subject: [llvm-commits] [llvm] r51031 - /llvm/branches/ggreif/use-diet/ Message-ID: <200805130937.m4D9b12Z015129@zion.cs.uiuc.edu> Author: ggreif Date: Tue May 13 04:37:01 2008 New Revision: 51031 URL: http://llvm.org/viewvc/llvm-project?rev=51031&view=rev Log: re-start with a fresh copy from trunk Added: llvm/branches/ggreif/use-diet/ - copied from r51030, llvm/trunk/ From nicolas.geoffray at lip6.fr Tue May 13 04:28:47 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 09:28:47 -0000 Subject: [llvm-commits] [vmkit] r51029 - in /vmkit/trunk: include/mvm/JIT.h lib/Mvm/JIT.cpp Message-ID: <200805130928.m4D9SlUn014895@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 04:28:46 2008 New Revision: 51029 URL: http://llvm.org/viewvc/llvm-project?rev=51029&view=rev Log: Set the data layout of the main LLVM module. Create new global types. Modified: vmkit/trunk/include/mvm/JIT.h vmkit/trunk/lib/Mvm/JIT.cpp Modified: vmkit/trunk/include/mvm/JIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/JIT.h?rev=51029&r1=51028&r2=51029&view=diff ============================================================================== --- vmkit/trunk/include/mvm/JIT.h (original) +++ vmkit/trunk/include/mvm/JIT.h Tue May 13 04:28:46 2008 @@ -145,6 +145,8 @@ extern llvm::Constant* constantPtrNull; extern llvm::ConstantInt* constantPtrSize; extern const llvm::PointerType* ptrType; +extern const llvm::PointerType* ptr32Type; +extern const llvm::PointerType* ptrPtrType; extern const llvm::Type* arrayPtrType; Modified: vmkit/trunk/lib/Mvm/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/JIT.cpp?rev=51029&r1=51028&r2=51029&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/JIT.cpp (original) +++ vmkit/trunk/lib/Mvm/JIT.cpp Tue May 13 04:28:46 2008 @@ -228,8 +228,11 @@ executionEngine = llvm::ExecutionEngine::createJIT(jit::globalModuleProvider, 0, jit::memoryManager); executionEngine->InstallExceptionTableRegister(__register_frame); - + module->setDataLayout(mvm::jit::executionEngine->getTargetData()->getStringRepresentation()); + ptrType = PointerType::getUnqual(Type::Int8Ty); + ptr32Type = PointerType::getUnqual(Type::Int32Ty); + ptrPtrType = PointerType::getUnqual(ptrType); { std::vector arg_types; @@ -645,6 +648,8 @@ llvm::Constant* mvm::jit::constantPtrNull; llvm::ConstantInt* mvm::jit::constantPtrSize; const llvm::PointerType* mvm::jit::ptrType; +const llvm::PointerType* mvm::jit::ptr32Type; +const llvm::PointerType* mvm::jit::ptrPtrType; const llvm::Type* mvm::jit::arrayPtrType; llvm::Module *mvm::jit::globalModule; From Sanjiv.Gupta at microchip.com Tue May 13 04:29:17 2008 From: Sanjiv.Gupta at microchip.com (Sanjiv.Gupta at microchip.com) Date: Tue, 13 May 2008 02:29:17 -0700 Subject: [llvm-commits] PATCH for PIC16 target. In-Reply-To: References: Message-ID: > Ok, I've read through all the files. They look very > straight-forward. > I have a > number of minor comments below, but these files look fine to > check in whenever you're ready. > I have checked them in after taking care of your comments. Also, I have emailed a separate patch for configure. Thanks. - Sanjiv From nicolas.geoffray at lip6.fr Tue May 13 04:27:10 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 09:27:10 -0000 Subject: [llvm-commits] [vmkit] r51028 - in /vmkit/trunk/lib/JnJVM/VMCore: JavaClass.cpp JavaClass.h JavaIsolate.cpp JavaJIT.cpp JavaJIT.h JavaJITInitialise.cpp JavaJITOpcodes.cpp JavaMetaJIT.cpp JavaRuntimeJIT.cpp Jnjvm.cpp Jnjvm.h LowerConstantCalls.cpp VirtualTables.cpp Message-ID: <200805130927.m4D9RAD9014839@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 04:27:08 2008 New Revision: 51028 URL: http://llvm.org/viewvc/llvm-project?rev=51028&view=rev Log: Java code does not call doNew anymore but gcmalloc instead. The virtualInstance field of a class was useless. Removed unused LLVM functions. Set the data layout when creating modules. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h vmkit/trunk/lib/JnJVM/VMCore/LowerConstantCalls.cpp vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp?rev=51028&r1=51027&r2=51028&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp Tue May 13 04:27:08 2008 @@ -351,39 +351,12 @@ return res; } -#ifndef MULTIPLE_VM -JavaObject* Class::doNew(Jnjvm* vm) { - JavaObject* res = (JavaObject*)gc::operator new(virtualSize, virtualVT); - res->classOf = this; - return res; -} - -// Copy doNew because LLVM wants two different pointers (for simplicity) -JavaObject* Class::doNewUnknown(Jnjvm* vm) { - JavaObject* res = (JavaObject*)gc::operator new(virtualSize, virtualVT); - res->classOf = this; - return res; -} -#else JavaObject* Class::doNew(Jnjvm* vm) { JavaObject* res = (JavaObject*)vm->allocateObject(virtualSize, virtualVT); res->classOf = this; return res; } -// Copy doNew because LLVM wants two different pointers (for simplicity) -JavaObject* Class::doNewUnknown(Jnjvm* vm) { - JavaObject* res = (JavaObject*)vm->allocateObject(virtualSize, virtualVT); - res->classOf = this; - return res; -} -#endif - -JavaObject* Class::initialiseObject(JavaObject* res) { - memcpy(res, virtualInstance, virtualSize); - return res; -} - bool CommonClass::inheritName(const UTF8* Tname) { if (name->equals(Tname)) { return true; @@ -576,16 +549,15 @@ VirtualTable* VT = JavaJIT::makeVT(cl, false); uint64 size = mvm::jit::getTypeSize(cl->virtualType->getContainedType(0)); - cl->virtualSize = size; + cl->virtualSize = (uint32)size; + mvm::jit::protectConstants(); + cl->virtualSizeLLVM = llvm::ConstantInt::get(llvm::Type::Int32Ty, size); + mvm::jit::unprotectConstants(); cl->virtualVT = VT; - cl->virtualInstance = (JavaObject*)cl->isolate->allocateObject(size, VT); - cl->virtualInstance->initialise(cl); for (std::vector::iterator i = cl->virtualFields.begin(), e = cl->virtualFields.end(); i!= e; ++i) { - // Virtual fields apparenty do not have initializers, which is good - // for isolates. I should not have to do this, but just to make sure. - (*i)->initField(cl->virtualInstance); + JavaJIT::initField(*i); } } Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h?rev=51028&r1=51027&r2=51028&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Tue May 13 04:27:08 2008 @@ -169,13 +169,13 @@ class Class : public CommonClass { private: llvm::GlobalVariable* _staticVar; + llvm::GlobalVariable* _llvmVT; public: static VirtualTable* VT; unsigned int minor; unsigned int major; ArrayUInt8* bytes; - JavaObject* virtualInstance; llvm::Function* virtualTracer; llvm::Function* staticTracer; mvm::Code* codeVirtualTracer; @@ -189,14 +189,14 @@ void resolveFields(); llvm::Value* staticVar(JavaJIT* jit); + llvm::Value* llvmVT(JavaJIT* jit); - uint64 virtualSize; + llvm::ConstantInt* virtualSizeLLVM; + uint32 virtualSize; VirtualTable* virtualVT; - uint64 staticSize; + uint32 staticSize; VirtualTable* staticVT; JavaObject* doNew(Jnjvm* vm); - JavaObject* doNewUnknown(Jnjvm* vm); - JavaObject* initialiseObject(JavaObject* obj); virtual void print(mvm::PrintBuffer *buf) const; virtual void TRACER; Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp?rev=51028&r1=51027&r2=51028&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp Tue May 13 04:27:08 2008 @@ -449,6 +449,9 @@ isolate->functions = vm_new(isolate, FunctionMap)(); isolate->functionDefs = vm_new(isolate, FunctionDefMap)(); isolate->module = new llvm::Module("Isolate JnJVM"); + std::string str = + mvm::jit::executionEngine->getTargetData()->getStringRepresentation(); + isolate->module->setDataLayout(str); isolate->protectModule = mvm::Lock::allocNormal(); isolate->TheModuleProvider = new JnjvmModuleProvider(isolate->module, isolate->functions, @@ -514,6 +517,9 @@ isolate->functionDefs = vm_new(isolate, FunctionDefMap)(); isolate->protectModule = mvm::Lock::allocNormal(); isolate->module = new llvm::Module("Bootstrap JnJVM"); + std::string str = + mvm::jit::executionEngine->getTargetData()->getStringRepresentation(); + isolate->module->setDataLayout(str); isolate->TheModuleProvider = new JnjvmModuleProvider(isolate->module, isolate->functions, isolate->functionDefs); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp?rev=51028&r1=51027&r2=51028&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp Tue May 13 04:27:08 2008 @@ -253,7 +253,8 @@ endNode = llvm::PHINode::Create(funcType->getReturnType(), "", endBlock); Value* buf = llvm::CallInst::Create(getSJLJBufferLLVM, "", currentBlock); - Value* test = llvm::CallInst::Create(mvm::jit::setjmpLLVM, buf, "", currentBlock); + Value* test = llvm::CallInst::Create(mvm::jit::setjmpLLVM, buf, "", + currentBlock); test = new ICmpInst(ICmpInst::ICMP_EQ, test, mvm::jit::constantZero, "", currentBlock); llvm::BranchInst::Create(executeBlock, endBlock, test, currentBlock); @@ -300,8 +301,8 @@ valPtrType); mvm::jit::unprotectConstants();//->unlock(); - Value* result = llvm::CallInst::Create(valPtr, nativeArgs.begin(), nativeArgs.end(), - "", currentBlock); + Value* result = llvm::CallInst::Create(valPtr, nativeArgs.begin(), + nativeArgs.end(), "", currentBlock); if (funcType->getReturnType() != Type::VoidTy) endNode->addIncoming(result, currentBlock); @@ -727,7 +728,8 @@ mvm::jit::runPasses(llvmFunction, JavaThread::get()->perFunctionPasses); /* - if (compilingMethod->name == compilingClass->isolate->asciizConstructUTF8("main")) { + if (compilingMethod->name == + compilingClass->isolate->asciizConstructUTF8("main")) { llvmFunction->print(llvm::cout); void* res = mvm::jit::executionEngine->getPointerToGlobal(llvmFunction); void* base = res; @@ -1605,35 +1607,43 @@ ctpInfo->checkInfoOfClass(index); Class* cl = (Class*)(ctpInfo->getMethodClassIfLoaded(index)); - Value* val = 0; - if (!cl || !(cl->isResolved()) -#ifndef MULTIPLE_VM - || !cl->isReady() -#endif - ) { - Value* node = getResolvedClass(index, true); -#ifndef MULTIPLE_VM - val = invoke(doNewUnknownLLVM, node, "", currentBlock); -#else - val = invoke(doNewUnknownLLVM, node, isolateLocal, "", currentBlock); -#endif + Value* Size = 0; + Value* VT = 0; + Value* Cl = 0; + if (!cl || !cl->isResolved()) { + Cl = getResolvedClass(index, true); + Size = CallInst::Create(getObjectSizeFromClassLLVM, Cl, "", currentBlock); + VT = CallInst::Create(getVTFromClassLLVM, Cl, "", currentBlock); } else { - Value* load = new LoadInst(cl->llvmVar(compilingClass->isolate->module), - "", currentBlock); -#ifdef MULTIPLE_VM Module* M = compilingClass->isolate->module; - Value* arg = new LoadInst(cl->llvmVar(M), "", currentBlock); - load = invoke(initialisationCheckLLVM, arg, "", currentBlock); - val = invoke(doNewLLVM, load, isolateLocal, "", currentBlock); -#else - val = invoke(doNewLLVM, load, "", currentBlock); + Size = cl->virtualSizeLLVM; + VT = cl->llvmVT(this); + Cl = new LoadInst(cl->llvmVar(M), "", currentBlock); +#ifndef MULTIPLE_VM + if (!cl->isReady()) #endif - // give the real type info, escape analysis uses it - new BitCastInst(val, cl->virtualType, "", currentBlock); + Cl = invoke(initialisationCheckLLVM, Cl, "", currentBlock); } - - push(val, AssessorDesc::dRef); + std::vector args; + args.push_back(Size); + args.push_back(VT); +#ifdef MULTIPLE_GC + args.push_back(CallInst::Create(getCollectorLLVM, isolateLocal, "", + currentBlock)); +#endif + Value* val = invoke(javaObjectAllocateLLVM, args, "", currentBlock); + + // Set the class + + std::vector gep; + gep.push_back(mvm::jit::constantZero); + gep.push_back(JavaObject::classOffset()); + Value* GEP = GetElementPtrInst::Create(val, gep.begin(), gep.end(), "", + currentBlock); + new StoreInst(Cl, GEP, currentBlock); + + push(val, AssessorDesc::dRef); } Value* JavaJIT::arraySize(Value* val) { Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h?rev=51028&r1=51027&r2=51028&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h Tue May 13 04:27:08 2008 @@ -229,6 +229,7 @@ static void initialiseJITIsolateVM(Jnjvm* vm); + static void initField(JavaField* field); static void initField(JavaField* field, JavaObject* obj, uint64 val = 0); static void initField(JavaField* field, JavaObject* obj, JavaObject* val); static void initField(JavaField* field, JavaObject* obj, double val); @@ -237,26 +238,12 @@ static llvm::Function* getSJLJBufferLLVM; static llvm::Function* virtualLookupLLVM; static llvm::Function* fieldLookupLLVM; - static llvm::Function* UTF8AconsLLVM; - static llvm::Function* Int8AconsLLVM; - static llvm::Function* Int32AconsLLVM; - static llvm::Function* Int16AconsLLVM; - static llvm::Function* FloatAconsLLVM; - static llvm::Function* DoubleAconsLLVM; - static llvm::Function* LongAconsLLVM; - static llvm::Function* ObjectAconsLLVM; static llvm::Function* printExecutionLLVM; static llvm::Function* printMethodStartLLVM; static llvm::Function* printMethodEndLLVM; static llvm::Function* jniProceedPendingExceptionLLVM; - static llvm::Function* doNewLLVM; - // this is when the type is not known at compile time (escape analysis) - static llvm::Function* doNewUnknownLLVM; -#ifdef MULTIPLE_VM static llvm::Function* initialisationCheckLLVM; static llvm::Function* forceInitialisationCheckLLVM; -#endif - static llvm::Function* initialiseObjectLLVM; static llvm::Function* newLookupLLVM; #ifndef WITHOUT_VTABLE static llvm::Function* vtableLookupLLVM; @@ -275,8 +262,14 @@ static llvm::Function* arrayLengthLLVM; static llvm::Function* getVTLLVM; static llvm::Function* getClassLLVM; - static llvm::Function* getCollectorLLVM; static llvm::Function* javaObjectAllocateLLVM; +#ifdef MULTIPLE_GC + static llvm::Function* getCollectorLLVM; +#endif + static llvm::Function* getVTFromClassLLVM; + static llvm::Function* getObjectSizeFromClassLLVM; + static llvm::ConstantInt* constantOffsetObjectSizeInClass; + static llvm::ConstantInt* constantOffsetVTInClass; static Class* getCallingClass(); @@ -289,6 +282,8 @@ static llvm::Function* markAndTraceLLVM; static const llvm::FunctionType* markAndTraceLLVMType; #endif + + static const llvm::Type* VTType; static llvm::Constant* constantJavaObjectNull; static llvm::Constant* constantUTF8Null; Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp?rev=51028&r1=51027&r2=51028&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp Tue May 13 04:27:08 2008 @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "llvm/Instructions.h" #include "llvm/LinkAllPasses.h" #include "llvm/Module.h" @@ -19,6 +21,7 @@ #include "JavaArray.h" #include "JavaCache.h" +#include "JavaClass.h" #include "JavaJIT.h" #include "JavaObject.h" #include "JavaThread.h" @@ -69,7 +72,7 @@ mvm::jit::protectTypes();//->lock(); // Create JavaObject::llvmType const llvm::Type* Pty = mvm::jit::ptrType; - const llvm::Type* VTType = PointerType::getUnqual(PointerType::getUnqual(Type::Int32Ty)); + VTType = PointerType::getUnqual(PointerType::getUnqual(Type::Int32Ty)); std::vector objectFields; objectFields.push_back(VTType); // VT @@ -178,36 +181,6 @@ module); } - // Create doNewLLVM - { - std::vector args; - args.push_back(mvm::jit::ptrType); -#ifdef MULTIPLE_VM - args.push_back(mvm::jit::ptrType); -#endif - const FunctionType* type = FunctionType::get(JavaObject::llvmType, args, - false); - - doNewLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm5Class5doNewEPNS_5JnjvmE", - module); - } - - // Create doNewUnknownLLVM - { - std::vector args; - args.push_back(mvm::jit::ptrType); -#ifdef MULTIPLE_VM - args.push_back(mvm::jit::ptrType); -#endif - const FunctionType* type = FunctionType::get(JavaObject::llvmType, args, - false); - - doNewUnknownLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm5Class12doNewUnknownEPNS_5JnjvmE", - module); - } - // Create multiCallNewLLVM { std::vector args; @@ -221,7 +194,6 @@ module); } -#ifdef MULTIPLE_VM // Create initialisationCheckLLVM { std::vector args; @@ -251,73 +223,7 @@ "forceInitialisationCheck", module); } -#endif - - - - // Create *AconsLLVM - { - std::vector args; - args.push_back(Type::Int32Ty); - args.push_back(mvm::jit::ptrType); -#ifdef MULTIPLE_VM - args.push_back(mvm::jit::ptrType); -#endif - const FunctionType* type = FunctionType::get(JavaObject::llvmType, args, - false); - - FloatAconsLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm10ArrayFloat5aconsEiPNS_10ClassArrayEPNS_5JnjvmE", - module); - - Int8AconsLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm10ArraySInt85aconsEiPNS_10ClassArrayEPNS_5JnjvmE", - module); - - DoubleAconsLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm11ArrayDouble5aconsEiPNS_10ClassArrayEPNS_5JnjvmE", - module); - - Int16AconsLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm11ArraySInt165aconsEiPNS_10ClassArrayEPNS_5JnjvmE", - module); - - Int32AconsLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm11ArraySInt325aconsEiPNS_10ClassArrayEPNS_5JnjvmE", - module); - UTF8AconsLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm4UTF85aconsEiPNS_10ClassArrayEPNS_5JnjvmE", - module); - - LongAconsLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm9ArrayLong5aconsEiPNS_10ClassArrayEPNS_5JnjvmE", - module); - - ObjectAconsLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm11ArrayObject5aconsEiPNS_10ClassArrayEPNS_5JnjvmE", - module); - } - - // Create initialiseObjectLLVM - { - std::vector args; - args.push_back(mvm::jit::ptrType); - args.push_back(JavaObject::llvmType); - const FunctionType* type = FunctionType::get(JavaObject::llvmType, args, - false); - - initialiseObjectLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm5Class16initialiseObjectEPNS_10JavaObjectE", - module); - PAListPtr func_toto_PAL; - SmallVector Attrs; - ParamAttrsWithIndex PAWI; - PAWI.Index = 0; PAWI.Attrs = 0 | ParamAttr::ReadNone; - Attrs.push_back(PAWI); - func_toto_PAL = PAListPtr::get(Attrs.begin(), Attrs.end()); - initialiseObjectLLVM->setParamAttrs(func_toto_PAL); - } // Create arrayLengthLLVM { @@ -364,7 +270,7 @@ const FunctionType* type = FunctionType::get(mvm::jit::ptrType, args, false); getClassLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "getVT", + "getClass", module); PAListPtr func_toto_PAL; SmallVector Attrs; @@ -397,6 +303,65 @@ newLookupLLVM->setParamAttrs(func_toto_PAL); } +#ifdef MULTIPLE_GC + // Create getCollectorLLVM + { + std::vector args; + args.push_back(mvm::jit::ptrType); + const FunctionType* type = FunctionType::get(mvm::jit::ptrType, args, + false); + + getCollectorLLVM = Function::Create(type, GlobalValue::ExternalLinkage, + "getCollector", + module); + PAListPtr func_toto_PAL; + SmallVector Attrs; + ParamAttrsWithIndex PAWI; + PAWI.Index = 0; PAWI.Attrs = 0 | ParamAttr::ReadNone; + Attrs.push_back(PAWI); + func_toto_PAL = PAListPtr::get(Attrs.begin(), Attrs.end()); + getCollectorLLVM->setParamAttrs(func_toto_PAL); + } +#endif + + // Create getVTFromClassLLVM + { + std::vector args; + args.push_back(mvm::jit::ptrType); + const FunctionType* type = FunctionType::get(VTType, args, + false); + + getVTFromClassLLVM = Function::Create(type, GlobalValue::ExternalLinkage, + "getVTFromClass", + module); + PAListPtr func_toto_PAL; + SmallVector Attrs; + ParamAttrsWithIndex PAWI; + PAWI.Index = 0; PAWI.Attrs = 0 | ParamAttr::ReadNone; + Attrs.push_back(PAWI); + func_toto_PAL = PAListPtr::get(Attrs.begin(), Attrs.end()); + getVTFromClassLLVM->setParamAttrs(func_toto_PAL); + } + + // Create getSizeFromClassLLVM + { + std::vector args; + args.push_back(mvm::jit::ptrType); + const FunctionType* type = FunctionType::get(Type::Int32Ty, args, + false); + + getObjectSizeFromClassLLVM = Function::Create(type, GlobalValue::ExternalLinkage, + "getObjectSizeFromClass", + module); + PAListPtr func_toto_PAL; + SmallVector Attrs; + ParamAttrsWithIndex PAWI; + PAWI.Index = 0; PAWI.Attrs = 0 | ParamAttr::ReadNone; + Attrs.push_back(PAWI); + func_toto_PAL = PAListPtr::get(Attrs.begin(), Attrs.end()); + getObjectSizeFromClassLLVM->setParamAttrs(func_toto_PAL); + } + #ifndef WITHOUT_VTABLE // Create vtableLookupLLVM { @@ -782,9 +747,14 @@ GlobalValue::ExternalLinkage, cons, "", module); - - - + { + Class fake; + int offset = (intptr_t)&(fake.virtualSize) - (intptr_t)&fake; + constantOffsetObjectSizeInClass = ConstantInt::get(Type::Int32Ty, offset); + offset = (intptr_t)&(fake.virtualVT) - (intptr_t)&fake; + constantOffsetVTInClass = ConstantInt::get(Type::Int32Ty, offset); + } + mvm::jit::unprotectConstants();//->unlock(); } @@ -794,7 +764,8 @@ llvm::Constant* JavaJIT::constantJavaObjectSize; llvm::GlobalVariable* JavaJIT::JavaObjectVT; llvm::GlobalVariable* JavaJIT::ArrayObjectVT; - +llvm::ConstantInt* JavaJIT::constantOffsetObjectSizeInClass; +llvm::ConstantInt* JavaJIT::constantOffsetVTInClass; namespace mvm { @@ -814,8 +785,6 @@ // LLVM does not allow calling functions from other modules in verifier //PM->add(llvm::createVerifierPass()); // Verify that input is correct - // do escape analysis first, because the type is given in the first bitcastinst - addPass(PM, mvm::createEscapeAnalysisPass(JavaJIT::doNewLLVM, JavaJIT::initialiseObjectLLVM)); addPass(PM, llvm::createCFGSimplificationPass()); // Clean up disgusting code addPass(PM, llvm::createScalarReplAggregatesPass());// Kill useless allocas addPass(PM, llvm::createInstructionCombiningPass()); // Clean up after IPCP & DAE Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp?rev=51028&r1=51027&r2=51028&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp Tue May 13 04:27:08 2008 @@ -1902,7 +1902,7 @@ args.push_back(size); args.push_back(new LoadInst(TheVT, "", currentBlock)); #ifdef MULTIPLE_GC - args.push_back(CallInst::Create(getCollector, isolateLocal, "", + args.push_back(CallInst::Create(getCollectorLLVM, isolateLocal, "", currentBlock)); #endif Value* res = invoke(javaObjectAllocateLLVM, args, "", currentBlock); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp?rev=51028&r1=51027&r2=51028&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp Tue May 13 04:27:08 2008 @@ -98,6 +98,28 @@ return _llvmVar; } +Value* Class::llvmVT(JavaJIT* jit) { + if (!_llvmVT) { + aquire(); + if (!_llvmVT) { + mvm::jit::protectConstants();//->lock(); + Constant* cons = + ConstantExpr::getIntToPtr(ConstantInt::get(Type::Int64Ty, uint64_t (virtualVT)), + JavaJIT::VTType); + mvm::jit::unprotectConstants();//->unlock(); + + isolate->protectModule->lock(); + _llvmVT = new GlobalVariable(JavaJIT::VTType, true, + GlobalValue::ExternalLinkage, + cons, "", + isolate->module); + isolate->protectModule->unlock(); + } + release(); + } + return new LoadInst(_llvmVT, "", jit->currentBlock); +} + Value* CommonClass::llvmDelegatee(llvm::Module* M, llvm::BasicBlock* BB) { #ifndef MULTIPLE_VM if (!_llvmDelegatee) { @@ -312,7 +334,7 @@ } -static void _initField(JavaField* field) { +void JavaJIT::initField(JavaField* field) { ConstantInt* offset = field->offset; const TargetData* targetData = mvm::jit::executionEngine->getTargetData(); bool stat = isStatic(field->access); @@ -327,7 +349,7 @@ } void JavaJIT::initField(JavaField* field, JavaObject* obj, uint64 val) { - _initField(field); + initField(field); const AssessorDesc* funcs = field->signature->funcs; if (funcs == AssessorDesc::dLong) { @@ -349,17 +371,17 @@ } void JavaJIT::initField(JavaField* field, JavaObject* obj, JavaObject* val) { - _initField(field); + initField(field); ((JavaObject**)((uint64)obj + field->ptrOffset))[0] = val; } void JavaJIT::initField(JavaField* field, JavaObject* obj, double val) { - _initField(field); + initField(field); ((double*)((uint64)obj + field->ptrOffset))[0] = val; } void JavaJIT::initField(JavaField* field, JavaObject* obj, float val) { - _initField(field); + initField(field); ((float*)((uint64)obj + field->ptrOffset))[0] = val; } @@ -779,22 +801,22 @@ void JavaField::operator()(float val) { JavaField * field = this; - return (*field)(classDef->virtualInstance, val); + return (*field)(0, val); } void JavaField::operator()(double val) { JavaField * field = this; - return (*field)(classDef->virtualInstance, val); + return (*field)(0, val); } void JavaField::operator()(sint64 val) { JavaField * field = this; - return (*field)(classDef->virtualInstance, val); + return (*field)(0, val); } void JavaField::operator()(uint32 val) { JavaField * field = this; - return (*field)(classDef->virtualInstance, val); + return (*field)(0, val); } Function* Signdef::createFunctionCallBuf(bool virt) { Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp?rev=51028&r1=51027&r2=51028&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp Tue May 13 04:27:08 2008 @@ -47,25 +47,12 @@ #ifndef WITHOUT_VTABLE llvm::Function* JavaJIT::vtableLookupLLVM = 0; #endif -llvm::Function* JavaJIT::UTF8AconsLLVM = 0; -llvm::Function* JavaJIT::Int8AconsLLVM = 0; -llvm::Function* JavaJIT::Int32AconsLLVM = 0; -llvm::Function* JavaJIT::Int16AconsLLVM = 0; -llvm::Function* JavaJIT::FloatAconsLLVM = 0; -llvm::Function* JavaJIT::DoubleAconsLLVM = 0; -llvm::Function* JavaJIT::LongAconsLLVM = 0; -llvm::Function* JavaJIT::ObjectAconsLLVM = 0; llvm::Function* JavaJIT::printExecutionLLVM = 0; llvm::Function* JavaJIT::printMethodStartLLVM = 0; llvm::Function* JavaJIT::printMethodEndLLVM = 0; llvm::Function* JavaJIT::jniProceedPendingExceptionLLVM = 0; -llvm::Function* JavaJIT::doNewLLVM = 0; -llvm::Function* JavaJIT::doNewUnknownLLVM = 0; -#ifdef MULTIPLE_VM llvm::Function* JavaJIT::initialisationCheckLLVM = 0; llvm::Function* JavaJIT::forceInitialisationCheckLLVM = 0; -#endif -llvm::Function* JavaJIT::initialiseObjectLLVM = 0; llvm::Function* JavaJIT::newLookupLLVM = 0; llvm::Function* JavaJIT::instanceOfLLVM = 0; llvm::Function* JavaJIT::aquireObjectLLVM = 0; @@ -77,12 +64,20 @@ llvm::Function* JavaJIT::arrayLengthLLVM = 0; llvm::Function* JavaJIT::getVTLLVM = 0; llvm::Function* JavaJIT::getClassLLVM = 0; +llvm::Function* JavaJIT::getVTFromClassLLVM = 0; +llvm::Function* JavaJIT::getObjectSizeFromClassLLVM = 0; + +#ifdef MULTIPLE_GC +llvm::Function* JavaJIT::getCollectorLLVM; +#endif #ifdef SERVICE_VM llvm::Function* JavaJIT::aquireObjectInSharedDomainLLVM = 0; llvm::Function* JavaJIT::releaseObjectInSharedDomainLLVM = 0; #endif +const llvm::Type* JavaJIT::VTType; + extern "C" JavaString* runtimeUTF8ToStr(const UTF8* val) { Jnjvm* vm = JavaThread::get()->isolate; return vm->UTF8ToStr(val); @@ -239,12 +234,12 @@ } return val->second; } +#endif extern "C" CommonClass* initialisationCheck(CommonClass* cl) { cl->isolate->initialiseClass(cl); return cl; } -#endif extern "C" JavaObject* getClassDelegatee(CommonClass* cl) { #ifdef MULTIPLE_VM Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=51028&r1=51027&r2=51028&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Tue May 13 04:27:08 2008 @@ -716,7 +716,6 @@ #ifndef MULTIPLE_VM cl->_staticInstance = 0; #endif - cl->virtualInstance = 0; cl->super = 0; cl->ctpInfo = 0; return cl; Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h?rev=51028&r1=51027&r2=51028&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h Tue May 13 04:27:08 2008 @@ -59,6 +59,9 @@ class Jnjvm : public mvm::Object{ public: +#ifdef MULTIPLE_GC + Collector* GC; +#endif static VirtualTable* VT; static Jnjvm* bootstrapVM; @@ -256,9 +259,6 @@ DelegateeMap* delegatees; #endif -#ifdef MULTIPLE_GC - Collector* GC; -#endif mvm::Lock* protectModule; llvm::Module* module; Modified: vmkit/trunk/lib/JnJVM/VMCore/LowerConstantCalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/LowerConstantCalls.cpp?rev=51028&r1=51027&r2=51028&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/LowerConstantCalls.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/LowerConstantCalls.cpp Tue May 13 04:27:08 2008 @@ -32,7 +32,8 @@ private: }; char LowerConstantCalls::ID = 0; - RegisterPass X("LowerArrayLength", "Lower Array length"); + RegisterPass X("LowerConstantCalls", + "Lower Constant calls"); bool LowerConstantCalls::runOnFunction(Function& F) { bool Changed = false; @@ -78,9 +79,46 @@ Value* cl = new LoadInst(classPtr, "", CI); CI->replaceAllUsesWith(cl); CI->eraseFromParent(); + } else if (V == jnjvm::JavaJIT::getVTFromClassLLVM) { + Changed = true; + Value* val = CI->getOperand(1); + std::vector indexes; + indexes.push_back(jnjvm::JavaJIT::constantOffsetVTInClass); + Value* VTPtr = GetElementPtrInst::Create(val, indexes.begin(), + indexes.end(), "", CI); + VTPtr = new BitCastInst(VTPtr, mvm::jit::ptrPtrType, "", CI); + Value* VT = new LoadInst(VTPtr, "", CI); + VT = new BitCastInst(VT, jnjvm::JavaJIT::VTType, "", CI); + CI->replaceAllUsesWith(VT); + CI->eraseFromParent(); + } else if (V == jnjvm::JavaJIT::getObjectSizeFromClassLLVM) { + Changed = true; + Value* val = CI->getOperand(1); + std::vector indexes; + indexes.push_back(jnjvm::JavaJIT::constantOffsetObjectSizeInClass); + Value* SizePtr = GetElementPtrInst::Create(val, indexes.begin(), + indexes.end(), "", CI); + SizePtr = new BitCastInst(SizePtr, mvm::jit::ptr32Type, "", CI); + Value* Size = new LoadInst(SizePtr, "", CI); + CI->replaceAllUsesWith(Size); + CI->eraseFromParent(); } -#ifdef MULTIPLE_VM else if (V == jnjvm::JavaJIT::forceInitialisationCheckLLVM) { + Changed = true; + CI->eraseFromParent(); + } +#ifdef MULTIPLE_GC + else if (V == jnjvm::JavaJIT::getCollectorLLVM) { + Changed = true; + Value* val = CI->getOperand(1); + std::vector indexes; + indexes.push_back(mvm::jit::constantOne); + val = new BitCastInst(val, mvm::jit::ptrPtrType, "", CI); + Value* CollectorPtr = GetElementPtrInst::Create(val, indexes.begin(), + indexes.end(), "", + CI); + Value* Collector = new LoadInst(CollectorPtr, "", CI); + CI->replaceAllUsesWith(Collector); CI->eraseFromParent(); } #endif Modified: vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp?rev=51028&r1=51027&r2=51028&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp Tue May 13 04:27:08 2008 @@ -133,7 +133,6 @@ #ifndef MULTIPLE_VM _staticInstance->MARK_AND_TRACE; #endif - virtualInstance->MARK_AND_TRACE; ctpInfo->MARK_AND_TRACE; TRACE_VECTOR(Attribut*, gc_allocator, attributs); codeStaticTracer->MARK_AND_TRACE; From nicolas.geoffray at lip6.fr Tue May 13 05:12:06 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 10:12:06 -0000 Subject: [llvm-commits] [vmkit] r51032 - in /vmkit/trunk/lib/JnJVM/Classpath: Classpath.cpp ClasspathConstructor.h ClasspathMethod.h ClasspathVMClass.h ClasspathVMClassLoader.h ClasspathVMField.h ClasspathVMObject.h ClasspathVMRuntime.h ClasspathVMStackWalker.h ClasspathVMSystem.h ClasspathVMSystemProperties.h ClasspathVMThread.h ClasspathVMThrowable.h Makefile.am Message-ID: <200805131012.m4DAC8vB016328@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 05:11:57 2008 New Revision: 51032 URL: http://llvm.org/viewvc/llvm-project?rev=51032&view=rev Log: Remove useless .h files. The file Classpath.cpp now includes the .cpp files and the BootstrapClasspath function does nothing. Removed: vmkit/trunk/lib/JnJVM/Classpath/ClasspathConstructor.h vmkit/trunk/lib/JnJVM/Classpath/ClasspathMethod.h vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClass.h vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClassLoader.h vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.h vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMObject.h vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.h vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.h vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMSystem.h vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMSystemProperties.h vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.h vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.h Modified: vmkit/trunk/lib/JnJVM/Classpath/Classpath.cpp vmkit/trunk/lib/JnJVM/Classpath/Makefile.am Modified: vmkit/trunk/lib/JnJVM/Classpath/Classpath.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/Classpath.cpp?rev=51032&r1=51031&r2=51032&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/Classpath.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/Classpath.cpp Tue May 13 05:11:57 2008 @@ -11,68 +11,26 @@ #include "Classpath.h" -#include "ClasspathConstructor.h" -#include "ClasspathMethod.h" -#include "ClasspathVMClass.h" -#include "ClasspathVMClassLoader.h" -#include "ClasspathVMField.h" -#include "ClasspathVMObject.h" -#include "ClasspathVMRuntime.h" -#include "ClasspathVMStackWalker.h" -#include "ClasspathVMSystem.h" -#include "ClasspathVMSystemProperties.h" -#include "ClasspathVMThread.h" -#include "ClasspathVMThrowable.h" +#include "ClasspathConstructor.cpp" +#include "ClasspathMethod.cpp" +#include "ClasspathVMClass.cpp" +#include "ClasspathVMClassLoader.cpp" +#include "ClasspathVMField.cpp" +#include "ClasspathVMObject.cpp" +#include "ClasspathVMRuntime.cpp" +#include "ClasspathVMStackWalker.cpp" +#include "ClasspathVMSystem.cpp" +#include "ClasspathVMSystemProperties.cpp" +#include "ClasspathVMThread.cpp" +#include "ClasspathVMThrowable.cpp" #include "JavaClass.h" #include "Jnjvm.h" #include "NativeUtil.h" -typedef void (*function_t) (void); - -function_t faketable[] = { - (function_t)Java_java_lang_VMSystem_arraycopy, - (function_t)Java_java_lang_VMSystem_identityHashCode, - (function_t)Java_java_lang_VMThread_currentThread, - (function_t)Java_java_lang_VMClassLoader_getPrimitiveClass, - (function_t)Java_java_lang_VMClass_isArray, - (function_t)Java_java_lang_VMClass_getDeclaredConstructors, - (function_t)Java_java_lang_VMClass_getDeclaredMethods, - (function_t)Java_java_lang_VMClass_forName, - (function_t)Java_java_lang_VMClass_getModifiers, - (function_t)Java_gnu_classpath_VMSystemProperties_preInit, - (function_t)Java_java_lang_VMObject_clone, - (function_t)Java_java_lang_VMObject_getClass, - (function_t)Java_java_lang_VMRuntime_mapLibraryName, - (function_t)Java_java_lang_VMRuntime_nativeLoad, - (function_t)Java_java_lang_reflect_Constructor_getParameterTypes, - (function_t)Java_java_lang_reflect_Constructor_getModifiersInternal, - (function_t)Java_java_lang_reflect_Method_getModifiersInternal, - (function_t)Java_java_lang_reflect_Constructor_constructNative, - (function_t)Java_java_lang_VMClassLoader_findLoadedClass, - (function_t)Java_java_lang_VMClassLoader_loadClass, - (function_t)Java_java_lang_VMClass_getName, - (function_t)Java_java_lang_VMThrowable_fillInStackTrace, - (function_t)Java_java_lang_VMClassLoader_defineClass, - (function_t)Java_java_lang_VMClassLoader_resolveClass, - (function_t)Java_java_lang_VMClass_isPrimitive, - (function_t)Java_java_lang_VMClass_isInterface, - (function_t)Java_java_lang_VMClass_getComponentType, - (function_t)Java_java_lang_VMRuntime_gc, - (function_t)Java_java_lang_VMClass_getClassLoader, - (function_t)Java_java_lang_VMClass_isAssignableFrom, - (function_t)Java_java_lang_reflect_Field_getModifiersInternal, - (function_t)Java_gnu_classpath_VMStackWalker_getClassContext -}; - - - +// Called by JnJVM to ensure the compiler will link the classpath methods extern "C" int ClasspathBoot(int argc, char** argv, char** env) { - void* p; - p = &faketable; - p = &GNUClasspathLibs; - p = &GNUClasspathGlibj; return 1; } Removed: vmkit/trunk/lib/JnJVM/Classpath/ClasspathConstructor.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathConstructor.h?rev=51031&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathConstructor.h (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathConstructor.h (removed) @@ -1,80 +0,0 @@ -//===-------- ClasspathConstructor.h - Classpath methods ------------------===// -// -// JnJVM -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -#ifndef _JAVA_LANG_REFLECT_CONSTRUCTOR_H -#define _JAVA_LANG_REFLECT_CONSTRUCTOR_H - -#include - -extern "C" { - -/* - * Class: java/lang/reflect/Constructor - * Method: getParameterTypes - * Signature: ()[Ljava/lang/Class; - */ -JNIEXPORT jobject JNICALL Java_java_lang_reflect_Constructor_getParameterTypes( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject cons -); - -/* - * Class: java/lang/reflect/Constructor - * Method: getModifiersInternal - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_java_lang_reflect_Constructor_getModifiersInternal( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject cons); - - -/* - * Class: java/lang/reflect/Constructor - * Method: constructNative - * Signature: ([Ljava/lang/Object;Ljava/lang/Class;I)Ljava/lang/Object; - */ - -JNIEXPORT jobject JNICALL Java_java_lang_reflect_Constructor_constructNative( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject cons, jobject args, jclass Clazz, jint meth); - - - -/* - * Class: java/lang/reflect/Constructor - * Method: getExceptionTypes - * Signature: ()[Ljava/lang/Class; - */ -JNIEXPORT jobjectArray JNICALL Java_java_lang_reflect_Constructor_getExceptionTypes( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject cons); - - - -#if 0 -/* - * Class: java/lang/reflect/Constructor - * Method: getSignature - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT struct java_lang_String* JNICALL Java_java_lang_reflect_Constructor_getSignature(JNIEnv *env, struct java_lang_reflect_Constructor* this); - -#endif - -} -#endif Removed: vmkit/trunk/lib/JnJVM/Classpath/ClasspathMethod.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathMethod.h?rev=51031&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathMethod.h (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathMethod.h (removed) @@ -1,89 +0,0 @@ -//===----------- ClasspathMethod.h - Classpath methods --------------------===// -// -// JnJVM -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef _JAVA_LANG_REFLECT_METHOD_H -#define _JAVA_LANG_REFLECT_METHOD_H - - -extern "C" { -/* - * Class: java/lang/reflect/Method - * Method: getModifiersInternal - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_java_lang_reflect_Method_getModifiersInternal( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif - jobject meth); - - -/* - * Class: java/lang/reflect/Method - * Method: getReturnType - * Signature: ()Ljava/lang/Class; - */ -JNIEXPORT jclass JNICALL Java_java_lang_reflect_Method_getReturnType( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif - jobject meth); - - -/* - * Class: java/lang/reflect/Method - * Method: getParameterTypes - * Signature: ()[Ljava/lang/Class; - */ -JNIEXPORT jobject JNICALL Java_java_lang_reflect_Method_getParameterTypes( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif - jobject Meth); - -/* - * Class: java/lang/reflect/Method - * Method: invokeNative - * Signature: (Ljava/lang/Object;[Ljava/lang/Object;Ljava/lang/Class;I)Ljava/lang/Object; - */ -JNIEXPORT jobject JNICALL Java_java_lang_reflect_Method_invokeNative( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif - jobject Meth, jobject obj, jobject Args, jclass Cl, jint meth); - - -/* - * Class: java/lang/reflect/Method - * Method: getExceptionTypes - * Signature: ()[Ljava/lang/Class; - */ -JNIEXPORT jobjectArray JNICALL Java_java_lang_reflect_Method_getExceptionTypes( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif - jobject meth); - - - -#if 0 -/* - * Class: java/lang/reflect/Method - * Method: getSignature - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT struct java_lang_String* JNICALL Java_java_lang_reflect_Method_getSignature( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif - struct java_lang_reflect_Method* this); -#endif -} -#endif - Removed: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClass.h?rev=51031&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClass.h (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClass.h (removed) @@ -1,359 +0,0 @@ -//===---------- ClasspathVMClass.h - Classpath methods --------------------===// -// -// JnJVM -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef _JAVA_LANG_VMCLASS_H -#define _JAVA_LANG_VMCLASS_H - -#include - -extern "C" { - -/* - * Class: java/lang/VMClass - * Method: isArray - * Signature: (Ljava/lang/Class;)Z - */ -JNIEXPORT jboolean JNICALL Java_java_lang_VMClass_isArray( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject klass); - -/* - * Class: java/lang/VMClass - * Method: forName - * Signature: (Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class; - */ -JNIEXPORT jclass JNICALL Java_java_lang_VMClass_forName( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject str, jboolean clinit, jobject loader); - -/* - * Class: java/lang/VMClass - * Method: getDeclaredConstructors - * Signature: (Ljava/lang/Class;Z)[Ljava/lang/reflect/Constructor; - */ -JNIEXPORT jobject JNICALL Java_java_lang_VMClass_getDeclaredConstructors( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject cl, jboolean publicOnly); - -/* - * Class: java/lang/VMClass - * Method: getDeclaredMethods - * Signature: (Ljava/lang/Class;Z)[Ljava/lang/reflect/Method; - */ -JNIEXPORT jobject JNICALL Java_java_lang_VMClass_getDeclaredMethods( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jclass cl, jboolean publicOnly); - -/* - * Class: java/lang/VMClass - * Method: getModifiers - * Signature: (Ljava/lang/Class;Z)I - */ -JNIEXPORT jint JNICALL Java_java_lang_VMClass_getModifiers( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jclass Cl, jboolean ignore); - -/* - * Class: java/lang/VMClass - * Method: getName - * Signature: (Ljava/lang/Class;)Ljava/lang/String; - */ -JNIEXPORT jobject JNICALL Java_java_lang_VMClass_getName( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject Cl); - -/* - * Class: java/lang/VMClass - * Method: isPrimitive - * Signature: (Ljava/lang/Class;)Z - */ -JNIEXPORT jboolean JNICALL Java_java_lang_VMClass_isPrimitive( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jclass Cl); - -/* - * Class: java/lang/VMClass - * Method: isInterface - * Signature: (Ljava/lang/Class;)Z - */ -JNIEXPORT jboolean JNICALL Java_java_lang_VMClass_isInterface( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jclass Cl); - -/* - * Class: java/lang/VMClass - * Method: getComponentType - * Signature: (Ljava/lang/Class;)Ljava/lang/Class; - */ -JNIEXPORT jclass JNICALL Java_java_lang_VMClass_getComponentType( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jclass Cl); - -/* - * Class: java/lang/VMClass - * Method: getClassLoader - * Signature: (Ljava/lang/Class;)Ljava/lang/ClassLoader; - */ -JNIEXPORT jobject JNICALL Java_java_lang_VMClass_getClassLoader( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jclass Cl); - -/* - * Class: java/lang/VMClass - * Method: isAssignableFrom - * Signature: (Ljava/lang/Class;Ljava/lang/Class;)Z - */ -JNIEXPORT jboolean JNICALL Java_java_lang_VMClass_isAssignableFrom( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jclass Cl1, jclass Cl2); - -/* - * Class: java/lang/VMClass - * Method: getSuperclass - * Signature: (Ljava/lang/Class;)Ljava/lang/Class; - */ -JNIEXPORT jclass JNICALL Java_java_lang_VMClass_getSuperclass( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jclass Cl); - - - -/* - * Class: java/lang/VMClass - * Method: isInstance - * Signature: (Ljava/lang/Class;Ljava/lang/Object;)Z - */ -JNIEXPORT bool JNICALL Java_java_lang_VMClass_isInstance( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jclass par1, jobject par2); - - -/* - * Class: java/lang/VMClass - * Method: getDeclaredFields - * Signature: (Ljava/lang/Class;Z)[Ljava/lang/reflect/Field; - */ -JNIEXPORT jobject JNICALL Java_java_lang_VMClass_getDeclaredFields( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jclass par1, jboolean publicOnly); - - - - - - - - - - -/* - * Class: java/lang/VMClass - * Method: getInterfaces - * Signature: (Ljava/lang/Class;)[Ljava/lang/Class; - */ -JNIEXPORT jobject JNICALL Java_java_lang_VMClass_getInterfaces( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jclass par1); - - - - - - -/* - * Class: java/lang/VMClass - * Method: getDeclaringClass - * Signature: (Ljava/lang/Class;)Ljava/lang/Class; - */ -JNIEXPORT jclass JNICALL Java_java_lang_VMClass_getDeclaringClass( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jclass Cl); - -/* - * Class: java/lang/VMClass - * Method: throwException - * Signature: (Ljava/lang/Throwable;)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMClass_throwException( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject throwable); - -#if 0 -/* - * Class: java/lang/VMClass - * Method: getDeclaredClasses - * Signature: (Ljava/lang/Class;Z)[Ljava/lang/Class; - */ -JNIEXPORT java_objectarray* JNICALL Java_java_lang_VMClass_getDeclaredClasses( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, struct java_lang_Class* par1, s4 par2); - - - - - - - - - - - - - -/* - * Class: java/lang/VMClass - * Method: getDeclaredAnnotations - * Signature: (Ljava/lang/Class;)[Ljava/lang/annotation/Annotation; - */ -JNIEXPORT java_objectarray* JNICALL Java_java_lang_VMClass_getDeclaredAnnotations( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, struct java_lang_Class* par1); - - -/* - * Class: java/lang/VMClass - * Method: getEnclosingClass - * Signature: (Ljava/lang/Class;)Ljava/lang/Class; - */ -JNIEXPORT struct java_lang_Class* JNICALL Java_java_lang_VMClass_getEnclosingClass( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, struct java_lang_Class* par1); - - -/* - * Class: java/lang/VMClass - * Method: getEnclosingConstructor - * Signature: (Ljava/lang/Class;)Ljava/lang/reflect/Constructor; - */ -JNIEXPORT struct java_lang_reflect_Constructor* JNICALL Java_java_lang_VMClass_getEnclosingConstructor( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, struct java_lang_Class* par1); - - -/* - * Class: java/lang/VMClass - * Method: getEnclosingMethod - * Signature: (Ljava/lang/Class;)Ljava/lang/reflect/Method; - */ -JNIEXPORT struct java_lang_reflect_Method* JNICALL Java_java_lang_VMClass_getEnclosingMethod( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, struct java_lang_Class* par1); - - -/* - * Class: java/lang/VMClass - * Method: getClassSignature - * Signature: (Ljava/lang/Class;)Ljava/lang/String; - */ -JNIEXPORT struct java_lang_String* JNICALL Java_java_lang_VMClass_getClassSignature( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, struct java_lang_Class* par1); - - -/* - * Class: java/lang/VMClass - * Method: isAnonymousClass - * Signature: (Ljava/lang/Class;)Z - */ -JNIEXPORT s4 JNICALL Java_java_lang_VMClass_isAnonymousClass( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, struct java_lang_Class* par1); - - -/* - * Class: java/lang/VMClass - * Method: isLocalClass - * Signature: (Ljava/lang/Class;)Z - */ -JNIEXPORT s4 JNICALL Java_java_lang_VMClass_isLocalClass( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, struct java_lang_Class* par1); - - -/* - * Class: java/lang/VMClass - * Method: isMemberClass - * Signature: (Ljava/lang/Class;)Z - */ -JNIEXPORT s4 JNICALL Java_java_lang_VMClass_isMemberClass( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, struct java_lang_Class* par1); -#endif -} -#endif - Removed: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClassLoader.h?rev=51031&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClassLoader.h (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClassLoader.h (removed) @@ -1,101 +0,0 @@ -//===------ ClasspathVMClassLoader.h - Classpath methods ------------------===// -// -// JnJVM -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef _JAVA_LANG_VMCLASSLOADER_H -#define _JAVA_LANG_VMCLASSLOADER_H - -#include - -extern "C" { - -/* - * Class: java/lang/VMClassLoader - * Method: getPrimitiveClass - * Signature: (C)Ljava/lang/Class; - */ -JNIEXPORT jclass JNICALL Java_java_lang_VMClassLoader_getPrimitiveClass( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jchar par1); - -/* - * Class: java/lang/VMClassLoader - * Method: findLoadedClass - * Signature: (Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/Class; - */ -JNIEXPORT jclass JNICALL Java_java_lang_VMClassLoader_findLoadedClass( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject loader, jobject name); - -/* - * Class: java/lang/VMClassLoader - * Method: loadClass - * Signature: (Ljava/lang/String;Z)Ljava/lang/Class; - */ -JNIEXPORT jclass JNICALL Java_java_lang_VMClassLoader_loadClass( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject str, jboolean doResolve); - - -/* - * Class: java/lang/VMClassLoader - * Method: defineClass - * Signature: (Ljava/lang/ClassLoader;Ljava/lang/String;[BIILjava/security/ProtectionDomain;)Ljava/lang/Class; - */ -JNIEXPORT jclass JNICALL Java_java_lang_VMClassLoader_defineClass( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject loader, jobject str, jobject bytes, jint off, jint len, jobject pd); - - -/* - * Class: java/lang/VMClassLoader - * Method: resolveClass - * Signature: (Ljava/lang/Class;)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMClassLoader_resolveClass( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jclass Cl); - - - -#if 0 -/* - * Class: java/lang/VMClassLoader - * Method: nativeGetResources - * Signature: (Ljava/lang/String;)Ljava/util/Vector; - */ -JNIEXPORT struct java_util_Vector* JNICALL Java_java_lang_VMClassLoader_nativeGetResources( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, struct java_lang_String* par1); - - - - -#endif - -} - -#endif - Removed: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.h?rev=51031&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.h (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.h (removed) @@ -1,268 +0,0 @@ -//===------------ ClasspathVMField.h - Classpath methods ------------------===// -// -// JnJVM -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef _JAVA_LANG_REFLECT_FIELD_H -#define _JAVA_LANG_REFLECT_FIELD_H - -#include - -extern "C" { - -/* - * Class: java/lang/reflect/Field - * Method: getModifiersInternal - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_java_lang_reflect_Field_getModifiersInternal( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject obj); - - -/* - * Class: java/lang/reflect/Field - * Method: getType - * Signature: ()Ljava/lang/Class; - */ -JNIEXPORT jclass JNICALL Java_java_lang_reflect_Field_getType( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject field); - -/* - * Class: java/lang/reflect/Field - * Method: getInt - * Signature: (Ljava/lang/Object;)I - */ -JNIEXPORT jint JNICALL Java_java_lang_reflect_Field_getInt( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject obj); - - -/* - * Class: java/lang/reflect/Field - * Method: getLong - * Signature: (Ljava/lang/Object;)J - */ -JNIEXPORT jlong JNICALL Java_java_lang_reflect_Field_getLong( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject obj); - - -/* - * Class: java/lang/reflect/Field - * Method: get - * Signature: (Ljava/lang/Object;)Ljava/lang/Object; - */ -JNIEXPORT jobject JNICALL Java_java_lang_reflect_Field_get( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject _obj); - - -/* - * Class: java/lang/reflect/Field - * Method: getBoolean - * Signature: (Ljava/lang/Object;)Z - */ -JNIEXPORT jboolean JNICALL Java_java_lang_reflect_Field_getBoolean( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject _obj); - -/* - * Class: java/lang/reflect/Field - * Method: getFloat - * Signature: (Ljava/lang/Object;)F - */ -JNIEXPORT jfloat JNICALL Java_java_lang_reflect_Field_getFloat( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject _obj); - -/* - * Class: java/lang/reflect/Field - * Method: getByte - * Signature: (Ljava/lang/Object;)B - */ -JNIEXPORT jbyte JNICALL Java_java_lang_reflect_Field_getByte( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject obj); - - -/* - * Class: java/lang/reflect/Field - * Method: getChar - * Signature: (Ljava/lang/Object;)C - */ -JNIEXPORT jchar JNICALL Java_java_lang_reflect_Field_getChar( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject obj); - - -/* - * Class: java/lang/reflect/Field - * Method: getShort - * Signature: (Ljava/lang/Object;)S - */ -JNIEXPORT jshort JNICALL Java_java_lang_reflect_Field_getShort( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject obj); - - -/* - * Class: java/lang/reflect/Field - * Method: getDouble - * Signature: (Ljava/lang/Object;)D - */ -JNIEXPORT jdouble JNICALL Java_java_lang_reflect_Field_getDouble( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject obj); - - -/* - * Class: java/lang/reflect/Field - * Method: set - * Signature: (Ljava/lang/Object;Ljava/lang/Object;)V - */ -JNIEXPORT void JNICALL Java_java_lang_reflect_Field_set( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject obj, jobject val); - - -/* - * Class: java/lang/reflect/Field - * Method: setBoolean - * Signature: (Ljava/lang/Object;Z)V - */ -JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setBoolean( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject obj, jboolean val); - - -/* - * Class: java/lang/reflect/Field - * Method: setByte - * Signature: (Ljava/lang/Object;B)V - */ -JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setByte( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject obj, jbyte val); - - -/* - * Class: java/lang/reflect/Field - * Method: setChar - * Signature: (Ljava/lang/Object;C)V - */ -JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setChar( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject obj, jchar val); - - -/* - * Class: java/lang/reflect/Field - * Method: setShort - * Signature: (Ljava/lang/Object;S)V - */ -JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setShort( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject obj, jshort val); - - -/* - * Class: java/lang/reflect/Field - * Method: setInt - * Signature: (Ljava/lang/Object;I)V - */ -JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setInt( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject obj, jint val); - - -/* - * Class: java/lang/reflect/Field - * Method: setLong - * Signature: (Ljava/lang/Object;J)V - */ -JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setLong( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject obj, jlong val); - - -/* - * Class: java/lang/reflect/Field - * Method: setFloat - * Signature: (Ljava/lang/Object;F)V - */ -JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setFloat( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject obj, jfloat val); - - -/* - * Class: java/lang/reflect/Field - * Method: setDouble - * Signature: (Ljava/lang/Object;D)V - */ -JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setDouble( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject Field, jobject obj, jdouble val); - -#if 0 -/* - * Class: java/lang/reflect/Field - * Method: getSignature - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT struct java_lang_String* JNICALL Java_java_lang_reflect_Field_getSignature( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -struct java_lang_reflect_Field* this); -#endif -} -#endif - - Removed: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMObject.h?rev=51031&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMObject.h (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMObject.h (removed) @@ -1,78 +0,0 @@ -//===----------- ClasspathVMObject.h - Classpath methods ------------------===// -// -// JnJVM -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef _JAVA_LANG_VMOBJECT_H -#define _JAVA_LANG_VMOBJECT_H - -extern "C" { - -/* - * Class: java/lang/VMObject - * Method: clone - * Signature: (Ljava/lang/Cloneable;)Ljava/lang/Object; - */ -JNIEXPORT jobject JNICALL Java_java_lang_VMObject_clone( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject par1); - -/* - * Class: java/lang/VMObject - * Method: getClass - * Signature: (Ljava/lang/Object;)Ljava/lang/Class; - */ -JNIEXPORT jobject JNICALL Java_java_lang_VMObject_getClass( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject obj); - -/* - * Class: java/lang/VMObject - * Method: notifyAll - * Signature: (Ljava/lang/Object;)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMObject_notifyAll( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject par1); - -/* - * Class: java/lang/VMObject - * Method: wait - * Signature: (Ljava/lang/Object;JI)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMObject_wait( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject par1, jlong par2, jint par3); - -/* - * Class: java/lang/VMObject - * Method: notify - * Signature: (Ljava/lang/Object;)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMObject_notify( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject obj); - - - -} -#endif Removed: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.h?rev=51031&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.h (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.h (removed) @@ -1,193 +0,0 @@ -//===-------- ClasspathVMRuntime.h - Classpath methods ------------------===// -// -// JnJVM -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef _JAVA_LANG_VMRUNTIME_H -#define _JAVA_LANG_VMRUNTIME_H - -#include - -extern "C" { - -/* - * Class: java/lang/VMRuntime - * Method: mapLibraryName - * Signature: (Ljava/lang/String;)Ljava/lang/String; - */ -JNIEXPORT jobject JNICALL Java_java_lang_VMRuntime_mapLibraryName( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject strLib); - -/* - * Class: java/lang/VMRuntime - * Method: nativeLoad - * Signature: (Ljava/lang/String;Ljava/lang/ClassLoader;)I - */ -JNIEXPORT jint JNICALL Java_java_lang_VMRuntime_nativeLoad( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject _str, jobject _loader); - -/* - * Class: java/lang/VMRuntime - * Method: gc - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_java_lang_VMRuntime_gc( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -); - -/* - * Class: java/lang/VMRuntime - * Method: runFinalization - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_java_lang_VMRuntime_runFinalization( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -); - -/* - * Class: java/lang/VMRuntime - * Method: runFinalizationForExit - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_java_lang_VMRuntime_runFinalizationForExit( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -); - -/* - * Class: java/lang/VMRuntime - * Method: exit - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMRuntime_exit( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jint par1); - -/* - * Class: java/lang/VMRuntime - * Method: freeMemory - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_java_lang_VMRuntime_freeMemory( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz -#endif -); - - -/* - * Class: java/lang/VMRuntime - * Method: totalMemory - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_java_lang_VMRuntime_totalMemory( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz -#endif -); - - -/* - * Class: java/lang/VMRuntime - * Method: maxMemory - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_java_lang_VMRuntime_maxMemory( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz -#endif -); - -#if 0 -/* - * Class: java/lang/VMRuntime - * Method: availableProcessors - * Signature: ()I - */ -JNIEXPORT s4 JNICALL Java_java_lang_VMRuntime_availableProcessors( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz); - - - - - - - - - - -/* - * Class: java/lang/VMRuntime - * Method: traceInstructions - * Signature: (Z)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMRuntime_traceInstructions( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, s4 par1); - - -/* - * Class: java/lang/VMRuntime - * Method: traceMethodCalls - * Signature: (Z)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMRuntime_traceMethodCalls( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, s4 par1); - - -/* - * Class: java/lang/VMRuntime - * Method: runFinalizersOnExit - * Signature: (Z)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMRuntime_runFinalizersOnExit( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, s4 par1); - - - - - - - -#endif - -} - -#endif Removed: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.h?rev=51031&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.h (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.h (removed) @@ -1,61 +0,0 @@ -//===------- ClasspathVMStackWalker.h - Classpath methods -----------------===// -// -// JnJVM -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef _GNU_CLASSPATH_VMSTACKWALKER_H -#define _GNU_CLASSPATH_VMSTACKWALKER_H - -extern "C" { - -/* - * Class: gnu/classpath/VMStackWalker - * Method: getClassContext - * Signature: ()[Ljava/lang/Class; - */ -JNIEXPORT jobject JNICALL Java_gnu_classpath_VMStackWalker_getClassContext( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -); - -JNIEXPORT jobject JNICALL Java_gnu_classpath_VMStackWalker_getClassLoader( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jclass Cl); - -#if 0 -/* - * Class: gnu/classpath/VMStackWalker - * Method: getCallingClass - * Signature: ()Ljava/lang/Class; - */ -JNIEXPORT jclass JNICALL Java_gnu_classpath_VMStackWalker_getCallingClass( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz); - - -/* - * Class: gnu/classpath/VMStackWalker - * Method: getCallingClassLoader - * Signature: ()Ljava/lang/ClassLoader; - */ -JNIEXPORT jobject JNICALL Java_gnu_classpath_VMStackWalker_getCallingClassLoader( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz); -#endif - -} - -#endif Removed: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMSystem.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMSystem.h?rev=51031&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMSystem.h (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMSystem.h (removed) @@ -1,105 +0,0 @@ -//===----------- ClasspathVMSystem.h - Classpath methods ------------------===// -// -// JnJVM -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef _JAVA_LANG_VMSYSTEM_H -#define _JAVA_LANG_VMSYSTEM_H - -#include - - -extern "C" { -/* - * Class: java/lang/VMSystem - * Method: arraycopy - * Signature: (Ljava/lang/Object;ILjava/lang/Object;II)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMSystem_arraycopy( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject par1, jint par2, jobject par3, jint par4, jint par5); - - -/* - * Class: java/lang/VMSystem - * Method: identityHashCode - * Signature: (Ljava/lang/Object;)I - */ -JNIEXPORT jint JNICALL Java_java_lang_VMSystem_identityHashCode( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject obj); - - -#if 0 -/* - * Class: java/lang/VMSystem - * Method: setIn - * Signature: (Ljava/io/InputStream;)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMSystem_setIn( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, struct java_io_InputStream* par1); - - -/* - * Class: java/lang/VMSystem - * Method: setOut - * Signature: (Ljava/io/PrintStream;)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMSystem_setOut( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, struct java_io_PrintStream* par1); - - -/* - * Class: java/lang/VMSystem - * Method: setErr - * Signature: (Ljava/io/PrintStream;)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMSystem_setErr( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, struct java_io_PrintStream* par1); - - -/* - * Class: java/lang/VMSystem - * Method: currentTimeMillis - * Signature: ()J - */ -JNIEXPORT s8 JNICALL Java_java_lang_VMSystem_currentTimeMillis( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz); - - -/* - * Class: java/lang/VMSystem - * Method: getenv - * Signature: (Ljava/lang/String;)Ljava/lang/String; - */ -JNIEXPORT struct java_lang_String* JNICALL Java_java_lang_VMSystem_getenv( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, struct java_lang_String* par1); - -#endif -} -#endif Removed: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMSystemProperties.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMSystemProperties.h?rev=51031&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMSystemProperties.h (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMSystemProperties.h (removed) @@ -1,29 +0,0 @@ -//===----- ClasspathVMSystemProperties.h - Classpath methods --------------===// -// -// JnJVM -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef _GNU_CLASSPATH_VMSYSTEMPROPERTIES_H -#define _GNU_CLASSPATH_VMSYSTEMPROPERTIES_H - -extern "C" { -/* - * Class: gnu/classpath/VMSystemProperties - * Method: preInit - * Signature: (Ljava/util/Properties;)V - */ -JNIEXPORT void JNICALL Java_gnu_classpath_VMSystemProperties_preInit( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject par1); - -} - -#endif - Removed: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.h?rev=51031&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.h (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.h (removed) @@ -1,174 +0,0 @@ -//===----------- ClasspathVMThread.h - Classpath methods ------------------===// -// -// JnJVM -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef _JAVA_LANG_VMTHREAD_H -#define _JAVA_LANG_VMTHREAD_H - -#include -#include "types.h" - -extern "C" { - -/* - * Class: java/lang/VMThread - * Method: currentThread - * Signature: ()Ljava/lang/Thread; - */ -JNIEXPORT jobject JNICALL Java_java_lang_VMThread_currentThread( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -); - -/* - * Class: java/lang/VMThread - * Method: start - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMThread_start( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject obj, sint64 stackSize); - -/* - * Class: java/lang/VMThread - * Method: interrupt - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_java_lang_VMThread_interrupt( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject vmthread); - -/* - * Class: java/lang/VMThread - * Method: interrupted - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_java_lang_VMThread_interrupted( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -); - -/* - * Class: java/lang/VMThread - * Method: isInterrupted - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_java_lang_VMThread_isInterrupted( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject vmthread); - -/* - * Class: java/lang/VMThread - * Method: nativeSetPriority - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMThread_nativeSetPriority( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject vmthread, jint prio); - -/* - * Class: java/lang/VMThread - * Method: nativeStop - * Signature: (Ljava/lang/Throwable;)V - */ -JNIEXPORT void JNICALL Java_java_lang_VMThread_nativeStop( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject vmthread, jobject exc); - -/* - * Class: java/lang/VMThread - * Method: yield - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_java_lang_VMThread_yield( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -); - -#if 0 -/* - * Class: java/lang/VMThread - * Method: countStackFrames - * Signature: ()I - */ -JNIEXPORT s4 JNICALL Java_java_lang_VMThread_countStackFrames( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -struct java_lang_VMThread* this); - - - - - - - - -/* - * Class: java/lang/VMThread - * Method: suspend - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_java_lang_VMThread_suspend( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -struct java_lang_VMThread* this); - - -/* - * Class: java/lang/VMThread - * Method: resume - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_java_lang_VMThread_resume( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -struct java_lang_VMThread* this); - - - - - - - - - - -/* - * Class: java/lang/VMThread - * Method: holdsLock - * Signature: (Ljava/lang/Object;)Z - */ -JNIEXPORT s4 JNICALL Java_java_lang_VMThread_holdsLock( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jclass clazz, struct java_lang_Object* par1); - -#endif -} - -#endif Removed: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.h?rev=51031&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.h (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.h (removed) @@ -1,39 +0,0 @@ -//===-------- ClasspathVMThrowable.h - Classpath methods ------------------===// -// -// JnJVM -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef _JAVA_LANG_VMTHROWABLE_H -#define _JAVA_LANG_VMTHROWABLE_H - -extern "C" { -/* - * Class: java/lang/VMThrowable - * Method: fillInStackTrace - * Signature: (Ljava/lang/Throwable;)Ljava/lang/VMThrowable; - */ -JNIEXPORT jobject JNICALL Java_java_lang_VMThrowable_fillInStackTrace( -#ifdef NATIVE_JNI -JNIEnv *env, -jclass clazz, -#endif -jobject throwable); - -/* - * Class: java/lang/VMThrowable - * Method: getStackTrace - * Signature: (Ljava/lang/Throwable;)[Ljava/lang/StackTraceElement; - */ -JNIEXPORT jobject JNICALL Java_java_lang_VMThrowable_getStackTrace( -#ifdef NATIVE_JNI -JNIEnv *env, -#endif -jobject obj, jobject par1); - -} -#endif - Modified: vmkit/trunk/lib/JnJVM/Classpath/Makefile.am URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/Makefile.am?rev=51032&r1=51031&r2=51032&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/Makefile.am (original) +++ vmkit/trunk/lib/JnJVM/Classpath/Makefile.am Tue May 13 05:11:57 2008 @@ -2,13 +2,6 @@ PREFIX=@prefix@ -libClasspath_la_SOURCES = \ - ClasspathVMSystem.cpp ClasspathVMSystem.h Classpath.cpp \ - ClasspathVMThread.cpp ClasspathVMThread.h ClasspathVMClassLoader.h \ - ClasspathVMClassLoader.cpp ClasspathVMClass.cpp ClasspathVMClass.h ClasspathVMSystemProperties.h \ - ClasspathVMSystemProperties.cpp ClasspathVMObject.h ClasspathVMObject.cpp \ - ClasspathVMRuntime.h ClasspathVMRuntime.cpp ClasspathConstructor.cpp ClasspathConstructor.h \ - ClasspathVMThrowable.h ClasspathVMThrowable.cpp ClasspathMethod.h ClasspathMethod.cpp \ - ClasspathVMField.h ClasspathVMField.cpp ClasspathVMStackWalker.cpp ClasspathVMStackWalker.h +libClasspath_la_SOURCES = Classpath.cpp libClasspath_la_CXXFLAGS =-I../VMCore -DPREFIX=\"$(PREFIX)\" -W -Wall -ansi -Wno-unused-parameter -Wno-long-long -Wno-unused-function -fno-omit-frame-pointer -O2 -g -Werror From nicolas.geoffray at lip6.fr Tue May 13 05:17:52 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 10:17:52 -0000 Subject: [llvm-commits] [vmkit] r51033 - /vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.cpp Message-ID: <200805131017.m4DAHrJr016487@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 05:17:48 2008 New Revision: 51033 URL: http://llvm.org/viewvc/llvm-project?rev=51033&view=rev Log: Remove dead include. Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.cpp Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.cpp?rev=51033&r1=51032&r2=51033&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.cpp Tue May 13 05:17:48 2008 @@ -8,7 +8,6 @@ //===----------------------------------------------------------------------===// -#include "ClasspathVMField.h" #include "JavaClass.h" #include "JavaThread.h" #include "JavaTypes.h" From ggreif at gmail.com Tue May 13 07:37:34 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 13 May 2008 12:37:34 -0000 Subject: [llvm-commits] [llvm] r51034 - in /llvm/branches/ggreif/use-diet/lib/VMCore: Constants.cpp Function.cpp Instructions.cpp Mangler.cpp TypeSymbolTable.cpp Use.cpp Message-ID: <200805131237.m4DCbaUK020503@zion.cs.uiuc.edu> Author: ggreif Date: Tue May 13 07:37:25 2008 New Revision: 51034 URL: http://llvm.org/viewvc/llvm-project?rev=51034&view=rev Log: fix 80col violations Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Constants.cpp llvm/branches/ggreif/use-diet/lib/VMCore/Function.cpp llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp llvm/branches/ggreif/use-diet/lib/VMCore/Mangler.cpp llvm/branches/ggreif/use-diet/lib/VMCore/TypeSymbolTable.cpp llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Constants.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Constants.cpp?rev=51034&r1=51033&r2=51034&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/Constants.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/Constants.cpp Tue May 13 07:37:25 2008 @@ -539,9 +539,11 @@ GetElementPtrConstantExpr(Constant *C, const std::vector &IdxList, const Type *DestTy); public: - static GetElementPtrConstantExpr *Create(Constant *C, const std::vector &IdxList, + static GetElementPtrConstantExpr *Create(Constant *C, + const std::vector&IdxList, const Type *DestTy) { - return new(IdxList.size() + 1) GetElementPtrConstantExpr(C, IdxList, DestTy); + return new(IdxList.size() + 1) + GetElementPtrConstantExpr(C, IdxList, DestTy); } /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); @@ -1973,8 +1975,9 @@ Constant *ConstantExpr::getGetElementPtrTy(const Type *ReqTy, Constant *C, Value* const *Idxs, unsigned NumIdx) { - assert(GetElementPtrInst::getIndexedType(C->getType(), Idxs, Idxs+NumIdx, true) && - "GEP indices invalid!"); + assert(GetElementPtrInst::getIndexedType(C->getType(), + Idxs, Idxs+NumIdx, true) + && "GEP indices invalid!"); if (Constant *FC = ConstantFoldGetElementPtr(C, (Constant**)Idxs, NumIdx)) return FC; // Fold a few common cases... Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Function.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Function.cpp?rev=51034&r1=51033&r2=51034&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/Function.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/Function.cpp Tue May 13 07:37:25 2008 @@ -106,7 +106,8 @@ /// it in its containing function. bool Argument::hasStructRetAttr() const { if (!isa(getType())) return false; - if (this != getParent()->arg_begin()) return false; // StructRet param must be first param + if (this != getParent()->arg_begin()) + return false; // StructRet param must be first param return getParent()->paramHasAttr(1, ParamAttr::StructRet); } Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp?rev=51034&r1=51033&r2=51034&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp Tue May 13 07:37:25 2008 @@ -421,7 +421,8 @@ InvokeInst::InvokeInst(const InvokeInst &II) : TerminatorInst(II.getType(), Instruction::Invoke, - OperandTraits::op_end(this) - II.getNumOperands(), + OperandTraits::op_end(this) + - II.getNumOperands(), II.getNumOperands()) { setParamAttrs(II.getParamAttrs()); SubclassData = II.SubclassData; @@ -464,7 +465,8 @@ ReturnInst::ReturnInst(const ReturnInst &RI) : TerminatorInst(Type::VoidTy, Instruction::Ret, - OperandTraits::op_end(this) - RI.getNumOperands(), + OperandTraits::op_end(this) + - RI.getNumOperands(), RI.getNumOperands()) { unsigned N = RI.getNumOperands(); if (N == 1) @@ -997,7 +999,8 @@ GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI) : Instruction(reinterpret_cast(GEPI.getType()), GetElementPtr, - OperandTraits::op_end(this) - GEPI.getNumOperands(), + OperandTraits::op_end(this) + - GEPI.getNumOperands(), GEPI.getNumOperands()) { Use *OL = OperandList; Use *GEPIOL = GEPI.OperandList; @@ -1976,45 +1979,45 @@ unsigned DestBits = DestTy->getPrimitiveSizeInBits(); // 0 for ptr/vector // Run through the possibilities ... - if (DestTy->isInteger()) { // Casting to integral - if (SrcTy->isInteger()) { // Casting from integral + if (DestTy->isInteger()) { // Casting to integral + if (SrcTy->isInteger()) { // Casting from integral return true; - } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt + } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt return true; } else if (const VectorType *PTy = dyn_cast(SrcTy)) { - // Casting from vector + // Casting from vector return DestBits == PTy->getBitWidth(); - } else { // Casting from something else + } else { // Casting from something else return isa(SrcTy); } - } else if (DestTy->isFloatingPoint()) { // Casting to floating pt - if (SrcTy->isInteger()) { // Casting from integral + } else if (DestTy->isFloatingPoint()) { // Casting to floating pt + if (SrcTy->isInteger()) { // Casting from integral return true; - } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt + } else if (SrcTy->isFloatingPoint()) { // Casting from floating pt return true; } else if (const VectorType *PTy = dyn_cast(SrcTy)) { - // Casting from vector + // Casting from vector return DestBits == PTy->getBitWidth(); - } else { // Casting from something else + } else { // Casting from something else return false; } } else if (const VectorType *DestPTy = dyn_cast(DestTy)) { - // Casting to vector + // Casting to vector if (const VectorType *SrcPTy = dyn_cast(SrcTy)) { - // Casting from vector + // Casting from vector return DestPTy->getBitWidth() == SrcPTy->getBitWidth(); - } else { // Casting from something else + } else { // Casting from something else return DestPTy->getBitWidth() == SrcBits; } - } else if (isa(DestTy)) { // Casting to pointer - if (isa(SrcTy)) { // Casting from pointer + } else if (isa(DestTy)) { // Casting to pointer + if (isa(SrcTy)) { // Casting from pointer return true; - } else if (SrcTy->isInteger()) { // Casting from integral + } else if (SrcTy->isInteger()) { // Casting from integral return true; - } else { // Casting from something else + } else { // Casting from something else return false; } - } else { // Casting to something else + } else { // Casting to something else return false; } } @@ -2806,8 +2809,12 @@ CastInst *PtrToIntInst::clone() const { return new PtrToIntInst(*this); } CastInst *IntToPtrInst::clone() const { return new IntToPtrInst(*this); } CastInst *BitCastInst::clone() const { return new BitCastInst(*this); } -CallInst *CallInst::clone() const { return new(getNumOperands()) CallInst(*this); } -SelectInst *SelectInst::clone() const { return new(getNumOperands()) SelectInst(*this); } +CallInst *CallInst::clone() const { + return new(getNumOperands()) CallInst(*this); +} +SelectInst *SelectInst::clone() const { + return new(getNumOperands()) SelectInst(*this); +} VAArgInst *VAArgInst::clone() const { return new VAArgInst(*this); } ExtractElementInst *ExtractElementInst::clone() const { @@ -2820,10 +2827,16 @@ return new ShuffleVectorInst(*this); } PHINode *PHINode::clone() const { return new PHINode(*this); } -ReturnInst *ReturnInst::clone() const { return new(getNumOperands()) ReturnInst(*this); } -BranchInst *BranchInst::clone() const { return new(getNumOperands()) BranchInst(*this); } +ReturnInst *ReturnInst::clone() const { + return new(getNumOperands()) ReturnInst(*this); +} +BranchInst *BranchInst::clone() const { + return new(getNumOperands()) BranchInst(*this); +} SwitchInst *SwitchInst::clone() const { return new SwitchInst(*this); } -InvokeInst *InvokeInst::clone() const { return new(getNumOperands()) InvokeInst(*this); } +InvokeInst *InvokeInst::clone() const { + return new(getNumOperands()) InvokeInst(*this); +} UnwindInst *UnwindInst::clone() const { return new UnwindInst(); } UnreachableInst *UnreachableInst::clone() const { return new UnreachableInst();} GetResultInst *GetResultInst::clone() const { return new GetResultInst(*this); } Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Mangler.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Mangler.cpp?rev=51034&r1=51033&r2=51034&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/Mangler.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/Mangler.cpp Tue May 13 07:37:25 2008 @@ -166,7 +166,8 @@ } else { // If GV is external but the existing one is static, mangle the existing one if ((GV->hasExternalLinkage() || GV->hasDLLImportLinkage()) && - !(ExistingValue->hasExternalLinkage() || ExistingValue->hasDLLImportLinkage())) { + !(ExistingValue->hasExternalLinkage() + || ExistingValue->hasDLLImportLinkage())) { MangledGlobals.insert(ExistingValue); ExistingValue = GV; } else if ((GV->hasExternalLinkage() || @@ -208,6 +209,8 @@ std::map Names; for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) InsertName(I, Names); - for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) + for (Module::global_iterator I = M.global_begin(), E = M.global_end(); + I != E; + ++I) InsertName(I, Names); } Modified: llvm/branches/ggreif/use-diet/lib/VMCore/TypeSymbolTable.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/TypeSymbolTable.cpp?rev=51034&r1=51033&r2=51034&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/TypeSymbolTable.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/TypeSymbolTable.cpp Tue May 13 07:37:25 2008 @@ -64,7 +64,9 @@ // list... if (Result->isAbstract()) { #if DEBUG_ABSTYPE - cerr << "Removing abstract type from symtab" << Result->getDescription()<<"\n"; + cerr << "Removing abstract type from symtab" + << Result->getDescription() + << "\n"; #endif cast(Result)->removeAbstractTypeUser(this); } Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp?rev=51034&r1=51033&r2=51034&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Tue May 13 07:37:25 2008 @@ -1,4 +1,4 @@ -//===-- Use.cpp - Implement the Use class -------------------------------===// +//===-- Use.cpp - Implement the Use class ---------------------------------===// // // The LLVM Compiler Infrastructure // @@ -122,7 +122,9 @@ //===----------------------------------------------------------------------===// Use *User::allocHungoffUses(unsigned N) const { - Use *Begin = static_cast(::operator new(sizeof(Use) * N + sizeof(AugmentedUse) - sizeof(Use))); + Use *Begin = static_cast(::operator new(sizeof(Use) * N + + sizeof(AugmentedUse) + - sizeof(Use))); Use *End = Begin + N; static_cast(End[-1]).ref = addTag(this, tagOne); return Use::initTags(Begin, End); From asl at math.spbu.ru Tue May 13 08:16:26 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 13 May 2008 17:16:26 +0400 Subject: [llvm-commits] PATCH to configure PIC16 In-Reply-To: References: Message-ID: <1210684586.8813.399.camel@localhost> Hello, Sanjiv > Attached is that patch for configuring PIC16 backend. > Let me know if it looks okay to commit. Looks ok for me. But please don't forget about updating configure files itself. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From resistor at mac.com Tue May 13 08:41:38 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 13 May 2008 13:41:38 -0000 Subject: [llvm-commits] [llvm] r51035 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp Message-ID: <200805131341.m4DDfeCW022453@zion.cs.uiuc.edu> Author: resistor Date: Tue May 13 08:41:23 2008 New Revision: 51035 URL: http://llvm.org/viewvc/llvm-project?rev=51035&view=rev Log: Make the non-local CSE safety checks slightly more thorough. Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=51035&r1=51034&r2=51035&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Tue May 13 08:41:23 2008 @@ -443,7 +443,7 @@ DenseMap deps; MD->getNonLocalDependency(C, deps); - Value* dep = 0; + CallInst* cdep = 0; for (DenseMap::iterator I = deps.begin(), E = deps.end(); I != E; ++I) { @@ -453,22 +453,24 @@ return nextValueNumber++; } else if (I->second != MemoryDependenceAnalysis::NonLocal) { if (DT->dominates(I->first, C->getParent())) { - dep = I->second; + if (CallInst* CD = dyn_cast(I->second)) + cdep = CD; + else { + valueNumbering.insert(std::make_pair(V, nextValueNumber)); + return nextValueNumber++; + } } else { valueNumbering.insert(std::make_pair(V, nextValueNumber)); - return nextValueNumber++; } } } - if (!dep || !isa(dep)) { + if (!cdep) { valueNumbering.insert(std::make_pair(V, nextValueNumber)); return nextValueNumber++; } - CallInst* cdep = cast(dep); - if (cdep->getCalledFunction() != C->getCalledFunction() || cdep->getNumOperands() != C->getNumOperands()) { valueNumbering.insert(std::make_pair(V, nextValueNumber)); From nicolas.geoffray at lip6.fr Tue May 13 09:14:43 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 14:14:43 -0000 Subject: [llvm-commits] [vmkit] r51036 - /vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Message-ID: <200805131414.m4DEEhZn023477@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 09:14:42 2008 New Revision: 51036 URL: http://llvm.org/viewvc/llvm-project?rev=51036&view=rev Log: Remove compilation warnings. Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=51036&r1=51035&r2=51036&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Tue May 13 09:14:42 2008 @@ -247,7 +247,7 @@ if (assemblyName == 0) VMThread::get()->vm->error("can not find mscorlib.dll. Abort"); - vm->assemblyPath.push_back(""); + vm->assemblyPath.push_back((char*)""); vm->assemblyPath.push_back(assemblyName); const UTF8* mscorlib = vm->asciizConstructUTF8("mscorlib"); @@ -424,7 +424,7 @@ } extern "C" int start_app(int argc, char** argv) { - N3* vm = N3::allocate("", N3::bootstrapVM); + N3* vm = N3::allocate((char*)"", N3::bootstrapVM); vm->runMain(argc, argv); return 0; } From nicolas.geoffray at lip6.fr Tue May 13 09:15:18 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 14:15:18 -0000 Subject: [llvm-commits] [vmkit] r51037 - in /vmkit/trunk/lib/N3/VMCore: CLIJit.cpp LowerArrayLength.cpp Message-ID: <200805131415.m4DEFIJV023514@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 09:15:18 2008 New Revision: 51037 URL: http://llvm.org/viewvc/llvm-project?rev=51037&view=rev Log: Fix compilation build. Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/LowerArrayLength.cpp Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=51037&r1=51036&r2=51037&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Tue May 13 09:15:18 2008 @@ -2193,13 +2193,10 @@ namespace mvm { llvm::FunctionPass* createEscapeAnalysisPass(llvm::Function*, llvm::Function*); -} - -namespace n3 { llvm::FunctionPass* createLowerArrayLengthPass(); -//llvm::FunctionPass* createArrayChecksPass(); } + static void addPass(FunctionPassManager *PM, Pass *P) { // Add the pass to the pass manager... PM->add(P); @@ -2252,5 +2249,5 @@ addPass(PM, llvm::createDeadStoreEliminationPass()); // Delete dead stores addPass(PM, llvm::createAggressiveDCEPass()); // SSA based 'Aggressive DCE' addPass(PM, llvm::createCFGSimplificationPass()); // Merge & remove BBs - addPass(PM, n3::createLowerArrayLengthPass()); + addPass(PM, mvm::createLowerArrayLengthPass()); } Modified: vmkit/trunk/lib/N3/VMCore/LowerArrayLength.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/LowerArrayLength.cpp?rev=51037&r1=51036&r2=51037&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/LowerArrayLength.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/LowerArrayLength.cpp Tue May 13 09:15:18 2008 @@ -20,7 +20,7 @@ using namespace llvm; -namespace { +namespace mvm { class VISIBILITY_HIDDEN LowerArrayLength : public FunctionPass { public: @@ -32,7 +32,6 @@ }; char LowerArrayLength::ID = 0; RegisterPass X("LowerArrayLength", "Lower Array length"); -} bool LowerArrayLength::runOnFunction(Function& F) { bool Changed = false; @@ -62,10 +61,9 @@ return Changed; } -namespace n3 { - LowerArrayLength* createLowerArrayLengthPass() { return new LowerArrayLength(); } } + From nicolas.geoffray at lip6.fr Tue May 13 09:16:19 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 14:16:19 -0000 Subject: [llvm-commits] [vmkit] r51038 - /vmkit/trunk/lib/Mvm/Object.cpp Message-ID: <200805131416.m4DEGJ7l023557@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 09:16:18 2008 New Revision: 51038 URL: http://llvm.org/viewvc/llvm-project?rev=51038&view=rev Log: Create the C gcmalloc instructions, so that LLVM can directly use it. Modified: vmkit/trunk/lib/Mvm/Object.cpp Modified: vmkit/trunk/lib/Mvm/Object.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Object.cpp?rev=51038&r1=51037&r2=51038&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Object.cpp (original) +++ vmkit/trunk/lib/Mvm/Object.cpp Tue May 13 09:16:18 2008 @@ -18,6 +18,18 @@ using namespace mvm; + + +#ifdef USE_GC_BOEHM +#ifdef MULTIPLE_GC +extern "C" gc* gcmalloc(size_t sz, VirtualTable* VT, Collector* GC) { +#else +extern "C" gc* gcmalloc(size_t sz, VirtualTable* VT) { +#endif + return (gc*)gc::operator new(sz, VT); +} +#endif + VirtualTable *Object::VT = 0; VirtualTable *Method::VT = 0; VirtualTable *Code::VT = 0; From nicolas.geoffray at lip6.fr Tue May 13 09:26:11 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 14:26:11 -0000 Subject: [llvm-commits] [vmkit] r51039 - in /vmkit/trunk/lib/JnJVM: Classpath/ClasspathVMRuntime.cpp VMCore/JavaArray.cpp VMCore/JavaArray.h VMCore/JavaJIT.cpp VMCore/LockedMap.cpp Message-ID: <200805131426.m4DEQBX2023867@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 09:26:11 2008 New Revision: 51039 URL: http://llvm.org/viewvc/llvm-project?rev=51039&view=rev Log: Simplify UTF8 class Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp vmkit/trunk/lib/JnJVM/VMCore/LockedMap.cpp Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp?rev=51039&r1=51038&r2=51039&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp Tue May 13 09:26:11 2008 @@ -46,7 +46,7 @@ sint32 lgPre = vm->prelib->size; sint32 lgPost = vm->postlib->size; - UTF8* res = UTF8::acons(lgPre + lgLib + lgPost, JavaArray::ofChar, vm); + UTF8* res = (UTF8*)UTF8::acons(lgPre + lgLib + lgPost, JavaArray::ofChar, vm); memmove(res->elements, vm->prelib->elements, lgPre * sizeof(uint16)); memmove(&(res->elements[lgPre]), &(utf8Lib->elements[stLib]), lgLib * sizeof(uint16)); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp?rev=51039&r1=51038&r2=51039&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp Tue May 13 09:26:11 2008 @@ -94,36 +94,15 @@ ARRAYCLASS(ArrayLong, sint64, 8) ARRAYCLASS(ArrayFloat, float, 4) ARRAYCLASS(ArrayDouble, double, 8) -ARRAYCLASS(UTF8, uint16, 2) - -AT(ArrayObject, JavaObject*) +ARRAYCLASS(ArrayObject, JavaObject*, sizeof(JavaObject*)) #undef ARRAYCLASS #undef ACONS #undef AT -ArrayObject *ArrayObject::acons(sint32 n, ClassArray* atype, Jnjvm* vm) { - if (n < 0) - JavaThread::get()->isolate->negativeArraySizeException(n); - else if (n > JavaArray::MaxArraySize) - JavaThread::get()->isolate->outOfMemoryError(n); - ArrayObject* res = (ArrayObject*) -#ifndef MULTIPLE_VM - (Object*) operator new(sizeof(ArrayObject) + n * sizeof(JavaObject*), JavaObject::VT); -#else - (Object*) vm->allocateObject(sizeof(ArrayObject) + n * sizeof(JavaObject*), JavaObject::VT); -#endif - res->initialise(atype); - res->size = n; - res->setVirtualTable(ArrayObject::VT); - return res; -} - - void JavaArray::print(mvm::PrintBuffer *buf) const { assert(0 && "should not be here"); } - void ArrayUInt8::print(mvm::PrintBuffer *buf) const { buf->write("Array<"); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h?rev=51039&r1=51038&r2=51039&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h Tue May 13 09:26:11 2008 @@ -85,31 +85,15 @@ ARRAYCLASS(ArrayLong, sint64); ARRAYCLASS(ArrayFloat, float); ARRAYCLASS(ArrayDouble, double); +ARRAYCLASS(ArrayObject, JavaObject*); #undef ARRAYCLASS -class ArrayObject : public JavaArray { +class UTF8 : public ArrayUInt16 { public: static VirtualTable* VT; - static const llvm::Type* llvmType; - JavaObject* elements[0]; - static ArrayObject *acons(sint32 n, ClassArray* cl, Jnjvm* vm); - JavaObject* at(sint32) const; - void setAt(sint32, JavaObject*); - virtual void print(mvm::PrintBuffer* buf) const; - virtual void TRACER; -}; - -class UTF8 : public JavaArray { -public: - static VirtualTable* VT; - uint16 elements[0]; static const llvm::Type* llvmType; - static UTF8* acons(sint32 n, ClassArray* cl, Jnjvm* vm); - - unsigned short int at(sint32) const; - void setAt(sint32, uint16); virtual void print(mvm::PrintBuffer* buf) const; Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp?rev=51039&r1=51038&r2=51039&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp Tue May 13 09:26:11 2008 @@ -1010,7 +1010,7 @@ val = (void*)utf8; compilingClass->isolate->protectModule->lock(); gv = - new GlobalVariable(UTF8::llvmType, false, + new GlobalVariable(ArrayUInt16::llvmType, false, GlobalValue::ExternalLinkage, constantUTF8Null, "", compilingClass->isolate->module); Modified: vmkit/trunk/lib/JnJVM/VMCore/LockedMap.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/LockedMap.cpp?rev=51039&r1=51038&r2=51039&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/LockedMap.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/LockedMap.cpp Tue May 13 09:26:11 2008 @@ -90,7 +90,7 @@ } if (res == 0) { - UTF8* tmp = UTF8::acons(size, JavaArray::ofChar, vm); + UTF8* tmp = (UTF8*)UTF8::acons(size, JavaArray::ofChar, vm); for (sint32 i = 0; i < size; i++) { tmp->setAt(i, asciiz[i]); } @@ -119,7 +119,7 @@ } if (res == 0) { - UTF8* tmp = UTF8::acons(size, JavaArray::ofChar, vm); + UTF8* tmp = (UTF8*)UTF8::acons(size, JavaArray::ofChar, vm); memcpy(tmp->elements, buf, len * sizeof(uint16)); res = (const UTF8*)tmp; map.insert(std::make_pair(key, res)); From nicolas.geoffray at lip6.fr Tue May 13 09:27:01 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 14:27:01 -0000 Subject: [llvm-commits] [vmkit] r51040 - /vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp Message-ID: <200805131427.m4DER1Oq023925@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 09:27:01 2008 New Revision: 51040 URL: http://llvm.org/viewvc/llvm-project?rev=51040&view=rev Log: Update LLVM function passes, to reflect what "opt" does. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp?rev=51040&r1=51039&r2=51040&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp Tue May 13 09:27:01 2008 @@ -50,7 +50,6 @@ const llvm::Type* ArrayDouble::llvmType = 0; const llvm::Type* ArrayLong::llvmType = 0; const llvm::Type* ArrayObject::llvmType = 0; -const llvm::Type* UTF8::llvmType = 0; const llvm::Type* CacheNode::llvmType = 0; const llvm::Type* Enveloppe::llvmType = 0; @@ -112,16 +111,6 @@ #undef ARRAY_TYPE - // Create UTF8::llvmType - { - std::vector arrayFields; - arrayFields.push_back(JavaObject::llvmType->getContainedType(0)); - arrayFields.push_back(llvm::Type::Int32Ty); - arrayFields.push_back(llvm::ArrayType::get(llvm::Type::Int16Ty, 0)); - UTF8::llvmType = - llvm::PointerType::getUnqual(llvm::StructType::get(arrayFields, false)); - } - // Create CacheNode::llvmType { std::vector arrayFields; @@ -664,7 +653,7 @@ { std::vector args; - args.push_back(UTF8::llvmType); + args.push_back(ArrayUInt16::llvmType); FunctionType* FuncTy = FunctionType::get( /*Result=*/JavaObject::llvmType, /*Params=*/args, @@ -723,7 +712,7 @@ #endif mvm::jit::unprotectTypes();//->unlock(); mvm::jit::protectConstants();//->lock(); - constantUTF8Null = Constant::getNullValue(UTF8::llvmType); + constantUTF8Null = Constant::getNullValue(ArrayUInt16::llvmType); constantJavaObjectNull = Constant::getNullValue(JavaObject::llvmType); constantMaxArraySize = ConstantInt::get(Type::Int32Ty, JavaArray::MaxArraySize); @@ -786,46 +775,45 @@ //PM->add(llvm::createVerifierPass()); // Verify that input is correct addPass(PM, llvm::createCFGSimplificationPass()); // Clean up disgusting code - addPass(PM, llvm::createScalarReplAggregatesPass());// Kill useless allocas - addPass(PM, llvm::createInstructionCombiningPass()); // Clean up after IPCP & DAE - addPass(PM, llvm::createCFGSimplificationPass()); // Clean up after IPCP & DAE addPass(PM, llvm::createPromoteMemoryToRegisterPass());// Kill useless allocas addPass(PM, llvm::createInstructionCombiningPass()); // Clean up after IPCP & DAE addPass(PM, llvm::createCFGSimplificationPass()); // Clean up after IPCP & DAE - addPass(PM, llvm::createTailDuplicationPass()); // Simplify cfg by copying code - addPass(PM, llvm::createInstructionCombiningPass()); // Cleanup for scalarrepl. - addPass(PM, llvm::createCFGSimplificationPass()); // Merge & remove BBs - addPass(PM, llvm::createScalarReplAggregatesPass()); // Break up aggregate allocas - addPass(PM, llvm::createInstructionCombiningPass()); // Combine silly seq's - addPass(PM, llvm::createCondPropagationPass()); // Propagate conditionals - - - addPass(PM, llvm::createTailCallEliminationPass()); // Eliminate tail calls - addPass(PM, llvm::createCFGSimplificationPass()); // Merge & remove BBs - addPass(PM, llvm::createReassociatePass()); // Reassociate expressions - addPass(PM, llvm::createLoopRotatePass()); - addPass(PM, llvm::createLICMPass()); // Hoist loop invariants - addPass(PM, llvm::createLoopUnswitchPass()); // Unswitch loops. - addPass(PM, llvm::createInstructionCombiningPass()); // Clean up after LICM/reassoc - addPass(PM, llvm::createIndVarSimplifyPass()); // Canonicalize indvars - addPass(PM, llvm::createLoopUnrollPass()); // Unroll small loops - addPass(PM, llvm::createInstructionCombiningPass()); // Clean up after the unroller - //addPass(PM, mvm::createArrayChecksPass()); - addPass(PM, llvm::createGVNPass()); // GVN for load instructions - addPass(PM, llvm::createGCSEPass()); // Remove common subexprs - addPass(PM, llvm::createSCCPPass()); // Constant prop with SCCP - addPass(PM, llvm::createPredicateSimplifierPass()); - + addPass(PM, createTailDuplicationPass()); // Simplify cfg by copying code + addPass(PM, createSimplifyLibCallsPass()); // Library Call Optimizations + addPass(PM, createInstructionCombiningPass()); // Cleanup for scalarrepl. + addPass(PM, createJumpThreadingPass()); // Thread jumps. + addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs + addPass(PM, createScalarReplAggregatesPass()); // Break up aggregate allocas + addPass(PM, createInstructionCombiningPass()); // Combine silly seq's + addPass(PM, createCondPropagationPass()); // Propagate conditionals + + addPass(PM, createTailCallEliminationPass()); // Eliminate tail calls + addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs + addPass(PM, createReassociatePass()); // Reassociate expressions + addPass(PM, createLoopRotatePass()); + addPass(PM, createLICMPass()); // Hoist loop invariants + addPass(PM, createLoopUnswitchPass()); // Unswitch loops. + addPass(PM, createLoopIndexSplitPass()); // Index split loops. + addPass(PM, createInstructionCombiningPass()); // Clean up after LICM/reassoc + addPass(PM, createIndVarSimplifyPass()); // Canonicalize indvars + addPass(PM, createLoopDeletionPass()); // Delete dead loops + addPass(PM, createLoopUnrollPass()); // Unroll small loops + addPass(PM, createInstructionCombiningPass()); // Clean up after the unroller + addPass(PM, createGVNPass()); // Remove redundancies + addPass(PM, createMemCpyOptPass()); // Remove memcpy / form memset + addPass(PM, createSCCPPass()); // Constant prop with SCCP + addPass(PM, mvm::createLowerConstantCallsPass()); + // Run instcombine after redundancy elimination to exploit opportunities // opened up by them. - addPass(PM, llvm::createInstructionCombiningPass()); - addPass(PM, llvm::createCondPropagationPass()); // Propagate conditionals + addPass(PM, createInstructionCombiningPass()); + addPass(PM, createCondPropagationPass()); // Propagate conditionals + + addPass(PM, createDeadStoreEliminationPass()); // Delete dead stores + addPass(PM, createAggressiveDCEPass()); // SSA based 'Aggressive DCE' + addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs - addPass(PM, llvm::createDeadStoreEliminationPass()); // Delete dead stores - addPass(PM, llvm::createAggressiveDCEPass()); // SSA based 'Aggressive DCE' - addPass(PM, llvm::createCFGSimplificationPass()); // Merge & remove BBs - addPass(PM, mvm::createLowerConstantCallsPass()); } From nicolas.geoffray at lip6.fr Tue May 13 09:30:34 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 14:30:34 -0000 Subject: [llvm-commits] [vmkit] r51041 - in /vmkit/trunk/lib/JnJVM/VMCore: JavaPrimitive.cpp JavaPrimitive.h Message-ID: <200805131430.m4DEUYUI024031@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 09:30:34 2008 New Revision: 51041 URL: http://llvm.org/viewvc/llvm-project?rev=51041&view=rev Log: Remove unused files. Removed: vmkit/trunk/lib/JnJVM/VMCore/JavaPrimitive.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaPrimitive.h Removed: vmkit/trunk/lib/JnJVM/VMCore/JavaPrimitive.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaPrimitive.cpp?rev=51040&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaPrimitive.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaPrimitive.cpp (removed) @@ -1,62 +0,0 @@ -//===--- JavaPrimitive.cpp - Native functions for primitive values --------===// -// -// JnJVM -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include - -#include - -#include "JavaClass.h" -#include "JavaPrimitive.h" -#include "JavaTypes.h" - -using namespace jnjvm; - -void JavaPrimitive::print(mvm::PrintBuffer* buf) { - buf->write("Primitive"); -} - -JavaPrimitive* JavaPrimitive::byteIdToPrimitive(char id) { - for (uint32 i = 0; i < JavaPrimitive::primitives.size(); ++i) { - JavaPrimitive* cur = JavaPrimitive::primitives[i]; - if (cur->funcs->byteId == id) return cur; - } - return 0; -} - -JavaPrimitive* JavaPrimitive::asciizToPrimitive(char* asciiz) { - for (uint32 i = 0; i < JavaPrimitive::primitives.size(); ++i) { - JavaPrimitive* cur = JavaPrimitive::primitives[i]; - if (!(strcmp(asciiz, cur->funcs->asciizName))) return cur; - } - return 0; -} - -JavaPrimitive* JavaPrimitive::bogusClassToPrimitive(CommonClass* cl) { - for (uint32 i = 0; i < JavaPrimitive::primitives.size(); ++i) { - JavaPrimitive* cur = JavaPrimitive::primitives[i]; - if (cur->classType == cl) return cur; - } - return 0; -} - -JavaPrimitive* JavaPrimitive::classToPrimitive(CommonClass* cl) { - for (uint32 i = 0; i < JavaPrimitive::primitives.size(); ++i) { - JavaPrimitive* cur = JavaPrimitive::primitives[i]; - if (cur->className == cl->name) return cur; - } - return 0; -} - -JavaPrimitive* JavaPrimitive::funcsToPrimitive(AssessorDesc* func) { - for (uint32 i = 0; i < JavaPrimitive::primitives.size(); ++i) { - JavaPrimitive* cur = JavaPrimitive::primitives[i]; - if (cur->funcs == func) return cur; - } - return 0; -} Removed: vmkit/trunk/lib/JnJVM/VMCore/JavaPrimitive.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaPrimitive.h?rev=51040&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaPrimitive.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaPrimitive.h (removed) @@ -1,51 +0,0 @@ -//===--- JavaPrimitive.h - Native functions for primitive values ----------===// -// -// JnJVM -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef JNJVM_JAVA_PRIMITIVE_H -#define JNJVM_JAVA_PRIMITIVE_H - -#include "llvm/Function.h" - -#include "mvm/Object.h" - -#include "types.h" - -namespace jnjvm { - -class AssessorDesc; -class CommonClass; -class UTF8; - -class JavaPrimitive : public mvm::Object { -public: - static VirtualTable* VT; - AssessorDesc* funcs; - const UTF8* className; - CommonClass* classType; - const UTF8* symName; - llvm::Function* initer; - llvm::Function* getter; - - static std::vector primitives; - - static void initialise(); - - static JavaPrimitive* byteIdToPrimitive(char id); - static JavaPrimitive* asciizToPrimitive(char* asciiz); - static JavaPrimitive* bogusClassToPrimitive(CommonClass* cl); - static JavaPrimitive* classToPrimitive(CommonClass* cl); - static JavaPrimitive* funcsToPrimitive(AssessorDesc* funcs); - - virtual void print(mvm::PrintBuffer* buf); - virtual void TRACER; -}; - -} // end namespace jnjvm - -#endif From nicolas.geoffray at lip6.fr Tue May 13 09:48:23 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 14:48:23 -0000 Subject: [llvm-commits] [vmkit] r51043 - in /vmkit/trunk/lib/JnJVM: Classpath/ClasspathVMStackWalker.cpp Classpath/ClasspathVMThrowable.cpp VMCore/JavaBacktrace.cpp VMCore/JavaJIT.h Message-ID: <200805131448.m4DEmNGU024538@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 09:48:23 2008 New Revision: 51043 URL: http://llvm.org/viewvc/llvm-project?rev=51043&view=rev Log: Make ip_to_meth a function of JavaJIT Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp?rev=51043&r1=51042&r2=51043&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp Tue May 13 09:48:23 2008 @@ -24,13 +24,11 @@ using namespace jnjvm; -extern "C" JavaMethod* ip_to_meth(int* ip); - extern "C" { ArrayObject* recGetClassContext(int** stack, uint32 size, uint32 first, uint32 rec) { if (size != first) { - JavaMethod* meth = ip_to_meth(stack[first]); + JavaMethod* meth = JavaJIT::IPToJavaMethod(stack[first]); if (meth) { ArrayObject* res = recGetClassContext(stack, size, first + 1, rec + 1); res->setAt(rec, meth->classDef->getClassDelegatee()); @@ -57,7 +55,7 @@ CommonClass* cl = Classpath::vmStackWalker; while (i < real_size) { - JavaMethod* meth = ip_to_meth(ips[i++]); + JavaMethod* meth = JavaJIT::IPToJavaMethod(ips[i++]); if (meth && meth->classDef == cl) { first = i; break; Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp?rev=51043&r1=51042&r2=51043&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp Tue May 13 09:48:23 2008 @@ -29,8 +29,6 @@ using namespace jnjvm; -extern "C" JavaMethod* ip_to_meth(int* ip); - extern "C" { JNIEXPORT jobject JNICALL Java_java_lang_VMThrowable_fillInStackTrace( @@ -83,7 +81,7 @@ #else int *begIp = (int*)Collector::begOf(stack[first]); #endif - JavaMethod* meth = ip_to_meth(begIp); + JavaMethod* meth = JavaJIT::IPToJavaMethod(begIp); if (meth) { ArrayObject* res = recGetStackTrace(stack, first + 1, rec + 1); res->setAt(rec, consStackElement(meth, stack[first])); @@ -112,7 +110,7 @@ #else int *begIp = (int*)Collector::begOf((void*)stack[i++]); #endif - JavaMethod* meth = ip_to_meth(begIp); + JavaMethod* meth = JavaJIT::IPToJavaMethod(begIp); if (meth && meth->classDef == cl) { first = i; break; Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp?rev=51043&r1=51042&r2=51043&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp Tue May 13 09:48:23 2008 @@ -25,7 +25,7 @@ using namespace jnjvm; -extern "C" JavaMethod* ip_to_meth(int* begIp) { +JavaMethod* JavaJIT::IPToJavaMethod(void* begIp) { mvm::Code* val = mvm::Code::getCodeFromPointer(begIp); if (val) { mvm::Method* m = val->method(); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h?rev=51043&r1=51042&r2=51043&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h Tue May 13 09:48:23 2008 @@ -277,6 +277,7 @@ static JavaObject* getCallingClassLoader(); static void printBacktrace(); static int getBacktrace(void** array, int size); + static JavaMethod* IPToJavaMethod(void* ip); #ifdef WITH_TRACER static llvm::Function* markAndTraceLLVM; From nicolas.geoffray at lip6.fr Tue May 13 09:54:57 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 14:54:57 -0000 Subject: [llvm-commits] [vmkit] r51044 - /vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h Message-ID: <200805131454.m4DEsvNn024766@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 09:54:57 2008 New Revision: 51044 URL: http://llvm.org/viewvc/llvm-project?rev=51044&view=rev Log: Fix constness in map types. Modified: vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h Modified: vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h?rev=51044&r1=51043&r2=51044&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h Tue May 13 09:54:57 2008 @@ -52,12 +52,12 @@ template class LockedMap : public mvm::Object { public: - typedef typename std::map::iterator iterator; + typedef typename std::map::iterator iterator; typedef Container (*funcCreate)(Key& V, Jnjvm *vm); mvm::Lock* lock; - std::map > > map; + std::map > > map; inline Container lookupOrCreate(Key& V, Jnjvm *vm, funcCreate func) { lock->lock(); @@ -103,11 +103,11 @@ class UTF8Map : public mvm::Object { public: - typedef std::multimap::iterator iterator; + typedef std::multimap::iterator iterator; mvm::Lock* lock; - std::multimap, - gc_allocator< std::pair > > map; + std::multimap, + gc_allocator< std::pair > > map; static VirtualTable* VT; const UTF8* lookupOrCreateAsciiz(Jnjvm* vm, const char* asciiz); const UTF8* lookupOrCreateReader(Jnjvm* vm, const uint16* buf, uint32 size); From nicolas.geoffray at lip6.fr Tue May 13 09:55:30 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 14:55:30 -0000 Subject: [llvm-commits] [vmkit] r51045 - /vmkit/trunk/lib/JnJVM/VMCore/JavaInitialise.cpp Message-ID: <200805131455.m4DEtV6V024789@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 09:55:30 2008 New Revision: 51045 URL: http://llvm.org/viewvc/llvm-project?rev=51045&view=rev Log: Use the ".dylib" postfix on Darwin. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaInitialise.cpp Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaInitialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaInitialise.cpp?rev=51045&r1=51044&r2=51045&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaInitialise.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaInitialise.cpp Tue May 13 09:55:30 2008 @@ -174,7 +174,11 @@ Jnjvm::clinitType = vm->asciizConstructUTF8("()V"); Jnjvm::runName = vm->asciizConstructUTF8("run"); Jnjvm::prelib = vm->asciizConstructUTF8("lib"); +#if defined(__MACH__) + Jnjvm::postlib = vm->asciizConstructUTF8(".dylib"); +#else Jnjvm::postlib = vm->asciizConstructUTF8(".so"); +#endif Jnjvm::mathName = vm->asciizConstructUTF8("java/lang/Math"); #define DEF_UTF8(var) \ From nicolas.geoffray at lip6.fr Tue May 13 09:56:41 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 14:56:41 -0000 Subject: [llvm-commits] [vmkit] r51046 - /vmkit/trunk/lib/JnJVM/VMCore/NativeUtil.cpp Message-ID: <200805131456.m4DEuf7P024834@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 09:56:41 2008 New Revision: 51046 URL: http://llvm.org/viewvc/llvm-project?rev=51046&view=rev Log: Use SELF_HANDLE on Darwin for dlsym'ing its own symbols. Modified: vmkit/trunk/lib/JnJVM/VMCore/NativeUtil.cpp Modified: vmkit/trunk/lib/JnJVM/VMCore/NativeUtil.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/NativeUtil.cpp?rev=51046&r1=51045&r2=51046&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/NativeUtil.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/NativeUtil.cpp Tue May 13 09:56:41 2008 @@ -30,6 +30,12 @@ return JavaThread::get()->isolate; } +#if defined(__MACH__) +#define SELF_HANDLE RTLD_DEFAULT +#else +#define SELF_HANDLE 0 +#endif + #define PRE "Java_" #define PRE_LEN 5 @@ -181,7 +187,7 @@ #undef PRE_LEN static void* loadName(char* buf, bool& jnjvm) { - void* res = dlsym(0, buf); + void* res = dlsym(SELF_HANDLE, buf); if (!res) { #ifndef SERVICE_VM Jnjvm* vm = JavaThread::get()->isolate; From nicolas.geoffray at lip6.fr Tue May 13 10:02:24 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 15:02:24 -0000 Subject: [llvm-commits] [vmkit] r51047 - /vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Message-ID: <200805131502.m4DF2OjY025029@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 10:02:24 2008 New Revision: 51047 URL: http://llvm.org/viewvc/llvm-project?rev=51047&view=rev Log: Darwin requires to preallocate rp. Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=51047&r1=51046&r2=51047&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Tue May 13 10:02:24 2008 @@ -125,7 +125,6 @@ char* buf = (char*)alloca(len + 1); const char* cur = str; int top = 0; - char* rp = 0; char c = 1; while (c != 0) { while (((c = cur[top]) != 0) && c != envSeparator[0]) { @@ -134,8 +133,10 @@ if (top != 0) { memcpy(buf, cur, top); buf[top] = 0; + char* rp = (char*)malloc(4096); + memset(rp, 0, 4096); rp = realpath(buf, rp); - if (rp != 0) { + if (rp[4095] == 0 && strlen(rp) != 0) { struct stat st; stat(rp, &st); if ((st.st_mode & S_IFMT) == S_IFDIR) { @@ -145,9 +146,12 @@ temp[len] = dirSeparator[0]; temp[len + 1] = 0; bootClasspath.push_back(temp); + free(rp); } else { bootClasspath.push_back(rp); } + } else { + free(rp); } } cur = cur + top + 1; From asl at math.spbu.ru Tue May 13 10:03:16 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 13 May 2008 15:03:16 -0000 Subject: [llvm-commits] [llvm] r51048 - /llvm/trunk/include/llvm/ADT/StringSet.h Message-ID: <200805131503.m4DF3GnF025062@zion.cs.uiuc.edu> Author: asl Date: Tue May 13 10:03:16 2008 New Revision: 51048 URL: http://llvm.org/viewvc/llvm-project?rev=51048&view=rev Log: Add thin layer over StringMap to form StringSet. By Mikhail Glushenkov. Added: llvm/trunk/include/llvm/ADT/StringSet.h Added: llvm/trunk/include/llvm/ADT/StringSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringSet.h?rev=51048&view=auto ============================================================================== --- llvm/trunk/include/llvm/ADT/StringSet.h (added) +++ llvm/trunk/include/llvm/ADT/StringSet.h Tue May 13 10:03:16 2008 @@ -0,0 +1,40 @@ +//===--- StringSet.h - The LLVM Compiler Driver -----------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open +// Source License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// StringSet - A set-like wrapper for the StringMap. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ADT_STRINGSET_H +#define LLVM_ADT_STRINGSET_H + +#include "llvm/ADT/StringMap.h" + +#include + +namespace llvm { + + /// StringSet - A wrapper for StringMap that provides set-like + /// functionality. Only insert() and count() methods are used by my + /// code. + template + class StringSet : public llvm::StringMap { + typedef llvm::StringMap base; + public: + void insert (const std::string& InLang) { + assert(!InLang.empty()); + const char* KeyStart = &InLang[0]; + const char* KeyEnd = KeyStart + InLang.size(); + base::insert(llvm::StringMapEntry:: + Create(KeyStart, KeyEnd, base::getAllocator(), '+')); + } + }; +} + +#endif // LLVM_ADT_STRINGSET_H From nicolas.geoffray at lip6.fr Tue May 13 10:28:27 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 15:28:27 -0000 Subject: [llvm-commits] [vmkit] r51049 - in /vmkit/trunk/lib: JnJVM/VMCore/JavaBacktrace.cpp JnJVM/VMCore/JavaIsolate.cpp Mvm/BoehmGC/MvmGC.h Mvm/GCMmap2/gc.cpp Message-ID: <200805131528.m4DFSRp2025737@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 10:28:27 2008 New Revision: 51049 URL: http://llvm.org/viewvc/llvm-project?rev=51049&view=rev Log: Use our own end of stack info. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp vmkit/trunk/lib/Mvm/BoehmGC/MvmGC.h vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp?rev=51049&r1=51048&r2=51049&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp Tue May 13 10:28:27 2008 @@ -43,13 +43,11 @@ #define FRAME_IP(fp) (fp[1]) #endif -extern void* __libc_stack_end; - int JavaJIT::getBacktrace(void** stack, int size) { void** blah = (void**)__builtin_frame_address(1); int cpt = 0; - while (blah && cpt < size && blah < __libc_stack_end && - !(((long) blah & 3))) { + void* baseSP = JavaThread::get()->baseSP; + while (blah && cpt < size && blah < baseSP) { stack[cpt++] = (void**)FRAME_IP(blah); blah = (void**)blah[0]; } Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp?rev=51049&r1=51048&r2=51049&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp Tue May 13 10:28:27 2008 @@ -460,11 +460,13 @@ isolate->bootstrapThread = vm_new(isolate, JavaThread)(); isolate->bootstrapThread->initialise(0, isolate); + void* baseSP = mvm::Thread::get()->baseSP; #ifdef MULTIPLE_GC isolate->bootstrapThread->GC = isolate->GC; - isolate->GC->inject_my_thread(0); + isolate->GC->inject_my_thread(baseSP); mvm::jit::memoryManager->addGCForModule(isolate->module, isolate->GC); #endif + isolate->bootstrapThread->baseSP = baseSP; JavaThread::threadKey->set(isolate->bootstrapThread); isolate->threadSystem = vm_new(isolate, ThreadSystem)(); @@ -527,13 +529,15 @@ isolate->bootstrapThread = vm_new(isolate, JavaThread)(); isolate->bootstrapThread->initialise(0, isolate); + void* baseSP = mvm::Thread::get()->baseSP; #ifdef MULTIPLE_GC isolate->bootstrapThread->GC = isolate->GC; #ifndef SERVICE_VM - isolate->GC->inject_my_thread(0); + isolate->GC->inject_my_thread(baseSP); #endif mvm::jit::memoryManager->addGCForModule(isolate->module, isolate->GC); #endif + isolate->bootstrapThread->baseSP = baseSP; JavaThread::threadKey->set(isolate->bootstrapThread); isolate->name = "bootstrapVM"; Modified: vmkit/trunk/lib/Mvm/BoehmGC/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/BoehmGC/MvmGC.h?rev=51049&r1=51048&r2=51049&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/BoehmGC/MvmGC.h (original) +++ vmkit/trunk/lib/Mvm/BoehmGC/MvmGC.h Tue May 13 10:28:27 2008 @@ -78,6 +78,7 @@ typedef void (*markerFn)(void*); static void initialise(markerFn mark, void *base_sp) { + mvm::Thread::get()->baseSP = base_sp; GC_INIT(); } static void destroy() {} @@ -110,6 +111,7 @@ } static void inject_my_thread(void *sp) { + mvm::Thread::get()->baseSP = base_sp; GC_init(); } Modified: vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp?rev=51049&r1=51048&r2=51049&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp Tue May 13 10:28:27 2008 @@ -116,6 +116,7 @@ GCCollector::initialise(marker); GCCollector::inject_my_thread(base_sp); #endif + mvm::Thread::get()->baseSP = base_sp; } void Collector::destroy() { @@ -126,6 +127,7 @@ #ifdef HAVE_PTHREAD COLLECTOR inject_my_thread(base_sp); #endif + mvm::Thread::get()->baseSP = base_sp; } void Collector::maybeCollect() { From nicolas.geoffray at lip6.fr Tue May 13 10:30:57 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 15:30:57 -0000 Subject: [llvm-commits] [vmkit] r51050 - in /vmkit/trunk/lib/JnJVM/VMCore: JavaArray.cpp JavaArray.h Message-ID: <200805131530.m4DFUvQv025824@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 10:30:57 2008 New Revision: 51050 URL: http://llvm.org/viewvc/llvm-project?rev=51050&view=rev Log: Change the printing of ArrayUInt16 array. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp?rev=51050&r1=51049&r2=51050&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp Tue May 13 10:30:57 2008 @@ -122,15 +122,6 @@ buf->write(">"); } -void ArrayUInt16::print(mvm::PrintBuffer *buf) const { - buf->write("Array<"); - for (int i = 0; i < size; i++) { - buf->writeS4(elements[i]); - buf->write(" "); - } - buf->write(">"); -} - void ArraySInt16::print(mvm::PrintBuffer *buf) const { buf->write("Array<"); for (int i = 0; i < size; i++) { @@ -195,7 +186,7 @@ } -void UTF8::print(mvm::PrintBuffer* buf) const { +void ArrayUInt16::print(mvm::PrintBuffer* buf) const { for (int i = 0; i < size; i++) buf->writeChar((char)elements[i]); } Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h?rev=51050&r1=51049&r2=51050&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h Tue May 13 10:30:57 2008 @@ -95,8 +95,6 @@ static const llvm::Type* llvmType; - virtual void print(mvm::PrintBuffer* buf) const; - const UTF8* internalToJava(Jnjvm *vm, unsigned int start, unsigned int len) const; From nicolas.geoffray at lip6.fr Tue May 13 10:35:00 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 15:35:00 -0000 Subject: [llvm-commits] [vmkit] r51051 - /vmkit/trunk/include/mvm/Threads/Thread.h Message-ID: <200805131535.m4DFZ094025936@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 10:35:00 2008 New Revision: 51051 URL: http://llvm.org/viewvc/llvm-project?rev=51051&view=rev Log: Add a baseSP info on a thread object. This allows to be platform independent when backtracing. Modified: vmkit/trunk/include/mvm/Threads/Thread.h Modified: vmkit/trunk/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=51051&r1=51050&r2=51051&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Thread.h (original) +++ vmkit/trunk/include/mvm/Threads/Thread.h Tue May 13 10:35:00 2008 @@ -30,6 +30,7 @@ static mvm::Key* threadKey; Collector* GC; + void* baseSP; static Thread* get() { return (Thread*)Thread::threadKey->get(); } From nicolas.geoffray at lip6.fr Tue May 13 10:51:31 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 15:51:31 -0000 Subject: [llvm-commits] [vmkit] r51052 - /vmkit/trunk/lib/N3/VMCore/N3.cpp Message-ID: <200805131551.m4DFpVeY026385@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 10:51:31 2008 New Revision: 51052 URL: http://llvm.org/viewvc/llvm-project?rev=51052&view=rev Log: Fix data layout of LLVM modules. Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=51052&r1=51051&r2=51052&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Tue May 13 10:51:31 2008 @@ -63,7 +63,11 @@ Collector* GC = Collector::allocate(); #endif + std::string str = + mvm::jit::executionEngine->getTargetData()->getStringRepresentation(); + vm->module = new llvm::Module("Bootstrap N3"); + vm->module->setDataLayout(str); vm->protectModule = mvm::Lock::allocNormal(); vm->functions = FunctionMap::allocate(); vm->TheModuleProvider = new N3ModuleProvider(vm->module, vm->functions); @@ -76,7 +80,7 @@ #endif VMThread::threadKey->set(vm->bootstrapThread); - vm->name = "bootstrapN3"; + vm->name = (char*)"bootstrapN3"; vm->hashUTF8 = UTF8Map::allocate(); vm->hashStr = StringMap::allocate(); vm->loadedAssemblies = AssemblyMap::allocate(); @@ -93,7 +97,10 @@ Collector* GC = Collector::allocate(); #endif + std::string str = + mvm::jit::executionEngine->getTargetData()->getStringRepresentation(); vm->module = new llvm::Module("App Domain"); + vm->module->setDataLayout(str); vm->protectModule = mvm::Lock::allocNormal(); vm->functions = FunctionMap::allocate(); vm->TheModuleProvider = new N3ModuleProvider(vm->module, vm->functions); From evan.cheng at apple.com Tue May 13 11:43:20 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 13 May 2008 09:43:20 -0700 Subject: [llvm-commits] [llvm] r51019 - in /llvm/trunk: lib/Target/X86/README-SSE.txt lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/vec_set-H.ll In-Reply-To: <200805131022.03193.baldrick@free.fr> References: <200805130054.m4D0s4BT018226@zion.cs.uiuc.edu> <200805131022.03193.baldrick@free.fr> Message-ID: <26A43360-A15E-4D08-A3EB-28627A492CF4@apple.com> On May 13, 2008, at 1:22 AM, Duncan Sands wrote: > Hi Evan, > >> On x86, it's safe to treat i32 load anyext as a normal i32 load. >> Ditto for i8 anyext load to i16. > > if this was loading the last two bytes in a page, then now it will be > loading two bytes from the next page, which could trap. Similarly, if I'm pretty certain that's not possible on x86. > > this was loading 2 bytes out of i/o registers, it may now be reading 4 > bytes out of i/o registers, which could have side effects. Yep, I forgot to check if it's volatile. I'll fix that. Thanks, Evan > > > Ciao, > > Duncan. From nicolas.geoffray at lip6.fr Tue May 13 11:43:50 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 16:43:50 -0000 Subject: [llvm-commits] [vmkit] r51053 - in /vmkit/trunk/lib: JnJVM/VMCore/JavaArray.cpp JnJVM/VMCore/JavaArray.h JnJVM/VMCore/JavaJIT.h JnJVM/VMCore/JavaJITInitialise.cpp JnJVM/VMCore/JavaObject.cpp JnJVM/VMCore/JavaObject.h JnJVM/VMCore/JavaRuntimeJIT.cpp JnJVM/VMCore/JavaThread.cpp JnJVM/VMCore/JavaThread.h JnJVM/VMCore/Jni.cpp JnJVM/VMCore/VirtualTables.cpp Mvm/GCMmap2/MvmGC.h Mvm/GCMmap2/gc.cpp Message-ID: <200805131643.m4DGhot3027809@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 11:43:50 2008 New Revision: 51053 URL: http://llvm.org/viewvc/llvm-project?rev=51053&view=rev Log: Add C wrappers for C++ runtime calls. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h vmkit/trunk/lib/JnJVM/VMCore/Jni.cpp vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp?rev=51053&r1=51052&r2=51053&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp Tue May 13 11:43:50 2008 @@ -242,49 +242,3 @@ buf->setAt(size, 0); return buf->cString(); } - -static JavaArray* multiCallNewIntern(arrayCtor_t ctor, ClassArray* cl, - uint32 len, - sint32* dims, - Jnjvm* vm) { - if (len <= 0) JavaThread::get()->isolate->unknownError("Can not happen"); - JavaArray* _res = ctor(dims[0], cl, vm); - if (len > 1) { - ArrayObject* res = (ArrayObject*)_res; - CommonClass* _base = cl->baseClass(); - if (_base->isArray) { - ClassArray* base = (ClassArray*)_base; - AssessorDesc* func = base->funcs(); - arrayCtor_t newCtor = func->arrayCtor; - if (dims[0] > 0) { - for (sint32 i = 0; i < dims[0]; ++i) { - res->setAt(i, multiCallNewIntern(newCtor, base, (len - 1), &dims[1], - vm)); - } - } else { - for (uint32 i = 1; i < len; ++i) { - sint32 p = dims[i]; - if (p < 0) JavaThread::get()->isolate->negativeArraySizeException(p); - } - } - } else { - JavaThread::get()->isolate->unknownError("Can not happen"); - } - } - return _res; -} - -JavaArray* JavaArray::multiCallNew(ClassArray* cl, uint32 len, ...) { - va_list ap; - va_start(ap, len); - sint32 dims[len]; - for (uint32 i = 0; i < len; ++i){ - dims[i] = va_arg(ap, int); - } -#ifdef MULTIPLE_VM - Jnjvm* vm = va_arg(ap, Jnjvm*); -#else - Jnjvm* vm = 0; -#endif - return multiCallNewIntern((arrayCtor_t)ArrayObject::acons, cl, len, dims, vm); -} Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h?rev=51053&r1=51052&r2=51053&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h Tue May 13 11:43:50 2008 @@ -55,7 +55,6 @@ static llvm::ConstantInt* sizeOffset(); static llvm::ConstantInt* elementsOffset(); - static JavaArray* multiCallNew(ClassArray* cl, uint32 len, ...); virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h?rev=51053&r1=51052&r2=51053&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.h Tue May 13 11:43:50 2008 @@ -293,6 +293,8 @@ static llvm::GlobalVariable* ArrayObjectVT; static llvm::GlobalVariable* JavaObjectVT; + + static void AddStandardCompilePasses(llvm::FunctionPassManager*); }; enum Opcode { Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp?rev=51053&r1=51052&r2=51053&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp Tue May 13 11:43:50 2008 @@ -146,11 +146,7 @@ const FunctionType* type = FunctionType::get(Type::VoidTy, args, false); javaObjectTracerLLVM = Function::Create(type, GlobalValue::ExternalLinkage, -#ifdef MULTIPLE_GC - "_ZN5jnjvm10JavaObject6tracerEPv", -#else - "_ZN5jnjvm10JavaObject6tracerEv", -#endif + "JavaObjectTracer", module); } @@ -179,7 +175,7 @@ true); multiCallNewLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm9JavaArray12multiCallNewEPNS_10ClassArrayEjz", + "multiCallNew", module); } @@ -513,7 +509,7 @@ const FunctionType* type = FunctionType::get(Type::VoidTy, args, false); throwExceptionLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm10JavaThread14throwExceptionEPNS_10JavaObjectE", + "JavaThreadThrowException", module); } @@ -523,7 +519,7 @@ const FunctionType* type = FunctionType::get(Type::VoidTy, args, false); clearExceptionLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm10JavaThread14clearExceptionEv", + "JavaThreadClearException", module); } @@ -536,7 +532,7 @@ args, false); getExceptionLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm10JavaThread12getExceptionEv", + "JavaThreadGetException", module); } @@ -547,7 +543,7 @@ args, false); getJavaExceptionLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm10JavaThread16getJavaExceptionEv", + "JavaThreadGetJavaException", module); } @@ -558,7 +554,7 @@ const FunctionType* type = FunctionType::get(Type::Int1Ty, args, false); compareExceptionLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm10JavaThread16compareExceptionEPNS_5ClassE", + "JavaThreadCompareException", module); } @@ -607,7 +603,7 @@ const FunctionType* type = FunctionType::get(Type::Int32Ty, args, false); instanceOfLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm10JavaObject10instanceOfEPNS_11CommonClassE", + "JavaObjectInstanceOf", module); PAListPtr func_toto_PAL; SmallVector Attrs; @@ -625,7 +621,7 @@ const FunctionType* type = FunctionType::get(Type::VoidTy, args, false); aquireObjectLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm10JavaObject6aquireEv", + "JavaObjectAquire", module); #ifdef SERVICE_VM aquireObjectInSharedDomainLLVM = Function::Create(type, GlobalValue::ExternalLinkage, @@ -641,7 +637,7 @@ const FunctionType* type = FunctionType::get(Type::VoidTy, args, false); releaseObjectLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm10JavaObject6unlockEv", + "JavaObjectRelease", module); #ifdef SERVICE_VM releaseObjectInSharedDomainLLVM = Function::Create(type, GlobalValue::ExternalLinkage, @@ -686,11 +682,7 @@ markAndTraceLLVMType = FunctionType::get(llvm::Type::VoidTy, args, false); markAndTraceLLVM = Function::Create(markAndTraceLLVMType, GlobalValue::ExternalLinkage, -#ifdef MULTIPLE_GC - "_ZNK2gc12markAndTraceEP9Collector", -#else - "_ZNK2gc12markAndTraceEv", -#endif + "MarkAndTrace", module); } #endif @@ -769,7 +761,7 @@ PM->add(P); } -void AddStandardCompilePasses(FunctionPassManager *PM) { +void JavaJIT::AddStandardCompilePasses(FunctionPassManager *PM) { llvm::MutexGuard locked(mvm::jit::executionEngine->lock); // LLVM does not allow calling functions from other modules in verifier //PM->add(llvm::createVerifierPass()); // Verify that input is correct Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp?rev=51053&r1=51052&r2=51053&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp Tue May 13 11:43:50 2008 @@ -104,7 +104,7 @@ buf->write(">"); } -static LockObj* myLock(JavaObject* obj) { +LockObj* LockObj::myLock(JavaObject* obj) { verifyNull(obj); if (obj->lockObj == 0) { JavaObject::globalLock->lock(); @@ -116,41 +116,8 @@ return obj->lockObj; } -void JavaObject::aquire() { -#ifdef SERVICE_VM - ServiceDomain* vm = (ServiceDomain*)JavaThread::get()->isolate; - if (!(vm->GC->isMyObject(this))) { - vm->serviceError(vm, "I'm locking an object I don't own"); - } -#endif - myLock(this)->aquire(); -} - - -void JavaObject::unlock() { - verifyNull(this); -#ifdef SERVICE_VM - ServiceDomain* vm = (ServiceDomain*)JavaThread::get()->isolate; - if (!(vm->GC->isMyObject(this))) { - vm->serviceError(vm, "I'm unlocking an object I don't own"); - } -#endif - lockObj->release(); -} - -#ifdef SERVICE_VM -extern "C" void aquireObjectInSharedDomain(JavaObject* obj) { - myLock(obj)->aquire(); -} - -extern "C" void releaseObjectInSharedDomain(JavaObject* obj) { - verifyNull(obj); - obj->lockObj->release(); -} -#endif - void JavaObject::waitIntern(struct timeval* info, bool timed) { - LockObj * l = myLock(this); + LockObj * l = LockObj::myLock(this); bool owner = l->owner(); if (owner) { @@ -205,7 +172,7 @@ } void JavaObject::notify() { - LockObj* l = myLock(this); + LockObj* l = LockObj::myLock(this); if (l->owner()) { l->varcond->notify(); } else { @@ -214,29 +181,10 @@ } void JavaObject::notifyAll() { - LockObj* l = myLock(this); + LockObj* l = LockObj::myLock(this); if (l->owner()) { l->varcond->notifyAll(); } else { JavaThread::get()->isolate->illegalMonitorStateException(this); } } - -bool JavaObject::instanceOfString(const UTF8* name) { - if (!this) return false; - else return this->classOf->isOfTypeName(name); -} - -bool JavaObject::checkCast(const UTF8* Tname) { - if (!this || this->classOf->isOfTypeName(Tname)) { - return true; - } else { - JavaThread::get()->isolate->classCastException("checkcast"); - return false; - } -} - -bool JavaObject::instanceOf(CommonClass* cl) { - if (!this) return false; - else return this->classOf->isAssignableFrom(cl); -} Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h?rev=51053&r1=51052&r2=51053&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h Tue May 13 11:43:50 2008 @@ -21,9 +21,10 @@ #include "types.h" +#include "JavaClass.h" + namespace jnjvm { -class CommonClass; class JavaField; class JavaObject; class JavaThread; @@ -55,6 +56,8 @@ virtual void TRACER; static LockObj* allocate(); + static LockObj* myLock(JavaObject* obj); + void aquire(); void release(); bool owner(); @@ -72,8 +75,6 @@ virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; - void aquire(); - void unlock(); void waitIntern(struct timeval *info, bool timed); void wait(); void timedWait(struct timeval &info); @@ -84,9 +85,15 @@ this->lockObj = 0; } - bool checkCast(const UTF8* name); - bool instanceOfString(const UTF8* name); - bool instanceOf(CommonClass* cl); + bool instanceOfString(const UTF8* name) { + if (!this) return false; + else return this->classOf->isOfTypeName(name); + } + + bool instanceOf(CommonClass* cl) { + if (!this) return false; + else return this->classOf->isAssignableFrom(cl); + } static llvm::ConstantInt* classOffset(); static llvm::ConstantInt* lockOffset(); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp?rev=51053&r1=51052&r2=51053&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaRuntimeJIT.cpp Tue May 13 11:43:50 2008 @@ -286,3 +286,106 @@ } #endif + +static JavaArray* multiCallNewIntern(arrayCtor_t ctor, ClassArray* cl, + uint32 len, + sint32* dims, + Jnjvm* vm) { + if (len <= 0) JavaThread::get()->isolate->unknownError("Can not happen"); + JavaArray* _res = ctor(dims[0], cl, vm); + if (len > 1) { + ArrayObject* res = (ArrayObject*)_res; + CommonClass* _base = cl->baseClass(); + if (_base->isArray) { + ClassArray* base = (ClassArray*)_base; + AssessorDesc* func = base->funcs(); + arrayCtor_t newCtor = func->arrayCtor; + if (dims[0] > 0) { + for (sint32 i = 0; i < dims[0]; ++i) { + res->setAt(i, multiCallNewIntern(newCtor, base, (len - 1), &dims[1], + vm)); + } + } else { + for (uint32 i = 1; i < len; ++i) { + sint32 p = dims[i]; + if (p < 0) JavaThread::get()->isolate->negativeArraySizeException(p); + } + } + } else { + JavaThread::get()->isolate->unknownError("Can not happen"); + } + } + return _res; +} + +extern "C" JavaArray* multiCallNew(ClassArray* cl, uint32 len, ...) { + va_list ap; + va_start(ap, len); + sint32 dims[len]; + for (uint32 i = 0; i < len; ++i){ + dims[i] = va_arg(ap, int); + } +#ifdef MULTIPLE_VM + Jnjvm* vm = va_arg(ap, Jnjvm*); +#else + Jnjvm* vm = 0; +#endif + return multiCallNewIntern((arrayCtor_t)ArrayObject::acons, cl, len, dims, vm); +} + +extern "C" void JavaObjectAquire(JavaObject* obj) { +#ifdef SERVICE_VM + ServiceDomain* vm = (ServiceDomain*)JavaThread::get()->isolate; + if (!(vm->GC->isMyObject(obj))) { + vm->serviceError(vm, "I'm locking an object I don't own"); + } +#endif + LockObj::myLock(obj)->aquire(); +} + + +extern "C" void JavaObjectRelease(JavaObject* obj) { + verifyNull(obj); +#ifdef SERVICE_VM + ServiceDomain* vm = (ServiceDomain*)JavaThread::get()->isolate; + if (!(vm->GC->isMyObject(obj))) { + vm->serviceError(vm, "I'm unlocking an object I don't own"); + } +#endif + obj->lockObj->release(); +} + +#ifdef SERVICE_VM +extern "C" void aquireObjectInSharedDomain(JavaObject* obj) { + myLock(obj)->aquire(); +} + +extern "C" void releaseObjectInSharedDomain(JavaObject* obj) { + verifyNull(obj); + obj->lockObj->release(); +} +#endif + +extern "C" bool JavaObjectInstanceOf(JavaObject* obj, CommonClass* cl) { + return obj->instanceOf(cl); +} + +extern "C" void* JavaThreadGetException() { + return JavaThread::getException(); +} + +extern "C" void JavaThreadThrowException(JavaObject* obj) { + return JavaThread::throwException(obj); +} + +extern "C" JavaObject* JavaThreadGetJavaException() { + return JavaThread::getJavaException(); +} + +extern "C" bool JavaThreadCompareException(Class* cl) { + return JavaThread::compareException(cl); +} + +extern "C" void JavaThreadClearException() { + return JavaThread::clearException(); +} Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp?rev=51053&r1=51052&r2=51053&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp Tue May 13 11:43:50 2008 @@ -43,8 +43,6 @@ return (JavaThread*)Thread::threadKey->get(); } -extern void AddStandardCompilePasses(llvm::FunctionPassManager*); - void JavaThread::initialise(JavaObject* thread, Jnjvm* isolate) { this->javaThread = thread; this->isolate = isolate; @@ -57,7 +55,7 @@ ModuleProvider* MP = isolate->TheModuleProvider; this->perFunctionPasses = new llvm::FunctionPassManager(MP); this->perFunctionPasses->add(new llvm::TargetData(isolate->module)); - AddStandardCompilePasses(this->perFunctionPasses); + JavaJIT::AddStandardCompilePasses(this->perFunctionPasses); } JavaObject* JavaThread::currentThread() { @@ -68,27 +66,6 @@ return 0; } -extern "C" void* __cxa_allocate_exception(unsigned); -extern "C" void __cxa_throw(void*, void*, void*); - -void* JavaThread::getException() { - return (void*)((char*)JavaThread::get()->internalPendingException - 8 * sizeof(void*)); -} - -JavaObject* JavaThread::getJavaException() { - return JavaThread::get()->pendingException; -} - - -void JavaThread::throwException(JavaObject* obj) { - JavaThread* th = JavaThread::get(); - assert(th->pendingException == 0 && "pending exception already there?"); - th->pendingException = obj; - void* exc = __cxa_allocate_exception(0); - th->internalPendingException = exc; - __cxa_throw(exc, 0, 0); -} - void JavaThread::throwPendingException() { JavaThread* th = JavaThread::get(); assert(th->pendingException); @@ -97,19 +74,6 @@ __cxa_throw(exc, 0, 0); } -void JavaThread::clearException() { - JavaThread* th = JavaThread::get(); - th->pendingException = 0; - th->internalPendingException = 0; -} - -bool JavaThread::compareException(Class* cl) { - JavaObject* pe = JavaThread::get()->pendingException; - assert(pe && "no pending exception?"); - bool val = pe->classOf->subclassOf(cl); - return val; -} - void JavaThread::returnFromNative() { assert(sjlj_buffers.size()); #if defined(__MACH__) Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h?rev=51053&r1=51052&r2=51053&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h Tue May 13 11:43:50 2008 @@ -20,6 +20,11 @@ #include "mvm/Threads/Locks.h" #include "mvm/Threads/Thread.h" +#include "JavaObject.h" + +extern "C" void* __cxa_allocate_exception(unsigned); +extern "C" void __cxa_throw(void*, void*, void*); + namespace jnjvm { class Class; @@ -53,12 +58,39 @@ static JavaThread* get(); static JavaObject* currentThread(); - static void* getException(); - static void throwException(JavaObject*); + static void* getException() { + return (void*) + ((char*)JavaThread::get()->internalPendingException - 8 * sizeof(void*)); + } + + static void throwException(JavaObject* obj) { + JavaThread* th = JavaThread::get(); + assert(th->pendingException == 0 && "pending exception already there?"); + th->pendingException = obj; + void* exc = __cxa_allocate_exception(0); + th->internalPendingException = exc; + __cxa_throw(exc, 0, 0); + } + static void throwPendingException(); - static void clearException(); - static bool compareException(Class*); - static JavaObject* getJavaException(); + + static void clearException() { + JavaThread* th = JavaThread::get(); + th->pendingException = 0; + th->internalPendingException = 0; + } + + static bool compareException(Class* cl) { + JavaObject* pe = JavaThread::get()->pendingException; + assert(pe && "no pending exception?"); + bool val = pe->classOf->subclassOf(cl); + return val; + } + + static JavaObject* getJavaException() { + return JavaThread::get()->pendingException; + } + void returnFromNative(); }; Modified: vmkit/trunk/lib/JnJVM/VMCore/Jni.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jni.cpp?rev=51053&r1=51052&r2=51053&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jni.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jni.cpp Tue May 13 11:43:50 2008 @@ -2028,12 +2028,14 @@ return 0; } +extern "C" void JavaObjectAquire(JavaObject* obj); +extern "C" void JavaObjectRelease(JavaObject* obj); jint MonitorEnter(JNIEnv *env, jobject obj) { BEGIN_EXCEPTION - ((JavaObject*)obj)->aquire(); + JavaObjectAquire(((JavaObject*)obj)); return 1; END_EXCEPTION @@ -2045,7 +2047,7 @@ BEGIN_EXCEPTION - ((JavaObject*)obj)->unlock(); + JavaObjectRelease((JavaObject*)obj); return 1; END_EXCEPTION Modified: vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp?rev=51053&r1=51052&r2=51053&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp Tue May 13 11:43:50 2008 @@ -172,6 +172,16 @@ lockObj->MARK_AND_TRACE; } +#ifdef MULTIPLE_GC +extern "C" void JavaObjectTracer(JavaObject* obj, Collector* GC) { +#else +extern "C" void JavaObjectTracer(JavaObject* obj) { +#endif + obj->classOf->MARK_AND_TRACE; + obj->lockObj->MARK_AND_TRACE; +} + + void JavaThread::TRACER { javaThread->MARK_AND_TRACE; // FIXME: do I need this? Modified: vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h?rev=51053&r1=51052&r2=51053&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h Tue May 13 11:43:50 2008 @@ -100,10 +100,4 @@ STATIC void setMinMemory(size_t); }; -#ifdef MULTIPLE_GC -extern "C" gc* gcmalloc(size_t sz, VirtualTable* VT, Collector* GC); -#else -extern "C" gc* gcmalloc(size_t sz, VirtualTable* VT); -#endif - #endif Modified: vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp?rev=51053&r1=51052&r2=51053&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp Tue May 13 11:43:50 2008 @@ -31,10 +31,16 @@ void gc::markAndTrace(Collector* GC) const { ((GCCollector*)GC)->markAndTrace((void*)this); } +extern "C" void MarkAndTrace(gc* gc, Collector* GC) { + ((GCCollector*)GC)->markAndTrace((void*)gc); +} #else void gc::markAndTrace() const { GCCollector::markAndTrace((void*)this); } +extern "C" void MarkAndTrace(gc* gc) { + GCCollector::markAndTrace((void*)gc); +} #endif size_t gc::objectSize() const { From evan.cheng at apple.com Tue May 13 11:45:56 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 13 May 2008 16:45:56 -0000 Subject: [llvm-commits] [llvm] r51054 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td Message-ID: <200805131645.m4DGju35027873@zion.cs.uiuc.edu> Author: evancheng Date: Tue May 13 11:45:56 2008 New Revision: 51054 URL: http://llvm.org/viewvc/llvm-project?rev=51054&view=rev Log: - Don't treat anyext 16-bit load as a 32-bit load if it's volatile. - Correct a pasto. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=51054&r1=51053&r2=51054&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue May 13 11:45:56 2008 @@ -239,7 +239,7 @@ if (ExtType == ISD::NON_EXTLOAD) return true; if (ExtType == ISD::EXTLOAD) - return LD->getAlignment() >= 16; + return LD->getAlignment() >= 8 && !LD->isVolatile(); } return false; }]>; @@ -252,7 +252,7 @@ if (ExtType == ISD::NON_EXTLOAD) return true; if (ExtType == ISD::EXTLOAD) - return LD->getAlignment() >= 16; + return LD->getAlignment() >= 16 && !LD->isVolatile(); } return false; }]>; From evan.cheng at apple.com Tue May 13 12:02:39 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 13 May 2008 10:02:39 -0700 Subject: [llvm-commits] [llvm] r51000 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86ISelLowering.h X86InstrSSE.td In-Reply-To: <200805122034.m4CKYXhG001415@zion.cs.uiuc.edu> References: <200805122034.m4CKYXhG001415@zion.cs.uiuc.edu> Message-ID: <1016B3F3-0017-4CC1-9414-86682A1445CC@apple.com> On May 12, 2008, at 1:34 PM, Nate Begeman wrote: > > > if (Subtarget->hasMMX()) { > @@ -614,6 +615,7 @@ > setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v4f32, Custom); > setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v4f32, Custom); > setOperationAction(ISD::SELECT, MVT::v4f32, Custom); > + setOperationAction(ISD::VSETCC, MVT::v4f32, Legal); > } > > if (Subtarget->hasSSE2()) { > @@ -639,6 +641,12 @@ > setOperationAction(ISD::FSQRT, MVT::v2f64, Legal); > setOperationAction(ISD::FNEG, MVT::v2f64, Custom); > > + setOperationAction(ISD::VSETCC, MVT::v2f64, Legal); > + setOperationAction(ISD::VSETCC, MVT::v16i8, Legal); > + setOperationAction(ISD::VSETCC, MVT::v8i16, Legal); > + setOperationAction(ISD::VSETCC, MVT::v4i32, Legal); > + setOperationAction(ISD::VSETCC, MVT::v2i64, Legal); > + Is VSETCC legal for v4f32 and v2f64? I don't see how they are isel'd. Thanks, Evan > > setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v16i8, Custom); > setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v8i16, Custom); > setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v8i16, Custom); > @@ -686,6 +694,7 @@ > setOperationAction(ISD::LOAD, MVT::v2i64, Legal); > setOperationAction(ISD::SELECT, MVT::v2f64, Custom); > setOperationAction(ISD::SELECT, MVT::v2i64, Custom); > + > } > > if (Subtarget->hasSSE41()) { > > Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=51000&r1=50999&r2=51000&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) > +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Mon May 12 15:34:32 > 2008 > @@ -565,7 +565,6 @@ > MachineBasicBlock > *EmitAtomicMinMaxWithCustomInserter(MachineInstr *BInstr, > > MachineBasicBlock *BB, > unsigned > cmovOpc); > - > }; > } > > > Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=51000&r1=50999&r2=51000&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) > +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Mon May 12 15:34:32 2008 > @@ -161,6 +161,22 @@ > return getI32Imm(N->getValue() >> 3); > }]>; > > +def SSE_CC_imm : SDNodeXForm + unsigned Val; > + switch (N->get()) { > + default: Val = 0; assert(0 && "Unexpected CondCode"); break; > + case ISD::SETOEQ: Val = 0; break; > + case ISD::SETOLT: Val = 1; break; > + case ISD::SETOLE: Val = 2; break; > + case ISD::SETUO: Val = 3; break; > + case ISD::SETONE: Val = 4; break; > + case ISD::SETOGE: Val = 5; break; > + case ISD::SETOGT: Val = 6; break; > + case ISD::SETO: Val = 7; break; > + } > + return getI8Imm(Val); > +}]>; > + > // SHUFFLE_get_shuf_imm xform function: convert vector_shuffle mask > to PSHUF*, > // SHUFP* etc. imm. > def SHUFFLE_get_shuf_imm : SDNodeXForm @@ -255,6 +271,7 @@ > return X86::isSHUFPMask(N); > }], SHUFFLE_get_shuf_imm>; > > + > // > = > = > = > ----------------------------------------------------------------------= > ==// > // SSE scalar FP Instructions > // > = > = > = > ----------------------------------------------------------------------= > ==// > @@ -855,16 +872,20 @@ > > let Constraints = "$src1 = $dst" in { > def CMPPSrri : PSIi8<0xC2, MRMSrcReg, > - (outs VR128:$dst), (ins VR128:$src1, > VR128:$src, SSECC:$cc), > - "cmp${cc}ps\t{$src, $dst|$dst, $src}", > - [(set VR128:$dst, (int_x86_sse_cmp_ps > VR128:$src1, > - VR128:$src, imm:$cc))]>; > + (outs VR128:$dst), (ins VR128:$src1, > VR128:$src, SSECC:$cc), > + "cmp${cc}ps\t{$src, $dst|$dst, $src}", > + [(set VR128:$dst, (int_x86_sse_cmp_ps > VR128:$src1, > + VR128:$src, > imm:$cc))]>; > def CMPPSrmi : PSIi8<0xC2, MRMSrcMem, > - (outs VR128:$dst), (ins VR128:$src1, f128mem: > $src, SSECC:$cc), > - "cmp${cc}ps\t{$src, $dst|$dst, $src}", > - [(set VR128:$dst, (int_x86_sse_cmp_ps > VR128:$src1, > - (load addr:$src), imm: > $cc))]>; > -} > + (outs VR128:$dst), (ins VR128:$src1, f128mem: > $src, SSECC:$cc), > + "cmp${cc}ps\t{$src, $dst|$dst, $src}", > + [(set VR128:$dst, (int_x86_sse_cmp_ps VR128:$src1, > + (load addr:$src), > imm:$cc))]>; > +} > +def : Pat<(v4i32 (vsetcc (v4f32 VR128:$src1), VR128:$src2, cond: > $cc)), > + (CMPPSrri VR128:$src1, VR128:$src2, (SSE_CC_imm cond: > $cc))>; > +def : Pat<(v4i32 (vsetcc (v4f32 VR128:$src1), (memop addr:$src2), > cond:$cc)), > + (CMPPSrmi VR128:$src1, addr:$src2, (SSE_CC_imm cond:$cc))>; > > // Shuffle and unpack instructions > let Constraints = "$src1 = $dst" in { > @@ -1675,13 +1696,17 @@ > (outs VR128:$dst), (ins VR128:$src1, VR128:$src, > SSECC:$cc), > "cmp${cc}pd\t{$src, $dst|$dst, $src}", > [(set VR128:$dst, (int_x86_sse2_cmp_pd > VR128:$src1, > - VR128:$src, imm:$cc))]>; > + VR128:$src, > imm:$cc))]>; > def CMPPDrmi : PDIi8<0xC2, MRMSrcMem, > (outs VR128:$dst), (ins VR128:$src1, f128mem:$src, > SSECC:$cc), > "cmp${cc}pd\t{$src, $dst|$dst, $src}", > [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1, > - (load addr:$src), imm:$cc))]>; > + (load addr:$src), > imm:$cc))]>; > } > +def : Pat<(v2i64 (vsetcc (v2f64 VR128:$src1), VR128:$src2, cond: > $cc)), > + (CMPPDrri VR128:$src1, VR128:$src2, (SSE_CC_imm cond: > $cc))>; > +def : Pat<(v2i64 (vsetcc (v2f64 VR128:$src1), (memop addr:$src2), > cond:$cc)), > + (CMPPDrmi VR128:$src1, addr:$src2, (SSE_CC_imm cond:$cc))>; > > // Shuffle and unpack instructions > let Constraints = "$src1 = $dst" in { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From clattner at apple.com Tue May 13 12:03:40 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 13 May 2008 10:03:40 -0700 Subject: [llvm-commits] [llvm] r51019 - in /llvm/trunk: lib/Target/X86/README-SSE.txt lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/vec_set-H.ll In-Reply-To: <26A43360-A15E-4D08-A3EB-28627A492CF4@apple.com> References: <200805130054.m4D0s4BT018226@zion.cs.uiuc.edu> <200805131022.03193.baldrick@free.fr> <26A43360-A15E-4D08-A3EB-28627A492CF4@apple.com> Message-ID: <1DDF319F-400E-4131-A63A-C9C7F2337FDD@apple.com> On May 13, 2008, at 9:43 AM, Evan Cheng wrote: > > On May 13, 2008, at 1:22 AM, Duncan Sands wrote: > >> Hi Evan, >> >>> On x86, it's safe to treat i32 load anyext as a normal i32 load. >>> Ditto for i8 anyext load to i16. >> >> if this was loading the last two bytes in a page, then now it will be >> loading two bytes from the next page, which could trap. Similarly, >> if > > I'm pretty certain that's not possible on x86. Checking that the i8 is known to have 16 bit alignment should be sufficient to prevent this. -Chris From edwintorok at gmail.com Tue May 13 12:06:58 2008 From: edwintorok at gmail.com (=?ISO-8859-1?Q?T=F6r=F6k_Edwin?=) Date: Tue, 13 May 2008 20:06:58 +0300 Subject: [llvm-commits] [llvm] r51019 - in /llvm/trunk: lib/Target/X86/README-SSE.txt lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/vec_set-H.ll In-Reply-To: <1DDF319F-400E-4131-A63A-C9C7F2337FDD@apple.com> References: <200805130054.m4D0s4BT018226@zion.cs.uiuc.edu> <200805131022.03193.baldrick@free.fr> <26A43360-A15E-4D08-A3EB-28627A492CF4@apple.com> <1DDF319F-400E-4131-A63A-C9C7F2337FDD@apple.com> Message-ID: <4829CAB2.50207@gmail.com> Chris Lattner wrote: > On May 13, 2008, at 9:43 AM, Evan Cheng wrote: > > >> On May 13, 2008, at 1:22 AM, Duncan Sands wrote: >> >> >>> Hi Evan, >>> >>> >>>> On x86, it's safe to treat i32 load anyext as a normal i32 load. >>>> Ditto for i8 anyext load to i16. >>>> >>> if this was loading the last two bytes in a page, then now it will be >>> loading two bytes from the next page, which could trap. Similarly, >>> if >>> >> I'm pretty certain that's not possible on x86. >> > > Checking that the i8 is known to have 16 bit alignment should be > sufficient to prevent this. This reminds me of a gcc 4.0 bug that caused a kernel crash. A byte access was turned into a word access, and the pointer was at the end of a page, see full details here: http://lkml.org/lkml/2007/10/3/172 Best regards, --Edwin From dalej at apple.com Tue May 13 12:10:03 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 13 May 2008 10:10:03 -0700 Subject: [llvm-commits] [llvm] r51019 - in /llvm/trunk: lib/Target/X86/README-SSE.txt lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/vec_set-H.ll In-Reply-To: <4829CAB2.50207@gmail.com> References: <200805130054.m4D0s4BT018226@zion.cs.uiuc.edu> <200805131022.03193.baldrick@free.fr> <26A43360-A15E-4D08-A3EB-28627A492CF4@apple.com> <1DDF319F-400E-4131-A63A-C9C7F2337FDD@apple.com> <4829CAB2.50207@gmail.com> Message-ID: <9E9ABB71-8E6E-4D03-A3F6-8CA1EFC3C574@apple.com> On May 13, 2008, at 10:06 AM, T?r?k Edwin wrote: > Chris Lattner wrote: >> On May 13, 2008, at 9:43 AM, Evan Cheng wrote: >>> On May 13, 2008, at 1:22 AM, Duncan Sands wrote: >>>> Hi Evan, >>>> >>>>> On x86, it's safe to treat i32 load anyext as a normal i32 load. >>>>> Ditto for i8 anyext load to i16. >>>>> >>>> if this was loading the last two bytes in a page, then now it >>>> will be >>>> loading two bytes from the next page, which could trap. Similarly, >>>> if >>>> >>> I'm pretty certain that's not possible on x86. Why not? Seems to me it's perfectly possible (try __aligned__). From Sanjiv.Gupta at microchip.com Tue May 13 12:13:25 2008 From: Sanjiv.Gupta at microchip.com (Sanjiv.Gupta at microchip.com) Date: Tue, 13 May 2008 10:13:25 -0700 Subject: [llvm-commits] PATCH to configure PIC16 In-Reply-To: <1210684586.8813.399.camel@localhost> References: <1210684586.8813.399.camel@localhost> Message-ID: > Looks ok for me. But please don't forget about updating > configure files > itself. > I did not quite get you. Do we need to make changes in any other files besides the configure? TIA, - Sanjiv From natebegeman at mac.com Tue May 13 12:17:57 2008 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 13 May 2008 10:17:57 -0700 Subject: [llvm-commits] [llvm] r51000 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86ISelLowering.h X86InstrSSE.td In-Reply-To: <1016B3F3-0017-4CC1-9414-86682A1445CC@apple.com> References: <200805122034.m4CKYXhG001415@zion.cs.uiuc.edu> <1016B3F3-0017-4CC1-9414-86682A1445CC@apple.com> Message-ID: On May 13, 2008, at 10:02 AM, Evan Cheng wrote: > > On May 12, 2008, at 1:34 PM, Nate Begeman wrote: >> >> >> if (Subtarget->hasMMX()) { >> @@ -614,6 +615,7 @@ >> setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v4f32, Custom); >> setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v4f32, Custom); >> setOperationAction(ISD::SELECT, MVT::v4f32, Custom); >> + setOperationAction(ISD::VSETCC, MVT::v4f32, Legal); >> } >> >> if (Subtarget->hasSSE2()) { >> @@ -639,6 +641,12 @@ >> setOperationAction(ISD::FSQRT, MVT::v2f64, Legal); >> setOperationAction(ISD::FNEG, MVT::v2f64, Custom); >> >> + setOperationAction(ISD::VSETCC, MVT::v2f64, Legal); >> + setOperationAction(ISD::VSETCC, MVT::v16i8, Legal); >> + setOperationAction(ISD::VSETCC, MVT::v8i16, Legal); >> + setOperationAction(ISD::VSETCC, MVT::v4i32, Legal); >> + setOperationAction(ISD::VSETCC, MVT::v2i64, Legal); >> + > > Is VSETCC legal for v4f32 and v2f64? I don't see how they are isel'd. Yes, check the cmpps and cmppd instructions. Nate From Sanjiv.Gupta at microchip.com Tue May 13 12:17:55 2008 From: Sanjiv.Gupta at microchip.com (Sanjiv.Gupta at microchip.com) Date: Tue, 13 May 2008 10:17:55 -0700 Subject: [llvm-commits] PATCH to configure PIC16 In-Reply-To: References: <1210684586.8813.399.camel@localhost> Message-ID: > > Looks ok for me. But please don't forget about updating configure > > files itself. > > > I did not quite get you. Do we need to make changes in any > other files besides the configure? > > TIA, > - Sanjiv > Got it. I think you meant I was not at the latest configure file myself. Will update that. Thx. - Sanjiv > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From sanjiv.gupta at microchip.com Tue May 13 12:37:32 2008 From: sanjiv.gupta at microchip.com (Sanjiv Gupta) Date: Tue, 13 May 2008 17:37:32 -0000 Subject: [llvm-commits] [llvm] r51056 - /llvm/trunk/configure Message-ID: <200805131737.m4DHbXO4029445@zion.cs.uiuc.edu> Author: sgupta Date: Tue May 13 12:37:32 2008 New Revision: 51056 URL: http://llvm.org/viewvc/llvm-project?rev=51056&view=rev Log: Added configure switches for PIC16 backend. Modified: llvm/trunk/configure Modified: llvm/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=51056&r1=51055&r2=51056&view=diff ============================================================================== --- llvm/trunk/configure (original) +++ llvm/trunk/configure Tue May 13 12:37:32 2008 @@ -2375,6 +2375,7 @@ ia64-*) llvm_cv_target_arch="IA64" ;; arm-*) llvm_cv_target_arch="ARM" ;; mips-*) llvm_cv_target_arch="Mips" ;; + pic16-*) llvm_cv_target_arch="PIC16" ;; *) llvm_cv_target_arch="Unknown" ;; esac fi @@ -4662,6 +4663,8 @@ ;; Mips) TARGET_HAS_JIT=0 ;; + PIC16) TARGET_HAS_JIT=0 + ;; *) TARGET_HAS_JIT=0 ;; esac @@ -4743,7 +4746,7 @@ fi case "$enableval" in - all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU CBackend MSIL CppBackend" ;; + all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU CBackend MSIL CppBackend PIC16" ;; host-only) case "$llvm_cv_target_arch" in x86) TARGETS_TO_BUILD="X86" ;; @@ -4754,6 +4757,7 @@ IA64) TARGETS_TO_BUILD="IA64" ;; ARM) TARGETS_TO_BUILD="ARM" ;; Mips) TARGETS_TO_BUILD="Mips" ;; + PIC16) TARGETS_TO_BUILD="PIC16" ;; CellSPU|SPU) TARGETS_TO_BUILD="CellSPU" ;; *) { { echo "$as_me:$LINENO: error: Can not set target to build" >&5 echo "$as_me: error: Can not set target to build" >&2;} @@ -4770,6 +4774,7 @@ ia64) TARGETS_TO_BUILD="IA64 $TARGETS_TO_BUILD" ;; arm) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;; mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;; + pic16) TARGETS_TO_BUILD="PIC16 $TARGETS_TO_BUILD" ;; spu) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;; cbe) TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;; msil) TARGETS_TO_BUILD="MSIL $TARGETS_TO_BUILD" ;; From natebegeman at mac.com Tue May 13 12:52:09 2008 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 13 May 2008 17:52:09 -0000 Subject: [llvm-commits] [llvm] r51057 - /llvm/trunk/lib/Target/X86/X86InstrSSE.td Message-ID: <200805131752.m4DHq9vR029880@zion.cs.uiuc.edu> Author: sampo Date: Tue May 13 12:52:09 2008 New Revision: 51057 URL: http://llvm.org/viewvc/llvm-project?rev=51057&view=rev Log: Fix one more encoding bug. Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=51057&r1=51056&r2=51057&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue May 13 12:52:09 2008 @@ -1911,7 +1911,7 @@ int_x86_sse2_psrl_w, int_x86_sse2_psrli_w>; defm PSRLD : PDI_binop_rmi_int<0xD2, 0x72, MRM2r, "psrld", int_x86_sse2_psrl_d, int_x86_sse2_psrli_d>; -defm PSRLQ : PDI_binop_rmi_int<0xD3, 0x72, MRM2r, "psrlq", +defm PSRLQ : PDI_binop_rmi_int<0xD3, 0x73, MRM2r, "psrlq", int_x86_sse2_psrl_q, int_x86_sse2_psrli_q>; defm PSRAW : PDI_binop_rmi_int<0xE1, 0x71, MRM4r, "psraw", From isanbard at gmail.com Tue May 13 13:02:58 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 13 May 2008 11:02:58 -0700 Subject: [llvm-commits] [vmkit] r51036 - /vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp In-Reply-To: <200805131414.m4DEEhZn023477@zion.cs.uiuc.edu> References: <200805131414.m4DEEhZn023477@zion.cs.uiuc.edu> Message-ID: <16e5fdf90805131102n7197d162y75b71c13f7149088@mail.gmail.com> On Tue, May 13, 2008 at 7:14 AM, Nicolas Geoffray wrote: > Author: geoffray > Date: Tue May 13 09:14:42 2008 > New Revision: 51036 > > URL: http://llvm.org/viewvc/llvm-project?rev=51036&view=rev > Log: > Remove compilation warnings. > > > Modified: > vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp > > Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp > URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=51036&r1=51035&r2=51036&view=diff > > ============================================================================== > --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) > +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Tue May 13 09:14:42 2008 > @@ -247,7 +247,7 @@ > if (assemblyName == 0) > VMThread::get()->vm->error("can not find mscorlib.dll. Abort"); > > - vm->assemblyPath.push_back(""); > + vm->assemblyPath.push_back((char*)""); > vm->assemblyPath.push_back(assemblyName); > > const UTF8* mscorlib = vm->asciizConstructUTF8("mscorlib"); > @@ -424,7 +424,7 @@ > } > > extern "C" int start_app(int argc, char** argv) { > - N3* vm = N3::allocate("", N3::bootstrapVM); > + N3* vm = N3::allocate((char*)"", N3::bootstrapVM); Wouldn't it be better to make N3::allocate and vm->assemblyPath take "const char *" instead of doing this casting? If you really mean that the argument should be "char *", it's not safe to pass in a string. (Unless you compile with -fwritable-strings, in which case....ewwww!) -bw From isanbard at gmail.com Tue May 13 13:05:21 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 13 May 2008 18:05:21 -0000 Subject: [llvm-commits] [test-suite] r51058 - /test-suite/trunk/Makefile.programs Message-ID: <200805131805.m4DI5Lt5030242@zion.cs.uiuc.edu> Author: void Date: Tue May 13 13:05:20 2008 New Revision: 51058 URL: http://llvm.org/viewvc/llvm-project?rev=51058&view=rev Log: Experiment over. Modified: test-suite/trunk/Makefile.programs Modified: test-suite/trunk/Makefile.programs URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=51058&r1=51057&r2=51058&view=diff ============================================================================== --- test-suite/trunk/Makefile.programs (original) +++ test-suite/trunk/Makefile.programs Tue May 13 13:05:20 2008 @@ -205,8 +205,8 @@ endif#DISABLE_DIFFS ifeq ($(ARCH),PowerPC) -LLCBETAOPTION := -machine-licm -#-enable-sinking +LLCBETAOPTION := -enable-sinking +#-machine-licm #-coalescer-commute-instrs #--enable-tail-merge #--enable-ppc-preinc @@ -220,8 +220,7 @@ LLCBETAOPTION := -sched=simple endif ifeq ($(ARCH),x86) -LLCBETAOPTION := -machine-licm -#-schedule-livein-copies +LLCBETAOPTION := -schedule-livein-copies #-align-loops=false #-enable-sinking #-coalescer-commute-instrs From isanbard at gmail.com Tue May 13 13:07:01 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 13 May 2008 11:07:01 -0700 Subject: [llvm-commits] [vmkit] r51047 - /vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp In-Reply-To: <200805131502.m4DF2OjY025029@zion.cs.uiuc.edu> References: <200805131502.m4DF2OjY025029@zion.cs.uiuc.edu> Message-ID: <16e5fdf90805131107m5c80a826k1e9ff7585e418dd6@mail.gmail.com> On Tue, May 13, 2008 at 8:02 AM, Nicolas Geoffray wrote: > Author: geoffray > Date: Tue May 13 10:02:24 2008 > New Revision: 51047 > > URL: http://llvm.org/viewvc/llvm-project?rev=51047&view=rev > Log: > Darwin requires to preallocate rp. > > > Modified: > vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp > > Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp > URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=51047&r1=51046&r2=51047&view=diff > > ============================================================================== > --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) > +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Tue May 13 10:02:24 2008 > @@ -125,7 +125,6 @@ > char* buf = (char*)alloca(len + 1); > const char* cur = str; > int top = 0; > - char* rp = 0; > char c = 1; > while (c != 0) { > while (((c = cur[top]) != 0) && c != envSeparator[0]) { > @@ -134,8 +133,10 @@ > if (top != 0) { > memcpy(buf, cur, top); > buf[top] = 0; > + char* rp = (char*)malloc(4096); > + memset(rp, 0, 4096); Instead of these magic numbers, could you use either a #define or enum and comment why you're using that value? -bw > rp = realpath(buf, rp); > - if (rp != 0) { > + if (rp[4095] == 0 && strlen(rp) != 0) { > struct stat st; > stat(rp, &st); > if ((st.st_mode & S_IFMT) == S_IFDIR) { > @@ -145,9 +146,12 @@ > temp[len] = dirSeparator[0]; > temp[len + 1] = 0; > bootClasspath.push_back(temp); > + free(rp); > } else { > bootClasspath.push_back(rp); > } > + } else { > + free(rp); > } > } > cur = cur + top + 1; > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From gohman at apple.com Tue May 13 13:16:07 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 May 2008 18:16:07 -0000 Subject: [llvm-commits] [llvm] r51059 - /llvm/trunk/docs/LangRef.html Message-ID: <200805131816.m4DIG7sr030578@zion.cs.uiuc.edu> Author: djg Date: Tue May 13 13:16:06 2008 New Revision: 51059 URL: http://llvm.org/viewvc/llvm-project?rev=51059&view=rev Log: s/indicies/indices/ and clarify the extractvalue and insertvalue are working with struct field or array element values. Thanks Duncan! Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=51059&r1=51058&r2=51059&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue May 13 13:16:06 2008 @@ -2809,8 +2809,8 @@
        Overview:

        -The 'extractvalue' instruction extracts a value -from an aggregate value. +The 'extractvalue' instruction extracts the value of a struct field +or array element from an aggregate value.

        @@ -2819,8 +2819,8 @@

        The first operand of an 'extractvalue' instruction is a value of struct or array -type. The operands are constant indicies to specify which value to extract -in the same manner as indicies in a +type. The operands are constant indices to specify which value to extract +in the same manner as indices in a 'getelementptr' instruction.

        @@ -2856,7 +2856,7 @@

        The 'insertvalue' instruction inserts a value -into a aggregate. +into a struct field or array element in an aggregate.

        @@ -2866,19 +2866,19 @@ The first operand of an 'insertvalue' instruction is a value of struct or array type. The second operand is a first-class value to insert. -type of the first operand. The following operands are constant indicies +type of the first operand. The following operands are constant indices indicating the position at which to insert the value in the same manner as -indicies in a +indices in a 'getelementptr' instruction. The value to insert must have the same type as the value identified -by the indicies. +by the indices.
        Semantics:

        The result is an aggregate of the same type as val. Its value is that of val except that the value at the position -specified by the indicies is that of elt. +specified by the indices is that of elt.

        Example:
        From clattner at apple.com Tue May 13 13:30:07 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 13 May 2008 11:30:07 -0700 Subject: [llvm-commits] [llvm] r51019 - in /llvm/trunk: lib/Target/X86/README-SSE.txt lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/vec_set-H.ll In-Reply-To: <4829CAB2.50207@gmail.com> References: <200805130054.m4D0s4BT018226@zion.cs.uiuc.edu> <200805131022.03193.baldrick@free.fr> <26A43360-A15E-4D08-A3EB-28627A492CF4@apple.com> <1DDF319F-400E-4131-A63A-C9C7F2337FDD@apple.com> <4829CAB2.50207@gmail.com> Message-ID: <48CD8E2C-6AA4-4173-93B4-5880E77E7CD8@apple.com> On May 13, 2008, at 10:06 AM, T?r?k Edwin wrote: >> Checking that the i8 is known to have 16 bit alignment should be >> sufficient to prevent this. > > This reminds me of a gcc 4.0 bug that caused a kernel crash. > > A byte access was turned into a word access, and the pointer was at > the > end of a page, see full details here: > http://lkml.org/lkml/2007/10/3/172 A byte that is at the end of the page doesn't have 16 bit alignment, therefore it should not be transformed. -Chris From isanbard at gmail.com Tue May 13 13:31:13 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 13 May 2008 11:31:13 -0700 Subject: [llvm-commits] [llvm] r51056 - /llvm/trunk/configure In-Reply-To: <200805131737.m4DHbXO4029445@zion.cs.uiuc.edu> References: <200805131737.m4DHbXO4029445@zion.cs.uiuc.edu> Message-ID: <16e5fdf90805131131wdeedcdndfc2271884e5a5e2@mail.gmail.com> Did you change the autoconf/configure.ac file as well? -bw On Tue, May 13, 2008 at 10:37 AM, Sanjiv Gupta wrote: > Author: sgupta > Date: Tue May 13 12:37:32 2008 > New Revision: 51056 > > URL: http://llvm.org/viewvc/llvm-project?rev=51056&view=rev > Log: > Added configure switches for PIC16 backend. > > Modified: > llvm/trunk/configure > > Modified: llvm/trunk/configure > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=51056&r1=51055&r2=51056&view=diff > > ============================================================================== > --- llvm/trunk/configure (original) > +++ llvm/trunk/configure Tue May 13 12:37:32 2008 > @@ -2375,6 +2375,7 @@ > ia64-*) llvm_cv_target_arch="IA64" ;; > arm-*) llvm_cv_target_arch="ARM" ;; > mips-*) llvm_cv_target_arch="Mips" ;; > + pic16-*) llvm_cv_target_arch="PIC16" ;; > *) llvm_cv_target_arch="Unknown" ;; > esac > fi > @@ -4662,6 +4663,8 @@ > ;; > Mips) TARGET_HAS_JIT=0 > ;; > + PIC16) TARGET_HAS_JIT=0 > + ;; > *) TARGET_HAS_JIT=0 > ;; > esac > @@ -4743,7 +4746,7 @@ > fi > > case "$enableval" in > - all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU CBackend MSIL CppBackend" ;; > + all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU CBackend MSIL CppBackend PIC16" ;; > host-only) > case "$llvm_cv_target_arch" in > x86) TARGETS_TO_BUILD="X86" ;; > @@ -4754,6 +4757,7 @@ > IA64) TARGETS_TO_BUILD="IA64" ;; > ARM) TARGETS_TO_BUILD="ARM" ;; > Mips) TARGETS_TO_BUILD="Mips" ;; > + PIC16) TARGETS_TO_BUILD="PIC16" ;; > CellSPU|SPU) TARGETS_TO_BUILD="CellSPU" ;; > *) { { echo "$as_me:$LINENO: error: Can not set target to build" >&5 > echo "$as_me: error: Can not set target to build" >&2;} > @@ -4770,6 +4774,7 @@ > ia64) TARGETS_TO_BUILD="IA64 $TARGETS_TO_BUILD" ;; > arm) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;; > mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;; > + pic16) TARGETS_TO_BUILD="PIC16 $TARGETS_TO_BUILD" ;; > spu) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;; > cbe) TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;; > msil) TARGETS_TO_BUILD="MSIL $TARGETS_TO_BUILD" ;; > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From echristo at apple.com Tue May 13 13:33:43 2008 From: echristo at apple.com (Eric Christopher) Date: Tue, 13 May 2008 11:33:43 -0700 Subject: [llvm-commits] [llvm] r51056 - /llvm/trunk/configure In-Reply-To: <16e5fdf90805131131wdeedcdndfc2271884e5a5e2@mail.gmail.com> References: <200805131737.m4DHbXO4029445@zion.cs.uiuc.edu> <16e5fdf90805131131wdeedcdndfc2271884e5a5e2@mail.gmail.com> Message-ID: <328025AB-2CA4-455C-8D86-2056114348CB@apple.com> On May 13, 2008, at 11:31 AM, Bill Wendling wrote: > Did you change the autoconf/configure.ac file as well? If not, your patch will disappear after the next regen. Perhaps we should get a commit hook that will depend configure being committed on configure.ac being updated? :) -eric From clattner at apple.com Tue May 13 13:37:40 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 13 May 2008 11:37:40 -0700 Subject: [llvm-commits] [llvm] r51054 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: <200805131645.m4DGju35027873@zion.cs.uiuc.edu> References: <200805131645.m4DGju35027873@zion.cs.uiuc.edu> Message-ID: <601248DD-531D-496F-9D57-CD518EB91CC4@apple.com> On May 13, 2008, at 9:45 AM, Evan Cheng wrote: > URL: http://llvm.org/viewvc/llvm-project?rev=51054&view=rev > Log: > - Don't treat anyext 16-bit load as a 32-bit load if it's volatile. > - Correct a pasto. The correction goes the wrong way: > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) > +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue May 13 11:45:56 2008 > @@ -239,7 +239,7 @@ > if (ExtType == ISD::NON_EXTLOAD) > return true; > if (ExtType == ISD::EXTLOAD) > - return LD->getAlignment() >= 16; > + return LD->getAlignment() >= 8 && !LD->isVolatile(); This should be 16, > > } > return false; > }]>; > @@ -252,7 +252,7 @@ > if (ExtType == ISD::NON_EXTLOAD) > return true; > if (ExtType == ISD::EXTLOAD) > - return LD->getAlignment() >= 16; > + return LD->getAlignment() >= 16 && !LD->isVolatile(); > } This should be 32. // It's always safe to treat a anyext i16 load as a i32 load. Ditto for // i8 to i16. This should be "it is safe to treat anyext i16 load as i32 load if the i16 is known to be 32-bit aligned or better". -Chris From sabre at nondot.org Tue May 13 13:48:54 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 May 2008 18:48:54 -0000 Subject: [llvm-commits] [llvm] r51060 - /llvm/trunk/lib/Target/X86/README-SSE.txt Message-ID: <200805131848.m4DImsS4031562@zion.cs.uiuc.edu> Author: lattner Date: Tue May 13 13:48:54 2008 New Revision: 51060 URL: http://llvm.org/viewvc/llvm-project?rev=51060&view=rev Log: add a note Modified: llvm/trunk/lib/Target/X86/README-SSE.txt Modified: llvm/trunk/lib/Target/X86/README-SSE.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README-SSE.txt?rev=51060&r1=51059&r2=51060&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/README-SSE.txt (original) +++ llvm/trunk/lib/Target/X86/README-SSE.txt Tue May 13 13:48:54 2008 @@ -764,4 +764,28 @@ //===---------------------------------------------------------------------===// +Consider: +#include +__m128 foo2 (float x) { + return _mm_set_ps (0, 0, x, 0); +} + +In x86-32 mode, we generate this spiffy code: + +_foo2: + movss 4(%esp), %xmm0 + pshufd $81, %xmm0, %xmm0 + ret + +in x86-64 mode, we generate this code, which could be better: + +_foo2: + xorps %xmm1, %xmm1 + movss %xmm0, %xmm1 + pshufd $81, %xmm1, %xmm0 + ret + +In sse4 mode, we could use insertps to make both better. + +//===---------------------------------------------------------------------===// From evan.cheng at apple.com Tue May 13 13:59:59 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 13 May 2008 18:59:59 -0000 Subject: [llvm-commits] [llvm] r51061 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td Message-ID: <200805131859.m4DIxxuC031927@zion.cs.uiuc.edu> Author: evancheng Date: Tue May 13 13:59:59 2008 New Revision: 51061 URL: http://llvm.org/viewvc/llvm-project?rev=51061&view=rev Log: - Fix the pasto in the fix for a previous pasto. - Incorporate Chris' comment suggestion. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=51061&r1=51060&r2=51061&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue May 13 13:59:59 2008 @@ -229,8 +229,8 @@ }]>; // Helper fragments for loads. -// It's always safe to treat a anyext i16 load as a i32 load. Ditto for -// i8 to i16. +// It's always safe to treat a anyext i16 load as a i32 load if the i16 is +// known to be 32-bit aligned or better. Ditto for i8 to i16. def loadi16 : PatFrag<(ops node:$ptr), (i16 (ld node:$ptr)), [{ if (LoadSDNode *LD = dyn_cast(N)) { if (LD->getAddressingMode() != ISD::UNINDEXED) @@ -239,7 +239,7 @@ if (ExtType == ISD::NON_EXTLOAD) return true; if (ExtType == ISD::EXTLOAD) - return LD->getAlignment() >= 8 && !LD->isVolatile(); + return LD->getAlignment() >= 16 && !LD->isVolatile(); } return false; }]>; @@ -252,7 +252,7 @@ if (ExtType == ISD::NON_EXTLOAD) return true; if (ExtType == ISD::EXTLOAD) - return LD->getAlignment() >= 16 && !LD->isVolatile(); + return LD->getAlignment() >= 32 && !LD->isVolatile(); } return false; }]>; From evan.cheng at apple.com Tue May 13 14:03:25 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 13 May 2008 12:03:25 -0700 Subject: [llvm-commits] [llvm] r51054 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: <601248DD-531D-496F-9D57-CD518EB91CC4@apple.com> References: <200805131645.m4DGju35027873@zion.cs.uiuc.edu> <601248DD-531D-496F-9D57-CD518EB91CC4@apple.com> Message-ID: <388A2E9F-5BEA-43E3-B423-4FA33576BD22@apple.com> Fixed. Thanks. Evan On May 13, 2008, at 11:37 AM, Chris Lattner wrote: > On May 13, 2008, at 9:45 AM, Evan Cheng wrote: >> URL: http://llvm.org/viewvc/llvm-project?rev=51054&view=rev >> Log: >> - Don't treat anyext 16-bit load as a 32-bit load if it's volatile. >> - Correct a pasto. > > The correction goes the wrong way: >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) >> +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue May 13 11:45:56 >> 2008 >> @@ -239,7 +239,7 @@ >> if (ExtType == ISD::NON_EXTLOAD) >> return true; >> if (ExtType == ISD::EXTLOAD) >> - return LD->getAlignment() >= 16; >> + return LD->getAlignment() >= 8 && !LD->isVolatile(); > > This should be 16, > >> >> } >> return false; >> }]>; >> @@ -252,7 +252,7 @@ >> if (ExtType == ISD::NON_EXTLOAD) >> return true; >> if (ExtType == ISD::EXTLOAD) >> - return LD->getAlignment() >= 16; >> + return LD->getAlignment() >= 16 && !LD->isVolatile(); >> } > > This should be 32. > > // It's always safe to treat a anyext i16 load as a i32 load. Ditto > for > // i8 to i16. > > This should be "it is safe to treat anyext i16 load as i32 load if the > i16 is known to be 32-bit aligned or better". > > -Chris > _______________________________________________ > 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 Tue May 13 14:05:54 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 13 May 2008 12:05:54 -0700 Subject: [llvm-commits] [llvm] r51060 - /llvm/trunk/lib/Target/X86/README-SSE.txt In-Reply-To: <200805131848.m4DImsS4031562@zion.cs.uiuc.edu> References: <200805131848.m4DImsS4031562@zion.cs.uiuc.edu> Message-ID: <0551ECF7-095B-4B96-9B1E-CEB507A0C574@apple.com> On May 13, 2008, at 11:48 AM, Chris Lattner wrote: > Author: lattner > Date: Tue May 13 13:48:54 2008 > New Revision: 51060 > > URL: http://llvm.org/viewvc/llvm-project?rev=51060&view=rev > Log: > add a note > > Modified: > llvm/trunk/lib/Target/X86/README-SSE.txt > > Modified: llvm/trunk/lib/Target/X86/README-SSE.txt > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README-SSE.txt?rev=51060&r1=51059&r2=51060&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/README-SSE.txt (original) > +++ llvm/trunk/lib/Target/X86/README-SSE.txt Tue May 13 13:48:54 2008 > @@ -764,4 +764,28 @@ > > // > = > = > = > --------------------------------------------------------------------- > ===// > > +Consider: > +#include > +__m128 foo2 (float x) { > + return _mm_set_ps (0, 0, x, 0); > +} > + > +In x86-32 mode, we generate this spiffy code: > + > +_foo2: > + movss 4(%esp), %xmm0 > + pshufd $81, %xmm0, %xmm0 > + ret > + > +in x86-64 mode, we generate this code, which could be better: > + > +_foo2: > + xorps %xmm1, %xmm1 > + movss %xmm0, %xmm1 > + pshufd $81, %xmm1, %xmm0 > + ret True. > > + > +In sse4 mode, we could use insertps to make both better. This is not clear. Is insertps fastish (I suppose the load folding variant is better than 2 instruction)? Right now the x86 backend is very reluctant to make use of any extracting and insertion instructions. Evan > > + > +// > = > = > = > --------------------------------------------------------------------- > ===// > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Tue May 13 14:56:21 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 May 2008 19:56:21 -0000 Subject: [llvm-commits] [llvm] r51062 - /llvm/trunk/lib/Target/X86/README-SSE.txt Message-ID: <200805131956.m4DJuLrG001413@zion.cs.uiuc.edu> Author: lattner Date: Tue May 13 14:56:20 2008 New Revision: 51062 URL: http://llvm.org/viewvc/llvm-project?rev=51062&view=rev Log: add a note Modified: llvm/trunk/lib/Target/X86/README-SSE.txt Modified: llvm/trunk/lib/Target/X86/README-SSE.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README-SSE.txt?rev=51062&r1=51061&r2=51062&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/README-SSE.txt (original) +++ llvm/trunk/lib/Target/X86/README-SSE.txt Tue May 13 14:56:20 2008 @@ -787,5 +787,23 @@ In sse4 mode, we could use insertps to make both better. +Here's another testcase that could use insertps [mem]: + +#include +extern float x2, x3; +__m128 foo1 (float x1, float x4) { + return _mm_set_ps (x2, x1, x3, x4); +} + +gcc mainline compiles it to: + +foo1: + insertps $0x10, x2(%rip), %xmm0 + insertps $0x10, x3(%rip), %xmm1 + movaps %xmm1, %xmm2 + movlhps %xmm0, %xmm2 + movaps %xmm2, %xmm0 + ret + //===---------------------------------------------------------------------===// From clattner at apple.com Tue May 13 14:57:10 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 13 May 2008 12:57:10 -0700 Subject: [llvm-commits] [llvm] r51060 - /llvm/trunk/lib/Target/X86/README-SSE.txt In-Reply-To: <0551ECF7-095B-4B96-9B1E-CEB507A0C574@apple.com> References: <200805131848.m4DImsS4031562@zion.cs.uiuc.edu> <0551ECF7-095B-4B96-9B1E-CEB507A0C574@apple.com> Message-ID: On May 13, 2008, at 12:05 PM, Evan Cheng wrote: >> +In sse4 mode, we could use insertps to make both better. > > This is not clear. Is insertps fastish (I suppose the load folding > variant is better than 2 instruction)? Right now the x86 backend is > very reluctant to make use of any extracting and insertion > instructions. I don't know. I assume so :), it saves a register if nothing else. -Chris From clattner at apple.com Tue May 13 14:59:10 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 13 May 2008 12:59:10 -0700 Subject: [llvm-commits] [llvm] r51024 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp In-Reply-To: <200805130817.m4D8HN92011939@zion.cs.uiuc.edu> References: <200805130817.m4D8HN92011939@zion.cs.uiuc.edu> Message-ID: <0F489371-27E1-4B72-8E63-72A1BB91B19E@apple.com> On May 13, 2008, at 1:17 AM, Owen Anderson wrote: > Author: resistor > Date: Tue May 13 03:17:22 2008 > New Revision: 51024 > > URL: http://llvm.org/viewvc/llvm-project?rev=51024&view=rev > Log: > Add support for non-local CSE of read-only calls. nice! -Chris From dalej at apple.com Tue May 13 15:06:43 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 13 May 2008 20:06:43 -0000 Subject: [llvm-commits] [llvm] r51063 - in /llvm/trunk: lib/Transforms/Scalar/TailDuplication.cpp test/Transforms/TailDup/2008-05-13-InfiniteLoop.ll Message-ID: <200805132006.m4DK6hB4001806@zion.cs.uiuc.edu> Author: johannes Date: Tue May 13 15:06:43 2008 New Revision: 51063 URL: http://llvm.org/viewvc/llvm-project?rev=51063&view=rev Log: Fix for PR 2323, infinite loop in tail dup. Added: llvm/trunk/test/Transforms/TailDup/2008-05-13-InfiniteLoop.ll Modified: llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp Modified: llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp?rev=51063&r1=51062&r2=51063&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp Tue May 13 15:06:43 2008 @@ -32,6 +32,7 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/ADT/Statistic.h" +#include "llvm/ADT/SmallPtrSet.h" #include using namespace llvm; @@ -51,6 +52,7 @@ private: inline bool shouldEliminateUnconditionalBranch(TerminatorInst *TI); inline void eliminateUnconditionalBranch(BranchInst *BI); + SmallPtrSet CycleDetector; }; } @@ -61,17 +63,21 @@ FunctionPass *llvm::createTailDuplicationPass() { return new TailDup(); } /// runOnFunction - Top level algorithm - Loop over each unconditional branch in -/// the function, eliminating it if it looks attractive enough. -/// +/// the function, eliminating it if it looks attractive enough. CycleDetector +/// prevents infinite loops by checking that we aren't redirecting a branch to +/// a place it already pointed to earlier; see PR 2323. bool TailDup::runOnFunction(Function &F) { bool Changed = false; - for (Function::iterator I = F.begin(), E = F.end(); I != E; ) + CycleDetector.clear(); + for (Function::iterator I = F.begin(), E = F.end(); I != E; ) { if (shouldEliminateUnconditionalBranch(I->getTerminator())) { eliminateUnconditionalBranch(cast(I->getTerminator())); Changed = true; } else { ++I; + CycleDetector.clear(); } + } return Changed; } @@ -140,7 +146,7 @@ if (TooMany-- == 0) return false; } - // Finally, if this unconditional branch is a fall-through, be careful about + // If this unconditional branch is a fall-through, be careful about // tail duplicating it. In particular, we don't want to taildup it if the // original block will still be there after taildup is completed: doing so // would eliminate the fall-through, requiring unconditional branches. @@ -170,6 +176,11 @@ } } + // Finally, check that we haven't redirected to this target block earlier; + // there are cases where we loop forever if we don't check this (PR 2323). + if (!CycleDetector.insert(Dest)) + return false; + return true; } Added: llvm/trunk/test/Transforms/TailDup/2008-05-13-InfiniteLoop.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/TailDup/2008-05-13-InfiniteLoop.ll?rev=51063&view=auto ============================================================================== --- llvm/trunk/test/Transforms/TailDup/2008-05-13-InfiniteLoop.ll (added) +++ llvm/trunk/test/Transforms/TailDup/2008-05-13-InfiniteLoop.ll Tue May 13 15:06:43 2008 @@ -0,0 +1,26 @@ +; RUN: llvm-as < %s | opt -tailduplicate | llc +; PR2323 + +define i32 @func_27(i32 %p_28) nounwind { +entry: + %tmp125 = trunc i32 %p_28 to i8 ; [#uses=1] + %tmp5.i = icmp eq i8 %tmp125, 0 ; [#uses=1] + br i1 %tmp5.i, label %bb8.i, label %bb.i + +bb.i: ; preds = %entry + br label %bb39.i + +bb8.i: ; preds = %entry + br label %bb11.i + +bb11.i: ; preds = %bb39.i, %bb8.i + %tmp126 = trunc i32 %p_28 to i8 ; [#uses=1] + br label %bb39.i + +bb39.i: ; preds = %bb11.i, %bb.i + %tmp127 = trunc i32 %p_28 to i8 ; [#uses=1] + br label %bb11.i + +func_29.exit: ; No predecessors! + ret i32 undef +} From nicolas.geoffray at lip6.fr Tue May 13 15:11:29 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 20:11:29 -0000 Subject: [llvm-commits] [vmkit] r51064 - in /vmkit/trunk/lib/N3/VMCore: N3.cpp N3.h N3Initialise.cpp Message-ID: <200805132011.m4DKBU0x001983@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 15:11:29 2008 New Revision: 51064 URL: http://llvm.org/viewvc/llvm-project?rev=51064&view=rev Log: Make N3::allocate, vm->assemblyPath and N3::name take const char*. Thanks Bill! Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp vmkit/trunk/lib/N3/VMCore/N3.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=51064&r1=51063&r2=51064&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Tue May 13 15:11:29 2008 @@ -80,7 +80,7 @@ #endif VMThread::threadKey->set(vm->bootstrapThread); - vm->name = (char*)"bootstrapN3"; + vm->name = "bootstrapN3"; vm->hashUTF8 = UTF8Map::allocate(); vm->hashStr = StringMap::allocate(); vm->loadedAssemblies = AssemblyMap::allocate(); @@ -90,7 +90,7 @@ } -N3* N3::allocate(char* name, N3* parent) { +N3* N3::allocate(const char* name, N3* parent) { N3 *vm= gc_new(N3)(); #ifdef MULTIPLE_GC @@ -133,7 +133,7 @@ uint32 idx = 0; while ((res == 0) && (idx < assemblyPath.size())) { - char* cur = assemblyPath[idx]; + const char* cur = assemblyPath[idx]; uint32 strLen = strlen(cur); char* buf = (char*)alloca(strLen + alen + 16); Modified: vmkit/trunk/lib/N3/VMCore/N3.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.h?rev=51064&r1=51063&r2=51064&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.h (original) +++ vmkit/trunk/lib/N3/VMCore/N3.h Tue May 13 15:11:29 2008 @@ -43,15 +43,15 @@ Assembly* constructAssembly(const UTF8* name); Assembly* lookupAssembly(const UTF8* name); - char* name; + const char* name; StringMap * hashStr; AssemblyMap* loadedAssemblies; - std::vector assemblyPath; + std::vector assemblyPath; Assembly* coreAssembly; static N3* allocateBootstrap(); - static N3* allocate(char* name, N3* parent); + static N3* allocate(const char* name, N3* parent); ArrayUInt8* openAssembly(const UTF8* name, const char* extension); Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=51064&r1=51063&r2=51064&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Tue May 13 15:11:29 2008 @@ -247,7 +247,7 @@ if (assemblyName == 0) VMThread::get()->vm->error("can not find mscorlib.dll. Abort"); - vm->assemblyPath.push_back((char*)""); + vm->assemblyPath.push_back(""); vm->assemblyPath.push_back(assemblyName); const UTF8* mscorlib = vm->asciizConstructUTF8("mscorlib"); @@ -424,7 +424,7 @@ } extern "C" int start_app(int argc, char** argv) { - N3* vm = N3::allocate((char*)"", N3::bootstrapVM); + N3* vm = N3::allocate("", N3::bootstrapVM); vm->runMain(argc, argv); return 0; } From nicolas.geoffray at lip6.fr Tue May 13 15:11:49 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 22:11:49 +0200 Subject: [llvm-commits] [vmkit] r51036 - /vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp In-Reply-To: <16e5fdf90805131102n7197d162y75b71c13f7149088@mail.gmail.com> References: <200805131414.m4DEEhZn023477@zion.cs.uiuc.edu> <16e5fdf90805131102n7197d162y75b71c13f7149088@mail.gmail.com> Message-ID: <4829F605.6010000@lip6.fr> Done. Thanks Bill for reviewing! Bill Wendling wrote: > On Tue, May 13, 2008 at 7:14 AM, Nicolas Geoffray > wrote: > >> Author: geoffray >> Date: Tue May 13 09:14:42 2008 >> New Revision: 51036 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=51036&view=rev >> Log: >> Remove compilation warnings. >> >> >> Modified: >> vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp >> >> Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp >> URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=51036&r1=51035&r2=51036&view=diff >> >> ============================================================================== >> --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) >> +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Tue May 13 09:14:42 2008 >> @@ -247,7 +247,7 @@ >> if (assemblyName == 0) >> VMThread::get()->vm->error("can not find mscorlib.dll. Abort"); >> >> - vm->assemblyPath.push_back(""); >> + vm->assemblyPath.push_back((char*)""); >> vm->assemblyPath.push_back(assemblyName); >> >> const UTF8* mscorlib = vm->asciizConstructUTF8("mscorlib"); >> @@ -424,7 +424,7 @@ >> } >> >> extern "C" int start_app(int argc, char** argv) { >> - N3* vm = N3::allocate("", N3::bootstrapVM); >> + N3* vm = N3::allocate((char*)"", N3::bootstrapVM); >> > > Wouldn't it be better to make N3::allocate and vm->assemblyPath take > "const char *" instead of doing this casting? If you really mean that > the argument should be "char *", it's not safe to pass in a string. > (Unless you compile with -fwritable-strings, in which case....ewwww!) > > -bw > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From nicolas.geoffray at lip6.fr Tue May 13 15:18:21 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 20:18:21 -0000 Subject: [llvm-commits] [vmkit] r51066 - /vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Message-ID: <200805132018.m4DKIL6P002230@zion.cs.uiuc.edu> Author: geoffray Date: Tue May 13 15:18:21 2008 New Revision: 51066 URL: http://llvm.org/viewvc/llvm-project?rev=51066&view=rev Log: Use PATH_MAX for the realpath buffer, as written in "man realpath". Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=51066&r1=51065&r2=51066&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Tue May 13 15:18:21 2008 @@ -133,10 +133,10 @@ if (top != 0) { memcpy(buf, cur, top); buf[top] = 0; - char* rp = (char*)malloc(4096); - memset(rp, 0, 4096); + char* rp = (char*)malloc(PATH_MAX); + memset(rp, 0, PATH_MAX); rp = realpath(buf, rp); - if (rp[4095] == 0 && strlen(rp) != 0) { + if (rp[PATH_MAX - 1] == 0 && strlen(rp) != 0) { struct stat st; stat(rp, &st); if ((st.st_mode & S_IFMT) == S_IFDIR) { From nicolas.geoffray at lip6.fr Tue May 13 15:18:34 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 May 2008 22:18:34 +0200 Subject: [llvm-commits] [vmkit] r51047 - /vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp In-Reply-To: <16e5fdf90805131107m5c80a826k1e9ff7585e418dd6@mail.gmail.com> References: <200805131502.m4DF2OjY025029@zion.cs.uiuc.edu> <16e5fdf90805131107m5c80a826k1e9ff7585e418dd6@mail.gmail.com> Message-ID: <4829F79A.1050405@lip6.fr> Done too! And thanks again for reviewing. Bill Wendling wrote: > On Tue, May 13, 2008 at 8:02 AM, Nicolas Geoffray > wrote: > >> Author: geoffray >> Date: Tue May 13 10:02:24 2008 >> New Revision: 51047 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=51047&view=rev >> Log: >> Darwin requires to preallocate rp. >> >> >> Modified: >> vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp >> >> Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp >> URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=51047&r1=51046&r2=51047&view=diff >> >> ============================================================================== >> --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) >> +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Tue May 13 10:02:24 2008 >> @@ -125,7 +125,6 @@ >> char* buf = (char*)alloca(len + 1); >> const char* cur = str; >> int top = 0; >> - char* rp = 0; >> char c = 1; >> while (c != 0) { >> while (((c = cur[top]) != 0) && c != envSeparator[0]) { >> @@ -134,8 +133,10 @@ >> if (top != 0) { >> memcpy(buf, cur, top); >> buf[top] = 0; >> + char* rp = (char*)malloc(4096); >> + memset(rp, 0, 4096); >> > > Instead of these magic numbers, could you use either a #define or enum > and comment why you're using that value? > > -bw > > >> rp = realpath(buf, rp); >> - if (rp != 0) { >> + if (rp[4095] == 0 && strlen(rp) != 0) { >> struct stat st; >> stat(rp, &st); >> if ((st.st_mode & S_IFMT) == S_IFDIR) { >> @@ -145,9 +146,12 @@ >> temp[len] = dirSeparator[0]; >> temp[len + 1] = 0; >> bootClasspath.push_back(temp); >> + free(rp); >> } else { >> bootClasspath.push_back(rp); >> } >> + } else { >> + free(rp); >> } >> } >> cur = cur + top + 1; >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> >> > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From lattner at apple.com Tue May 13 15:39:24 2008 From: lattner at apple.com (Tanya Lattner) Date: Tue, 13 May 2008 13:39:24 -0700 Subject: [llvm-commits] PATCH to configure PIC16 In-Reply-To: References: <1210684586.8813.399.camel@localhost> Message-ID: <04ECE8C0-5E67-4160-BE69-701910F4E059@apple.com> On May 13, 2008, at 10:13 AM, Sanjiv.Gupta at microchip.com wrote: > > >> Looks ok for me. But please don't forget about updating >> configure files >> itself. >> > I did not quite get you. Do we need to make changes in any other files > besides the configure? > Yes. You need to modify autoconf/configure.ac and then run autoconf/ AutoRegen.sh to regenerate configure. Check in all changes. -Tanya > TIA, > - Sanjiv > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From lattner at apple.com Tue May 13 15:49:13 2008 From: lattner at apple.com (Tanya Lattner) Date: Tue, 13 May 2008 13:49:13 -0700 Subject: [llvm-commits] [llvm] r51027 - in /llvm/trunk/lib/Target/PIC16: ./ Makefile PIC16.h PIC16.td PIC16AsmPrinter.cpp PIC16CallingConv.td PIC16ConstantPoolValue.cpp PIC16ConstantPoolValue.h PIC16ISelDAGToDAG.cpp PIC16ISelLowering.cpp PIC16ISelLowering.h PIC16InstrFormats.td PIC16InstrInfo.cpp PIC16InstrInfo.h PIC16InstrInfo.td PIC16RegisterInfo.cpp PIC16RegisterInfo.h PIC16RegisterInfo.td PIC16Subtarget.cpp PIC16Subtarget.h PIC16TargetAsmInfo.cpp PIC16TargetAsmInfo.h PIC16TargetMachine.cpp PIC16TargetMachine.h In-Reply-To: <200805130903.m4D930nv014096@zion.cs.uiuc.edu> References: <200805130903.m4D930nv014096@zion.cs.uiuc.edu> Message-ID: <0FCAB36E-5A30-46E8-BCEC-2119F23952EF@apple.com> > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16.h (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16.h Tue May 13 04:02:57 2008 > @@ -0,0 +1,38 @@ > +//===-- PIC16.h - Top-level interface for PIC16 representation -- > *- C++ -*-===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file was developed by Bruno Cardoso Lopes and is > distributed under the > +// University of Illinois Open Source License. See LICENSE.TXT for > details. > +// > +// > ===------------------------------------------------------------------- > ---===// Please remove the name from the header. We no longer store developer names in source files. Use CREDITS.txt. -Tanya > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,569 @@ > +//===-- PIC16AsmPrinter.cpp - PIC16 LLVM assembly writer > ------------------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This file contains a printer that converts from our internal > representation > +// of machine-dependent LLVM code to PIC16 assembly language. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#define DEBUG_TYPE "asm-printer" > +#include "PIC16.h" > +#include "PIC16TargetMachine.h" > +#include "PIC16ConstantPoolValue.h" > +#include "PIC16InstrInfo.h" > +#include "llvm/Constants.h" > +#include "llvm/DerivedTypes.h" > +#include "llvm/Module.h" > +#include "llvm/ADT/SetVector.h" > +#include "llvm/ADT/Statistic.h" > +#include "llvm/ADT/StringExtras.h" > +#include "llvm/CodeGen/AsmPrinter.h" > +#include "llvm/CodeGen/MachineFunctionPass.h" > +#include "llvm/CodeGen/MachineConstantPool.h" > +#include "llvm/CodeGen/MachineFrameInfo.h" > +#include "llvm/CodeGen/MachineInstr.h" > +#include "llvm/Support/CommandLine.h" > +#include "llvm/Support/Debug.h" > +#include "llvm/Support/Mangler.h" > +#include "llvm/Support/MathExtras.h" > +#include "llvm/Target/TargetAsmInfo.h" > +#include "llvm/Target/TargetData.h" > +#include "llvm/Target/TargetMachine.h" > +#include "llvm/Target/TargetOptions.h" > +#include > + > +using namespace llvm; > + > +STATISTIC(EmittedInsts, "Number of machine instrs printed"); > + > +namespace { > + struct VISIBILITY_HIDDEN PIC16AsmPrinter : public AsmPrinter { > + PIC16AsmPrinter(std::ostream &O, TargetMachine &TM, const > TargetAsmInfo *T) > + : AsmPrinter(O, TM, T) { > + } > + > + > + /// We name each basic block in a Function with a unique > number, so > + /// that we can consistently refer to them later. This is cleared > + /// at the beginning of each call to runOnMachineFunction(). > + /// > + typedef std::map ValueMapTy; > + ValueMapTy NumberForBB; > + > + /// Keeps the set of GlobalValues that require non-lazy- > pointers for > + /// indirect access. > + std::set GVNonLazyPtrs; > + > + /// Keeps the set of external function GlobalAddresses that > the asm > + /// printer should generate stubs for. > + std::set FnStubs; > + > + /// True if asm printer is printing a series of CONSTPOOL_ENTRY. > + bool InCPMode; > + > + virtual const char *getPassName() const { > + return "PIC16 Assembly Printer"; > + } > + > + void printOperand(const MachineInstr *MI, int opNum, > + const char *Modifier = 0); > + > + void printSOImmOperand(const MachineInstr *MI, int opNum); > + > + void printAddrModeOperand(const MachineInstr *MI, int OpNo); > + > + void printRegisterList(const MachineInstr *MI, int opNum); > + void printCPInstOperand(const MachineInstr *MI, int opNum, > + const char *Modifier); > + > + > + bool printInstruction(const MachineInstr *MI); // autogenerated. > + void emitFunctionStart(MachineFunction &F); > + bool runOnMachineFunction(MachineFunction &F); > + bool doInitialization(Module &M); > + bool doFinalization(Module &M); > + > + virtual void EmitMachineConstantPoolValue > (MachineConstantPoolValue *MCPV); > + > + void getAnalysisUsage(AnalysisUsage &AU) const; > + > + public: > + void SwitchToTextSection(const char *NewSection, > + const GlobalValue *GV = NULL); > + void SwitchToDataSection(const char *NewSection, > + const GlobalValue *GV = NULL); > + void SwitchToDataOvrSection(const char *NewSection, > + const GlobalValue *GV = NULL); > + }; > +} // end of anonymous namespace > + > +#include "PIC16GenAsmWriter.inc" > + > +/// createPIC16CodePrinterPass - Returns a pass that prints the PIC16 > +/// assembly code for a MachineFunction to the given output stream, > +/// using the given target machine description. This should work > +/// regardless of whether the function is in SSA form. > +/// > +FunctionPass *llvm::createPIC16CodePrinterPass(std::ostream &o, > + PIC16TargetMachine > &tm) { > + return new PIC16AsmPrinter(o, tm, tm.getTargetAsmInfo()); > +} > + > +void PIC16AsmPrinter::getAnalysisUsage(AnalysisUsage &AU) const > +{ > + // Currently unimplemented. > +} > + > + > +void PIC16AsmPrinter :: > +EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) > +{ > + printDataDirective(MCPV->getType()); > + > + PIC16ConstantPoolValue *ACPV = (PIC16ConstantPoolValue*)MCPV; > + GlobalValue *GV = ACPV->getGV(); > + std::string Name = GV ? Mang->getValueName(GV) : TAI- > >getGlobalPrefix(); > + if (!GV) > + Name += ACPV->getSymbol(); > + if (ACPV->isNonLazyPointer()) { > + GVNonLazyPtrs.insert(Name); > + O << TAI->getPrivateGlobalPrefix() << Name << "$non_lazy_ptr"; > + } else if (ACPV->isStub()) { > + FnStubs.insert(Name); > + O << TAI->getPrivateGlobalPrefix() << Name << "$stub"; > + } else > + O << Name; > + if (ACPV->hasModifier()) O << "(" << ACPV->getModifier() << ")"; > + > + if (ACPV->getPCAdjustment() != 0) { > + O << "-(" << TAI->getPrivateGlobalPrefix() << "PC" > + << utostr(ACPV->getLabelId()) > + << "+" << (unsigned)ACPV->getPCAdjustment(); > + > + if (ACPV->mustAddCurrentAddress()) > + O << "-."; > + > + O << ")"; > + } > + O << "\n"; > + > + // If the constant pool value is a extern weak symbol, > remember to emit > + // the weak reference. > + if (GV && GV->hasExternalWeakLinkage()) > + ExtWeakSymbols.insert(GV); > +} > + > +/// Emit the directives used by ASM on the start of functions > +void PIC16AsmPrinter:: emitFunctionStart(MachineFunction &MF) > +{ > + // Print out the label for the function. > + const Function *F = MF.getFunction(); > + MachineFrameInfo *FrameInfo = MF.getFrameInfo(); > + if (FrameInfo->hasStackObjects()) { > + int indexBegin = FrameInfo->getObjectIndexBegin(); > + int indexEnd = FrameInfo->getObjectIndexEnd(); > + while (indexBegin + if (indexBegin ==0) > + SwitchToDataOvrSection(F->getParent()->getModuleIdentifier > ().c_str(), > + F); > + > + O << "\t\t" << CurrentFnName << "_" << indexBegin << " " > << "RES" > + << " " << FrameInfo->getObjectSize(indexBegin) << "\n" ; > + indexBegin++; > + } > + } > + SwitchToTextSection(CurrentFnName.c_str(), F); > + O << "_" << CurrentFnName << ":" ; > + O << "\n"; > +} > + > + > +/// runOnMachineFunction - This uses the printInstruction() > +/// method to print assembly for each instruction. > +/// > +bool PIC16AsmPrinter:: > +runOnMachineFunction(MachineFunction &MF) > +{ > + > + // DW.SetModuleInfo(&getAnalysis()); > + SetupMachineFunction(MF); > + O << "\n"; > + > + // NOTE: we don't print out constant pools here, they are > handled as > + // instructions. > + O << "\n"; > + > + // What's my mangled name? > + CurrentFnName = Mang->getValueName(MF.getFunction()); > + > + // Emit the function start directives > + emitFunctionStart(MF); > + > + // Emit pre-function debug information. > + // DW.BeginFunction(&MF); > + > + // Print out code for the function. > + for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); > + I != E; ++I) { > + // Print a label for the basic block. > + if (I != MF.begin()) { > + printBasicBlockLabel(I, true); > + O << '\n'; > + } > + for (MachineBasicBlock::const_iterator II = I->begin(), E = I- > >end(); > + II != E; ++II) { > + // Print the assembly for the instruction. > + O << '\t'; > + printInstruction(II); > + ++EmittedInsts; > + } > + } > + > + // Emit post-function debug information. > + // DW.EndFunction(); > + > + // We didn't modify anything. > + return false; > +} > + > +void PIC16AsmPrinter:: > +printOperand(const MachineInstr *MI, int opNum, const char *Modifier) > +{ > + const MachineOperand &MO = MI->getOperand(opNum); > + const TargetRegisterInfo &RI = *TM.getRegisterInfo(); > + > + switch (MO.getType()) > + { > + case MachineOperand::MO_Register: > + { > + if (TargetRegisterInfo::isPhysicalRegister(MO.getReg())) > + O << RI.get(MO.getReg()).Name; > + else > + assert(0 && "not implemented"); > + break; > + } > + case MachineOperand::MO_Immediate: > + { > + if (!Modifier || strcmp(Modifier, "no_hash") != 0) > + O << "#"; > + O << (int)MO.getImm(); > + break; > + } > + case MachineOperand::MO_MachineBasicBlock: > + { > + printBasicBlockLabel(MO.getMBB()); > + return; > + } > + case MachineOperand::MO_GlobalAddress: > + { > + O << Mang->getValueName(MO.getGlobal())<<'+'< + break; > + } > + case MachineOperand::MO_ExternalSymbol: > + { > + O << MO.getSymbolName(); > + break; > + } > + case MachineOperand::MO_ConstantPoolIndex: > + { > + O << TAI->getPrivateGlobalPrefix() << "CPI" << > getFunctionNumber() > + << '_' << MO.getIndex(); > + break; > + } > + case MachineOperand::MO_FrameIndex: > + { > + O << "_" << CurrentFnName > + << '+' << MO.getIndex(); > + break; > + } > + case MachineOperand::MO_JumpTableIndex: > + { > + O << TAI->getPrivateGlobalPrefix() << "JTI" << > getFunctionNumber() > + << '_' << MO.getIndex(); > + break; > + } > + default: > + { > + O << ""; abort (); > + break; > + } > + } // end switch. > +} > + > +static void > +printSOImm(std::ostream &O, int64_t V, const TargetAsmInfo *TAI) > +{ > + assert(V < (1 << 12) && "Not a valid so_imm value!"); > + unsigned Imm = V; > + > + O << Imm; > +} > + > +/// printSOImmOperand - SOImm is 4-bit rotate amount in bits 8-11 > with 8-bit > +/// immediate in bits 0-7. > +void PIC16AsmPrinter:: > +printSOImmOperand(const MachineInstr *MI, int OpNum) > +{ > + const MachineOperand &MO = MI->getOperand(OpNum); > + assert(MO.isImmediate() && "Not a valid so_imm value!"); > + printSOImm(O, MO.getImm(), TAI); > +} > + > + > +void PIC16AsmPrinter:: printAddrModeOperand(const MachineInstr > *MI, int Op) > +{ > + const MachineOperand &MO1 = MI->getOperand(Op); > + const MachineOperand &MO2 = MI->getOperand(Op+1); > + > + if (MO2.isFrameIndex ()) { > + printOperand(MI, Op+1); > + return; > + } > + > + if (!MO1.isRegister()) { // FIXME: This is for CP entries, but > isn't right. > + printOperand(MI, Op); > + return; > + } > + > + // If this is Stack Slot > + if (MO1.isRegister()) { > + if(strcmp(TM.getRegisterInfo()->get(MO1.getReg()).Name, "SP")==0) > + { > + O << CurrentFnName <<"_"<< MO2.getImm(); > + return; > + } > + O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).Name; > + O << "+"; > + O << MO2.getImm(); > + O << "]"; > + return; > + } > + > + O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).Name; > + O << "]"; > +} > + > + > +void PIC16AsmPrinter:: printRegisterList(const MachineInstr *MI, > int opNum) > +{ > + O << "{"; > + for (unsigned i = opNum, e = MI->getNumOperands(); i != e; ++i) { > + printOperand(MI, i); > + if (i != e-1) O << ", "; > + } > + O << "}"; > +} > + > +void PIC16AsmPrinter:: > +printCPInstOperand(const MachineInstr *MI, int OpNo, const char > *Modifier) > +{ > + assert(Modifier && "This operand only works with a modifier!"); > + > + // There are two aspects to a CONSTANTPOOL_ENTRY operand, the > label and the > + // data itself. > + if (!strcmp(Modifier, "label")) { > + unsigned ID = MI->getOperand(OpNo).getImm(); > + O << TAI->getPrivateGlobalPrefix() << "CPI" << > getFunctionNumber() > + << '_' << ID << ":\n"; > + } else { > + assert(!strcmp(Modifier, "cpentry") && "Unknown modifier for > CPE"); > + unsigned CPI = MI->getOperand(OpNo).getIndex(); > + > + const MachineConstantPoolEntry &MCPE = // Chasing pointers is > fun? > + MI->getParent()->getParent()->getConstantPool()->getConstants > ()[CPI]; > + > + if (MCPE.isMachineConstantPoolEntry()) > + EmitMachineConstantPoolValue(MCPE.Val.MachineCPVal); > + else { > + EmitGlobalConstant(MCPE.Val.ConstVal); > + // remember to emit the weak reference > + if (const GlobalValue *GV = dyn_cast > (MCPE.Val.ConstVal)) > + if (GV->hasExternalWeakLinkage()) > + ExtWeakSymbols.insert(GV); > + } > + } > +} > + > + > +bool PIC16AsmPrinter:: doInitialization(Module &M) > +{ > + // Emit initial debug information. > + // DW.BeginModule(&M); > + > + bool Result = AsmPrinter::doInitialization(M); > + return Result; > +} > + > +bool PIC16AsmPrinter:: doFinalization(Module &M) > +{ > + const TargetData *TD = TM.getTargetData(); > + > + for (Module::const_global_iterator I = M.global_begin(), E = > M.global_end(); > + I != E; ++I) { > + if (!I->hasInitializer()) // External global require no code > + continue; > + > + if (EmitSpecialLLVMGlobal(I)) { > + continue; > + } > + > + std::string name = Mang->getValueName(I); > + Constant *C = I->getInitializer(); > + const Type *Type = C->getType(); > + unsigned Size = TD->getABITypeSize(Type); > + unsigned Align = TD->getPreferredAlignmentLog(I); > + > + const char *VisibilityDirective = NULL; > + if (I->hasHiddenVisibility()) > + VisibilityDirective = TAI->getHiddenDirective(); > + else if (I->hasProtectedVisibility()) > + VisibilityDirective = TAI->getProtectedDirective(); > + > + if (VisibilityDirective) > + O << VisibilityDirective << name << "\n"; > + > + if (C->isNullValue()) { > + if (I->hasExternalLinkage()) { > + if (const char *Directive = TAI->getZeroFillDirective()) { > + O << "\t.globl\t" << name << "\n"; > + O << Directive << "__DATA__, __common, " << name << ", " > + << Size << ", " << Align << "\n"; > + continue; > + } > + } > + > + if (!I->hasSection() && > + (I->hasInternalLinkage() || I->hasWeakLinkage() || > + I->hasLinkOnceLinkage())) { > + if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, > avoid it. > + if (!NoZerosInBSS && TAI->getBSSSection()) > + SwitchToDataSection(M.getModuleIdentifier().c_str(), I); > + else > + SwitchToDataSection(TAI->getDataSection(), I); > + if (TAI->getLCOMMDirective() != NULL) { > + if (I->hasInternalLinkage()) { > + O << TAI->getLCOMMDirective() << name << "," << Size; > + } else > + O << TAI->getCOMMDirective() << name << "," << Size; > + } else { > + if (I->hasInternalLinkage()) > + O << "\t.local\t" << name << "\n"; > + > + O << TAI->getCOMMDirective() <<"\t" << name << " " > <<"RES"<< " " > + << Size; > + O << "\n\t\tGLOBAL" <<" "<< name; > + if (TAI->getCOMMDirectiveTakesAlignment()) > + O << "," << (TAI->getAlignmentIsInBytes() ? (1 << > Align) : Align); > + } > + continue; > + } > + } > + > + switch (I->getLinkage()) > + { > + case GlobalValue::AppendingLinkage: > + { > + // FIXME: appending linkage variables should go into a > section of > + // their name or something. For now, just emit them as > external. > + // Fall through > + } > + case GlobalValue::ExternalLinkage: > + { > + O << "\t.globl " << name << "\n"; > + // FALL THROUGH > + } > + case GlobalValue::InternalLinkage: > + { > + if (I->isConstant()) { > + const ConstantArray *CVA = dyn_cast(C); > + if (TAI->getCStringSection() && CVA && CVA->isCString()) { > + SwitchToDataSection(TAI->getCStringSection(), I); > + break; > + } > + } > + break; > + } > + default: > + { > + assert(0 && "Unknown linkage type!"); > + break; > + } > + } // end switch. > + > + EmitAlignment(Align, I); > + O << name << ":\t\t\t\t" << TAI->getCommentString() << " " << > I->getName() > + << "\n"; > + > + // If the initializer is a extern weak symbol, remember to > emit the weak > + // reference! > + if (const GlobalValue *GV = dyn_cast(C)) > + if (GV->hasExternalWeakLinkage()) > + ExtWeakSymbols.insert(GV); > + > + EmitGlobalConstant(C); > + O << '\n'; > + } // end for. > + > + O << "\n "<< "END"; > + return AsmPrinter::doFinalization(M); > +} > + > +void PIC16AsmPrinter:: > +SwitchToTextSection(const char *NewSection, const GlobalValue *GV) > +{ > + O << "\n"; > + if (NewSection && *NewSection) { > + std::string codeSection = "code_"; > + codeSection += NewSection; > + codeSection += " "; > + codeSection += "CODE"; > + AsmPrinter::SwitchToTextSection(codeSection.c_str(),GV); > + } > + else > + AsmPrinter::SwitchToTextSection(NewSection,GV); > +} > + > +void PIC16AsmPrinter:: > +SwitchToDataSection(const char *NewSection, const GlobalValue *GV) > +{ > + //Need to append index for page > + O << "\n"; > + if (NewSection && *NewSection) { > + std::string dataSection ="udata_"; > + dataSection+=NewSection; > + if (dataSection.substr(dataSection.length()-2).compare(".o") > == 0) { > + dataSection = dataSection.substr(0,dataSection.length()-2); > + } > + dataSection += " "; > + dataSection += "UDATA"; > + AsmPrinter::SwitchToDataSection(dataSection.c_str(),GV); > + } > + else > + AsmPrinter::SwitchToDataSection(NewSection,GV); > +} > + > +void PIC16AsmPrinter:: > +SwitchToDataOvrSection(const char *NewSection, const GlobalValue *GV) > +{ > + O << "\n"; > + if (NewSection && *NewSection) { > + std::string dataSection = "frame_"; > + dataSection += NewSection; > + if (dataSection.substr(dataSection.length()-2).compare(".o") > == 0) { > + dataSection = dataSection.substr(0,dataSection.length()-2); > + } > + dataSection += "_"; > + dataSection += CurrentFnName; > + dataSection += " "; > + dataSection += "UDATA_OVR"; > + AsmPrinter::SwitchToDataSection(dataSection.c_str(),GV); > + } > + else > + AsmPrinter::SwitchToDataSection(NewSection,GV); > +} > > Added: llvm/trunk/lib/Target/PIC16/PIC16CallingConv.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16CallingConv.td?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16CallingConv.td (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16CallingConv.td Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,17 @@ > +//===- PIC16CallingConv.td - Calling Conventions Sparc -----*- > tablegen -*-===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This describes the calling conventions for the PIC16 > architectures. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +// > ===------------------------------------------------------------------- > ---===// > +// Return Value Calling Conventions > +// > ===------------------------------------------------------------------- > ---===// > + > > Added: llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16ConstantPoolValue.cpp?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.cpp (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.cpp Tue May > 13 04:02:57 2008 > @@ -0,0 +1,88 @@ > +//===- PIC16ConstantPoolValue.cpp - PIC16 constantpool value > --------------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This file implements the PIC16 specific constantpool value class. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#include "PIC16ConstantPoolValue.h" > +#include "llvm/ADT/FoldingSet.h" > +#include "llvm/GlobalValue.h" > +#include "llvm/Type.h" > +using namespace llvm; > + > +PIC16ConstantPoolValue::PIC16ConstantPoolValue(GlobalValue *gv, > unsigned id, > + > PIC16CP::PIC16CPKind k, > + unsigned char PCAdj, > + const char *Modif, > bool AddCA) > + : MachineConstantPoolValue((const Type*)gv->getType()), > + GV(gv), S(NULL), LabelId(id), Kind(k), PCAdjust(PCAdj), > + Modifier(Modif), AddCurrentAddress(AddCA) {} > + > +PIC16ConstantPoolValue::PIC16ConstantPoolValue(const char *s, > unsigned id, > + > PIC16CP::PIC16CPKind k, > + unsigned char PCAdj, > + const char *Modif, > bool AddCA) > + : MachineConstantPoolValue((const Type*)Type::Int32Ty), > + GV(NULL), S(s), LabelId(id), Kind(k), PCAdjust(PCAdj), > + Modifier(Modif), AddCurrentAddress(AddCA) {} > + > +PIC16ConstantPoolValue::PIC16ConstantPoolValue(GlobalValue *gv, > + > PIC16CP::PIC16CPKind k, > + const char *Modif) > + : MachineConstantPoolValue((const Type*)Type::Int32Ty), > + GV(gv), S(NULL), LabelId(0), Kind(k), PCAdjust(0), > + Modifier(Modif) {} > + > +int PIC16ConstantPoolValue::getExistingMachineCPValue > (MachineConstantPool *CP, > + unsigned > Alignment) { > + unsigned AlignMask = (1 << Alignment)-1; > + const std::vector Constants = CP- > >getConstants(); > + for (unsigned i = 0, e = Constants.size(); i != e; ++i) { > + if (Constants[i].isMachineConstantPoolEntry() && > + (Constants[i].Offset & AlignMask) == 0) { > + PIC16ConstantPoolValue *CPV = > + (PIC16ConstantPoolValue *)Constants[i].Val.MachineCPVal; > + if (CPV->GV == GV && > + CPV->S == S && > + CPV->LabelId == LabelId && > + CPV->Kind == Kind && > + CPV->PCAdjust == PCAdjust) > + return i; > + } > + } > + > + return -1; > +} > + > +void > +PIC16ConstantPoolValue::AddSelectionDAGCSEId(FoldingSetNodeID &ID) { > + ID.AddPointer(GV); > + ID.AddPointer(S); > + ID.AddInteger(LabelId); > + ID.AddInteger((unsigned)Kind); > + ID.AddInteger(PCAdjust); > +} > + > +void PIC16ConstantPoolValue::print(std::ostream &O) const { > + if (GV) > + O << GV->getName(); > + else > + O << S; > + if (isNonLazyPointer()) O << "$non_lazy_ptr"; > + else if (isStub()) O << "$stub"; > + if (Modifier) O << "(" << Modifier << ")"; > + if (PCAdjust != 0) { > + O << "-(LPIC" << LabelId << "+" > + << (unsigned)PCAdjust; > + if (AddCurrentAddress) > + O << "-."; > + O << ")"; > + } > +} > > Added: llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16ConstantPoolValue.h?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.h (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.h Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,75 @@ > +//===- PIC16ConstantPoolValue.h - PIC16 constantpool value ------ > *- C++ -*-===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This file implements the PIC16 specific constantpool value class. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#ifndef LLVM_TARGET_PIC16_CONSTANTPOOLVALUE_H > +#define LLVM_TARGET_PIC16_CONSTANTPOOLVALUE_H > + > +#include "llvm/CodeGen/MachineConstantPool.h" > + > +namespace llvm { > + > +namespace PIC16CP { > + enum PIC16CPKind { > + CPValue, > + CPNonLazyPtr, > + CPStub > + }; > +} > + > +/// PIC16ConstantPoolValue - PIC16 specific constantpool value. > This is used to > +/// represent PC relative displacement between the address of the > load > +/// instruction and the global value being loaded, i.e. (&GV-(LPIC > +8)). > +class PIC16ConstantPoolValue : public MachineConstantPoolValue { > + GlobalValue *GV; // GlobalValue being loaded. > + const char *S; // ExtSymbol being loaded. > + unsigned LabelId; // Label id of the load. > + PIC16CP::PIC16CPKind Kind; // non_lazy_ptr or stub? > + unsigned char PCAdjust; // Extra adjustment if constantpool is > pc relative. > + // 8 for PIC16 > + const char *Modifier; // GV modifier i.e. (&GV(modifier)-(LPIC > +8)) > + bool AddCurrentAddress; > + > +public: > + PIC16ConstantPoolValue(GlobalValue *gv, unsigned id, > + PIC16CP::PIC16CPKind Kind = PIC16CP::CPValue, > + unsigned char PCAdj = 0, const char > *Modifier = NULL, > + bool AddCurrentAddress = false); > + PIC16ConstantPoolValue(const char *s, unsigned id, > + PIC16CP::PIC16CPKind Kind = PIC16CP::CPValue, > + unsigned char PCAdj = 0, const char > *Modifier = NULL, > + bool AddCurrentAddress = false); > + PIC16ConstantPoolValue(GlobalValue *GV, PIC16CP::PIC16CPKind Kind, > + const char *Modifier); > + > + > + GlobalValue *getGV() const { return GV; } > + const char *getSymbol() const { return S; } > + const char *getModifier() const { return Modifier; } > + bool hasModifier() const { return Modifier != NULL; } > + bool mustAddCurrentAddress() const { return AddCurrentAddress; } > + unsigned getLabelId() const { return LabelId; } > + bool isNonLazyPointer() const { return Kind == > PIC16CP::CPNonLazyPtr; } > + bool isStub() const { return Kind == PIC16CP::CPStub; } > + unsigned char getPCAdjustment() const { return PCAdjust; } > + > + virtual int getExistingMachineCPValue(MachineConstantPool *CP, > + unsigned Alignment); > + > + virtual void AddSelectionDAGCSEId(FoldingSetNodeID &ID); > + > + virtual void print(std::ostream &O) const; > +}; > + > +} > + > +#endif > > Added: llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16ISelDAGToDAG.cpp?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,291 @@ > +//===-- PIC16ISelDAGToDAG.cpp - A dag to dag inst selector for > PIC16 ------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This file defines an instruction selector for the PIC16 target. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#define DEBUG_TYPE "pic16-isel" > + > +#include "PIC16.h" > +#include "PIC16ISelLowering.h" > +#include "PIC16RegisterInfo.h" > +#include "PIC16Subtarget.h" > +#include "PIC16TargetMachine.h" > +#include "llvm/GlobalValue.h" > +#include "llvm/Instructions.h" > +#include "llvm/Intrinsics.h" > +#include "llvm/Type.h" > +#include "llvm/CodeGen/MachineConstantPool.h" > +#include "llvm/CodeGen/MachineFunction.h" > +#include "llvm/CodeGen/MachineFrameInfo.h" > +#include "llvm/CodeGen/MachineInstrBuilder.h" > +#include "llvm/CodeGen/SelectionDAGISel.h" > +#include "llvm/CodeGen/SelectionDAGNodes.h" > +#include "llvm/Support/CFG.h" > +#include "llvm/Support/Compiler.h" > +#include "llvm/Support/Debug.h" > +#include "llvm/Target/TargetMachine.h" > +#include > +#include > + > +using namespace llvm; > + > +// > ===------------------------------------------------------------------- > ---===// > +// Instruction Selector Implementation > +// > ===------------------------------------------------------------------- > ---===// > + > +// > ===------------------------------------------------------------------- > ---===// > +// PIC16DAGToDAGISel - PIC16 specific code to select PIC16 machine > +// instructions for SelectionDAG operations. > +// > ===------------------------------------------------------------------- > ---===// > +namespace { > + > +class VISIBILITY_HIDDEN PIC16DAGToDAGISel : public SelectionDAGISel { > + > + /// TM - Keep a reference to PIC16TargetMachine. > + PIC16TargetMachine &TM; > + > + /// PIC16Lowering - This object fully describes how to lower > LLVM code to an > + /// PIC16-specific SelectionDAG. > + PIC16TargetLowering PIC16Lowering; > + > + /// Subtarget - Keep a pointer to the PIC16Subtarget around so > that we can > + /// make the right decision when generating code for different > targets. > + //TODO: add initialization on constructor > + //const PIC16Subtarget *Subtarget; > + > +public: > + PIC16DAGToDAGISel(PIC16TargetMachine &tm) : > + SelectionDAGISel(PIC16Lowering), > + TM(tm), PIC16Lowering(*TM.getTargetLowering()) {} > + > + virtual void InstructionSelectBasicBlock(SelectionDAG &SD); > + > + // Pass Name > + virtual const char *getPassName() const { > + return "PIC16 DAG->DAG Pattern Instruction Selection"; > + } > + > +private: > + // Include the pieces autogenerated from the target description. > + #include "PIC16GenDAGISel.inc" > + > + SDNode *Select(SDOperand N); > + > + // Select addressing mode. currently assume base + offset addr > mode. > + bool SelectAM(SDOperand Op, SDOperand N, SDOperand &Base, > SDOperand &Offset); > + bool SelectDirectAM(SDOperand Op, SDOperand N, SDOperand &Base, > + SDOperand &Offset); > + bool StoreInDirectAM(SDOperand Op, SDOperand N, SDOperand &fsr); > + bool LoadFSR(SDOperand Op, SDOperand N, SDOperand &Base, > SDOperand &Offset); > + bool LoadNothing(SDOperand Op, SDOperand N, SDOperand &Base, > + SDOperand &Offset); > + > + // getI8Imm - Return a target constant with the specified > + // value, of type i8. > + inline SDOperand getI8Imm(unsigned Imm) { > + return CurDAG->getTargetConstant(Imm, MVT::i8); > + } > + > + > + #ifndef NDEBUG > + unsigned Indent; > + #endif > +}; > + > +} > + > +/// InstructionSelectBasicBlock - This callback is invoked by > +/// SelectionDAGISel when it has created a SelectionDAG for us to > codegen. > +void PIC16DAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &SD) > +{ > + DEBUG(BB->dump()); > + // Codegen the basic block. > + #ifndef NDEBUG > + DOUT << "===== Instruction selection begins:\n"; > + Indent = 0; > + #endif > + > + // Select target instructions for the DAG. > + SD.setRoot(SelectRoot(SD.getRoot())); > + > + #ifndef NDEBUG > + DOUT << "===== Instruction selection ends:\n"; > + #endif > + > + SD.RemoveDeadNodes(); > + > + // Emit machine code to BB. > + ScheduleAndEmitDAG(SD); > +} > + > + > +bool PIC16DAGToDAGISel:: > +SelectDirectAM (SDOperand Op, SDOperand N, SDOperand &Base, > SDOperand &Offset) > +{ > + GlobalAddressSDNode *GA; > + ConstantSDNode *GC; > + > + // if Address is FI, get the TargetFrameIndex. > + if (FrameIndexSDNode *FIN = dyn_cast(N)) { > + cout << "--------- its frame Index\n"; > + Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32); > + Offset = CurDAG->getTargetConstant(0, MVT::i32); > + return true; > + } > + > + if (N.getOpcode() == ISD::GlobalAddress) { > + GA = dyn_cast(N); > + Offset = CurDAG->getTargetConstant((unsigned char)GA->getOffset > (), MVT::i8); > + Base = CurDAG->getTargetGlobalAddress(GA->getGlobal(), MVT::i16, > + GA->getOffset()); > + return true; > + } > + > + if (N.getOpcode() == ISD::ADD) { > + GC = dyn_cast(N.getOperand(1)); > + Offset = CurDAG->getTargetConstant((unsigned char)GC->getValue > (), MVT::i8); > + if ((GA = dyn_cast(N.getOperand(0)))) { > + Base = CurDAG->getTargetGlobalAddress(GA->getGlobal(), > MVT::i16, > + GC->getValue()); > + return true; > + } > + else if (FrameIndexSDNode *FIN > + = dyn_cast(N.getOperand(0))) { > + Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32); > + return true; > + } > + } > + > + return false; > +} > + > + > +//FIXME: must also account for preinc/predec/postinc/postdec > +bool PIC16DAGToDAGISel:: > +StoreInDirectAM (SDOperand Op, SDOperand N, SDOperand &fsr) > +{ > + RegisterSDNode *Reg; > + if (N.getOpcode() == ISD::LOAD) { > + LoadSDNode *LD = dyn_cast(N); > + if (LD) { > + fsr = LD->getBasePtr(); > + } > + else if (isa(N.Val)) { > + //FIXME an attempt to retrieve the register number > + //but does not work > + cout << "this is a register\n"; > + Reg = dyn_cast(N.Val); > + fsr = CurDAG->getRegister(Reg->getReg(),MVT::i16); > + } > + else { > + cout << "this is not a register\n"; > + // FIXME must use whatever load is using > + fsr = CurDAG->getRegister(1,MVT::i16); > + } > + return true; > + } > + return false; > +} > + > +bool PIC16DAGToDAGISel:: > +LoadFSR (SDOperand Op, SDOperand N, SDOperand &Base, SDOperand > &Offset) > +{ > + GlobalAddressSDNode *GA; > + > + if (N.getOpcode() == ISD::GlobalAddress) { > + GA = dyn_cast(N); > + Offset = CurDAG->getTargetConstant((unsigned char)GA->getOffset > (), MVT::i8); > + Base = CurDAG->getTargetGlobalAddress(GA->getGlobal(), MVT::i16, > + GA->getOffset()); > + return true; > + } > + else if (N.getOpcode() == PIC16ISD::Package) { > + CurDAG->setGraphColor(Op.Val, "blue"); > + CurDAG->viewGraph(); > + } > + > + return false; > +} > + > +//don't thake this seriously, it will change > +bool PIC16DAGToDAGISel:: > +LoadNothing (SDOperand Op, SDOperand N, SDOperand &Base, SDOperand > &Offset) > +{ > + GlobalAddressSDNode *GA; > + if (N.getOpcode() == ISD::GlobalAddress) { > + GA = dyn_cast(N); > + cout << "==========" << GA->getOffset() << "\n"; > + Offset = CurDAG->getTargetConstant((unsigned char)GA->getOffset > (), MVT::i8); > + Base = CurDAG->getTargetGlobalAddress(GA->getGlobal(), MVT::i16, > + GA->getOffset()); > + return true; > + } > + > + return false; > +} > + > + > +/// Select instructions not customized! Used for > +/// expanded, promoted and normal instructions > +SDNode* PIC16DAGToDAGISel::Select(SDOperand N) > +{ > + SDNode *Node = N.Val; > + unsigned Opcode = Node->getOpcode(); > + > + // Dump information about the Node being selected > + #ifndef NDEBUG > + DOUT << std::string(Indent, ' ') << "Selecting: "; > + DEBUG(Node->dump(CurDAG)); > + DOUT << "\n"; > + Indent += 2; > + #endif > + > + // If we have a custom node, we already have selected! > + if (Opcode >= ISD::BUILTIN_OP_END && Opcode < > PIC16ISD::FIRST_NUMBER) { > + #ifndef NDEBUG > + DOUT << std::string(Indent-2, ' ') << "== "; > + DEBUG(Node->dump(CurDAG)); > + DOUT << "\n"; > + Indent -= 2; > + #endif > + return NULL; > + } > + > + /// > + // Instruction Selection not handled by custom or by the > + // auto-generated tablegen selection should be handled here. > + /// > + switch(Opcode) { > + default: break; > + } > + > + // Select the default instruction. > + SDNode *ResNode = SelectCode(N); > + > + #ifndef NDEBUG > + DOUT << std::string(Indent-2, ' ') << "=> "; > + if (ResNode == NULL || ResNode == N.Val) > + DEBUG(N.Val->dump(CurDAG)); > + else > + DEBUG(ResNode->dump(CurDAG)); > + DOUT << "\n"; > + Indent -= 2; > + #endif > + > + return ResNode; > +} > + > +/// createPIC16ISelDag - This pass converts a legalized DAG into a > +/// PIC16-specific DAG, ready for instruction scheduling. > +FunctionPass *llvm::createPIC16ISelDag(PIC16TargetMachine &TM) { > + return new PIC16DAGToDAGISel(TM); > +} > + > > Added: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16ISelLowering.cpp?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,801 @@ > +//===-- PIC16ISelLowering.cpp - PIC16 DAG Lowering Implementation > ---------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This file defines the interfaces that PIC16 uses to lower LLVM > code into a > +// selection DAG. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#define DEBUG_TYPE "pic16-lower" > + > +#include "PIC16ISelLowering.h" > +#include "PIC16TargetMachine.h" > +#include "llvm/DerivedTypes.h" > +#include "llvm/Function.h" > +#include "llvm/Intrinsics.h" > +#include "llvm/CallingConv.h" > +#include "llvm/CodeGen/CallingConvLower.h" > +#include "llvm/CodeGen/MachineFrameInfo.h" > +#include "llvm/CodeGen/MachineFunction.h" > +#include "llvm/CodeGen/MachineInstrBuilder.h" > +#include "llvm/CodeGen/MachineRegisterInfo.h" > +#include "llvm/CodeGen/SelectionDAGISel.h" > +#include "llvm/CodeGen/ValueTypes.h" > +#include "llvm/Support/Debug.h" > +#include > +#include > + > +using namespace llvm; > + > +const char *PIC16TargetLowering:: getTargetNodeName(unsigned > Opcode) const > +{ > + switch (Opcode) > + { > + case PIC16ISD::Hi : return "PIC16ISD::Hi"; > + case PIC16ISD::Lo : return "PIC16ISD::Lo"; > + case PIC16ISD::Package : return "PIC16ISD::Package"; > + case PIC16ISD::Wrapper : return "PIC16ISD::Wrapper"; > + case PIC16ISD::SetBank : return "PIC16ISD::SetBank"; > + case PIC16ISD::SetPage : return "PIC16ISD::SetPage"; > + case PIC16ISD::Branch : return "PIC16ISD::Branch"; > + case PIC16ISD::Cmp : return "PIC16ISD::Cmp"; > + case PIC16ISD::BTFSS : return "PIC16ISD::BTFSS"; > + case PIC16ISD::BTFSC : return "PIC16ISD::BTFSC"; > + case PIC16ISD::XORCC : return "PIC16ISD::XORCC"; > + case PIC16ISD::SUBCC : return "PIC16ISD::SUBCC"; > + default : return NULL; > + } > +} > + > +PIC16TargetLowering:: > +PIC16TargetLowering(PIC16TargetMachine &TM): TargetLowering(TM) > +{ > + // PIC16 does not have i1 type, so use i8 for > + // setcc operations results (slt, sgt, ...). > + // setSetCCResultType(MVT::i8); > + // setSetCCResultContents(ZeroOrOneSetCCResult); > + > + // Set up the register classes > + addRegisterClass(MVT::i8, PIC16::CPURegsRegisterClass); > + addRegisterClass(MVT::i16, PIC16::PTRRegsRegisterClass); > + // Custom > + > + // Load extented operations for i1 types must be promoted > + setLoadXAction(ISD::EXTLOAD, MVT::i1, Promote); > + setLoadXAction(ISD::ZEXTLOAD, MVT::i1, Promote); > + setLoadXAction(ISD::SEXTLOAD, MVT::i1, Promote); > + > + // Store operations for i1 types must be promoted > + // setStoreXAction(MVT::i1, Promote); > + // setStoreXAction(MVT::i8, Legal); > + // setStoreXAction(MVT::i16, Custom); > + // setStoreXAction(MVT::i32, Expand); > + > + // setOperationAction(ISD::BUILD_PAIR, MVT::i32, Expand); > + // setOperationAction(ISD::BUILD_PAIR, MVT::i16, Expand); > + > + setOperationAction(ISD::ADD, MVT::i1, Promote); > + setOperationAction(ISD::ADD, MVT::i8, Legal); > + setOperationAction(ISD::ADD, MVT::i16, Custom); > + setOperationAction(ISD::ADD, MVT::i32, Expand); > + setOperationAction(ISD::ADD, MVT::i64, Expand); > + > + setOperationAction(ISD::SUB, MVT::i1, Promote); > + setOperationAction(ISD::SUB, MVT::i8, Legal); > + setOperationAction(ISD::SUB, MVT::i16, Custom); > + setOperationAction(ISD::SUB, MVT::i32, Expand); > + setOperationAction(ISD::SUB, MVT::i64, Expand); > + > + setOperationAction(ISD::ADDC, MVT::i1, Promote); > + setOperationAction(ISD::ADDC, MVT::i8, Legal); > + setOperationAction(ISD::ADDC, MVT::i16, Custom); > + setOperationAction(ISD::ADDC, MVT::i32, Expand); > + setOperationAction(ISD::ADDC, MVT::i64, Expand); > + > + setOperationAction(ISD::ADDE, MVT::i1, Promote); > + setOperationAction(ISD::ADDE, MVT::i8, Legal); > + setOperationAction(ISD::ADDE, MVT::i16, Custom); > + setOperationAction(ISD::ADDE, MVT::i32, Expand); > + setOperationAction(ISD::ADDE, MVT::i64, Expand); > + > + setOperationAction(ISD::SUBC, MVT::i1, Promote); > + setOperationAction(ISD::SUBC, MVT::i8, Legal); > + setOperationAction(ISD::SUBC, MVT::i16, Custom); > + setOperationAction(ISD::SUBC, MVT::i32, Expand); > + setOperationAction(ISD::SUBC, MVT::i64, Expand); > + > + setOperationAction(ISD::SUBE, MVT::i1, Promote); > + setOperationAction(ISD::SUBE, MVT::i8, Legal); > + setOperationAction(ISD::SUBE, MVT::i16, Custom); > + setOperationAction(ISD::SUBE, MVT::i32, Expand); > + setOperationAction(ISD::SUBE, MVT::i64, Expand); > + > + // PIC16 does not have these NodeTypes below. > + setOperationAction(ISD::SETCC, MVT::i1, Expand); > + setOperationAction(ISD::SETCC, MVT::i8, Expand); > + setOperationAction(ISD::SETCC, MVT::Other, Expand); > + setOperationAction(ISD::SELECT_CC, MVT::i1, Custom); > + setOperationAction(ISD::SELECT_CC, MVT::i8, Custom); > + > + setOperationAction(ISD::BRCOND, MVT::i1, Expand); > + setOperationAction(ISD::BRCOND, MVT::i8, Expand); > + setOperationAction(ISD::BRCOND, MVT::Other, Expand); > + setOperationAction(ISD::BR_CC, MVT::i1, Custom); > + setOperationAction(ISD::BR_CC, MVT::i8, Custom); > + > + setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand); > + > + > + // Do we really need to Custom lower the GA ?? > + // setOperationAction(ISD::GlobalAddress, MVT::i16, Custom); > + setOperationAction(ISD::GlobalAddress, MVT::i8, Custom); > + setOperationAction(ISD::RET, MVT::Other, Custom); > + > + // PIC16 not supported intrinsics. > + // setOperationAction(ISD::MEMMOVE, MVT::Other, Expand); > + // setOperationAction(ISD::MEMSET, MVT::Other, Expand); > + // setOperationAction(ISD::MEMCPY, MVT::Other, Expand); > + > + setOperationAction(ISD::CTPOP, MVT::i32, Expand); > + setOperationAction(ISD::CTTZ , MVT::i32, Expand); > + setOperationAction(ISD::CTLZ , MVT::i32, Expand); > + setOperationAction(ISD::ROTL , MVT::i32, Expand); > + setOperationAction(ISD::ROTR , MVT::i32, Expand); > + setOperationAction(ISD::BSWAP, MVT::i32, Expand); > + > + setOperationAction(ISD::SHL_PARTS, MVT::i32, Expand); > + setOperationAction(ISD::SRA_PARTS, MVT::i32, Expand); > + setOperationAction(ISD::SRL_PARTS, MVT::i32, Expand); > + > + // We don't have line number support yet. > + setOperationAction(ISD::LOCATION, MVT::Other, Expand); > + setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); > + setOperationAction(ISD::LABEL, MVT::Other, Expand); > + > + // Use the default for now > + setOperationAction(ISD::STACKSAVE, MVT::Other, Expand); > + setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand); > + > + setOperationAction(ISD::LOAD, MVT::i1, Promote); > + setOperationAction(ISD::LOAD, MVT::i8, Legal); > + // setOperationAction(ISD::LOAD, MVT::i16, Expand); > + // setOperationAction(ISD::LOAD, MVT::i32, Expand); > + > + setTargetDAGCombine(ISD::LOAD); > + setTargetDAGCombine(ISD::STORE); > + setTargetDAGCombine(ISD::ADDE); > + setTargetDAGCombine(ISD::ADDC); > + setTargetDAGCombine(ISD::ADD); > + setTargetDAGCombine(ISD::SUBE); > + setTargetDAGCombine(ISD::SUBC); > + setTargetDAGCombine(ISD::SUB); > + > + // We must find a way to get rid of Package nodes in the map > + // setTargetDAGCombine(PIC16ISD::Package); > + > + // getValueTypeActions().setTypeAction((MVT::ValueType)MVT::i16, > Expand); > + > + setStackPointerRegisterToSaveRestore(PIC16::STKPTR); > + computeRegisterProperties(); > +} > + > + > +SDOperand PIC16TargetLowering:: LowerOperation(SDOperand Op, > SelectionDAG &DAG) > +{ > + SDVTList VTList16 = DAG.getVTList(MVT::i16, MVT::i16, MVT::Other); > + switch (Op.getOpcode()) > + { > + case ISD::STORE: > + cout << "reduce store\n"; > + break; > + case ISD::FORMAL_ARGUMENTS: > + cout<<"==== lowering formal args\n"; > + return LowerFORMAL_ARGUMENTS(Op, DAG); > + case ISD::GlobalAddress: > + cout<<"==== lowering GA\n"; > + return LowerGlobalAddress(Op, DAG); > + case ISD::RET: > + cout<<"==== lowering ret\n"; > + return LowerRET(Op, DAG); > + case ISD::FrameIndex: > + cout<<"==== lowering frame index\n"; > + return LowerFrameIndex(Op, DAG); > + case ISD::ADDE: > + cout <<"==== lowering adde\n"; > + break; > + case ISD::LOAD: > + case ISD::ADD: > + break; > + case ISD::BR_CC: > + cout << "==== lowering BR_CC\n"; > + return LowerBR_CC(Op, DAG); > + } //end swithch > + return SDOperand(); > +} > + > + > +// > ===------------------------------------------------------------------- > ---===// > +// Lower helper functions > +// > ===------------------------------------------------------------------- > ---===// > + > + > +SDOperand > +PIC16TargetLowering::LowerBR_CC(SDOperand Op, SelectionDAG &DAG) > +{ > + MVT::ValueType VT = Op.getValueType(); > + SDOperand Chain = Op.getOperand(0); > + ISD::CondCode CC = cast(Op.getOperand(1))->get(); > + SDOperand LHS = Op.getOperand(2); > + SDOperand RHS = Op.getOperand(3); > + SDOperand JumpVal = Op.getOperand(4); > + SDOperand Result; > + unsigned cmpOpcode; > + unsigned branchOpcode; > + SDOperand branchOperand; > + > + SDOperand StatusReg = DAG.getRegister(PIC16::STATUSREG,MVT::i8); > + SDOperand CPUReg = DAG.getRegister(PIC16::WREG,MVT::i8); > + switch(CC) > + { > + default: > + assert(0 && "This condition code is not handled yet!!"); > + abort(); > + case ISD::SETNE: > + { > + cout << "setne\n"; > + cmpOpcode = PIC16ISD::XORCC; > + branchOpcode = PIC16ISD::BTFSS; > + branchOperand = DAG.getConstant(2,MVT::i8); > + break; > + } > + case ISD::SETEQ: > + { > + cout << "seteq\n"; > + cmpOpcode = PIC16ISD::XORCC; > + branchOpcode = PIC16ISD::BTFSC; > + branchOperand = DAG.getConstant(2,MVT::i8); > + break; > + } > + case ISD::SETGT: > + { > + assert(0 && "Greater Than condition code is not handled > yet!!"); > + abort(); > + } > + case ISD::SETGE: > + { > + cout << "setge\n"; > + cmpOpcode = PIC16ISD::SUBCC; > + branchOpcode = PIC16ISD::BTFSS; > + branchOperand = DAG.getConstant(1, MVT::i8); > + break; > + } > + case ISD::SETLT: > + { > + cout << "setlt\n"; > + cmpOpcode = PIC16ISD::SUBCC; > + branchOpcode = PIC16ISD::BTFSC; > + branchOperand = DAG.getConstant(1,MVT::i8); > + break; > + } > + case ISD::SETLE: > + { > + assert(0 && "Less Than Equal condition code is not handled > yet!!"); > + abort(); > + } > + } // End of Switch > + > + SDVTList VTList = DAG.getVTList(MVT::i8, MVT::Flag); > + SDOperand CmpValue = DAG.getNode(cmpOpcode, VTList, LHS, > RHS).getValue(1); > + // SDOperand CCOper = DAG.getConstant(CC,MVT::i8); > + // Result = DAG.getNode(branchOpcode,VT, Chain, JumpVal, > CCOper, StatusReg, > + // CmpValue); > + Result = DAG.getNode(branchOpcode, VT, Chain, JumpVal, > branchOperand, > + StatusReg, CmpValue); > + return Result; > + > + // return SDOperand(); > +} > + > + > +// > ===------------------------------------------------------------------- > ---===// > +// Misc Lower Operation implementation > +// > ===------------------------------------------------------------------- > ---===// > +// Create a constant pool entry for global value and wrap it in a > wrapper node. > +SDOperand > +PIC16TargetLowering::LowerGlobalAddress(SDOperand Op, SelectionDAG > &DAG) > +{ > + MVT::ValueType PtrVT = getPointerTy(); > + GlobalAddressSDNode *GSDN = cast(Op); > + GlobalValue *GV = GSDN->getGlobal(); > + > + //for now only do the ram. > + SDOperand CPAddr = DAG.getTargetConstantPool(GV, PtrVT, 2); > + SDOperand CPBank = DAG.getNode(PIC16ISD::SetBank, MVT::i8, CPAddr); > + CPAddr = DAG.getNode(PIC16ISD::Wrapper, MVT::i8, CPAddr,CPBank); > + > + return CPAddr; > +} > + > +SDOperand > +PIC16TargetLowering::LowerRET(SDOperand Op, SelectionDAG &DAG) > +{ > + switch(Op.getNumOperands()) > + { > + default: > + assert(0 && "Do not know how to return this many arguments!"); > + abort(); > + case 1: > + return SDOperand(); // ret void is legal > + } > +} > + > +SDOperand > +PIC16TargetLowering::LowerFrameIndex(SDOperand N, SelectionDAG &DAG) > +{ > + if (FrameIndexSDNode *FIN = dyn_cast(N)) { > + return DAG.getTargetFrameIndex(FIN->getIndex(), MVT::i32); > + } > + > + return N; > +} > + > +SDOperand > +PIC16TargetLowering::LowerLOAD(SDNode *N, > + SelectionDAG &DAG, > + DAGCombinerInfo &DCI) const > +{ > + SDOperand Outs[2]; > + SDOperand TF; //TokenFactor > + SDOperand OutChains[2]; > + SDOperand Chain = N->getOperand(0); > + SDOperand Src = N->getOperand(1); > + SDOperand retVal; > + SDVTList VTList; > + > + // If this load is directly stored, replace the load value with > the stored > + // value. > + // TODO: Handle store large -> read small portion. > + // TODO: Handle TRUNCSTORE/LOADEXT > + LoadSDNode *LD = cast(N); > + SDOperand Ptr = LD->getBasePtr(); > + if (LD->getExtensionType() == ISD::NON_EXTLOAD) { > + if (ISD::isNON_TRUNCStore(Chain.Val)) { > + StoreSDNode *PrevST = cast(Chain); > + if (PrevST->getBasePtr() == Ptr && > + PrevST->getValue().getValueType() == N->getValueType(0)) > + return DCI.CombineTo(N, Chain.getOperand(1), Chain); > + } > + } > + > + if (N->getValueType(0) != MVT::i16) > + return SDOperand(); > + > + SDOperand toWorklist; > + Outs[0] = DAG.getLoad(MVT::i8, Chain, Src, NULL, 0); > + toWorklist = DAG.getNode(ISD::ADD, MVT::i16, Src, > + DAG.getConstant(1, MVT::i16)); > + Outs[1] = DAG.getLoad(MVT::i8, Chain, toWorklist, NULL, 0); > + // Add to worklist may not be needed. > + // It is meant to merge sequences of add with constant into one. > + DCI.AddToWorklist(toWorklist.Val); > + > + // Create the tokenfactors and carry it on to the build_pair node > + OutChains[0] = Outs[0].getValue(1); > + OutChains[1] = Outs[1].getValue(1); > + TF = DAG.getNode(ISD::TokenFactor, MVT::Other, &OutChains[0], 2); > + > + VTList = DAG.getVTList(MVT::i16, MVT::Flag); > + retVal = DAG.getNode (PIC16ISD::Package, VTList, &Outs[0], 2); > + > + DCI.CombineTo (N, retVal, TF); > + > + return retVal; > +} > + > +SDOperand > +PIC16TargetLowering::LowerADDSUB(SDNode *N, SelectionDAG &DAG, > + DAGCombinerInfo &DCI) const > +{ > + bool changed = false; > + int i; > + SDOperand LoOps[3], HiOps[3]; > + SDOperand OutOps[3]; //[0]:left, [1]:right, [2]:carry > + SDOperand InOp[2]; > + SDOperand retVal; > + SDOperand as1,as2; > + SDVTList VTList; > + unsigned AS,ASE,ASC; > + > + InOp[0] = N->getOperand(0); > + InOp[1] = N->getOperand(1); > + > + switch (N->getOpcode()) > + { > + case ISD::ADD: > + if (InOp[0].getOpcode() == ISD::Constant && > + InOp[1].getOpcode() == ISD::Constant) { > + ConstantSDNode *CST0 = dyn_cast(InOp[0]); > + ConstantSDNode *CST1 = dyn_cast(InOp[1]); > + return DAG.getConstant(CST0->getValue() + CST1->getValue > (), MVT::i16); > + } > + case ISD::ADDE: > + case ISD::ADDC: > + AS = ISD::ADD; > + ASE = ISD::ADDE; > + ASC = ISD::ADDC; > + break; > + case ISD::SUB: > + if (InOp[0].getOpcode() == ISD::Constant && > + InOp[1].getOpcode() == ISD::Constant) { > + ConstantSDNode *CST0 = dyn_cast(InOp[0]); > + ConstantSDNode *CST1 = dyn_cast(InOp[1]); > + return DAG.getConstant(CST0->getValue() - CST1->getValue > (), MVT::i16); > + } > + case ISD::SUBE: > + case ISD::SUBC: > + AS = ISD::SUB; > + ASE = ISD::SUBE; > + ASC = ISD::SUBC; > + break; > + } > + > + assert ((N->getValueType(0) == MVT::i16) > + && "expecting an MVT::i16 node for lowering"); > + assert ((N->getOperand(0).getValueType() == MVT::i16) > + && (N->getOperand(1).getValueType() == MVT::i16) > + && "both inputs to addx/subx:i16 must be i16"); > + > + for (i = 0; i < 2; i++) { > + if (InOp[i].getOpcode() == ISD::GlobalAddress) { > + //we don't want to lower subs/adds with global address (at > least not yet) > + return SDOperand(); > + } > + else if (InOp[i].getOpcode() == ISD::Constant) { > + changed = true; > + ConstantSDNode *CST = dyn_cast(InOp[i]); > + LoOps[i] = DAG.getConstant(CST->getValue() & 0xFF, MVT::i8); > + HiOps[i] = DAG.getConstant(CST->getValue() >> 8, MVT::i8); > + } > + else if (InOp[i].getOpcode() == PIC16ISD::Package) { > + LoOps[i] = InOp[i].getOperand(0); > + HiOps[i] = InOp[i].getOperand(1); > + } > + else if (InOp[i].getOpcode() == ISD::LOAD) { > + changed = true; > + // LowerLOAD returns a Package node or it may combine and > return > + // anything else > + SDOperand lowered = LowerLOAD(InOp[i].Val, DAG, DCI); > + > + // So If LowerLOAD returns something other than Package, > + // then just call ADD again > + if (lowered.getOpcode() != PIC16ISD::Package) > + return LowerADDSUB(N, DAG, DCI); > + > + LoOps[i] = lowered.getOperand(0); > + HiOps[i] = lowered.getOperand(1); > + } > + else if ((InOp[i].getOpcode() == ISD::ADD) || > + (InOp[i].getOpcode() == ISD::ADDE) || > + (InOp[i].getOpcode() == ISD::ADDC) || > + (InOp[i].getOpcode() == ISD::SUB) || > + (InOp[i].getOpcode() == ISD::SUBE) || > + (InOp[i].getOpcode() == ISD::SUBC)) { > + changed = true; > + //must call LowerADDSUB recursively here.... > + //LowerADDSUB returns a Package node > + SDOperand lowered = LowerADDSUB(InOp[i].Val, DAG, DCI); > + > + LoOps[i] = lowered.getOperand(0); > + HiOps[i] = lowered.getOperand(1); > + } > + else if (InOp[i].getOpcode() == ISD::SIGN_EXTEND) { > + //FIXME: I am just zero extending. for now. > + changed = true; > + LoOps[i] = InOp[i].getOperand(0); > + HiOps[i] = DAG.getConstant(0, MVT::i8); > + } > + else { > + DAG.setGraphColor(N, "blue"); > + DAG.viewGraph(); > + assert (0 && "not implemented yet"); > + } > + } //end for > + > + assert (changed && "nothing changed while lowering SUBx/ADDx"); > + > + VTList = DAG.getVTList(MVT::i8, MVT::Flag); > + if (N->getOpcode() == ASE) { > + //we must take in the existing carry > + //if this node is part of an existing subx/addx sequence > + LoOps[2] = N->getOperand(2).getValue(1); > + as1 = DAG.getNode (ASE, VTList, LoOps, 3); > + } > + else { > + as1 = DAG.getNode (ASC, VTList, LoOps, 2); > + } > + HiOps[2] = as1.getValue(1); > + as2 = DAG.getNode (ASE, VTList, HiOps, 3); > + //we must build a pair that also provides the carry from sube/adde > + OutOps[0] = as1; > + OutOps[1] = as2; > + OutOps[2] = as2.getValue(1); > + //breaking an original i16 so lets make the Package also an i16 > + if (N->getOpcode() == ASE) { > + VTList = DAG.getVTList(MVT::i16, MVT::Flag); > + retVal = DAG.getNode (PIC16ISD::Package, VTList, OutOps, 3); > + DCI.CombineTo (N, retVal, OutOps[2]); > + } > + else if (N->getOpcode() == ASC) { > + VTList = DAG.getVTList(MVT::i16, MVT::Flag); > + retVal = DAG.getNode (PIC16ISD::Package, VTList, OutOps, 2); > + DCI.CombineTo (N, retVal, OutOps[2]); > + } > + else if (N->getOpcode() == AS) { > + VTList = DAG.getVTList(MVT::i16); > + retVal = DAG.getNode (PIC16ISD::Package, VTList, OutOps, 2); > + DCI.CombineTo (N, retVal); > + } > + > + return retVal; > +} > + > + > +// > ===------------------------------------------------------------------- > ---===// > +// Calling Convention Implementation > +// > +// The lower operations present on calling convention works on > this order: > +// LowerCALL (virt regs --> phys regs, virt regs --> stack) > +// LowerFORMAL_ARGUMENTS (phys --> virt regs, stack --> virt > regs) > +// LowerRET (virt regs --> phys regs) > +// LowerCALL (phys regs --> virt regs) > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#include "PIC16GenCallingConv.inc" > + > +// > ===------------------------------------------------------------------- > ---===// > +// CALL Calling Convention Implementation > +// > ===------------------------------------------------------------------- > ---===// > + > + > +// > ===------------------------------------------------------------------- > ---===// > +// FORMAL_ARGUMENTS Calling Convention Implementation > +// > ===------------------------------------------------------------------- > ---===// > +SDOperand PIC16TargetLowering:: > +LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG) > +{ > + SmallVector ArgValues; > + SDOperand Root = Op.getOperand(0); > + > + // Return the new list of results. > + // Just copy right now. > + ArgValues.push_back(Root); > + > + return DAG.getNode(ISD::MERGE_VALUES, Op.Val->getVTList(), > &ArgValues[0], > + ArgValues.size()).getValue(Op.ResNo); > +} > + > + > +// > ===------------------------------------------------------------------- > ---===// > +// Return Value Calling Convention Implementation > +// > ===------------------------------------------------------------------- > ---===// > + > +// > ===------------------------------------------------------------------- > ---===// > +// PIC16 Inline Assembly Support > +// > ===------------------------------------------------------------------- > ---===// > + > +// > ===------------------------------------------------------------------- > ---===// > +// Target Optimization Hooks > +// > ===------------------------------------------------------------------- > ---===// > + > +SDOperand PIC16TargetLowering::PerformDAGCombine(SDNode *N, > + DAGCombinerInfo > &DCI) const > +{ > + int i; > + ConstantSDNode *CST; > + SelectionDAG &DAG = DCI.DAG; > + > + switch (N->getOpcode()) > + { > + default: break; > + case PIC16ISD::Package : > + cout <<"==== combining PIC16ISD::Package\n"; > + return SDOperand(); > + case ISD::ADD : > + case ISD::SUB : > + if ((N->getOperand(0).getOpcode() == ISD::GlobalAddress) || > + (N->getOperand(0).getOpcode() == ISD::FrameIndex)) { > + //do not touch pointer adds > + return SDOperand (); > + } > + case ISD::ADDE : > + case ISD::ADDC : > + case ISD::SUBE : > + case ISD::SUBC : > + if (N->getValueType(0) == MVT::i16) { > + SDOperand retVal = LowerADDSUB(N, DAG,DCI); > + // LowerADDSUB has already combined the result, > + // so we just return nothing to avoid assertion failure from > llvm > + // if N has been deleted already > + return SDOperand(); > + } > + else if (N->getValueType(0) == MVT::i8) { > + //sanity check .... > + for (int i=0; i<2; i++) { > + if (N->getOperand (i).getOpcode() == PIC16ISD::Package) { > + assert (0 && > + "don't want to have PIC16ISD::Package as intput to add:i8"); > + } > + } > + } > + break; > + case ISD::STORE : > + { > + SDOperand Chain = N->getOperand(0); > + SDOperand Src = N->getOperand(1); > + SDOperand Dest = N->getOperand(2); > + unsigned int DstOff = 0; > + int NUM_STORES; > + SDOperand Stores[6]; > + > + > + // if source operand is expected to be extended to > + // some higher type then - remove this extension > + // SDNode and do the extension manually > + if ((Src.getOpcode() == ISD::ANY_EXTEND) || > + (Src.getOpcode() == ISD::SIGN_EXTEND) || > + (Src.getOpcode() == ISD::ZERO_EXTEND)) { > + Src = Src.Val->getOperand(0); > + Stores[0] = DAG.getStore(Chain, Src, Dest, NULL,0); > + return Stores[0]; > + } > + > + switch(Src.getValueType()) > + { > + case MVT::i8: > + break; > + case MVT::i16: > + NUM_STORES = 2; > + break; > + case MVT::i32: > + NUM_STORES = 4; > + break; > + case MVT::i64: > + NUM_STORES = 8; > + break; > + } > + > + if (isa(Dest) && isa(Src) && > + (Src.getValueType() != MVT::i8)) { > + //create direct addressing a = b > + Chain = Src.getOperand(0); > + for (i=0; i + SDOperand ADN = DAG.getNode(ISD::ADD, MVT::i16, Src.getOperand(1), > + DAG.getConstant(DstOff, > MVT::i16)); > + SDOperand LDN = DAG.getLoad(MVT::i8, Chain, ADN, NULL, 0); > + SDOperand DSTADDR = DAG.getNode(ISD::ADD, MVT::i16, Dest, > + DAG.getConstant(DstOff, > MVT::i16)); > + Stores[i] = DAG.getStore(Chain, LDN, DSTADDR, NULL, 0); > + Chain = Stores[i]; > + DstOff += 1; > + } > + > + Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &Stores > [0], i); > + return Chain; > + } > + else if (isa(Dest) && isa > (Src) > + && (Src.getValueType() != MVT::i8)) > + { > + //create direct addressing a = CONST > + CST = dyn_cast(Src); > + for (i = 0; i < NUM_STORES; i++) { > + SDOperand CNST = DAG.getConstant(CST->getValue() >> i*8, MVT::i8); > + SDOperand ADN = DAG.getNode(ISD::ADD, MVT::i16, Dest, > + DAG.getConstant(DstOff, > MVT::i16)); > + Stores[i] = DAG.getStore(Chain, CNST, ADN, NULL, 0); > + Chain = Stores[i]; > + DstOff += 1; > + } > + > + Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &Stores > [0], i); > + return Chain; > + } > + else if (isa(Dest) && isa(Src) > + && (Src.getValueType() != MVT::i8)) { > + //create indirect addressing > + CST = dyn_cast(Src); > + Chain = Dest.getOperand(0); > + SDOperand Load; > + Load = DAG.getLoad(MVT::i16, Chain,Dest.getOperand(1), NULL, > 0); > + Chain = Load.getValue(1); > + for (i=0; i + SDOperand CNST = DAG.getConstant(CST->getValue() >> i*8, MVT::i8); > + Stores[i] = DAG.getStore(Chain, CNST, Load, NULL, 0); > + Chain = Stores[i]; > + DstOff += 1; > + } > + > + Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &Stores > [0], i); > + return Chain; > + } > + else if (isa(Dest) && isa > (Src)) { > + // GlobalAddressSDNode *GAD = dyn_cast > (Src); > + return SDOperand(); > + } > + else if (Src.getOpcode() == PIC16ISD::Package) { > + StoreSDNode *st = dyn_cast(N); > + SDOperand toWorkList, retVal; > + Chain = N->getOperand(0); > + > + if (st->isTruncatingStore()) { > + retVal = DAG.getStore(Chain, Src.getOperand(0), Dest, > NULL, 0); > + } > + else { > + toWorkList = DAG.getNode(ISD::ADD, MVT::i16, Dest, > + DAG.getConstant(1, MVT::i16)); > + Stores[1] = DAG.getStore(Chain, Src.getOperand(0), Dest, > NULL, 0); > + Stores[0] = DAG.getStore(Chain, Src.getOperand(1), > toWorkList, NULL, 0); > + > + // We want to merge sequence of add with constant to one > add and a > + // constant, so add the ADD node to worklist to have llvm > do that > + // automatically. > + DCI.AddToWorklist(toWorkList.Val); > + > + // We don't need the Package so add to worklist so llvm > deletes it > + DCI.AddToWorklist(Src.Val); > + retVal = DAG.getNode(ISD::TokenFactor, MVT::Other, &Stores > [0], 2); > + } > + > + return retVal; > + } > + else if (Src.getOpcode() == ISD::TRUNCATE) { > + } > + else { > + // DAG.setGraphColor(N, "blue"); > + // DAG.viewGraph(); > + // assert (0 && "input to store not implemented yet"); > + } > + } //end ISD::STORE > + > + break; > + case ISD::LOAD : > + { > + SDOperand Ptr = N->getOperand(1); > + if (Ptr.getOpcode() == PIC16ISD::Package) { > + // DAG.setGraphColor(N, "blue"); > + // DAG.viewGraph(); > + // Here we must make so that: > + // Ptr.getOperand(0) --> fsrl > + // Ptr.getOperand(1) --> fsrh > + assert (0 && "not implemented yet"); > + } > + //return SDOperand(); > + //break; > + } > + }//end switch > + > + return SDOperand(); > +} > + > +// > ===------------------------------------------------------------------- > ---===// > +// Utility functions > +// > ===------------------------------------------------------------------- > ---===// > +const SDOperand *PIC16TargetLowering:: > +findLoadi8(const SDOperand &Src, SelectionDAG &DAG) const > +{ > + unsigned int i; > + if ((Src.getOpcode() == ISD::LOAD) && (Src.getValueType() == > MVT::i8)) > + return &Src; > + for (i=0; i + const SDOperand *retVal = findLoadi8(Src.getOperand(i),DAG); > + if (retVal) return retVal; > + } > + > + return NULL; > +} > > Added: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16ISelLowering.h?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.h (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.h Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,92 @@ > +//===-- PIC16ISelLowering.h - PIC16 DAG Lowering Interface ------ > *- C++ -*-===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This file defines the interfaces that PIC16 uses to lower LLVM > code into a > +// selection DAG. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#ifndef PIC16ISELLOWERING_H > +#define PIC16ISELLOWERING_H > + > +#include "llvm/CodeGen/SelectionDAG.h" > +#include "llvm/Target/TargetLowering.h" > +#include "PIC16.h" > +#include "PIC16Subtarget.h" > + > +namespace llvm { > + namespace PIC16ISD { > + enum NodeType { > + // Start the numbering from where ISD NodeType finishes. > + FIRST_NUMBER = ISD::BUILTIN_OP_END+PIC16::INSTRUCTION_LIST_END, > + > + // used for encapsulating the expanded nodes into one node. > + Package, > + > + // Get the Higher 16 bits from a 32-bit immediate > + Hi, > + > + // Get the Lower 16 bits from a 32-bit immediate > + Lo, > + > + Cmp, // PIC16 Generic Comparison instruction. > + Branch, // PIC16 Generic Branch Instruction. > + BTFSS, // PIC16 BitTest Instruction (Skip if set). > + BTFSC, // PIC16 BitTest Instruction (Skip if clear). > + > + // PIC16 comparison to be converted to either XOR or SUB > + // Following instructions cater to those convertions. > + XORCC, > + SUBCC, > + > + // Get the Global Address wrapped into a wrapper that also > captures > + // the bank or page. > + Wrapper, > + SetBank, > + SetPage > + }; > + } > + > + // > ===------------------------------------------------------------------- > -===// > + // TargetLowering Implementation > + // > ===------------------------------------------------------------------- > -===// > + class PIC16TargetLowering : public TargetLowering > + { > + public: > + typedef std::map NodeMap_t; > + > + explicit PIC16TargetLowering(PIC16TargetMachine &TM); > + > + /// LowerOperation - Provide custom lowering hooks for some > operations. > + virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG > &DAG); > + > + SDOperand LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG); > + SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG); > + SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG); > + SDOperand LowerFrameIndex(SDOperand Op, SelectionDAG &DAG); > + SDOperand LowerBR_CC(SDOperand Op, SelectionDAG &DAG); > + > + SDOperand RemoveHiLo(SDNode *, SelectionDAG &DAG, > + DAGCombinerInfo &DCI) const; > + SDOperand LowerADDSUB(SDNode *, SelectionDAG &DAG, > + DAGCombinerInfo &DCI) const; > + SDOperand LowerLOAD(SDNode *, SelectionDAG &DAG, > + DAGCombinerInfo &DCI) const; > + > + /// getTargetNodeName - This method returns the name of a > target specific > + // DAG node. > + virtual const char *getTargetNodeName(unsigned Opcode) const; > + virtual SDOperand PerformDAGCombine(SDNode *N, DAGCombinerInfo > &DCI) const; > + > + // utility function. > + const SDOperand *findLoadi8(const SDOperand &Src, SelectionDAG > &DAG) const; > + }; > +} // namespace llvm > + > +#endif // PIC16ISELLOWERING_H > > Added: llvm/trunk/lib/Target/PIC16/PIC16InstrFormats.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16InstrFormats.td?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16InstrFormats.td (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16InstrFormats.td Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,112 @@ > +//===- PIC16RegisterInfo.td - PIC16 Register defs ------------*- > tblgen -*-===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +// > ===------------------------------------------------------------------- > ---===// > +// Describe PIC16 instructions format > +// > +// All the possible PIC16 fields are: > +// > +// opcode - operation code. > +// f - 7-bit register file address. > +// d - 1-bit direction specifier > +// k - 8/11 bit literals > +// b - 3 bits bit num specifier > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +// Generic PIC16 Format > +class PIC16Inst pattern> > + : Instruction > +{ > + field bits<14> Inst; > + > + let Namespace = "PIC16"; > + > + dag OutOperandList = outs; > + dag InOperandList = ins; > + > + let AsmString = asmstr; > + let Pattern = pattern; > +} > + > + > +// > ===------------------------------------------------------------------- > ---===// > +// Byte Oriented instruction class in PIC16 : <|opcode|d|f|> > +// > ===------------------------------------------------------------------- > ---===// > + > +class ByteFormat op, dag outs, dag ins, string asmstr, > + list pattern> > + :PIC16Inst > +{ > + bits<1> d; > + bits<7> f; > + > + let Inst{13-8} = op; > + > + let Inst{7} = d; > + let Inst{6-0} = f; > +} > + > +// > ===------------------------------------------------------------------- > ---===// > +// Bit Oriented instruction class in PIC16 : <|opcode|b|f|> > +// > ===------------------------------------------------------------------- > ---===// > + > +class BitFormat op, dag outs, dag ins, string asmstr, > list pattern> > + : PIC16Inst > +{ > + bits<3> b; > + bits<7> f; > + > + let Inst{13-10} = op; > + > + let Inst{9-7} = b; > + let Inst{6-0} = f; > +} > + > +// > ===------------------------------------------------------------------- > ---===// > +// Literal Format instruction class in PIC16 : <|opcode|k|> > +// > ===------------------------------------------------------------------- > ---===// > + > +class LiteralFormat op, dag outs, dag ins, string asmstr, > + list pattern> > + : PIC16Inst > +{ > + bits<8> k; > + > + > + let Inst{13-8} = op; > + > + let Inst{7-0} = k; > +} > + > +// > ===------------------------------------------------------------------- > ---===// > +// Control Format instruction class in PIC16 : <|opcode|k|> > +// > ===------------------------------------------------------------------- > ---===// > + > +class ControlFormat op, dag outs, dag ins, string asmstr, > + list pattern> > + :PIC16Inst > +{ > + bits<11> k; > + > + > + let Inst{13-11} = op; > + > + let Inst{10-0} = k; > +} > + > +// > ===------------------------------------------------------------------- > ---===// > +// Pseudo instruction class in PIC16 > +// > ===------------------------------------------------------------------- > ---===// > + > +class Pseudo op, dag outs, dag ins, string asmstr, > list pattern>: > + PIC16Inst > +{ > + let Inst{13-6} = op; > +} > > Added: llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16InstrInfo.cpp?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,143 @@ > +//===- PIC16InstrInfo.cpp - PIC16 Instruction Information > -----------------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This file contains the PIC16 implementation of the > TargetInstrInfo class. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#include "PIC16.h" > +#include "PIC16InstrInfo.h" > +#include "llvm/Function.h" > +#include "llvm/ADT/STLExtras.h" > +#include "llvm/CodeGen/MachineFunction.h" > +#include "llvm/CodeGen/MachineInstrBuilder.h" > +#include "PIC16GenInstrInfo.inc" > + > +using namespace llvm; > + > +// TODO: Add the subtarget support on this constructor. > +PIC16InstrInfo::PIC16InstrInfo(PIC16TargetMachine &tm) > + : TargetInstrInfoImpl(PIC16Insts, array_lengthof(PIC16Insts)), > + TM(tm), RI(*this) {} > + > +static bool isZeroImm(const MachineOperand &op) { > + return op.isImmediate() && op.getImm() == 0; > +} > + > + > +/// isLoadFromStackSlot - If the specified machine instruction is > a direct > +/// load from a stack slot, return the virtual or physical > register number of > +/// the destination along with the FrameIndex of the loaded stack > slot. If > +/// not, return 0. This predicate must return 0 if the > instruction has > +/// any side effects other than loading from the stack slot. > +unsigned PIC16InstrInfo:: > +isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const > +{ > + if (MI->getOpcode() == PIC16::MOVF) { > + if ((MI->getOperand(2).isFrameIndex()) && // is a stack slot > + (MI->getOperand(1).isImmediate()) && // the imm is zero > + (isZeroImm(MI->getOperand(1)))) { > + FrameIndex = MI->getOperand(2).getIndex(); > + return MI->getOperand(0).getReg(); > + } > + } > + > + return 0; > +} > + > +/// isStoreToStackSlot - If the specified machine instruction is a > direct > +/// store to a stack slot, return the virtual or physical register > number of > +/// the source reg along with the FrameIndex of the loaded stack > slot. If > +/// not, return 0. This predicate must return 0 if the > instruction has > +/// any side effects other than storing to the stack slot. > +unsigned PIC16InstrInfo:: > +isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const > +{ > + if (MI->getOpcode() == PIC16::MOVWF) { > + if ((MI->getOperand(0).isFrameIndex()) && // is a stack slot > + (MI->getOperand(1).isImmediate()) && // the imm is zero > + (isZeroImm(MI->getOperand(1)))) { > + FrameIndex = MI->getOperand(0).getIndex(); > + return MI->getOperand(2).getReg(); > + } > + } > + return 0; > +} > + > +void PIC16InstrInfo:: > +storeRegToStackSlot(MachineBasicBlock &MBB, > + MachineBasicBlock::iterator I, > + unsigned SrcReg, bool isKill, int FI, > + const TargetRegisterClass *RC) const { > + const Function *Func = MBB.getParent()->getFunction(); > + const std::string FuncName = Func->getName(); > + > + char *tmpName = new char [strlen(FuncName.c_str()) + 6]; > + sprintf(tmpName, "%s_tmp_%d",FuncName.c_str(),FI); > + > + if (RC == PIC16::CPURegsRegisterClass) { > + //src is always WREG. > + BuildMI(MBB, I, this->get(PIC16::MOVWF)) > + .addReg(SrcReg,false,false,true,true) > + .addExternalSymbol(tmpName) // the current printer > expects 3 operands, > + .addExternalSymbol(tmpName); // all we need is actually one, > + // so we repeat. > + } > + else > + assert(0 && "Can't store this register to stack slot"); > +} > + > +void PIC16InstrInfo:: > +loadRegFromStackSlot(MachineBasicBlock &MBB, > MachineBasicBlock::iterator I, > + unsigned DestReg, int FI, > + const TargetRegisterClass *RC) const > +{ > + const Function *Func = MBB.getParent()->getFunction(); > + const std::string FuncName = Func->getName(); > + > + char *tmpName = new char [strlen(FuncName.c_str()) + 6]; > + sprintf(tmpName, "%s_tmp_%d",FuncName.c_str(),FI); > + > + if (RC == PIC16::CPURegsRegisterClass) > + BuildMI(MBB, I, this->get(PIC16::MOVF), DestReg) > + .addExternalSymbol(tmpName) // the current printer expects > 3 operands, > + .addExternalSymbol(tmpName); // all we need is actually > one,so we repeat. > + else > + assert(0 && "Can't load this register from stack slot"); > +} > + > +/// InsertBranch - Insert a branch into the end of the specified > +/// MachineBasicBlock. This operands to this method are the same > as those > +/// returned by AnalyzeBranch. This is invoked in cases where > AnalyzeBranch > +/// returns success and when an unconditional branch (TBB is non- > null, FBB is > +/// null, Cond is empty) needs to be inserted. It returns the > number of > +/// instructions inserted. > +unsigned PIC16InstrInfo:: > +InsertBranch(MachineBasicBlock &MBB, > + MachineBasicBlock *TBB, MachineBasicBlock *FBB, > + const std::vector &Cond) const > +{ > + // Shouldn't be a fall through. > + assert(TBB && "InsertBranch must not be told to insert a > fallthrough"); > + > + if (FBB == 0) { // One way branch. > + if (Cond.empty()) { > + // Unconditional branch? > + BuildMI(&MBB, get(PIC16::GOTO)).addMBB(TBB); > + } > + return 1; > + } > + > + // TODO: If the there are some conditions specified then > conditional branch > + // should be generated. > + // For the time being no instruction is being generated therefore > + // returning NULL. > + return 0; > +} > + > > Added: llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16InstrInfo.h?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.h (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.h Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,78 @@ > +//===- PIC16InstrInfo.h - PIC16 Instruction Information---------- > *- C++ -*-===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the niversity of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This file contains the PIC16 implementation of the > TargetInstrInfo class. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#ifndef PIC16INSTRUCTIONINFO_H > +#define PIC16INSTRUCTIONINFO_H > + > +#include "PIC16.h" > +#include "PIC16RegisterInfo.h" > +#include "llvm/Target/TargetInstrInfo.h" > + > +namespace llvm { > + > + > +class PIC16InstrInfo : public TargetInstrInfoImpl > +{ > + PIC16TargetMachine &TM; > + const PIC16RegisterInfo RI; > +public: > + explicit PIC16InstrInfo(PIC16TargetMachine &TM); > + > + /// getRegisterInfo - TargetInstrInfo is a superset of MRegister > info. As > + /// such, whenever a client has an instance of instruction info, > it should > + /// always be able to get register info as well (through this > method). > + /// > + virtual const TargetRegisterInfo &getRegisterInfo() const > { return RI; } > + > + > + /// isLoadFromStackSlot - If the specified machine instruction > is a direct > + /// load from a stack slot, return the virtual or physical > register number of > + /// the destination along with the FrameIndex of the loaded > stack slot. If > + /// not, return 0. This predicate must return 0 if the > instruction has > + /// any side effects other than loading from the stack slot. > + virtual unsigned isLoadFromStackSlot(MachineInstr *MI, int > &FrameIndex) const; > + > + /// isStoreToStackSlot - If the specified machine instruction is > a direct > + /// store to a stack slot, return the virtual or physical > register number of > + /// the source reg along with the FrameIndex of the loaded stack > slot. If > + /// not, return 0. This predicate must return 0 if the > instruction has > + /// any side effects other than storing to the stack slot. > + virtual unsigned isStoreToStackSlot(MachineInstr *MI, int > &FrameIndex) const; > + > + /// Used for spilling a register > + void storeRegToStackSlot(MachineBasicBlock &MBB, > + MachineBasicBlock::iterator MI, > + unsigned SrcReg, bool isKill, int > FrameIndex, > + const TargetRegisterClass *RC) const; > + > + > + void loadRegFromStackSlot(MachineBasicBlock &MBB, > + MachineBasicBlock::iterator MI, > + unsigned DestReg, int FrameIndex, > + const TargetRegisterClass *RC) const; > + > + /// InsertBranch - Insert a branch into the end of the specified > + /// MachineBasicBlock. This operands to this method are the > same as those > + /// returned by AnalyzeBranch. This is invoked in cases where > AnalyzeBranch > + /// returns success and when an unconditional branch (TBB is non- > null, FBB is > + /// null, Cond is empty) needs to be inserted. It returns the > number of > + /// instructions inserted. > + virtual unsigned InsertBranch(MachineBasicBlock &MBB, > MachineBasicBlock *TBB, > + MachineBasicBlock *FBB, > + const std::vector > &Cond) const ; > + > +}; > + > +} // namespace llvm > + > +#endif > > Added: llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16InstrInfo.td?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,302 @@ > +//===- PIC16InstrInfo.td - PIC16 Register defs ----------------*- > tblgen-*-===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +// > ===------------------------------------------------------------------- > ---===// > +// Instruction format superclass > +// > ===------------------------------------------------------------------- > ---===// > + > +include "PIC16InstrFormats.td" > + > +// > ===------------------------------------------------------------------- > ---===// > +// PIC16 profiles and nodes > +// > ===------------------------------------------------------------------- > ---===// > + > +// > ===------------------------------------------------------------------- > ---===// > +// PIC16 addressing mode. > +// > ===------------------------------------------------------------------- > ---===// > +// It matches address of globals as well as the stack slots > +// that are created for locals and temporaries. This addressing mode > +// converts the GlobalAddress and FrameIndex nodes to > TargetGlobalAddress > +// and TargetFrameIndex nodes. > +def diraddrmode : ComplexPattern [frameindex], []>; > +def dirloadmode : ComplexPattern [frameindex], []>; > +def indirloadmode : ComplexPattern [frameindex], []>; > + > + > +// Address operand. > +def mem : Operand { > + let PrintMethod = "printAddrModeOperand"; > + let MIOperandInfo = (ops i16imm, PTRRegs); > +} > + > +// Instruction operand types > +def simm8 : Operand; > + > + > +// These are target-independent nodes, but have target-specific > formats. > +def SDT_PIC16CallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i8> ]>; > +def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_PIC16CallSeq, > + [SDNPHasChain, SDNPOutFlag]>; > +def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_PIC16CallSeq, > + [SDNPHasChain, SDNPOutFlag]>; > + > +def PIC16Wrapper : SDNode<"PIC16ISD::Wrapper", SDTIntUnaryOp>; > + > +// so_imm_XFORM - Return a so_imm value packed into the format > described for > +// so_imm def below. > +def so_imm_XFORM : SDNodeXForm + return CurDAG->getTargetConstant((int8_t)N->getValue(), MVT::i32); > +}]>; > + > +def so_imm : Operand, > + PatLeaf<(imm), [{}]> { > + let PrintMethod = "printSOImmOperand"; > +} > + > + > + > +// PIC16 Address Mode! SDNode frameindex could possibily be a match > +// since load and store instructions from stack used it. > +def addr : Operand; > + > +// Arithmetic 2 register operands > +class ArithI op, string instr_asm, SDNode OpNode, > + Operand Od> : > + LiteralFormat< op, > + (outs CPURegs:$dst), > + (ins CPURegs:$b, Od:$c), > + !strconcat(instr_asm, " $c"), > + [(set CPURegs:$dst, (OpNode CPURegs:$b, Od:$c))]>; > + > +// Memory Load/Store > +class LoadDirect op, string instr_asm, PatFrag OpNode>: > + ByteFormat< op, > + (outs CPURegs:$dst), > + (ins mem:$addr), > + !strconcat(instr_asm, " $addr"), > + [(set CPURegs:$dst, (OpNode diraddrmode:$addr))]>; > + > +class LoadInDirect op, string instr_asm, PatFrag OpNode>: > + ByteFormat< op, > + (outs PTRRegs:$dst), > + (ins mem:$addr), > + !strconcat(instr_asm, " $addr, $dst"), > + [(set PTRRegs:$dst, (OpNode indirloadmode:$addr))]>; > + > +class StoreDirect op, string instr_asm, PatFrag OpNode>: > + ByteFormat< op, > + (outs), > + (ins CPURegs:$src, mem:$addr), > + !strconcat(instr_asm, " $addr"), > + [(OpNode CPURegs:$src, diraddrmode:$addr)]>; > + > +class StoreInDirect op, string instr_asm, PatFrag OpNode>: > + ByteFormat< op, > + (outs), > + (ins CPURegs:$src, PTRRegs:$fsr), > + !strconcat(instr_asm, " $fsr"), > + [(OpNode CPURegs:$src, PTRRegs:$fsr)]>; > + > +// Move > +class MovLit op, string instr_asm>: > + LiteralFormat< op, > + (outs CPURegs:$dst), > + (ins i8imm:$src), > + !strconcat(instr_asm, " $src"), > + [(set CPURegs:$dst, imm:$src)]>; > + > + > +// Arithmetic with memory store. > +// Arithmetic instrunctions involving W and memory location. > +// Since W is implicit, we only print the memory operand. > +class Arith1M op, string instr_asm, SDNode OpNode>: > + ByteFormat< op, > + (outs), > + (ins CPURegs:$b, mem:$dst), > + !strconcat(instr_asm, " $dst"), > + [(store (OpNode (load diraddrmode:$dst), CPURegs:$b), > diraddrmode:$dst), > + (store (OpNode CPURegs:$b, (load diraddrmode:$dst)), > diraddrmode:$dst)]>; > + > +// Arithmetic with memory load. > +// Arithmetic instrunctions involving W and memory location. > +// Since W is implicit, we only print the memory operand. > +class Arith1R op, string instr_asm, SDNode OpNode>: > + ByteFormat< op, > + (outs CPURegs:$dst), > + (ins mem:$src1, CPURegs:$src2), > + !strconcat(instr_asm, " $src1"), > + [(set CPURegs:$dst, (OpNode (load diraddrmode:$src1), > CPURegs:$src2))]>; > + > +// Arithmetic with memory load. > +// Arithmetic instrunctions involving W and memory location. > +// Since W is implicit, we only print the memory operand. > +class Arith2R op, string instr_asm, SDNode OpNode>: > + ByteFormat< op, > + (outs CPURegs:$dst), > + (ins mem:$src1, CPURegs:$src2), > + !strconcat(instr_asm, " $src1"), > + [(set CPURegs:$dst, (OpNode CPURegs:$src2, (load diraddrmode: > $src1)))]>; > + > +// > ===------------------------------------------------------------------- > ---===// > +// Instruction definition > +// > ===------------------------------------------------------------------- > ---===// > + > +// > ===------------------------------------------------------------------- > ---===// > +// PIC16I Instructions > +// > ===------------------------------------------------------------------- > ---===// > + > +// Arithmetic > + > +// ADDiu just accept 16-bit immediates but we handle this on Pat's. > +// immZExt32 is used here so it can match GlobalAddress immediates. > +// def ADDLW : ArithI<0x09, "addlw", add, so_imm>; > + > +let isReMaterializable = 1 in { > +def MOVLW : MovLit<0x24, "movlw">; > +} > + > +// Load/Store > +def LFSR1 : LoadInDirect <0x4, "lfsr", load>; > + > +let isReMaterializable = 1 in { > +def MOVF : LoadDirect <0x23, "movf", load>; > +} > + > +def MOVWF : StoreDirect <0x2b, "movwf", store>; > + > +def MOVFSRINC : StoreInDirect <0x5, "movfsrinc", store>; > + > +def RETURN : ControlFormat<0x03, (outs), (ins), "return", []>; > + > +def ADDWF : Arith1M<0x01, "addwf", add>; > +def ADDFW : Arith1R<0x02, "addfw", add>; > + > +def ADDWFE : Arith1M<0x03, "addwfe", adde>; > +def ADDFWE : Arith1R<0x04, "addfwe", adde>; > + > +def ADDWFC : Arith1M<0x05, "addwfc", addc>; > +def ADDFWC : Arith1R<0x06, "addfwc", addc>; > + > +def SUBWF : Arith1M<0x07, "subwf", sub>; > +def SUBFW : Arith1R<0x08, "subfw", sub>; > + > +def SUBWFE : Arith1M<0x09, "subwfe", sube>; > +def SUBFWE : Arith1R<0x0a, "subfwe", sube>; > + > +def SUBWFC : Arith1M<0x0b, "subwfc", subc>; > +def SUBFWC : Arith1R<0x0d, "subfwc", subc>; > + > +def SUBRFW : Arith2R<0x08, "subfw", sub>; > + > +def SUBRFWE : Arith2R<0x0a, "subfwe", sube>; > + > +def SUBRFWC : Arith2R<0x0d, "subfwc", subc>; > + > +def brtarget : Operand; > + > +class UncondJump< bits<4> op, string instr_asm>: > + BitFormat< op, > + (outs), > + (ins brtarget:$target), > + !strconcat(instr_asm, " $target"), > + [(br bb:$target)]>; > + > +def GOTO : UncondJump<0x1, "goto">; > + > +class LogicM op, string instr_asm, SDNode OpNode> : > + ByteFormat< op, > + (outs), > + (ins CPURegs:$b, mem:$dst), > + !strconcat(instr_asm, " $dst"), > + [(store (OpNode (load diraddrmode:$dst), CPURegs:$b), > diraddrmode:$dst)]>; > + > +class LogicR op, string instr_asm, SDNode OpNode> : > + ByteFormat< op, > + (outs CPURegs:$dst), > + (ins CPURegs:$b, mem:$c), > + !strconcat(instr_asm, " $c"), > + [(set CPURegs:$dst, (OpNode (load diraddrmode:$c), CPURegs: > $b))]>; > + > +class LogicI op, string instr_asm, SDNode OpNode, Operand > Od> : > + LiteralFormat< op, > + (outs CPURegs:$dst), > + (ins CPURegs:$b, Od:$c), > + !strconcat(instr_asm, " $c"), > + [(set CPURegs:$dst, (OpNode CPURegs:$b, Od:$c ))]>; > + > +def XORWF : LogicM<0x1,"xorwf",xor>; > +def XORFW : LogicR<0x1,"xorfw",xor>; > +def XORLW : LogicI<0x1,"xorlw",xor, so_imm>; > + > +def ANDWF : LogicM<0x1,"andwf",and>; > +def ANDFW : LogicR<0x1,"andfw",and>; > +def ANDLW : LogicI<0x1,"andlw",and, so_imm>; > + > +def IORWF : LogicM<0x1,"iorwf",or>; > +def IORFW : LogicR<0x1,"iorfw",or>; > +def IORLW : LogicI<0x1,"iorlw",or, so_imm>; > + > + > +/* For comparison before branch */ > +def SDT_PIC16Cmp : SDTypeProfile<1, 3, [SDTCisSameAs<0,1>]>; > +def SDTIntBinOpPIC16 : SDTypeProfile<1, 2, [SDTCisSameAs<0,1>, > + SDTCisSameAs<1,2>, SDTCisInt<1>]>; > + > +def PIC16Cmp : SDNode<"PIC16ISD::Cmp",SDTIntBinOpPIC16, > [SDNPOutFlag]>; > +def PIC16XORCC : SDNode<"PIC16ISD::XORCC",SDTIntBinOpPIC16, > [SDNPOutFlag]>; > +def PIC16SUBCC : SDNode<"PIC16ISD::SUBCC",SDTIntBinOpPIC16, > [SDNPOutFlag]>; > + > +def XORFWCC : LogicR<0x1,"xorfw",PIC16XORCC>; > +def XORLWCC : LogicI<0x1,"xorlw",PIC16XORCC, so_imm>; > +def SUBFWCC : Arith1R<0x1,"subfw",PIC16SUBCC>; > +def SUBLWCC : ArithI<0x1,"sublw",PIC16SUBCC, so_imm>; > + > + > +/* For branch conditions */ > +def SDT_PIC16Branch : SDTypeProfile<0, 3, [SDTCisVT<0, OtherVT>, > + SDTCisVT<1,i8>, SDTCisVT<2,i8>]>; > + > +def PIC16Branch : SDNode<"PIC16ISD::Branch",SDT_PIC16Branch, > + [SDNPHasChain, SDNPInFlag]>; > + > +def PIC16BTFSS : SDNode<"PIC16ISD::BTFSS",SDT_PIC16Branch, > + [SDNPHasChain, SDNPInFlag]>; > + > +def PIC16BTFSC : SDNode<"PIC16ISD::BTFSC",SDT_PIC16Branch, > + [SDNPHasChain, SDNPInFlag]>; > + > +class InstrBitTestCC op, string instr_asm,SDNode OpNode>: > + BitFormat< op, > + (outs), > + (ins brtarget:$target ,so_imm:$i, STATUSRegs:$s ), > + !strconcat(instr_asm, " $s, $i, $target"), > + [(OpNode bb:$target, so_imm:$i, STATUSRegs:$s )]>; > + > +def BTFSS : InstrBitTestCC<0x1,"btfss",PIC16BTFSS>; > +def BTFSC : InstrBitTestCC<0x1,"btfsc",PIC16BTFSC>; > + > + > +// > ===------------------------------------------------------------------- > ---===// > +// Pseudo instructions > +// > ===------------------------------------------------------------------- > ---===// > + > +let Defs = [STKPTR], Uses = [STKPTR] in { > +def ADJCALLSTACKDOWN : Pseudo<255, (outs), (ins i8imm:$amt), > + "!ADJCALLSTACKDOWN $amt", > + [(callseq_start imm:$amt)]>; > +def ADJCALLSTACKUP : Pseudo<254, (outs), (ins i8imm:$amt), > + "!ADJCALLSTACKUP $amt", > + [(callseq_end imm:$amt)]>; > +} > + > + > +// > ===------------------------------------------------------------------- > ---===// > +// Arbitrary patterns that map to one or more instructions > +// > ===------------------------------------------------------------------- > ---===// > +def : Pat<(ret), (RETURN)>; > > Added: llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16RegisterInfo.cpp?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,223 @@ > +//===- PIC16RegisterInfo.cpp - PIC16 Register Information > -----------------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This file contains the PIC16 implementation of the > TargetRegisterInfo class. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#define DEBUG_TYPE "pic16-reg-info" > + > +#include "PIC16.h" > +#include "PIC16RegisterInfo.h" > +#include "llvm/Constants.h" > +#include "llvm/Function.h" > +#include "llvm/Type.h" > +#include "llvm/ADT/BitVector.h" > +#include "llvm/ADT/STLExtras.h" > +#include "llvm/CodeGen/MachineFrameInfo.h" > +#include "llvm/CodeGen/MachineFunction.h" > +#include "llvm/CodeGen/MachineInstrBuilder.h" > +#include "llvm/CodeGen/MachineLocation.h" > +#include "llvm/CodeGen/ValueTypes.h" > +#include "llvm/Support/CommandLine.h" > +#include "llvm/Support/Debug.h" > +#include "llvm/Target/TargetFrameInfo.h" > +#include "llvm/Target/TargetInstrInfo.h" > +#include "llvm/Target/TargetMachine.h" > +#include "llvm/Target/TargetOptions.h" > + > +using namespace llvm; > + > +// TODO: add subtarget support > +PIC16RegisterInfo::PIC16RegisterInfo(const TargetInstrInfo &tii) > + : PIC16GenRegisterInfo(PIC16::ADJCALLSTACKDOWN, > PIC16::ADJCALLSTACKUP), > + TII(tii) {} > + > +/// getRegisterNumbering - Given the enum value for some register, > e.g. > +/// PIC16::RA, return the number that it corresponds to (e.g. 31). > +unsigned PIC16RegisterInfo:: > +getRegisterNumbering(unsigned RegEnum) > +{ > + assert (RegEnum <= 31 && "Unknown register number!"); > + return RegEnum; > +} > + > +void PIC16RegisterInfo:: > +copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, > + unsigned DestReg, unsigned SrcReg, > + const TargetRegisterClass *RC) const > +{ > + return; > +} > + > +void PIC16RegisterInfo::reMaterialize(MachineBasicBlock &MBB, > + MachineBasicBlock::iterator I, > + unsigned DestReg, > + const MachineInstr *Orig) const > +{ > + MachineInstr *MI = Orig->clone(); > + MI->getOperand(0).setReg(DestReg); > + MBB.insert(I, MI); > +} > + > +MachineInstr *PIC16RegisterInfo:: > +foldMemoryOperand(MachineInstr* MI, unsigned OpNum, int FI) const > +{ > + MachineInstr *NewMI = NULL; > + > + return NewMI; > +} > + > +// > ===------------------------------------------------------------------- > ---===// > +// > +// Callee Saved Registers methods > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +/// PIC16 Callee Saved Registers > +const unsigned* PIC16RegisterInfo:: > +getCalleeSavedRegs(const MachineFunction *MF) const > +{ > + // PIC16 calle-save register range is $16-$26(s0-s7) > + static const unsigned CalleeSavedRegs[] = { 0 }; > + return CalleeSavedRegs; > +} > + > +/// PIC16 Callee Saved Register Classes > +const TargetRegisterClass* const* > +PIC16RegisterInfo::getCalleeSavedRegClasses(const MachineFunction > *MF) const > +{ > + static const TargetRegisterClass * const CalleeSavedRegClasses[] > = { 0 }; > + return CalleeSavedRegClasses; > +} > + > +BitVector PIC16RegisterInfo:: > +getReservedRegs(const MachineFunction &MF) const > +{ > + BitVector Reserved(getNumRegs()); > + return Reserved; > +} > + > +// > ===------------------------------------------------------------------- > ---===// > +// > +// Stack Frame Processing methods > +// +----------------------------+ > +// > +// FIXME: Add stack layout description here. > +// > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +// hasFP - Return true if the specified function should have a > dedicated frame > +// pointer register. This is true if the function has variable > sized allocas or > +// if frame pointer elimination is disabled. > +bool PIC16RegisterInfo:: > +hasFP(const MachineFunction &MF) const { > + return false; > +} > + > +// This function eliminate ADJCALLSTACKDOWN, > +// ADJCALLSTACKUP pseudo instructions > +void PIC16RegisterInfo:: > +eliminateCallFramePseudoInstr(MachineFunction &MF, > MachineBasicBlock &MBB, > + MachineBasicBlock::iterator I) const { > + // Simply discard ADJCALLSTACKDOWN, ADJCALLSTACKUP instructions. > + MBB.erase(I); > +} > + > +// FrameIndex represent objects inside a abstract stack. > +// We must replace FrameIndex with an stack/frame pointer > +// direct reference. > +void PIC16RegisterInfo:: > +eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, > + RegScavenger *RS) const > +{ > + MachineInstr &MI = *II; > + MachineFunction &MF = *MI.getParent()->getParent(); > + > + unsigned i = 0; > + while (!MI.getOperand(i).isFrameIndex()) { > + ++i; > + assert(i < MI.getNumOperands() && > + "Instr doesn't have FrameIndex operand!"); > + } > + > + int FrameIndex = MI.getOperand(i).getIndex(); > + int stackSize = MF.getFrameInfo()->getStackSize(); > + int spOffset = MF.getFrameInfo()->getObjectOffset(FrameIndex); > + > + #ifndef NDEBUG > + DOUT << "\nFunction : " << MF.getFunction()->getName() << "\n"; > + DOUT << "<--------->\n"; > + MI.print(DOUT); > + DOUT << "FrameIndex : " << FrameIndex << "\n"; > + DOUT << "spOffset : " << spOffset << "\n"; > + DOUT << "stackSize : " << stackSize << "\n"; > + #endif > + > + // as explained on LowerFORMAL_ARGUMENTS, detect negative offsets > + // and adjust SPOffsets considering the final stack size. > + int Offset = ((spOffset < 0) ? (stackSize + (-(spOffset+4))) : > (spOffset)); > + //Offset += MI.getOperand(i+1).getImm(); > + > + #ifndef NDEBUG > + DOUT << "Offset : " << Offset << "\n"; > + DOUT << "<--------->\n"; > + #endif > + > + // MI.getOperand(i+1).ChangeToImmediate(Offset); > + MI.getOperand(i).ChangeToRegister(getFrameRegister(MF),false); > +} > + > +void PIC16RegisterInfo:: > +emitPrologue(MachineFunction &MF) const > +{ > +} > + > +void PIC16RegisterInfo:: > +emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const > +{ > +} > + > +void PIC16RegisterInfo:: > +processFunctionBeforeFrameFinalized(MachineFunction &MF) const { > +} > + > +unsigned PIC16RegisterInfo:: > +getRARegister() const { > + assert(0 && "What is the return address register"); > + return 0; > +} > + > +unsigned PIC16RegisterInfo:: > +getFrameRegister(MachineFunction &MF) const { > + return PIC16::STKPTR; > +} > + > +unsigned PIC16RegisterInfo:: > +getEHExceptionRegister() const { > + assert(0 && "What is the exception register"); > + return 0; > +} > + > +unsigned PIC16RegisterInfo:: > +getEHHandlerRegister() const { > + assert(0 && "What is the exception handler register"); > + return 0; > +} > + > +int PIC16RegisterInfo:: > +getDwarfRegNum(unsigned RegNum, bool isEH) const { > + assert(0 && "What is the dwarf register number"); > + return -1; > +} > + > + > +#include "PIC16GenRegisterInfo.inc" > + > > Added: llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16RegisterInfo.h?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,86 @@ > +//===- PIC16RegisterInfo.h - PIC16 Register Information Impl ---- > *- C++ -*-===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This file contains the PIC16 implementation of the > TargetRegisterInfo class. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#ifndef PIC16REGISTERINFO_H > +#define PIC16REGISTERINFO_H > + > +#include "PIC16GenRegisterInfo.h.inc" > +#include "llvm/Target/TargetRegisterInfo.h" > + > +namespace llvm { > + > +// Forward Declarations. > +class TargetInstrInfo; > +class Type; > + > +struct PIC16RegisterInfo : public PIC16GenRegisterInfo { > + const TargetInstrInfo &TII; > + > + explicit PIC16RegisterInfo(const TargetInstrInfo &tii); > + > + /// getRegisterNumbering - Given the enum value for some > register, e.g. > + /// PIC16::RA, return the number that it corresponds to (e.g. 31). > + static unsigned getRegisterNumbering(unsigned RegEnum); > + > + void reMaterialize(MachineBasicBlock &MBB, > MachineBasicBlock::iterator MI, > + unsigned DestReg, const MachineInstr *Orig) > const; > + > + MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum, > + int FrameIndex) const; > + > + MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum, > + MachineInstr* LoadMI) const { > + return 0; > + } > + > + void copyRegToReg(MachineBasicBlock &MBB, > MachineBasicBlock::iterator MBBI, > + unsigned DestReg, unsigned SrcReg, > + const TargetRegisterClass *RC) const; > + > + > + const unsigned *getCalleeSavedRegs(const MachineFunction* MF = > 0) const; > + > + const TargetRegisterClass* const* > + getCalleeSavedRegClasses(const MachineFunction* MF = 0) const; > + > + BitVector getReservedRegs(const MachineFunction &MF) const; > + > + bool hasFP(const MachineFunction &MF) const; > + > + void eliminateCallFramePseudoInstr(MachineFunction &MF, > + MachineBasicBlock &MBB, > + MachineBasicBlock::iterator > I) const; > + > + /// Stack Frame Processing Methods. > + void eliminateFrameIndex(MachineBasicBlock::iterator II, > + int SPAdj, RegScavenger *RS = NULL) const; > + > + void processFunctionBeforeFrameFinalized(MachineFunction &MF) > const; > + > + void emitPrologue(MachineFunction &MF) const; > + void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) > const; > + > + /// Debug information queries. > + unsigned getRARegister() const; > + unsigned getFrameRegister(MachineFunction &MF) const; > + > + /// Exception handling queries. > + unsigned getEHExceptionRegister() const; > + unsigned getEHHandlerRegister() const; > + > + int getDwarfRegNum(unsigned RegNum, bool isEH) const; > +}; > + > +} // end namespace llvm > + > +#endif > > Added: llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16RegisterInfo.td?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.td (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.td Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,84 @@ > +//===- PIC16RegisterInfo.td - PIC16 Register defs ------------*- > tblgen -*-===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +// > ===------------------------------------------------------------------- > ---===// > +// Declarations that describe the PIC16 register file > +// > ===------------------------------------------------------------------- > ---===// > + > +// We have banks of 32 registers each. > +class PIC16Reg : Register { > + field bits<5> Num; > + let Namespace = "PIC16"; > +} > + > +// PIC16 CPU Registers > +class PIC16GPRReg num, string n> : PIC16Reg { > + let Num = num; > +} > + > +// CPU GPR Registers > +def FSR0 : PIC16GPRReg< 0, "FSR0">, DwarfRegNum<[0]>; > +def FSR1 : PIC16GPRReg< 1, "FSR1">, DwarfRegNum<[1]>; > + > +// CPU Registers Class > +def PTRRegs : RegisterClass<"PIC16", [i16], 8, > + [FSR0, FSR1]> > +{ > + let MethodProtos = [{ > + iterator allocation_order_end(const MachineFunction &MF) const; > + }]; > + let MethodBodies = [{ > + PTRRegsClass::iterator > + PTRRegsClass::allocation_order_end(const MachineFunction &MF) > const { > + return end(); > + } > + }]; > +} > + > +def WREG : PIC16GPRReg< 0, "WREG">, DwarfRegNum<[0]>; > + > +// CPU Registers Class > +def CPURegs : RegisterClass<"PIC16", [i8], 8, > + [WREG]> > +{ > + let MethodProtos = [{ > + iterator allocation_order_end(const MachineFunction &MF) const; > + }]; > + let MethodBodies = [{ > + CPURegsClass::iterator > + CPURegsClass::allocation_order_end(const MachineFunction &MF) > const { > + return end(); > + } > + }]; > +} > + > +def STATUSREG : PIC16GPRReg<2, "STATUS">, DwarfRegNum<[0]>; > + > +// STATUS Registers Class > +def STATUSRegs : RegisterClass<"PIC16", [i8], 8, > + [STATUSREG]>; > + > + > +// Dummy stack pointer. > +def STKPTR : PIC16GPRReg< 0, "SP">, DwarfRegNum<[0]>; > + > +// CPU Registers Class > +def STKRegs : RegisterClass<"PIC16", [i8], 8, > + [STKPTR]> > +{ > + let MethodProtos = [{ > + iterator allocation_order_end(const MachineFunction &MF) const; > + }]; > + let MethodBodies = [{ > + STKRegsClass::iterator > + STKRegsClass::allocation_order_end(const MachineFunction &MF) > const { > + return end(); > + } > + }]; > +} > > Added: llvm/trunk/lib/Target/PIC16/PIC16Subtarget.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16Subtarget.cpp?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16Subtarget.cpp (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16Subtarget.cpp Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,27 @@ > +//===- PIC16Subtarget.cpp - PIC16 Subtarget Information > -------------------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This file implements the PIC16 specific subclass of > TargetSubtarget. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#include "PIC16Subtarget.h" > +#include "PIC16.h" > +#include "PIC16GenSubtarget.inc" > +using namespace llvm; > + > +PIC16Subtarget::PIC16Subtarget(const TargetMachine &TM, const > Module &M, > + const std::string &FS) > + :IsPIC16Old(false) > +{ > + std::string CPU = "generic"; > + > + // Parse features string. > + ParseSubtargetFeatures(FS, CPU); > +} > > Added: llvm/trunk/lib/Target/PIC16/PIC16Subtarget.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16Subtarget.h?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16Subtarget.h (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16Subtarget.h Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,41 @@ > +//=====-- PIC16Subtarget.h - Define Subtarget for the PIC16 ---*- C > ++ -*--====// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This file declares the PIC16 specific subclass of TargetSubtarget. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#ifndef PIC16SUBTARGET_H > +#define PIC16SUBTARGET_H > + > +#include "llvm/Target/TargetSubtarget.h" > +#include "llvm/Target/TargetMachine.h" > + > +#include > + > +namespace llvm { > +class Module; > + > +class PIC16Subtarget : public TargetSubtarget { > + bool IsPIC16Old; > + > +public: > + /// This constructor initializes the data members to match that > + /// of the specified module. > + /// > + PIC16Subtarget(const TargetMachine &TM, const Module &M, > + const std::string &FS); > + > + /// ParseSubtargetFeatures - Parses features string setting > specified > + /// subtarget options. Definition of function is auto generated > by tblgen. > + void ParseSubtargetFeatures(const std::string &FS, const > std::string &CPU); > +}; > +} // End llvm namespace > + > +#endif > > Added: llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16TargetAsmInfo.cpp?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,26 @@ > +//===-- PIC16TargetAsmInfo.cpp - PIC16 asm properties > ---------------------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This file contains the declarations of the PIC16TargetAsmInfo > properties. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#include "PIC16TargetAsmInfo.h" > + > +using namespace llvm; > + > +PIC16TargetAsmInfo:: > +PIC16TargetAsmInfo(const PIC16TargetMachine &TM) > +{ > + Data16bitsDirective = "\t.half\t"; > + Data32bitsDirective = "\t.word\t"; > + CommentString = ";"; > + COMMDirective = "\t"; > + COMMDirectiveTakesAlignment = 0; > +} > > Added: llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16TargetAsmInfo.h?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.h (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.h Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,30 @@ > +//=====-- PIC16TargetAsmInfo.h - PIC16 asm properties ---------*- C > ++ -*--====// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This file contains the declaration of the PIC16TargetAsmInfo > class. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#ifndef PIC16TARGETASMINFO_H > +#define PIC16TARGETASMINFO_H > + > +#include "llvm/Target/TargetAsmInfo.h" > + > +namespace llvm { > + > + // Forward declaration. > + class PIC16TargetMachine; > + > + struct PIC16TargetAsmInfo : public TargetAsmInfo { > + PIC16TargetAsmInfo(const PIC16TargetMachine &TM); > + }; > + > +} // namespace llvm > + > +#endif > > Added: llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16TargetMachine.cpp?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,72 @@ > +//===-- PIC16TargetMachine.cpp - Define TargetMachine for PIC16 > -----------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// Top-level implementation for the PIC16 target. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > +#include "PIC16.h" > +#include "PIC16TargetMachine.h" > +#include "PIC16TargetAsmInfo.h" > +#include "llvm/Module.h" > +#include "llvm/PassManager.h" > +#include "llvm/Target/TargetMachineRegistry.h" > +#include "llvm/Target/TargetAsmInfo.h" > + > +using namespace llvm; > + > +namespace { > + // Register the targets > + RegisterTarget X("pic16", " PIC16 14-bit"); > +} > + > +PIC16TargetMachine:: > +PIC16TargetMachine(const Module &M, const std::string &FS) : > + Subtarget(*this, M, FS), DataLayout("e-p:16:8:8-i8:8:8-i16:8:8- > i32:8:8"), > + InstrInfo(*this), TLInfo(*this), > + FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0) { } > + > + > +const TargetAsmInfo *PIC16TargetMachine:: > +createTargetAsmInfo() const > +{ > + return new PIC16TargetAsmInfo(*this); > +} > + > +// > ===------------------------------------------------------------------- > ---===// > +// Pass Pipeline Configuration > +// > ===------------------------------------------------------------------- > ---===// > + > +bool PIC16TargetMachine:: > +addInstSelector(PassManagerBase &PM, bool Fast) > +{ > + // Install an instruction selector. > + PM.add(createPIC16ISelDag(*this)); > + return false; > +} > + > +bool PIC16TargetMachine:: > +addPrologEpilogInserter(PassManagerBase &PM, bool Fast) > +{ > + return false; > +} > + > +bool PIC16TargetMachine:: addPreEmitPass(PassManagerBase &PM, bool > Fast) > +{ > + return true; > +} > + > +bool PIC16TargetMachine:: > +addAssemblyEmitter(PassManagerBase &PM, bool Fast, std::ostream &Out) > +{ > + // Output assembly language. > + PM.add(createPIC16CodePrinterPass(Out, *this)); > + return false; > +} > + > > Added: llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ > PIC16/PIC16TargetMachine.h?rev=51027&view=auto > > ====================================================================== > ======== > --- llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,61 @@ > +//===-- PIC16TargetMachine.h - Define TargetMachine for PIC16 --- > *- C++ -*-===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > ===------------------------------------------------------------------- > ---===// > +// > +// This file declares the PIC16 specific subclass of TargetMachine. > +// > +// > ===------------------------------------------------------------------- > ---===// > + > + > +#ifndef PIC16_TARGETMACHINE_H > +#define PIC16_TARGETMACHINE_H > + > +#include "PIC16InstrInfo.h" > +#include "PIC16ISelLowering.h" > +#include "PIC16Subtarget.h" > +#include "llvm/Target/TargetData.h" > +#include "llvm/Target/TargetFrameInfo.h" > +#include "llvm/Target/TargetMachine.h" > + > +namespace llvm { > + > +/// PIC16TargetMachine > +/// > +class PIC16TargetMachine : public LLVMTargetMachine { > + PIC16Subtarget Subtarget; > + const TargetData DataLayout; // Calculates type size > & alignment > + PIC16InstrInfo InstrInfo; > + PIC16TargetLowering TLInfo; > + TargetFrameInfo FrameInfo; > + > +protected: > + virtual const TargetAsmInfo *createTargetAsmInfo() const; > + > +public: > + PIC16TargetMachine(const Module &M, const std::string &FS); > + > + virtual const TargetFrameInfo *getFrameInfo() const > + { return &FrameInfo; } > + virtual const PIC16InstrInfo *getInstrInfo() const > + { return &InstrInfo; } > + virtual const TargetData *getTargetData() const > + { return &DataLayout; } > + virtual PIC16TargetLowering *getTargetLowering() const > + { return const_cast(&TLInfo); } > + virtual const TargetRegisterInfo *getRegisterInfo() const > + { return &InstrInfo.getRegisterInfo(); } > + > + virtual bool addInstSelector(PassManagerBase &PM, bool Fast); > + virtual bool addPrologEpilogInserter(PassManagerBase &PM, bool > Fast); > + virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); > + virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, > + std::ostream &Out); > +}; > +} // end namespace llvm > + > +#endif > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Tue May 13 15:56:51 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 May 2008 20:56:51 -0000 Subject: [llvm-commits] [llvm] r51067 - in /llvm/trunk/win32: ./ Analysis/ Archive/ AsmParser/ Bitcode/ CBackend/ CodeGen/ Configure/ ExecutionEngine/ Fibonacci/ Linker/ Support/ System/ TableGen/ Target/ Transforms/ VMCore/ bugpoint/ llc/ lli/ llvm-ar/ llvm-as/ llvm-bcanalyzer/ llvm-dis/ llvm-ld/ llvm-link/ llvm-nm/ llvm-prof/ llvm-ranlib/ opt/ x86/ Message-ID: <200805132056.m4DKurFG003381@zion.cs.uiuc.edu> Author: lattner Date: Tue May 13 15:56:51 2008 New Revision: 51067 URL: http://llvm.org/viewvc/llvm-project?rev=51067&view=rev Log: Update the Win32 project files, patch by Razvan Aciu! Modified: llvm/trunk/win32/Analysis/Analysis.vcproj llvm/trunk/win32/Archive/Archive.vcproj llvm/trunk/win32/AsmParser/AsmParser.vcproj llvm/trunk/win32/Bitcode/Bitcode.vcproj llvm/trunk/win32/CBackend/CBackend.vcproj llvm/trunk/win32/CodeGen/CodeGen.vcproj llvm/trunk/win32/Configure/Configure.vcproj llvm/trunk/win32/ExecutionEngine/ExecutionEngine.vcproj llvm/trunk/win32/Fibonacci/Fibonacci.vcproj llvm/trunk/win32/Linker/Linker.vcproj llvm/trunk/win32/Support/Support.vcproj llvm/trunk/win32/System/System.vcproj llvm/trunk/win32/TableGen/TableGen.vcproj llvm/trunk/win32/Target/Target.vcproj llvm/trunk/win32/Transforms/Transforms.vcproj llvm/trunk/win32/VMCore/VMCore.vcproj llvm/trunk/win32/bugpoint/bugpoint.vcproj llvm/trunk/win32/llc/llc.vcproj llvm/trunk/win32/lli/lli.vcproj llvm/trunk/win32/llvm-ar/llvm-ar.vcproj llvm/trunk/win32/llvm-as/llvm-as.vcproj llvm/trunk/win32/llvm-bcanalyzer/llvm-bcanalyzer.vcproj llvm/trunk/win32/llvm-dis/llvm-dis.vcproj llvm/trunk/win32/llvm-ld/llvm-ld.vcproj llvm/trunk/win32/llvm-link/llvm-link.vcproj llvm/trunk/win32/llvm-nm/llvm-nm.vcproj llvm/trunk/win32/llvm-prof/llvm-prof.vcproj llvm/trunk/win32/llvm-ranlib/llvm-ranlib.vcproj llvm/trunk/win32/llvm.sln llvm/trunk/win32/opt/opt.vcproj llvm/trunk/win32/x86/x86.vcproj Modified: llvm/trunk/win32/Analysis/Analysis.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/Analysis/Analysis.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/Analysis/Analysis.vcproj (original) +++ llvm/trunk/win32/Analysis/Analysis.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ + + + + Modified: llvm/trunk/win32/Archive/Archive.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/Archive/Archive.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/Archive/Archive.vcproj (original) +++ llvm/trunk/win32/Archive/Archive.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ - Modified: llvm/trunk/win32/ExecutionEngine/ExecutionEngine.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/ExecutionEngine/ExecutionEngine.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/ExecutionEngine/ExecutionEngine.vcproj (original) +++ llvm/trunk/win32/ExecutionEngine/ExecutionEngine.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ - @@ -161,6 +161,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - Modified: llvm/trunk/win32/Linker/Linker.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/Linker/Linker.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/Linker/Linker.vcproj (original) +++ llvm/trunk/win32/Linker/Linker.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ - - Modified: llvm/trunk/win32/TableGen/TableGen.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/TableGen/TableGen.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/TableGen/TableGen.vcproj (original) +++ llvm/trunk/win32/TableGen/TableGen.vcproj Tue May 13 15:56:51 2008 @@ -1,11 +1,12 @@ - @@ -160,6 +160,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - Modified: llvm/trunk/win32/Target/Target.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/Target/Target.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/Target/Target.vcproj (original) +++ llvm/trunk/win32/Target/Target.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ + + Modified: llvm/trunk/win32/Transforms/Transforms.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/Transforms/Transforms.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/Transforms/Transforms.vcproj (original) +++ llvm/trunk/win32/Transforms/Transforms.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ + + @@ -396,10 +401,6 @@ > - - Modified: llvm/trunk/win32/VMCore/VMCore.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/VMCore/VMCore.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/VMCore/VMCore.vcproj (original) +++ llvm/trunk/win32/VMCore/VMCore.vcproj Tue May 13 15:56:51 2008 @@ -1,11 +1,12 @@ - @@ -158,6 +158,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - Modified: llvm/trunk/win32/llc/llc.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/llc/llc.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/llc/llc.vcproj (original) +++ llvm/trunk/win32/llc/llc.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ - @@ -160,6 +160,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - Modified: llvm/trunk/win32/lli/lli.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/lli/lli.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/lli/lli.vcproj (original) +++ llvm/trunk/win32/lli/lli.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ - @@ -160,6 +160,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - Modified: llvm/trunk/win32/llvm-ar/llvm-ar.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/llvm-ar/llvm-ar.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/llvm-ar/llvm-ar.vcproj (original) +++ llvm/trunk/win32/llvm-ar/llvm-ar.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ - @@ -158,6 +158,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - Modified: llvm/trunk/win32/llvm-as/llvm-as.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/llvm-as/llvm-as.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/llvm-as/llvm-as.vcproj (original) +++ llvm/trunk/win32/llvm-as/llvm-as.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ - @@ -158,6 +158,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - Modified: llvm/trunk/win32/llvm-bcanalyzer/llvm-bcanalyzer.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/llvm-bcanalyzer/llvm-bcanalyzer.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/llvm-bcanalyzer/llvm-bcanalyzer.vcproj (original) +++ llvm/trunk/win32/llvm-bcanalyzer/llvm-bcanalyzer.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ - @@ -158,6 +158,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - Modified: llvm/trunk/win32/llvm-dis/llvm-dis.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/llvm-dis/llvm-dis.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/llvm-dis/llvm-dis.vcproj (original) +++ llvm/trunk/win32/llvm-dis/llvm-dis.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ - @@ -158,6 +158,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - Modified: llvm/trunk/win32/llvm-ld/llvm-ld.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/llvm-ld/llvm-ld.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/llvm-ld/llvm-ld.vcproj (original) +++ llvm/trunk/win32/llvm-ld/llvm-ld.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ - @@ -158,6 +158,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - Modified: llvm/trunk/win32/llvm-link/llvm-link.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/llvm-link/llvm-link.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/llvm-link/llvm-link.vcproj (original) +++ llvm/trunk/win32/llvm-link/llvm-link.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ - @@ -158,6 +158,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - Modified: llvm/trunk/win32/llvm-nm/llvm-nm.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/llvm-nm/llvm-nm.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/llvm-nm/llvm-nm.vcproj (original) +++ llvm/trunk/win32/llvm-nm/llvm-nm.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ - @@ -158,6 +158,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - Modified: llvm/trunk/win32/llvm-prof/llvm-prof.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/llvm-prof/llvm-prof.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/llvm-prof/llvm-prof.vcproj (original) +++ llvm/trunk/win32/llvm-prof/llvm-prof.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ - @@ -158,6 +158,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - Modified: llvm/trunk/win32/llvm-ranlib/llvm-ranlib.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/llvm-ranlib/llvm-ranlib.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/llvm-ranlib/llvm-ranlib.vcproj (original) +++ llvm/trunk/win32/llvm-ranlib/llvm-ranlib.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ - @@ -158,6 +158,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - Modified: llvm/trunk/win32/llvm.sln URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/llvm.sln?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/llvm.sln (original) +++ llvm/trunk/win32/llvm.sln Tue May 13 15:56:51 2008 @@ -1,31 +1,27 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "support", "Support\Support.vcproj", "{28AA9146-3482-4F41-9CC6-407B1D258508}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TableGen", "TableGen\TableGen.vcproj", "{339C2249-26B6-4172-B484-85653029AF57}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TableGen", "TableGen\TableGen.vcproj", "{339C2249-26B6-4172-B484-85653029AF57}" ProjectSection(ProjectDependencies) = postProject {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Fibonacci", "Fibonacci\Fibonacci.vcproj", "{48FB551D-E37E-42EC-BC97-FF7219774867}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Fibonacci", "Fibonacci\Fibonacci.vcproj", "{48FB551D-E37E-42EC-BC97-FF7219774867}" ProjectSection(ProjectDependencies) = postProject {144EEBF6-8C9B-4473-B715-2C821666AF6C} = {144EEBF6-8C9B-4473-B715-2C821666AF6C} {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} @@ -36,100 +32,100 @@ {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExecutionEngine", "ExecutionEngine\ExecutionEngine.vcproj", "{76295AE8-A083-460E-9F80-6F2B8923264A}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExecutionEngine", "ExecutionEngine\ExecutionEngine.vcproj", "{76295AE8-A083-460E-9F80-6F2B8923264A}" ProjectSection(ProjectDependencies) = postProject {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VMCore", "VMCore\VMCore.vcproj", "{45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VMCore", "VMCore\VMCore.vcproj", "{45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}" ProjectSection(ProjectDependencies) = postProject {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Target", "Target\Target.vcproj", "{059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Target", "Target\Target.vcproj", "{059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}" ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CodeGen", "CodeGen\CodeGen.vcproj", "{08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CodeGen", "CodeGen\CodeGen.vcproj", "{08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}" ProjectSection(ProjectDependencies) = postProject {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "System", "System\System.vcproj", "{0F8407F3-FA23-4CF1-83A9-DCBE0B361489}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "System", "System\System.vcproj", "{0F8407F3-FA23-4CF1-83A9-DCBE0B361489}" ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Analysis", "Analysis\Analysis.vcproj", "{0622E827-8464-489D-8B1C-B0B496F35C08}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Analysis", "Analysis\Analysis.vcproj", "{0622E827-8464-489D-8B1C-B0B496F35C08}" ProjectSection(ProjectDependencies) = postProject {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x86", "x86\x86.vcproj", "{144EEBF6-8C9B-4473-B715-2C821666AF6C}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x86", "x86\x86.vcproj", "{144EEBF6-8C9B-4473-B715-2C821666AF6C}" ProjectSection(ProjectDependencies) = postProject {C59374C1-9FC0-4147-B836-327DFDC52D99} = {C59374C1-9FC0-4147-B836-327DFDC52D99} {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897} = {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897} {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Transforms", "Transforms\Transforms.vcproj", "{C59374C1-9FC0-4147-B836-327DFDC52D99}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Transforms", "Transforms\Transforms.vcproj", "{C59374C1-9FC0-4147-B836-327DFDC52D99}" ProjectSection(ProjectDependencies) = postProject {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Configure", "Configure\Configure.vcproj", "{19514E48-456C-4B9D-8637-F2285476461E}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lli", "lli\lli.vcproj", "{FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Configure", "Configure\Configure.vcproj", "{19514E48-456C-4B9D-8637-F2285476461E}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lli", "lli\lli.vcproj", "{FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}" ProjectSection(ProjectDependencies) = postProject {144EEBF6-8C9B-4473-B715-2C821666AF6C} = {144EEBF6-8C9B-4473-B715-2C821666AF6C} {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} @@ -141,12 +137,12 @@ {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llc", "llc\llc.vcproj", "{ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llc", "llc\llc.vcproj", "{ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}" ProjectSection(ProjectDependencies) = postProject {144EEBF6-8C9B-4473-B715-2C821666AF6C} = {144EEBF6-8C9B-4473-B715-2C821666AF6C} {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} @@ -158,12 +154,12 @@ {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-dis", "llvm-dis\llvm-dis.vcproj", "{B13476BC-30AB-4EA0-BC1E-212C0A459405}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-dis", "llvm-dis\llvm-dis.vcproj", "{B13476BC-30AB-4EA0-BC1E-212C0A459405}" ProjectSection(ProjectDependencies) = postProject {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} @@ -171,12 +167,12 @@ {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-as", "llvm-as\llvm-as.vcproj", "{4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-as", "llvm-as\llvm-as.vcproj", "{4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}" ProjectSection(ProjectDependencies) = postProject {3DC216F5-1DDD-478A-84F8-C124E5C31982} = {3DC216F5-1DDD-478A-84F8-C124E5C31982} {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} @@ -185,21 +181,21 @@ {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AsmParser", "AsmParser\AsmParser.vcproj", "{3DC216F5-1DDD-478A-84F8-C124E5C31982}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AsmParser", "AsmParser\AsmParser.vcproj", "{3DC216F5-1DDD-478A-84F8-C124E5C31982}" ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ar", "llvm-ar\llvm-ar.vcproj", "{0FF2B75C-49C1-4B49-A44A-531C93000296}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ar", "llvm-ar\llvm-ar.vcproj", "{0FF2B75C-49C1-4B49-A44A-531C93000296}" ProjectSection(ProjectDependencies) = postProject {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} @@ -208,12 +204,12 @@ {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ranlib", "llvm-ranlib\llvm-ranlib.vcproj", "{BB16C7EE-B4ED-4714-B5ED-B775C62A6612}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ranlib", "llvm-ranlib\llvm-ranlib.vcproj", "{BB16C7EE-B4ED-4714-B5ED-B775C62A6612}" ProjectSection(ProjectDependencies) = postProject {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} @@ -222,12 +218,12 @@ {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-link", "llvm-link\llvm-link.vcproj", "{5E249789-49E1-4600-B12B-8AD2BB6439B2}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-link", "llvm-link\llvm-link.vcproj", "{5E249789-49E1-4600-B12B-8AD2BB6439B2}" ProjectSection(ProjectDependencies) = postProject {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} @@ -236,33 +232,33 @@ {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Linker", "Linker\Linker.vcproj", "{342CF48F-760A-4040-A9A1-7D75AA2471CE}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Linker", "Linker\Linker.vcproj", "{342CF48F-760A-4040-A9A1-7D75AA2471CE}" ProjectSection(ProjectDependencies) = postProject {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CBackend", "CBackend\CBackend.vcproj", "{057777CD-DED5-46DF-BF9A-6B76DE212549}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CBackend", "CBackend\CBackend.vcproj", "{057777CD-DED5-46DF-BF9A-6B76DE212549}" ProjectSection(ProjectDependencies) = postProject {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opt", "opt\opt.vcproj", "{006D8B41-C3C7-4448-85E1-AF8907E591E5}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opt", "opt\opt.vcproj", "{006D8B41-C3C7-4448-85E1-AF8907E591E5}" ProjectSection(ProjectDependencies) = postProject {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} @@ -273,24 +269,24 @@ {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-bcanalyzer", "llvm-bcanalyzer\llvm-bcanalyzer.vcproj", "{E0B1E329-BE3E-456D-B372-5F397BE42C84}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-bcanalyzer", "llvm-bcanalyzer\llvm-bcanalyzer.vcproj", "{E0B1E329-BE3E-456D-B372-5F397BE42C84}" ProjectSection(ProjectDependencies) = postProject {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ld", "llvm-ld\llvm-ld.vcproj", "{64D8AA46-88DB-41F4-B837-053AE02406B8}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ld", "llvm-ld\llvm-ld.vcproj", "{64D8AA46-88DB-41F4-B837-053AE02406B8}" ProjectSection(ProjectDependencies) = postProject {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} @@ -303,12 +299,12 @@ {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-nm", "llvm-nm\llvm-nm.vcproj", "{5FF862CE-80A0-4B48-A80B-68AE325A0432}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-nm", "llvm-nm\llvm-nm.vcproj", "{5FF862CE-80A0-4B48-A80B-68AE325A0432}" ProjectSection(ProjectDependencies) = postProject {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} @@ -317,12 +313,12 @@ {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-prof", "llvm-prof\llvm-prof.vcproj", "{ACBE81D9-64B1-4133-823A-807A4E60B454}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-prof", "llvm-prof\llvm-prof.vcproj", "{ACBE81D9-64B1-4133-823A-807A4E60B454}" ProjectSection(ProjectDependencies) = postProject {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} @@ -331,12 +327,12 @@ {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bugpoint", "bugpoint\bugpoint.vcproj", "{57249192-8E29-4D85-8B7A-FEFF1760B1DA}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bugpoint", "bugpoint\bugpoint.vcproj", "{57249192-8E29-4D85-8B7A-FEFF1760B1DA}" ProjectSection(ProjectDependencies) = postProject {3DC216F5-1DDD-478A-84F8-C124E5C31982} = {3DC216F5-1DDD-478A-84F8-C124E5C31982} {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} @@ -349,25 +345,29 @@ {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Bitcode", "Bitcode\Bitcode.vcproj", "{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Bitcode", "Bitcode\Bitcode.vcproj", "{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}" ProjectSection(ProjectDependencies) = postProject {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Archive", "Archive\Archive.vcproj", "{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Archive", "Archive\Archive.vcproj", "{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}" ProjectSection(ProjectDependencies) = postProject {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Modified: llvm/trunk/win32/opt/opt.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/opt/opt.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/opt/opt.vcproj (original) +++ llvm/trunk/win32/opt/opt.vcproj Tue May 13 15:56:51 2008 @@ -1,10 +1,11 @@ - @@ -158,6 +158,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - Modified: llvm/trunk/win32/x86/x86.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/x86/x86.vcproj?rev=51067&r1=51066&r2=51067&view=diff ============================================================================== --- llvm/trunk/win32/x86/x86.vcproj (original) +++ llvm/trunk/win32/x86/x86.vcproj Tue May 13 15:56:51 2008 @@ -1,11 +1,12 @@ Author: resistor Date: Tue May 13 16:25:37 2008 New Revision: 51069 URL: http://llvm.org/viewvc/llvm-project?rev=51069&view=rev Log: Fix memdep's handling of invokes when finding the dependency of another call instruction. This fixes some Ada miscompiles reported in PR2324. Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=51069&r1=51068&r2=51069&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue May 13 16:25:37 2008 @@ -129,7 +129,7 @@ // FreeInsts erase the entire structure pointerSize = ~0UL; - } else if (isa(QI)) { + } else if (CallSite::get(QI).getInstruction() != 0) { AliasAnalysis::ModRefBehavior result = AA.getModRefBehavior(CallSite::get(QI)); if (result != AliasAnalysis::DoesNotAccessMemory) { From kremenek at apple.com Tue May 13 16:28:56 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 13 May 2008 21:28:56 -0000 Subject: [llvm-commits] [llvm] r51071 - /llvm/tags/checker/checker-28/ Message-ID: <200805132128.m4DLSuID004462@zion.cs.uiuc.edu> Author: kremenek Date: Tue May 13 16:28:56 2008 New Revision: 51071 URL: http://llvm.org/viewvc/llvm-project?rev=51071&view=rev Log: Tagging checker-28. Added: llvm/tags/checker/checker-28/ - copied from r51070, llvm/trunk/ From ggreif at gmail.com Tue May 13 16:59:34 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 13 May 2008 21:59:34 -0000 Subject: [llvm-commits] [llvm] r51073 - in /llvm/branches/ggreif/use-diet: include/llvm/Instructions.h include/llvm/Use.h lib/VMCore/Instructions.cpp lib/VMCore/Use.cpp Message-ID: <200805132159.m4DLxYE3005615@zion.cs.uiuc.edu> Author: ggreif Date: Tue May 13 16:59:34 2008 New Revision: 51073 URL: http://llvm.org/viewvc/llvm-project?rev=51073&view=rev Log: Do not rely on std::swap, provide a (faster) member function instead. This change is primarily necessitated by MSVC++'s incompatibility with declaring std::swap to be a friend of Use. Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h llvm/branches/ggreif/use-diet/include/llvm/Use.h llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Instructions.h?rev=51073&r1=51072&r2=51073&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Instructions.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Tue May 13 16:59:34 2008 @@ -760,7 +760,7 @@ /// @brief Swap operands and adjust predicate. void swapOperands() { SubclassData = getSwappedPredicate(); - std::swap(Op<0>(), Op<1>()); + Op<0>().swap(Op<1>()); } virtual ICmpInst *clone() const; @@ -879,7 +879,7 @@ /// @brief Swap operands and adjust predicate. void swapOperands() { SubclassData = getSwappedPredicate(); - std::swap(Op<0>(), Op<1>()); + Op<0>().swap(Op<1>()); } virtual FCmpInst *clone() const; Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Use.h?rev=51073&r1=51072&r2=51073&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Use.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Use.h Tue May 13 16:59:34 2008 @@ -67,18 +67,20 @@ // class Use { public: + /// init - specify Value and User + /// @deprecated in 2.4, will be removed soon inline void init(Value *V, User *U); + /// swap - provide a fast substitute to std::swap + /// that also works with less standard-compliant compilers + void swap(Use &RHS); private: - /// Allow std::swap some intimacy - template friend void std::swap(U&, U&); + /// Copy ctor - do not implement + Use(const Use &U); - /// Copy ctor - Only for std::swap - Use(const Use &U) { init(U.get(), 0); } - - /// Destructor - Only for zap() and std::swap + /// Destructor - Only for zap() inline ~Use() { - if (get()) removeFromList(); + if (Val) removeFromList(); } /// Default ctor - This leaves the Use completely uninitialized. The only thing @@ -107,7 +109,7 @@ return RHS; } const Use &operator=(const Use &RHS) { - set(RHS.get()); + set(RHS.Val); return *this; } Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp?rev=51073&r1=51072&r2=51073&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp Tue May 13 16:59:34 2008 @@ -1566,7 +1566,7 @@ bool BinaryOperator::swapOperands() { if (!isCommutative()) return true; // Can't commute operands - std::swap(Op<0>(), Op<1>()); + Op<0>().swap(Op<1>()); return false; } Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp?rev=51073&r1=51072&r2=51073&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Tue May 13 16:59:34 2008 @@ -16,6 +16,29 @@ namespace llvm { //===----------------------------------------------------------------------===// +// Use swap Implementation +//===----------------------------------------------------------------------===// + +void Use::swap(Use &RHS) { + Value *V1(Val); + Value *V2(RHS.Val); + if (V1 != V2) { + if (V1) { + removeFromList(); + } + if (V2) { + RHS.removeFromList(); + Val = V2; + V2->addUse(*this); + } + if (V1) { + RHS.Val = V1; + V1->addUse(RHS); + } + } +} + +//===----------------------------------------------------------------------===// // Use getImpliedUser Implementation //===----------------------------------------------------------------------===// From ggreif at gmail.com Tue May 13 17:31:30 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 13 May 2008 22:31:30 -0000 Subject: [llvm-commits] [llvm] r51074 - /llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Message-ID: <200805132231.m4DMVUBJ006495@zion.cs.uiuc.edu> Author: ggreif Date: Tue May 13 17:31:30 2008 New Revision: 51074 URL: http://llvm.org/viewvc/llvm-project?rev=51074&view=rev Log: do not forget to clear out Val Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp?rev=51074&r1=51073&r2=51074&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Tue May 13 17:31:30 2008 @@ -26,14 +26,20 @@ if (V1) { removeFromList(); } + if (V2) { RHS.removeFromList(); Val = V2; V2->addUse(*this); + } else { + Val = 0; } + if (V1) { RHS.Val = V1; V1->addUse(RHS); + } else { + RHS.Val = 0; } } } From dpatel at apple.com Tue May 13 17:43:21 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 13 May 2008 22:43:21 -0000 Subject: [llvm-commits] [llvm] r51075 - /llvm/trunk/lib/VMCore/Dominators.cpp Message-ID: <200805132243.m4DMhLZM006817@zion.cs.uiuc.edu> Author: dpatel Date: Tue May 13 17:43:21 2008 New Revision: 51075 URL: http://llvm.org/viewvc/llvm-project?rev=51075&view=rev Log: Dominance Frontier is cfg only pass. Modified: llvm/trunk/lib/VMCore/Dominators.cpp Modified: llvm/trunk/lib/VMCore/Dominators.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Dominators.cpp?rev=51075&r1=51074&r2=51075&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Dominators.cpp (original) +++ llvm/trunk/lib/VMCore/Dominators.cpp Tue May 13 17:43:21 2008 @@ -67,7 +67,7 @@ char DominanceFrontier::ID = 0; static RegisterPass -G("domfrontier", "Dominance Frontier Construction", false, true); +G("domfrontier", "Dominance Frontier Construction", true, true); // NewBB is split and now it has one successor. Update dominace frontier to // reflect this change. From dpatel at apple.com Tue May 13 17:44:27 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 13 May 2008 22:44:27 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r51076 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Message-ID: <200805132244.m4DMiSL9006857@zion.cs.uiuc.edu> Author: dpatel Date: Tue May 13 17:44:27 2008 New Revision: 51076 URL: http://llvm.org/viewvc/llvm-project?rev=51076&view=rev Log: Do not run instruction combiner in middle of loop optimization passes. Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=51076&r1=51075&r2=51076&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Tue May 13 17:44:27 2008 @@ -377,7 +377,6 @@ PM->add(createLICMPass()); // Hoist loop invariants PM->add(createLoopUnswitchPass(optimize_size ? true : false)); PM->add(createLoopIndexSplitPass()); // Split loop index - PM->add(createInstructionCombiningPass()); // Clean up after LICM/reassoc PM->add(createIndVarSimplifyPass()); // Canonicalize indvars PM->add(createLoopDeletionPass()); // Delete dead loops if (flag_unroll_loops) From resistor at mac.com Tue May 13 17:48:22 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 13 May 2008 17:48:22 -0500 Subject: [llvm-commits] [llvm-gcc-4.2] r51076 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp In-Reply-To: <200805132244.m4DMiSL9006857@zion.cs.uiuc.edu> References: <200805132244.m4DMiSL9006857@zion.cs.uiuc.edu> Message-ID: Should this be changed in opt too? --Owen On May 13, 2008, at 5:44 PM, Devang Patel wrote: > Author: dpatel > Date: Tue May 13 17:44:27 2008 > New Revision: 51076 > > URL: http://llvm.org/viewvc/llvm-project?rev=51076&view=rev > Log: > Do not run instruction combiner in middle of loop optimization passes. > > Modified: > llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp > > Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=51076&r1=51075&r2=51076&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) > +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Tue May 13 17:44:27 2008 > @@ -377,7 +377,6 @@ > PM->add(createLICMPass()); // Hoist loop > invariants > PM->add(createLoopUnswitchPass(optimize_size ? true : false)); > PM->add(createLoopIndexSplitPass()); // Split loop index > - PM->add(createInstructionCombiningPass()); // Clean up after > LICM/reassoc > PM->add(createIndVarSimplifyPass()); // Canonicalize > indvars > PM->add(createLoopDeletionPass()); // Delete dead loops > if (flag_unroll_loops) > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4260 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080513/b88fd998/attachment.bin From echristo at apple.com Tue May 13 17:51:04 2008 From: echristo at apple.com (Eric Christopher) Date: Tue, 13 May 2008 22:51:04 -0000 Subject: [llvm-commits] [llvm] r51077 - /llvm/trunk/include/llvm/Analysis/SparsePropagation.h Message-ID: <200805132251.m4DMp4DR007033@zion.cs.uiuc.edu> Author: echristo Date: Tue May 13 17:51:04 2008 New Revision: 51077 URL: http://llvm.org/viewvc/llvm-project?rev=51077&view=rev Log: Make this function public. Modified: llvm/trunk/include/llvm/Analysis/SparsePropagation.h Modified: llvm/trunk/include/llvm/Analysis/SparsePropagation.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/SparsePropagation.h?rev=51077&r1=51076&r2=51077&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/SparsePropagation.h (original) +++ llvm/trunk/include/llvm/Analysis/SparsePropagation.h Tue May 13 17:51:04 2008 @@ -146,6 +146,10 @@ /// LatticeVal getOrInitValueState(Value *V); + /// isEdgeFeasible - Return true if the control flow edge from the 'From' + /// basic block to the 'To' basic block is currently feasible... + bool isEdgeFeasible(BasicBlock *From, BasicBlock *To); + private: /// UpdateState - When the state for some instruction is potentially updated, /// this function notices and adds I to the worklist if needed. @@ -163,10 +167,6 @@ /// successors are reachable from a given terminator instruction. void getFeasibleSuccessors(TerminatorInst &TI, SmallVectorImpl &Succs); - /// isEdgeFeasible - Return true if the control flow edge from the 'From' - /// basic block to the 'To' basic block is currently feasible... - bool isEdgeFeasible(BasicBlock *From, BasicBlock *To); - void visitInst(Instruction &I); void visitPHINode(PHINode &I); void visitTerminatorInst(TerminatorInst &TI); From ggreif at gmail.com Tue May 13 17:51:52 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 13 May 2008 22:51:52 -0000 Subject: [llvm-commits] [llvm] r51078 - in /llvm/trunk: include/llvm/Instructions.h include/llvm/Use.h lib/VMCore/Instructions.cpp lib/VMCore/Use.cpp Message-ID: <200805132251.m4DMpqs9007064@zion.cs.uiuc.edu> Author: ggreif Date: Tue May 13 17:51:52 2008 New Revision: 51078 URL: http://llvm.org/viewvc/llvm-project?rev=51078&view=rev Log: Merge of r51073-51074 from use-diet branch. Do not rely on std::swap, provide a (faster) member function instead. This change is primarily necessitated by MSVC++'s incompatibility with declaring std::swap to be a friend of Use. Also contains some minor tweaks to Use inline functions, to undo pointless changes that sneaked in with the last merge. Modified: llvm/trunk/include/llvm/Instructions.h llvm/trunk/include/llvm/Use.h llvm/trunk/lib/VMCore/Instructions.cpp llvm/trunk/lib/VMCore/Use.cpp Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=51078&r1=51077&r2=51078&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Tue May 13 17:51:52 2008 @@ -760,7 +760,7 @@ /// @brief Swap operands and adjust predicate. void swapOperands() { SubclassData = getSwappedPredicate(); - std::swap(Op<0>(), Op<1>()); + Op<0>().swap(Op<1>()); } virtual ICmpInst *clone() const; @@ -879,7 +879,7 @@ /// @brief Swap operands and adjust predicate. void swapOperands() { SubclassData = getSwappedPredicate(); - std::swap(Op<0>(), Op<1>()); + Op<0>().swap(Op<1>()); } virtual FCmpInst *clone() const; Modified: llvm/trunk/include/llvm/Use.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Use.h?rev=51078&r1=51077&r2=51078&view=diff ============================================================================== --- llvm/trunk/include/llvm/Use.h (original) +++ llvm/trunk/include/llvm/Use.h Tue May 13 17:51:52 2008 @@ -67,18 +67,20 @@ // class Use { public: + /// init - specify Value and User + /// @deprecated in 2.4, will be removed soon inline void init(Value *V, User *U); + /// swap - provide a fast substitute to std::swap + /// that also works with less standard-compliant compilers + void swap(Use &RHS); private: - /// Allow std::swap some intimacy - template friend void std::swap(U&, U&); + /// Copy ctor - do not implement + Use(const Use &U); - /// Copy ctor - Only for std::swap - Use(const Use &U) { init(U.get(), 0); } - - /// Destructor - Only for zap() and std::swap + /// Destructor - Only for zap() inline ~Use() { - if (get()) removeFromList(); + if (Val) removeFromList(); } /// Default ctor - This leaves the Use completely uninitialized. The only thing @@ -107,7 +109,7 @@ return RHS; } const Use &operator=(const Use &RHS) { - set(RHS.get()); + set(RHS.Val); return *this; } Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=51078&r1=51077&r2=51078&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Tue May 13 17:51:52 2008 @@ -1563,7 +1563,7 @@ bool BinaryOperator::swapOperands() { if (!isCommutative()) return true; // Can't commute operands - std::swap(Op<0>(), Op<1>()); + Op<0>().swap(Op<1>()); return false; } Modified: llvm/trunk/lib/VMCore/Use.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Use.cpp?rev=51078&r1=51077&r2=51078&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Use.cpp (original) +++ llvm/trunk/lib/VMCore/Use.cpp Tue May 13 17:51:52 2008 @@ -16,6 +16,35 @@ namespace llvm { //===----------------------------------------------------------------------===// +// Use swap Implementation +//===----------------------------------------------------------------------===// + +void Use::swap(Use &RHS) { + Value *V1(Val); + Value *V2(RHS.Val); + if (V1 != V2) { + if (V1) { + removeFromList(); + } + + if (V2) { + RHS.removeFromList(); + Val = V2; + V2->addUse(*this); + } else { + Val = 0; + } + + if (V1) { + RHS.Val = V1; + V1->addUse(RHS); + } else { + RHS.Val = 0; + } + } +} + +//===----------------------------------------------------------------------===// // Use getImpliedUser Implementation //===----------------------------------------------------------------------===// From resistor at mac.com Tue May 13 18:18:30 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 13 May 2008 23:18:30 -0000 Subject: [llvm-commits] [llvm] r51082 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp Message-ID: <200805132318.m4DNIU0I007824@zion.cs.uiuc.edu> Author: resistor Date: Tue May 13 18:18:30 2008 New Revision: 51082 URL: http://llvm.org/viewvc/llvm-project?rev=51082&view=rev Log: Fix Analysis/BasicAA/pure-const-dce.ll. This turned out to be a correctness bug as well as a missed optimization. We weren't properly checking for local dependencies before moving on to non-local ones when doing non-local read-only call CSE. Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=51082&r1=51081&r2=51082&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Tue May 13 18:18:30 2008 @@ -441,6 +441,43 @@ return nextValueNumber++; } + Instruction* local_dep = MD->getDependency(C); + + if (local_dep == MemoryDependenceAnalysis::None) { + valueNumbering.insert(std::make_pair(V, nextValueNumber)); + return nextValueNumber++; + } else if (local_dep != MemoryDependenceAnalysis::NonLocal) { + if (!isa(local_dep)) { + valueNumbering.insert(std::make_pair(V, nextValueNumber)); + return nextValueNumber++; + } + + CallInst* local_cdep = cast(local_dep); + + if (local_cdep->getCalledFunction() != C->getCalledFunction() || + local_cdep->getNumOperands() != C->getNumOperands()) { + valueNumbering.insert(std::make_pair(V, nextValueNumber)); + return nextValueNumber++; + } else if (!C->getCalledFunction()) { + valueNumbering.insert(std::make_pair(V, nextValueNumber)); + return nextValueNumber++; + } else { + for (unsigned i = 1; i < C->getNumOperands(); ++i) { + uint32_t c_vn = lookup_or_add(C->getOperand(i)); + uint32_t cd_vn = lookup_or_add(local_cdep->getOperand(i)); + if (c_vn != cd_vn) { + valueNumbering.insert(std::make_pair(V, nextValueNumber)); + return nextValueNumber++; + } + } + + uint32_t v = lookup_or_add(local_cdep); + valueNumbering.insert(std::make_pair(V, v)); + return v; + } + } + + DenseMap deps; MD->getNonLocalDependency(C, deps); CallInst* cdep = 0; @@ -488,7 +525,7 @@ } } - uint32_t v = valueNumbering[cdep]; + uint32_t v = lookup_or_add(cdep); valueNumbering.insert(std::make_pair(V, v)); return v; } From dpatel at apple.com Tue May 13 19:23:57 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 13 May 2008 17:23:57 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r51076 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp In-Reply-To: References: <200805132244.m4DMiSL9006857@zion.cs.uiuc.edu> Message-ID: <269C0056-E3B6-4B47-8400-81AF500CD91F@apple.com> On May 13, 2008, at 3:48 PM, Owen Anderson wrote: > Should this be changed in opt too? and lto and llvm-ld ... :) - Devang From gohman at apple.com Tue May 13 19:24:15 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 14 May 2008 00:24:15 -0000 Subject: [llvm-commits] [llvm] r51083 - in /llvm/trunk: include/llvm/Analysis/LoopInfo.h lib/Transforms/Scalar/LoopUnroll.cpp lib/Transforms/Utils/UnrollLoop.cpp Message-ID: <200805140024.m4E0OF5Y009664@zion.cs.uiuc.edu> Author: djg Date: Tue May 13 19:24:14 2008 New Revision: 51083 URL: http://llvm.org/viewvc/llvm-project?rev=51083&view=rev Log: Split the loop unroll mechanism logic out into a utility function. Patch by Matthijs Kooijman! Added: llvm/trunk/lib/Transforms/Utils/UnrollLoop.cpp - copied, changed from r51013, llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=51083&r1=51082&r2=51083&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Tue May 13 19:24:14 2008 @@ -418,6 +418,59 @@ return 0; } + /// getSmallConstantTripCount - Returns the trip count of this loop as a + /// normal unsigned value, if possible. Returns 0 if the trip count is unknown + /// of not constant. Will also return 0 if the trip count is very large + /// (>= 2^32) + inline unsigned getSmallConstantTripCount() const { + Value* TripCount = this->getTripCount(); + if (TripCount) { + if (ConstantInt *TripCountC = dyn_cast(TripCount)) { + // Guard against huge trip counts. + if (TripCountC->getValue().getActiveBits() <= 32) { + return (unsigned)TripCountC->getZExtValue(); + } + } + } + return 0; + } + + /// getSmallConstantTripMultiple - Returns the largest constant divisor of the + /// trip count of this loop as a normal unsigned value, if possible. This + /// means that the actual trip count is always a multiple of the returned + /// value (don't forget the trip count could very well be zero as well!). + /// + /// Returns 1 if the trip count is unknown or not guaranteed to be the + /// multiple of a constant (which is also the case if the trip count is simply + /// constant, use getSmallConstantTripCount for that case), Will also return 1 + /// if the trip count is very large (>= 2^32). + inline unsigned getSmallConstantTripMultiple() const { + Value* TripCount = this->getTripCount(); + // This will hold the ConstantInt result, if any + ConstantInt *Result = NULL; + if (TripCount) { + // See if the trip count is constant itself + Result = dyn_cast(TripCount); + // if not, see if it is a multiplication + if (!Result) + if (BinaryOperator *BO = dyn_cast(TripCount)) { + switch (BO->getOpcode()) { + case BinaryOperator::Mul: + Result = dyn_cast(BO->getOperand(1)); + break; + default: + break; + } + } + } + // Guard against huge trip counts. + if (Result && Result->getValue().getActiveBits() <= 32) { + return (unsigned)Result->getZExtValue(); + } else { + return 1; + } + } + /// isLCSSAForm - Return true if the Loop is in LCSSA form inline bool isLCSSAForm() const { // Sort the blocks vector so that we can use binary search to do quick Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp?rev=51083&r1=51082&r2=51083&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp Tue May 13 19:24:14 2008 @@ -10,39 +10,19 @@ // This pass implements a simple loop unroller. It works best when loops have // been canonicalized by the -indvars pass, allowing it to determine the trip // counts of loops easily. -// -// 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. -// //===----------------------------------------------------------------------===// #define DEBUG_TYPE "loop-unroll" +#include "llvm/IntrinsicInst.h" #include "llvm/Transforms/Scalar.h" -#include "llvm/Constants.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" -#include "llvm/Analysis/ConstantFolding.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/LoopPass.h" -#include "llvm/Transforms/Utils/Cloning.h" -#include "llvm/Transforms/Utils/Local.h" -#include "llvm/Support/CFG.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/MathExtras.h" -#include "llvm/ADT/Statistic.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/SmallPtrSet.h" -#include "llvm/IntrinsicInst.h" -#include -#include -#include -using namespace llvm; +#include "llvm/Transforms/Utils/UnrollLoop.h" -STATISTIC(NumCompletelyUnrolled, "Number of loops completely unrolled"); -STATISTIC(NumUnrolled, "Number of loops unrolled (completely or otherwise)"); +using namespace llvm; static cl::opt UnrollThreshold("unroll-threshold", cl::init(100), cl::Hidden, @@ -54,7 +34,6 @@ namespace { class VISIBILITY_HIDDEN LoopUnroll : public LoopPass { - LoopInfo *LI; // The current loop information public: static char ID; // Pass ID, replacement for typeid LoopUnroll() : LoopPass((intptr_t)&ID) {} @@ -65,8 +44,6 @@ static const unsigned NoThreshold = UINT_MAX; bool runOnLoop(Loop *L, LPPassManager &LPM); - bool unrollLoop(Loop *L, unsigned Count, unsigned Threshold); - BasicBlock *FoldBlockIntoPredecessor(BasicBlock *BB); /// This transformation requires natural loop information & requires that /// loop preheaders be inserted into the CFG... @@ -121,136 +98,18 @@ return Size; } -// RemapInstruction - Convert the instruction operands from referencing the -// current values into those specified by ValueMap. -// -static inline void RemapInstruction(Instruction *I, - DenseMap &ValueMap) { - for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) { - Value *Op = I->getOperand(op); - DenseMap::iterator It = ValueMap.find(Op); - if (It != ValueMap.end()) Op = It->second; - I->setOperand(op, Op); - } -} - -// FoldBlockIntoPredecessor - Folds a basic block into its predecessor if it -// only has one predecessor, and that predecessor only has one successor. -// 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. - // - BasicBlock *OnlyPred = BB->getSinglePredecessor(); - if (!OnlyPred) return 0; - - if (OnlyPred->getTerminator()->getNumSuccessors() != 1) - return 0; - - DOUT << "Merging: " << *BB << "into: " << *OnlyPred; - - // Resolve any PHI nodes at the start of the block. They are all - // guaranteed to have exactly one entry if they exist, unless there are - // multiple duplicate (but guaranteed to be equal) entries for the - // incoming edges. This occurs when there are multiple edges from - // OnlyPred to OnlySucc. - // - while (PHINode *PN = dyn_cast(&BB->front())) { - PN->replaceAllUsesWith(PN->getIncomingValue(0)); - BB->getInstList().pop_front(); // Delete the phi node... - } - - // Delete the unconditional branch from the predecessor... - OnlyPred->getInstList().pop_back(); - - // Move all definitions in the successor to the predecessor... - OnlyPred->getInstList().splice(OnlyPred->end(), BB->getInstList()); - - // Make all PHI nodes that referred to BB now refer to Pred as their - // source... - BB->replaceAllUsesWith(OnlyPred); - - std::string OldName = BB->getName(); - - // Erase basic block from the function... - LI->removeBlock(BB); - BB->eraseFromParent(); - - // Inherit predecessor's name if it exists... - if (!OldName.empty() && !OnlyPred->hasName()) - OnlyPred->setName(OldName); - - return OnlyPred; -} - bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) { - LI = &getAnalysis(); - - // Unroll the loop. - if (!unrollLoop(L, UnrollCount, UnrollThreshold)) - return false; - - // Update the loop information for this loop. - // If we completely unrolled the loop, remove it from the parent. - if (L->getNumBackEdges() == 0) - LPM.deleteLoopFromQueue(L); - - return true; -} - -/// Unroll the given loop by UnrollCount, or by a heuristically-determined -/// value if Count is zero. If Threshold is not NoThreshold, it is a value -/// to limit code size expansion. If the loop size would expand beyond the -/// threshold value, unrolling is suppressed. The return value is true if -/// any transformations are performed. -/// -bool LoopUnroll::unrollLoop(Loop *L, unsigned Count, unsigned Threshold) { assert(L->isLCSSAForm()); + LoopInfo *LI = &getAnalysis(); BasicBlock *Header = L->getHeader(); - BasicBlock *LatchBlock = L->getLoopLatch(); - BranchInst *BI = dyn_cast(LatchBlock->getTerminator()); - DOUT << "Loop Unroll: F[" << Header->getParent()->getName() << "] Loop %" << Header->getName() << "\n"; - if (!BI || BI->isUnconditional()) { - // The loop-rotate pass can be helpful to avoid this in many cases. - DOUT << " Can't unroll; loop not terminated by a conditional branch.\n"; - return false; - } - - // Determine the trip count and/or trip multiple. A TripCount value of zero - // is used to mean an unknown trip count. The TripMultiple value is the - // greatest known integer multiple of the trip count. - unsigned TripCount = 0; - unsigned TripMultiple = 1; - if (Value *TripCountValue = L->getTripCount()) { - if (ConstantInt *TripCountC = dyn_cast(TripCountValue)) { - // Guard against huge trip counts. This also guards against assertions in - // APInt from the use of getZExtValue, below. - if (TripCountC->getValue().getActiveBits() <= 32) { - TripCount = (unsigned)TripCountC->getZExtValue(); - } - } else if (BinaryOperator *BO = dyn_cast(TripCountValue)) { - switch (BO->getOpcode()) { - case BinaryOperator::Mul: - if (ConstantInt *MultipleC = dyn_cast(BO->getOperand(1))) { - if (MultipleC->getValue().getActiveBits() <= 32) { - TripMultiple = (unsigned)MultipleC->getZExtValue(); - } - } - break; - default: break; - } - } - } - if (TripCount != 0) - DOUT << " Trip Count = " << TripCount << "\n"; - if (TripMultiple != 1) - DOUT << " Trip Multiple = " << TripMultiple << "\n"; - + // Find trip count + unsigned TripCount = L->getSmallConstantTripCount(); + unsigned Count = UnrollCount; + // Automatically select an unroll count. if (Count == 0) { // Conservative heuristic: if we know the trip count, see if we can @@ -263,245 +122,21 @@ } } - // Effectively "DCE" unrolled iterations that are beyond the tripcount - // and will never be executed. - if (TripCount != 0 && Count > TripCount) - Count = TripCount; - - assert(Count > 0); - assert(TripMultiple > 0); - assert(TripCount == 0 || TripCount % TripMultiple == 0); - // Enforce the threshold. - if (Threshold != NoThreshold) { + if (UnrollThreshold != NoThreshold) { unsigned LoopSize = ApproximateLoopSize(L); DOUT << " Loop Size = " << LoopSize << "\n"; uint64_t Size = (uint64_t)LoopSize*Count; - if (TripCount != 1 && Size > Threshold) { + if (TripCount != 1 && Size > UnrollThreshold) { DOUT << " TOO LARGE TO UNROLL: " - << Size << ">" << Threshold << "\n"; + << Size << ">" << UnrollThreshold << "\n"; return false; } } - // Are we eliminating the loop control altogether? - bool CompletelyUnroll = Count == TripCount; - - // If we know the trip count, we know the multiple... - unsigned BreakoutTrip = 0; - if (TripCount != 0) { - BreakoutTrip = TripCount % Count; - TripMultiple = 0; - } else { - // Figure out what multiple to use. - BreakoutTrip = TripMultiple = - (unsigned)GreatestCommonDivisor64(Count, TripMultiple); - } - - if (CompletelyUnroll) { - DOUT << "COMPLETELY UNROLLING loop %" << Header->getName() - << " with trip count " << TripCount << "!\n"; - } else { - DOUT << "UNROLLING loop %" << Header->getName() - << " by " << Count; - if (TripMultiple == 0 || BreakoutTrip != TripMultiple) { - DOUT << " with a breakout at trip " << BreakoutTrip; - } else if (TripMultiple != 1) { - DOUT << " with " << TripMultiple << " trips per branch"; - } - DOUT << "!\n"; - } - - std::vector LoopBlocks = L->getBlocks(); - - bool ContinueOnTrue = L->contains(BI->getSuccessor(0)); - BasicBlock *LoopExit = BI->getSuccessor(ContinueOnTrue); - - // For the first iteration of the loop, we should use the precloned values for - // PHI nodes. Insert associations now. - typedef DenseMap ValueMapTy; - ValueMapTy LastValueMap; - std::vector OrigPHINode; - for (BasicBlock::iterator I = Header->begin(); isa(I); ++I) { - PHINode *PN = cast(I); - OrigPHINode.push_back(PN); - if (Instruction *I = - dyn_cast(PN->getIncomingValueForBlock(LatchBlock))) - if (L->contains(I->getParent())) - LastValueMap[I] = I; - } - - std::vector Headers; - std::vector Latches; - Headers.push_back(Header); - Latches.push_back(LatchBlock); - - for (unsigned It = 1; It != Count; ++It) { - char SuffixBuffer[100]; - sprintf(SuffixBuffer, ".%d", It); - - std::vector NewBlocks; - - for (std::vector::iterator BB = LoopBlocks.begin(), - E = LoopBlocks.end(); BB != E; ++BB) { - ValueMapTy ValueMap; - BasicBlock *New = CloneBasicBlock(*BB, ValueMap, SuffixBuffer); - Header->getParent()->getBasicBlockList().push_back(New); - - // Loop over all of the PHI nodes in the block, changing them to use the - // incoming values from the previous block. - if (*BB == Header) - for (unsigned i = 0, e = OrigPHINode.size(); i != e; ++i) { - PHINode *NewPHI = cast(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 (ValueMapTy::iterator VI = ValueMap.begin(), VE = ValueMap.end(); - VI != VE; ++VI) - LastValueMap[VI->first] = VI->second; - - L->addBasicBlockToLoop(New, LI->getBase()); - - // Add phi entries for newly created values to all exit blocks except - // the successor of the latch block. The successor of the exit block will - // be updated specially after unrolling all the way. - if (*BB != LatchBlock) - for (Value::use_iterator UI = (*BB)->use_begin(), UE = (*BB)->use_end(); - UI != UE;) { - Instruction *UseInst = cast(*UI); - ++UI; - if (isa(UseInst) && !L->contains(UseInst->getParent())) { - PHINode *phi = cast(UseInst); - Value *Incoming = phi->getIncomingValueForBlock(*BB); - phi->addIncoming(Incoming, New); - } - } - - // Keep track of new headers and latches as we create them, so that - // we can insert the proper branches later. - if (*BB == Header) - Headers.push_back(New); - if (*BB == LatchBlock) { - Latches.push_back(New); - - // Also, clear out the new latch's back edge so that it doesn't look - // like a new loop, so that it's amenable to being merged with adjacent - // blocks later on. - TerminatorInst *Term = New->getTerminator(); - assert(L->contains(Term->getSuccessor(!ContinueOnTrue))); - assert(Term->getSuccessor(ContinueOnTrue) == LoopExit); - Term->setSuccessor(!ContinueOnTrue, NULL); - } - - NewBlocks.push_back(New); - } - - // Remap all instructions in the most recent iteration - for (unsigned i = 0; i < NewBlocks.size(); ++i) - for (BasicBlock::iterator I = NewBlocks[i]->begin(), - E = NewBlocks[i]->end(); I != E; ++I) - RemapInstruction(I, LastValueMap); - } - - // The latch block exits the loop. If there are any PHI nodes in the - // successor blocks, update them to use the appropriate values computed as the - // last iteration of the loop. - if (Count != 1) { - SmallPtrSet 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); - - BasicBlock *LastIterationBB = cast(LastValueMap[LatchBlock]); - for (SmallPtrSet::iterator SI = Users.begin(), SE = Users.end(); - SI != SE; ++SI) { - PHINode *PN = *SI; - Value *InVal = PN->removeIncomingValue(LatchBlock, false); - // If this value was defined in the loop, take the value defined by the - // last iteration of the loop. - if (Instruction *InValI = dyn_cast(InVal)) { - if (L->contains(InValI->getParent())) - InVal = LastValueMap[InVal]; - } - PN->addIncoming(InVal, LastIterationBB); - } - } - - // Now, if we're doing complete unrolling, loop over the PHI nodes in the - // original block, setting them to their incoming values. - if (CompletelyUnroll) { - BasicBlock *Preheader = L->getLoopPreheader(); - for (unsigned i = 0, e = OrigPHINode.size(); i != e; ++i) { - PHINode *PN = OrigPHINode[i]; - PN->replaceAllUsesWith(PN->getIncomingValueForBlock(Preheader)); - Header->getInstList().erase(PN); - } - } - - // Now that all the basic blocks for the unrolled iterations are in place, - // set up the branches to connect them. - for (unsigned i = 0, e = Latches.size(); i != e; ++i) { - // The original branch was replicated in each unrolled iteration. - BranchInst *Term = cast(Latches[i]->getTerminator()); - - // The branch destination. - unsigned j = (i + 1) % e; - BasicBlock *Dest = Headers[j]; - bool NeedConditional = true; - - // For a complete unroll, make the last iteration end with a branch - // to the exit block. - if (CompletelyUnroll && j == 0) { - Dest = LoopExit; - NeedConditional = false; - } - - // If we know the trip count or a multiple of it, we can safely use an - // unconditional branch for some iterations. - if (j != BreakoutTrip && (TripMultiple == 0 || j % TripMultiple != 0)) { - NeedConditional = false; - } - - if (NeedConditional) { - // Update the conditional branch's successor for the following - // iteration. - Term->setSuccessor(!ContinueOnTrue, Dest); - } else { - Term->setUnconditionalDest(Dest); - // Merge adjacent basic blocks, if possible. - if (BasicBlock *Fold = FoldBlockIntoPredecessor(Dest)) { - std::replace(Latches.begin(), Latches.end(), Dest, Fold); - std::replace(Headers.begin(), Headers.end(), Dest, Fold); - } - } - } - - // At this point, the code is well formed. We now do a quick sweep over the - // inserted code, doing constant propagation and dead code elimination as we - // go. - const std::vector &NewLoopBlocks = L->getBlocks(); - for (std::vector::const_iterator BB = NewLoopBlocks.begin(), - BBE = NewLoopBlocks.end(); BB != BBE; ++BB) - for (BasicBlock::iterator I = (*BB)->begin(), E = (*BB)->end(); I != E; ) { - Instruction *Inst = I++; - - if (isInstructionTriviallyDead(Inst)) - (*BB)->getInstList().erase(Inst); - else if (Constant *C = ConstantFoldInstruction(Inst)) { - Inst->replaceAllUsesWith(C); - (*BB)->getInstList().erase(Inst); - } - } + // Unroll the loop. + if (!UnrollLoop(L, Count, LI, &LPM)) + return false; - NumCompletelyUnrolled += CompletelyUnroll; - ++NumUnrolled; return true; } Copied: llvm/trunk/lib/Transforms/Utils/UnrollLoop.cpp (from r51013, llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/UnrollLoop.cpp?p2=llvm/trunk/lib/Transforms/Utils/UnrollLoop.cpp&p1=llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp&r1=51013&r2=51083&rev=51083&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/UnrollLoop.cpp Tue May 13 19:24:14 2008 @@ -1,4 +1,4 @@ -//===-- LoopUnroll.cpp - Loop unroller pass -------------------------------===// +//===-- UnrollLoop.cpp - Loop unrolling utilities -------------------------===// // // The LLVM Compiler Infrastructure // @@ -7,124 +7,35 @@ // //===----------------------------------------------------------------------===// // -// This pass implements a simple loop unroller. It works best when loops have -// been canonicalized by the -indvars pass, allowing it to determine the trip -// counts of loops easily. +// This file implements some loop unrolling utilities. It does not define any +// actual pass or policy, but provides a single function to perform loop +// unrolling. // -// 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. +// It works best when loops have been canonicalized by the -indvars pass, +// allowing it to determine the trip counts of loops easily. // +// The process of unrolling can produce extraneous basic blocks linked with +// unconditional branches. This will be corrected in the future. //===----------------------------------------------------------------------===// #define DEBUG_TYPE "loop-unroll" -#include "llvm/Transforms/Scalar.h" -#include "llvm/Constants.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" +#include "llvm/Transforms/Utils/UnrollLoop.h" +#include "llvm/BasicBlock.h" +#include "llvm/ADT/Statistic.h" #include "llvm/Analysis/ConstantFolding.h" -#include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/LoopPass.h" +#include "llvm/Support/Debug.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Transforms/Utils/Local.h" -#include "llvm/Support/CFG.h" -#include "llvm/Support/Compiler.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/MathExtras.h" -#include "llvm/ADT/Statistic.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/SmallPtrSet.h" -#include "llvm/IntrinsicInst.h" -#include -#include -#include + using namespace llvm; +/* TODO: Should these be here or in LoopUnroll? */ STATISTIC(NumCompletelyUnrolled, "Number of loops completely unrolled"); STATISTIC(NumUnrolled, "Number of loops unrolled (completely or otherwise)"); -namespace { - static cl::opt - UnrollThreshold - ("unroll-threshold", cl::init(100), cl::Hidden, - cl::desc("The cut-off point for automatic loop unrolling")); - - static cl::opt - UnrollCount - ("unroll-count", cl::init(0), cl::Hidden, - cl::desc("Use this unroll count for all loops, for testing purposes")); - - class VISIBILITY_HIDDEN LoopUnroll : public LoopPass { - LoopInfo *LI; // The current loop information - public: - static char ID; // Pass ID, replacement for typeid - LoopUnroll() : LoopPass((intptr_t)&ID) {} - - /// A magic value for use with the Threshold parameter to indicate - /// that the loop unroll should be performed regardless of how much - /// code expansion would result. - static const unsigned NoThreshold = UINT_MAX; - - bool runOnLoop(Loop *L, LPPassManager &LPM); - bool unrollLoop(Loop *L, unsigned Count, unsigned Threshold); - BasicBlock *FoldBlockIntoPredecessor(BasicBlock *BB); - - /// This transformation requires natural loop information & requires that - /// loop preheaders be inserted into the CFG... - /// - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(LoopSimplifyID); - AU.addRequiredID(LCSSAID); - AU.addRequired(); - AU.addPreservedID(LCSSAID); - AU.addPreserved(); - } - }; - char LoopUnroll::ID = 0; - RegisterPass X("loop-unroll", "Unroll loops"); -} - -LoopPass *llvm::createLoopUnrollPass() { return new LoopUnroll(); } - -/// ApproximateLoopSize - Approximate the size of the loop. -static unsigned ApproximateLoopSize(const Loop *L) { - unsigned Size = 0; - for (unsigned i = 0, e = L->getBlocks().size(); i != e; ++i) { - BasicBlock *BB = L->getBlocks()[i]; - Instruction *Term = BB->getTerminator(); - for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) { - if (isa(I) && BB == L->getHeader()) { - // Ignore PHI nodes in the header. - } else if (I->hasOneUse() && I->use_back() == Term) { - // Ignore instructions only used by the loop terminator. - } else if (isa(I)) { - // Ignore debug instructions - } else if (isa(I)) { - // Estimate size overhead introduced by call instructions which - // is higher than other instructions. Here 3 and 10 are magic - // numbers that help one isolated test case from PR2067 without - // negatively impacting measured benchmarks. - if (isa(I)) - Size = Size + 3; - else - Size = Size + 10; - } else { - ++Size; - } - - // TODO: Ignore expressions derived from PHI and constants if inval of phi - // is a constant, or if operation is associative. This will get induction - // variables. - } - } - - return Size; -} - -// RemapInstruction - Convert the instruction operands from referencing the -// current values into those specified by ValueMap. -// +/// RemapInstruction - Convert the instruction operands from referencing the +/// current values into those specified by ValueMap. static inline void RemapInstruction(Instruction *I, DenseMap &ValueMap) { for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) { @@ -135,14 +46,14 @@ } } -// 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) { +/// FoldBlockIntoPredecessor - Folds a basic block into its predecessor if it +/// only has one predecessor, and that predecessor only has one successor. +/// The LoopInfo Analysis that is passed will be kept consistent. +/// Returns the new combined block. +static BasicBlock *FoldBlockIntoPredecessor(BasicBlock *BB, LoopInfo* LI) { // Merge basic blocks into their predecessor if there is only one distinct // pred, and if there is only one distinct successor of the predecessor, and // if there are no PHI nodes. - // BasicBlock *OnlyPred = BB->getSinglePredecessor(); if (!OnlyPred) return 0; @@ -185,85 +96,41 @@ return OnlyPred; } -bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) { - LI = &getAnalysis(); - - // Unroll the loop. - if (!unrollLoop(L, UnrollCount, UnrollThreshold)) - return false; - - // Update the loop information for this loop. - // If we completely unrolled the loop, remove it from the parent. - if (L->getNumBackEdges() == 0) - LPM.deleteLoopFromQueue(L); - - return true; -} - -/// Unroll the given loop by UnrollCount, or by a heuristically-determined -/// value if Count is zero. If Threshold is not NoThreshold, it is a value -/// to limit code size expansion. If the loop size would expand beyond the -/// threshold value, unrolling is suppressed. The return value is true if -/// any transformations are performed. +/// Unroll the given loop by Count. The loop must be in LCSSA form. Returns true +/// if unrolling was succesful, or false if the loop was unmodified. Unrolling +/// can only fail when the loop's latch block is not terminated by a conditional +/// branch instruction. However, if the trip count (and multiple) are not known, +/// loop unrolling will mostly produce more code that is no faster. /// -bool LoopUnroll::unrollLoop(Loop *L, unsigned Count, unsigned Threshold) { +/// The LoopInfo Analysis that is passed will be kept consistent. +/// +/// If a LoopPassManager is passed in, and the loop is fully removed, it will be +/// removed from the LoopPassManager as well. LPM can also be NULL. +bool llvm::UnrollLoop(Loop *L, unsigned Count, LoopInfo* LI, LPPassManager* LPM) { assert(L->isLCSSAForm()); BasicBlock *Header = L->getHeader(); BasicBlock *LatchBlock = L->getLoopLatch(); BranchInst *BI = dyn_cast(LatchBlock->getTerminator()); - - DOUT << "Loop Unroll: F[" << Header->getParent()->getName() - << "] Loop %" << Header->getName() << "\n"; - + if (!BI || BI->isUnconditional()) { // The loop-rotate pass can be helpful to avoid this in many cases. DOUT << " Can't unroll; loop not terminated by a conditional branch.\n"; return false; } - // Determine the trip count and/or trip multiple. A TripCount value of zero - // is used to mean an unknown trip count. The TripMultiple value is the - // greatest known integer multiple of the trip count. - unsigned TripCount = 0; + // Find trip count + unsigned TripCount = L->getSmallConstantTripCount(); + // Find trip multiple if count is not available unsigned TripMultiple = 1; - if (Value *TripCountValue = L->getTripCount()) { - if (ConstantInt *TripCountC = dyn_cast(TripCountValue)) { - // Guard against huge trip counts. This also guards against assertions in - // APInt from the use of getZExtValue, below. - if (TripCountC->getValue().getActiveBits() <= 32) { - TripCount = (unsigned)TripCountC->getZExtValue(); - } - } else if (BinaryOperator *BO = dyn_cast(TripCountValue)) { - switch (BO->getOpcode()) { - case BinaryOperator::Mul: - if (ConstantInt *MultipleC = dyn_cast(BO->getOperand(1))) { - if (MultipleC->getValue().getActiveBits() <= 32) { - TripMultiple = (unsigned)MultipleC->getZExtValue(); - } - } - break; - default: break; - } - } - } + if (TripCount == 0) + TripMultiple = L->getSmallConstantTripMultiple(); + if (TripCount != 0) DOUT << " Trip Count = " << TripCount << "\n"; if (TripMultiple != 1) DOUT << " Trip Multiple = " << TripMultiple << "\n"; - // Automatically select an unroll count. - if (Count == 0) { - // Conservative heuristic: if we know the trip count, see if we can - // completely unroll (subject to the threshold, checked below); otherwise - // don't unroll. - if (TripCount != 0) { - Count = TripCount; - } else { - return false; - } - } - // Effectively "DCE" unrolled iterations that are beyond the tripcount // and will never be executed. if (TripCount != 0 && Count > TripCount) @@ -273,18 +140,6 @@ assert(TripMultiple > 0); assert(TripCount == 0 || TripCount % TripMultiple == 0); - // Enforce the threshold. - if (Threshold != NoThreshold) { - unsigned LoopSize = ApproximateLoopSize(L); - DOUT << " Loop Size = " << LoopSize << "\n"; - uint64_t Size = (uint64_t)LoopSize*Count; - if (TripCount != 1 && Size > Threshold) { - DOUT << " TOO LARGE TO UNROLL: " - << Size << ">" << Threshold << "\n"; - return false; - } - } - // Are we eliminating the loop control altogether? bool CompletelyUnroll = Count == TripCount; @@ -478,7 +333,7 @@ } else { Term->setUnconditionalDest(Dest); // Merge adjacent basic blocks, if possible. - if (BasicBlock *Fold = FoldBlockIntoPredecessor(Dest)) { + if (BasicBlock *Fold = FoldBlockIntoPredecessor(Dest, LI)) { std::replace(Latches.begin(), Latches.end(), Dest, Fold); std::replace(Headers.begin(), Headers.end(), Dest, Fold); } @@ -504,5 +359,13 @@ NumCompletelyUnrolled += CompletelyUnroll; ++NumUnrolled; + // Remove the loop from the LoopPassManager if it's completely removed. + if (CompletelyUnroll && LPM != NULL) + LPM->deleteLoopFromQueue(L); + + // If we didn't completely unroll the loop, it should still be in LCSSA form. + if (!CompletelyUnroll) + assert(L->isLCSSAForm()); + return true; } From dpatel at apple.com Tue May 13 19:26:11 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 14 May 2008 00:26:11 -0000 Subject: [llvm-commits] [llvm] r51084 - /llvm/trunk/tools/opt/opt.cpp Message-ID: <200805140026.m4E0QBOW009722@zion.cs.uiuc.edu> Author: dpatel Date: Tue May 13 19:26:11 2008 New Revision: 51084 URL: http://llvm.org/viewvc/llvm-project?rev=51084&view=rev Log: Do not run instruction combiner in middle of loop optimization passes. Modified: llvm/trunk/tools/opt/opt.cpp Modified: llvm/trunk/tools/opt/opt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=51084&r1=51083&r2=51084&view=diff ============================================================================== --- llvm/trunk/tools/opt/opt.cpp (original) +++ llvm/trunk/tools/opt/opt.cpp Tue May 13 19:26:11 2008 @@ -280,7 +280,6 @@ addPass(PM, createLICMPass()); // Hoist loop invariants addPass(PM, createLoopUnswitchPass()); // Unswitch loops. addPass(PM, createLoopIndexSplitPass()); // Index split loops. - addPass(PM, createInstructionCombiningPass()); // Clean up after LICM/reassoc addPass(PM, createIndVarSimplifyPass()); // Canonicalize indvars addPass(PM, createLoopDeletionPass()); // Delete dead loops addPass(PM, createLoopUnrollPass()); // Unroll small loops From gohman at apple.com Tue May 13 19:39:39 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 14 May 2008 00:39:39 -0000 Subject: [llvm-commits] [llvm] r51085 - /llvm/trunk/include/llvm/PassSupport.h Message-ID: <200805140039.m4E0ddqx010088@zion.cs.uiuc.edu> Author: djg Date: Tue May 13 19:39:39 2008 New Revision: 51085 URL: http://llvm.org/viewvc/llvm-project?rev=51085&view=rev Log: Make PassInfo noncopyable. Modified: llvm/trunk/include/llvm/PassSupport.h Modified: llvm/trunk/include/llvm/PassSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=51085&r1=51084&r2=51085&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassSupport.h (original) +++ llvm/trunk/include/llvm/PassSupport.h Tue May 13 19:39:39 2008 @@ -137,6 +137,10 @@ protected: void registerPass(); void unregisterPass(); + +private: + void operator=(const PassInfo &); // do not implement + PassInfo(const PassInfo &); // do not implement }; From gohman at apple.com Tue May 13 19:40:34 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 14 May 2008 00:40:34 -0000 Subject: [llvm-commits] [llvm] r51087 - /llvm/trunk/include/llvm/PassManagers.h Message-ID: <200805140040.m4E0eYM0010168@zion.cs.uiuc.edu> Author: djg Date: Tue May 13 19:40:34 2008 New Revision: 51087 URL: http://llvm.org/viewvc/llvm-project?rev=51087&view=rev Log: Make getNumContainedManagers and getNumContainedPasses const. Modified: llvm/trunk/include/llvm/PassManagers.h Modified: llvm/trunk/include/llvm/PassManagers.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=51087&r1=51086&r2=51087&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassManagers.h (original) +++ llvm/trunk/include/llvm/PassManagers.h Tue May 13 19:40:34 2008 @@ -145,7 +145,7 @@ class PMTopLevelManager { public: - virtual unsigned getNumContainedManagers() { + virtual unsigned getNumContainedManagers() const { return (unsigned)PassManagers.size(); } @@ -305,7 +305,7 @@ void dumpAnalysisSetInfo(const char *Msg, Pass *P, const std::vector &Set) const; - virtual unsigned getNumContainedPasses() { + virtual unsigned getNumContainedPasses() const { return (unsigned)PassVector.size(); } From gohman at apple.com Tue May 13 19:42:30 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 14 May 2008 00:42:30 -0000 Subject: [llvm-commits] [llvm] r51088 - in /llvm/trunk/lib: System/Unix/Signals.inc VMCore/Verifier.cpp Message-ID: <200805140042.m4E0gURc010281@zion.cs.uiuc.edu> Author: djg Date: Tue May 13 19:42:30 2008 New Revision: 51088 URL: http://llvm.org/viewvc/llvm-project?rev=51088&view=rev Log: Make PreVerifyID, IntSigsEnd, and KillSigsEnd const. Modified: llvm/trunk/lib/System/Unix/Signals.inc llvm/trunk/lib/VMCore/Verifier.cpp Modified: llvm/trunk/lib/System/Unix/Signals.inc URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Signals.inc?rev=51088&r1=51087&r2=51088&view=diff ============================================================================== --- llvm/trunk/lib/System/Unix/Signals.inc (original) +++ llvm/trunk/lib/System/Unix/Signals.inc Tue May 13 19:42:30 2008 @@ -41,7 +41,8 @@ static const int IntSigs[] = { SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGTERM, SIGUSR1, SIGUSR2 }; -static const int *IntSigsEnd = IntSigs + sizeof(IntSigs) / sizeof(IntSigs[0]); +static const int *const IntSigsEnd = + IntSigs + sizeof(IntSigs) / sizeof(IntSigs[0]); // KillSigs - Signals that are synchronous with the program that will cause it // to die. @@ -51,7 +52,8 @@ , SIGEMT #endif }; -static const int *KillSigsEnd = KillSigs + sizeof(KillSigs) / sizeof(KillSigs[0]); +static const int *const KillSigsEnd = + KillSigs + sizeof(KillSigs) / sizeof(KillSigs[0]); #ifdef HAVE_BACKTRACE static void* StackTrace[256]; Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=51088&r1=51087&r2=51088&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Tue May 13 19:42:30 2008 @@ -97,7 +97,7 @@ char PreVerifier::ID = 0; static RegisterPass PreVer("preverify", "Preliminary module verification"); -static const PassInfo *PreVerifyID = &PreVer; +static const PassInfo *const PreVerifyID = &PreVer; namespace { struct VISIBILITY_HIDDEN From gohman at apple.com Tue May 13 19:43:11 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 14 May 2008 00:43:11 -0000 Subject: [llvm-commits] [llvm] r51089 - in /llvm/trunk: include/llvm/Pass.h include/llvm/Transforms/Scalar.h lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200805140043.m4E0hBGu010314@zion.cs.uiuc.edu> Author: djg Date: Tue May 13 19:43:10 2008 New Revision: 51089 URL: http://llvm.org/viewvc/llvm-project?rev=51089&view=rev Log: Whitespace cleanups. Modified: llvm/trunk/include/llvm/Pass.h llvm/trunk/include/llvm/Transforms/Scalar.h llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/include/llvm/Pass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Pass.h?rev=51089&r1=51088&r2=51089&view=diff ============================================================================== --- llvm/trunk/include/llvm/Pass.h (original) +++ llvm/trunk/include/llvm/Pass.h Tue May 13 19:43:10 2008 @@ -82,8 +82,7 @@ Pass(const Pass &); // DO NOT IMPLEMENT public: explicit Pass(intptr_t pid) : Resolver(0), PassID(pid) {} - explicit Pass(const void *pid) : Resolver(0), - PassID((intptr_t)pid) {} + explicit Pass(const void *pid) : Resolver(0), PassID((intptr_t)pid) {} virtual ~Pass(); /// getPassName - Return a nice clean name for a pass. This usually Modified: llvm/trunk/include/llvm/Transforms/Scalar.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar.h?rev=51089&r1=51088&r2=51089&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Scalar.h (original) +++ llvm/trunk/include/llvm/Transforms/Scalar.h Tue May 13 19:43:10 2008 @@ -204,7 +204,7 @@ // FunctionPass *createJumpThreadingPass(); - //===----------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // CFGSimplification - Merge basic blocks, eliminate unreachable blocks, // simplify terminator instructions, etc... Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=51089&r1=51088&r2=51089&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue May 13 19:43:10 2008 @@ -4004,7 +4004,7 @@ AddLegalizedOperand(SDOperand(Node, 1), Tmp1); return Op.ResNo ? Tmp1 : Result; } - case ISD::FLT_ROUNDS_: { + case ISD::FLT_ROUNDS_: { MVT::ValueType VT = Node->getValueType(0); switch (TLI.getOperationAction(Node->getOpcode(), VT)) { default: assert(0 && "This action not supported for this op yet!"); From gohman at apple.com Tue May 13 20:02:49 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 14 May 2008 01:02:49 -0000 Subject: [llvm-commits] [llvm] r51090 - /llvm/trunk/include/llvm/Analysis/LoopInfo.h Message-ID: <200805140102.m4E12n2h010845@zion.cs.uiuc.edu> Author: djg Date: Tue May 13 20:02:49 2008 New Revision: 51090 URL: http://llvm.org/viewvc/llvm-project?rev=51090&view=rev Log: Move RemoveFromVector out of the global namespace. Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=51090&r1=51089&r2=51090&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Tue May 13 20:02:49 2008 @@ -43,6 +43,8 @@ #include #include +namespace llvm { + template static void RemoveFromVector(std::vector &V, T *N) { typename std::vector::iterator I = std::find(V.begin(), V.end(), N); @@ -50,8 +52,6 @@ V.erase(I); } -namespace llvm { - class DominatorTree; class LoopInfo; class PHINode; From gohman at apple.com Tue May 13 20:58:56 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 14 May 2008 01:58:56 -0000 Subject: [llvm-commits] [llvm] r51091 - in /llvm/trunk/lib/Target: ARM/ Alpha/ CellSPU/ IA64/ Mips/ PIC16/ PowerPC/ Sparc/ X86/ Message-ID: <200805140158.m4E1wvFe012578@zion.cs.uiuc.edu> Author: djg Date: Tue May 13 20:58:56 2008 New Revision: 51091 URL: http://llvm.org/viewvc/llvm-project?rev=51091&view=rev Log: Change target-specific classes to use more precise static types. This eliminates the need for several awkward casts, including the last dynamic_cast under lib/Target. Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.h llvm/trunk/lib/Target/ARM/ARMTargetMachine.h llvm/trunk/lib/Target/Alpha/Alpha.h llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.h llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.h llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.h llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.h llvm/trunk/lib/Target/IA64/IA64InstrInfo.h llvm/trunk/lib/Target/IA64/IA64TargetMachine.h llvm/trunk/lib/Target/Mips/MipsInstrInfo.h llvm/trunk/lib/Target/Mips/MipsTargetMachine.h llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.h llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.h llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h llvm/trunk/lib/Target/Sparc/SparcInstrInfo.h llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h llvm/trunk/lib/Target/X86/X86InstrInfo.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.h llvm/trunk/lib/Target/X86/X86TargetMachine.h Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.h Tue May 13 20:58:56 2008 @@ -134,7 +134,7 @@ /// such, whenever a client has an instance of instruction info, it should /// always be able to get register info as well (through this method). /// - virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; } + virtual const ARMRegisterInfo &getRegisterInfo() const { return RI; } /// getPointerRegClass - Return the register class to use to hold pointers. /// This is used for addressing modes. Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMTargetMachine.h (original) +++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.h Tue May 13 20:58:56 2008 @@ -38,10 +38,10 @@ public: ARMTargetMachine(const Module &M, const std::string &FS, bool isThumb = false); - virtual const ARMInstrInfo *getInstrInfo() const { return &InstrInfo; } - virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } - virtual TargetJITInfo *getJITInfo() { return &JITInfo; } - virtual const TargetRegisterInfo *getRegisterInfo() const { + virtual const ARMInstrInfo *getInstrInfo() const { return &InstrInfo; } + virtual const ARMFrameInfo *getFrameInfo() const { return &FrameInfo; } + virtual ARMJITInfo *getJITInfo() { return &JITInfo; } + virtual const ARMRegisterInfo *getRegisterInfo() const { return &InstrInfo.getRegisterInfo(); } virtual const TargetData *getTargetData() const { return &DataLayout; } Modified: llvm/trunk/lib/Target/Alpha/Alpha.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/Alpha.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/Alpha.h (original) +++ llvm/trunk/lib/Target/Alpha/Alpha.h Tue May 13 20:58:56 2008 @@ -25,7 +25,7 @@ class MachineCodeEmitter; FunctionPass *createAlphaSimpleInstructionSelector(TargetMachine &TM); - FunctionPass *createAlphaISelDag(TargetMachine &TM); + FunctionPass *createAlphaISelDag(AlphaTargetMachine &TM); FunctionPass *createAlphaCodePrinterPass(std::ostream &OS, TargetMachine &TM); FunctionPass *createAlphaPatternInstructionSelector(TargetMachine &TM); Modified: llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Tue May 13 20:58:56 2008 @@ -146,9 +146,9 @@ } public: - AlphaDAGToDAGISel(TargetMachine &TM) + explicit AlphaDAGToDAGISel(AlphaTargetMachine &TM) : SelectionDAGISel(AlphaLowering), - AlphaLowering(*(AlphaTargetLowering*)(TM.getTargetLowering())) + AlphaLowering(*TM.getTargetLowering()) {} /// getI64Imm - Return a target constant with the specified value, of type @@ -559,6 +559,6 @@ /// createAlphaISelDag - This pass converts a legalized DAG into a /// Alpha-specific DAG, ready for instruction scheduling. /// -FunctionPass *llvm::createAlphaISelDag(TargetMachine &TM) { +FunctionPass *llvm::createAlphaISelDag(AlphaTargetMachine &TM) { return new AlphaDAGToDAGISel(TM); } Modified: llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.h (original) +++ llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.h Tue May 13 20:58:56 2008 @@ -28,7 +28,7 @@ /// such, whenever a client has an instance of instruction info, it should /// always be able to get register info as well (through this method). /// - virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; } + virtual const AlphaRegisterInfo &getRegisterInfo() const { return RI; } /// Return true if the instruction is a register to register move and /// leave the source and dest operands in the passed parameters. Modified: llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.h (original) +++ llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.h Tue May 13 20:58:56 2008 @@ -42,15 +42,15 @@ virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; } virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } - virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; } - virtual const TargetRegisterInfo *getRegisterInfo() const { + virtual const AlphaSubtarget *getSubtargetImpl() const{ return &Subtarget; } + virtual const AlphaRegisterInfo *getRegisterInfo() const { return &InstrInfo.getRegisterInfo(); } - virtual TargetLowering* getTargetLowering() const { + virtual AlphaTargetLowering* getTargetLowering() const { return const_cast(&TLInfo); } virtual const TargetData *getTargetData() const { return &DataLayout; } - virtual TargetJITInfo* getJITInfo() { + virtual AlphaJITInfo* getJITInfo() { return &JITInfo; } Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.h Tue May 13 20:58:56 2008 @@ -30,7 +30,7 @@ /// such, whenever a client has an instance of instruction info, it should /// always be able to get register info as well (through this method). /// - virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; } + virtual const SPURegisterInfo &getRegisterInfo() const { return RI; } /// getPointerRegClass - Return the register class to use to hold pointers. /// This is used for addressing modes. Modified: llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.h Tue May 13 20:58:56 2008 @@ -49,7 +49,7 @@ virtual const SPUInstrInfo *getInstrInfo() const { return &InstrInfo; } - virtual const TargetFrameInfo *getFrameInfo() const { + virtual const SPUFrameInfo *getFrameInfo() const { return &FrameInfo; } /*! @@ -70,7 +70,7 @@ return const_cast(&TLInfo); } - virtual const TargetRegisterInfo *getRegisterInfo() const { + virtual const SPURegisterInfo *getRegisterInfo() const { return &InstrInfo.getRegisterInfo(); } Modified: llvm/trunk/lib/Target/IA64/IA64InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64InstrInfo.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64InstrInfo.h (original) +++ llvm/trunk/lib/Target/IA64/IA64InstrInfo.h Tue May 13 20:58:56 2008 @@ -28,7 +28,7 @@ /// such, whenever a client has an instance of instruction info, it should /// always be able to get register info as well (through this method). /// - virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; } + virtual const IA64RegisterInfo &getRegisterInfo() const { return RI; } // // Return true if the instruction is a register to register move and Modified: llvm/trunk/lib/Target/IA64/IA64TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64TargetMachine.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64TargetMachine.h (original) +++ llvm/trunk/lib/Target/IA64/IA64TargetMachine.h Tue May 13 20:58:56 2008 @@ -40,7 +40,7 @@ virtual IA64TargetLowering *getTargetLowering() const { return const_cast(&TLInfo); } - virtual const TargetRegisterInfo *getRegisterInfo() const { + virtual const IA64RegisterInfo *getRegisterInfo() const { return &InstrInfo.getRegisterInfo(); } virtual const TargetData *getTargetData() const { return &DataLayout; } Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrInfo.h (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.h Tue May 13 20:58:56 2008 @@ -52,7 +52,7 @@ /// such, whenever a client has an instance of instruction info, it should /// always be able to get register info as well (through this method). /// - virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; } + virtual const MipsRegisterInfo &getRegisterInfo() const { return RI; } /// Return true if the instruction is a register to register move and /// leave the source and dest operands in the passed parameters. Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetMachine.h (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.h Tue May 13 20:58:56 2008 @@ -39,12 +39,12 @@ { return &InstrInfo; } virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } - virtual const TargetSubtarget *getSubtargetImpl() const + virtual const MipsSubtarget *getSubtargetImpl() const { return &Subtarget; } virtual const TargetData *getTargetData() const { return &DataLayout;} - virtual const TargetRegisterInfo *getRegisterInfo() const { + virtual const MipsRegisterInfo *getRegisterInfo() const { return &InstrInfo.getRegisterInfo(); } Modified: llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.h Tue May 13 20:58:56 2008 @@ -32,7 +32,7 @@ /// such, whenever a client has an instance of instruction info, it should /// always be able to get register info as well (through this method). /// - virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; } + virtual const PIC16RegisterInfo &getRegisterInfo() const { return RI; } /// isLoadFromStackSlot - If the specified machine instruction is a direct Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h Tue May 13 20:58:56 2008 @@ -47,7 +47,7 @@ { return &DataLayout; } virtual PIC16TargetLowering *getTargetLowering() const { return const_cast(&TLInfo); } - virtual const TargetRegisterInfo *getRegisterInfo() const + virtual const PIC16RegisterInfo *getRegisterInfo() const { return &InstrInfo.getRegisterInfo(); } virtual bool addInstSelector(PassManagerBase &PM, bool Fast); Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.h Tue May 13 20:58:56 2008 @@ -78,7 +78,7 @@ /// such, whenever a client has an instance of instruction info, it should /// always be able to get register info as well (through this method). /// - virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; } + virtual const PPCRegisterInfo &getRegisterInfo() const { return RI; } /// getPointerRegClass - Return the register class to use to hold pointers. /// This is used for addressing modes. Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.h Tue May 13 20:58:56 2008 @@ -46,12 +46,12 @@ PPCTargetMachine(const Module &M, const std::string &FS, bool is64Bit); virtual const PPCInstrInfo *getInstrInfo() const { return &InstrInfo; } - virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } - virtual TargetJITInfo *getJITInfo() { return &JITInfo; } + virtual const PPCFrameInfo *getFrameInfo() const { return &FrameInfo; } + virtual PPCJITInfo *getJITInfo() { return &JITInfo; } virtual PPCTargetLowering *getTargetLowering() const { return const_cast(&TLInfo); } - virtual const TargetRegisterInfo *getRegisterInfo() const { + virtual const PPCRegisterInfo *getRegisterInfo() const { return &InstrInfo.getRegisterInfo(); } Modified: llvm/trunk/lib/Target/Sparc/SparcInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcInstrInfo.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcInstrInfo.h (original) +++ llvm/trunk/lib/Target/Sparc/SparcInstrInfo.h Tue May 13 20:58:56 2008 @@ -41,7 +41,7 @@ /// such, whenever a client has an instance of instruction info, it should /// always be able to get register info as well (through this method). /// - virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; } + virtual const SparcRegisterInfo &getRegisterInfo() const { return RI; } /// Return true if the instruction is a register to register move and /// leave the source and dest operands in the passed parameters. Modified: llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h (original) +++ llvm/trunk/lib/Target/Sparc/SparcTargetMachine.h Tue May 13 20:58:56 2008 @@ -38,8 +38,8 @@ virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; } virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } - virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; } - virtual const TargetRegisterInfo *getRegisterInfo() const { + virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; } + virtual const SparcRegisterInfo *getRegisterInfo() const { return &InstrInfo.getRegisterInfo(); } virtual const TargetData *getTargetData() const { return &DataLayout; } Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Tue May 13 20:58:56 2008 @@ -38,18 +38,18 @@ class VISIBILITY_HIDDEN Emitter : public MachineFunctionPass { const X86InstrInfo *II; const TargetData *TD; - TargetMachine &TM; + X86TargetMachine &TM; MachineCodeEmitter &MCE; intptr_t PICBaseOffset; bool Is64BitMode; bool IsPIC; public: static char ID; - explicit Emitter(TargetMachine &tm, MachineCodeEmitter &mce) + explicit Emitter(X86TargetMachine &tm, MachineCodeEmitter &mce) : MachineFunctionPass((intptr_t)&ID), II(0), TD(0), TM(tm), MCE(mce), PICBaseOffset(0), Is64BitMode(false), IsPIC(TM.getRelocationModel() == Reloc::PIC_) {} - Emitter(TargetMachine &tm, MachineCodeEmitter &mce, + Emitter(X86TargetMachine &tm, MachineCodeEmitter &mce, const X86InstrInfo &ii, const TargetData &td, bool is64) : MachineFunctionPass((intptr_t)&ID), II(&ii), TD(&td), TM(tm), MCE(mce), PICBaseOffset(0), Is64BitMode(is64), @@ -112,8 +112,8 @@ MCE.setModuleInfo(&getAnalysis()); - II = ((X86TargetMachine&)TM).getInstrInfo(); - TD = ((X86TargetMachine&)TM).getTargetData(); + II = TM.getInstrInfo(); + TD = TM.getTargetData(); Is64BitMode = TM.getSubtarget().is64Bit(); do { @@ -220,7 +220,7 @@ } unsigned Emitter::getX86RegNum(unsigned RegNo) const { - return ((const X86RegisterInfo&)II->getRegisterInfo()).getX86RegNum(RegNo); + return II->getRegisterInfo().getX86RegNum(RegNo); } inline static unsigned char ModRMByte(unsigned Mod, unsigned RegOpcode, @@ -503,7 +503,7 @@ emitConstant(0, X86InstrInfo::sizeOfImm(Desc)); // Remember PIC base. PICBaseOffset = MCE.getCurrentPCOffset(); - X86JITInfo *JTI = dynamic_cast(TM.getJITInfo()); + X86JITInfo *JTI = TM.getJITInfo(); JTI->setPICBase(MCE.getCurrentPCValue()); break; } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue May 13 20:58:56 2008 @@ -44,7 +44,7 @@ // Forward declarations. static SDOperand getMOVLMask(unsigned NumElems, SelectionDAG &DAG); -X86TargetLowering::X86TargetLowering(TargetMachine &TM) +X86TargetLowering::X86TargetLowering(X86TargetMachine &TM) : TargetLowering(TM) { Subtarget = &TM.getSubtarget(); X86ScalarSSEf64 = Subtarget->hasSSE2(); @@ -5284,10 +5284,8 @@ const unsigned char JMP64r = TII->getBaseOpcodeFor(X86::JMP64r); const unsigned char MOV64ri = TII->getBaseOpcodeFor(X86::MOV64ri); - const unsigned char N86R10 = - ((const X86RegisterInfo*)RegInfo)->getX86RegNum(X86::R10); - const unsigned char N86R11 = - ((const X86RegisterInfo*)RegInfo)->getX86RegNum(X86::R11); + const unsigned char N86R10 = RegInfo->getX86RegNum(X86::R10); + const unsigned char N86R11 = RegInfo->getX86RegNum(X86::R11); const unsigned char REX_WB = 0x40 | 0x08 | 0x01; // REX prefix @@ -5374,8 +5372,7 @@ Disp = DAG.getNode(ISD::SUB, MVT::i32, FPtr, Addr); const unsigned char MOV32ri = TII->getBaseOpcodeFor(X86::MOV32ri); - const unsigned char N86Reg = - ((const X86RegisterInfo*)RegInfo)->getX86RegNum(NestReg); + const unsigned char N86Reg = RegInfo->getX86RegNum(NestReg); OutChains[0] = DAG.getStore(Root, DAG.getConstant(MOV32ri|N86Reg, MVT::i8), Trmp, TrmpAddr, 0); Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Tue May 13 20:58:56 2008 @@ -311,7 +311,7 @@ int BytesCallerReserves; // Number of arg bytes caller makes. public: - explicit X86TargetLowering(TargetMachine &TM); + explicit X86TargetLowering(X86TargetMachine &TM); /// getPICJumpTableRelocaBase - Returns relocation base for the given PIC /// jumptable. @@ -454,7 +454,7 @@ /// Subtarget - Keep a pointer to the X86Subtarget around so that we can /// make the right decision when generating code for different targets. const X86Subtarget *Subtarget; - const TargetRegisterInfo *RegInfo; + const X86RegisterInfo *RegInfo; /// X86StackPtr - X86 physical register used as stack ptr. unsigned X86StackPtr; Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Tue May 13 20:58:56 2008 @@ -2820,7 +2820,7 @@ unsigned X86InstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const { const TargetInstrDesc &Desc = MI->getDesc(); bool IsPIC = (TM.getRelocationModel() == Reloc::PIC_); - bool Is64BitMode = ((X86Subtarget*)TM.getSubtargetImpl())->is64Bit(); + bool Is64BitMode = TM.getSubtargetImpl()->is64Bit(); unsigned Size = GetInstSizeWithDesc(*MI, &Desc, IsPIC, Is64BitMode); if (Desc.getOpcode() == X86::MOVPC32r) { Size += GetInstSizeWithDesc(*MI, &get(X86::POP32r), IsPIC, Is64BitMode); Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Tue May 13 20:58:56 2008 @@ -250,7 +250,7 @@ /// such, whenever a client has an instance of instruction info, it should /// always be able to get register info as well (through this method). /// - virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; } + virtual const X86RegisterInfo &getRegisterInfo() const { return RI; } // Return true if the instruction is a register to register move and // leave the source and dest operands in the passed parameters. Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.h?rev=51091&r1=51090&r2=51091&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetMachine.h (original) +++ llvm/trunk/lib/Target/X86/X86TargetMachine.h Tue May 13 20:58:56 2008 @@ -44,12 +44,12 @@ virtual const X86InstrInfo *getInstrInfo() const { return &InstrInfo; } virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } - virtual TargetJITInfo *getJITInfo() { return &JITInfo; } - virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; } + virtual X86JITInfo *getJITInfo() { return &JITInfo; } + virtual const X86Subtarget *getSubtargetImpl() const{ return &Subtarget; } virtual X86TargetLowering *getTargetLowering() const { return const_cast(&TLInfo); } - virtual const TargetRegisterInfo *getRegisterInfo() const { + virtual const X86RegisterInfo *getRegisterInfo() const { return &InstrInfo.getRegisterInfo(); } virtual const TargetData *getTargetData() const { return &DataLayout; } From evan.cheng at apple.com Tue May 13 21:49:44 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 14 May 2008 02:49:44 -0000 Subject: [llvm-commits] [llvm] r51092 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td Message-ID: <200805140249.m4E2ni63014081@zion.cs.uiuc.edu> Author: evancheng Date: Tue May 13 21:49:43 2008 New Revision: 51092 URL: http://llvm.org/viewvc/llvm-project?rev=51092&view=rev Log: Doh. Alignment is in bytes, not in bits. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=51092&r1=51091&r2=51092&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue May 13 21:49:43 2008 @@ -239,7 +239,7 @@ if (ExtType == ISD::NON_EXTLOAD) return true; if (ExtType == ISD::EXTLOAD) - return LD->getAlignment() >= 16 && !LD->isVolatile(); + return LD->getAlignment() >= 2 && !LD->isVolatile(); } return false; }]>; @@ -252,7 +252,7 @@ if (ExtType == ISD::NON_EXTLOAD) return true; if (ExtType == ISD::EXTLOAD) - return LD->getAlignment() >= 32 && !LD->isVolatile(); + return LD->getAlignment() >= 4 && !LD->isVolatile(); } return false; }]>; From echristo at apple.com Tue May 13 22:06:37 2008 From: echristo at apple.com (Eric Christopher) Date: Tue, 13 May 2008 20:06:37 -0700 Subject: [llvm-commits] [llvm] r51083 - in /llvm/trunk: include/llvm/Analysis/LoopInfo.h lib/Transforms/Scalar/LoopUnroll.cpp lib/Transforms/Utils/UnrollLoop.cpp In-Reply-To: <200805140024.m4E0OF5Y009664@zion.cs.uiuc.edu> References: <200805140024.m4E0OF5Y009664@zion.cs.uiuc.edu> Message-ID: <85C936E8-6573-43C3-BE65-F321055BFD22@apple.com> On May 13, 2008, at 5:24 PM, Dan Gohman wrote: > Author: djg > Date: Tue May 13 19:24:14 2008 > New Revision: 51083 > > URL: http://llvm.org/viewvc/llvm-project?rev=51083&view=rev > Log: > Split the loop unroll mechanism logic out into a utility function. > Patch by Matthijs Kooijman! This broke building in a couple of different ways: a) no header: /Volumes/Data/sources/llvm-clean/lib/Transforms/Scalar/LoopUnroll.cpp: 23:46: error: llvm/Transforms/Utils/UnrollLoop.h: No such file or directory b) getting the complaint that UnrollLoop needs to be declared within namespace llvm. /Volumes/Data/sources/llvm-clean/lib/Transforms/Scalar/LoopUnroll.cpp: In member function ?virtual bool::LoopUnroll::runOnLoop(llvm::Loop*, llvm::LPPassManager&)?: /Volumes/Data/sources/llvm-clean/lib/Transforms/Scalar/LoopUnroll.cpp: 138: error: ?UnrollLoop? was not declared in this scope -eric From gohman at apple.com Tue May 13 23:39:40 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 14 May 2008 04:39:40 -0000 Subject: [llvm-commits] [llvm] r51093 - /llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h Message-ID: <200805140439.m4E4deqh017803@zion.cs.uiuc.edu> Author: djg Date: Tue May 13 23:39:40 2008 New Revision: 51093 URL: http://llvm.org/viewvc/llvm-project?rev=51093&view=rev Log: Commit the header I accidentally left out of 51083. Added: llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h Added: llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h?rev=51093&view=auto ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h (added) +++ llvm/trunk/include/llvm/Transforms/Utils/UnrollLoop.h Tue May 13 23:39:40 2008 @@ -0,0 +1,29 @@ +//===- llvm/Transforms/Utils/UnrollLoop.h - Unrolling utilities -*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines some loop unrolling utilities. It does not define any +// actual pass or policy, but provides a single function to perform loop +// unrolling. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_TRANSFORMS_UTILS_UNROLLLOOP_H +#define LLVM_TRANSFORMS_UTILS_UNROLLLOOP_H + +#include "llvm/Analysis/LoopInfo.h" + +namespace llvm { + +class LPPassManager; + +bool UnrollLoop(Loop *L, unsigned Count, LoopInfo* LI, LPPassManager* LPM); + +} + +#endif From Sanjiv.Gupta at microchip.com Wed May 14 01:44:55 2008 From: Sanjiv.Gupta at microchip.com (Sanjiv.Gupta at microchip.com) Date: Tue, 13 May 2008 23:44:55 -0700 Subject: [llvm-commits] PATCH to configure PIC16 In-Reply-To: <04ECE8C0-5E67-4160-BE69-701910F4E059@apple.com> References: <1210684586.8813.399.camel@localhost> <04ECE8C0-5E67-4160-BE69-701910F4E059@apple.com> Message-ID: > Yes. You need to modify autoconf/configure.ac and then run > autoconf/ AutoRegen.sh to regenerate configure. Check in all changes. > > -Tanya Will do that. - Sanjiv From sanjiv.gupta at microchip.com Wed May 14 01:50:02 2008 From: sanjiv.gupta at microchip.com (Sanjiv Gupta) Date: Wed, 14 May 2008 06:50:02 -0000 Subject: [llvm-commits] [llvm] r51094 - /llvm/trunk/lib/Target/PIC16/PIC16.h Message-ID: <200805140650.m4E6o2u9021672@zion.cs.uiuc.edu> Author: sgupta Date: Wed May 14 01:50:01 2008 New Revision: 51094 URL: http://llvm.org/viewvc/llvm-project?rev=51094&view=rev Log: Fixed the file description header at the top to remove the developer name. Modified: llvm/trunk/lib/Target/PIC16/PIC16.h Modified: llvm/trunk/lib/Target/PIC16/PIC16.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16.h?rev=51094&r1=51093&r2=51094&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16.h Wed May 14 01:50:01 2008 @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by Bruno Cardoso Lopes and is distributed under the -// University of Illinois Open Source License. See LICENSE.TXT for details. +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // From nicolas.geoffray at lip6.fr Wed May 14 02:52:05 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 May 2008 07:52:05 -0000 Subject: [llvm-commits] [llvm] r51095 - /llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Message-ID: <200805140752.m4E7q5UJ031686@zion.cs.uiuc.edu> Author: geoffray Date: Wed May 14 02:52:03 2008 New Revision: 51095 URL: http://llvm.org/viewvc/llvm-project?rev=51095&view=rev Log: Fix typo in ParameterAttribute fields usage. Add an include to make the Cpp backend output compilable. Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=51095&r1=51094&r2=51095&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Wed May 14 02:52:03 2008 @@ -431,7 +431,7 @@ void CppWriter::printParamAttrs(const PAListPtr &PAL, const std::string &name) { - Out << "PAListPtr " << name << "_PAL = 0;"; + Out << "PAListPtr " << name << "_PAL;"; nl(Out); if (!PAL.isEmpty()) { Out << '{'; in(); nl(Out); @@ -440,7 +440,7 @@ for (unsigned i = 0; i < PAL.getNumSlots(); ++i) { uint16_t index = PAL.getSlot(i).Index; ParameterAttributes attrs = PAL.getSlot(i).Attrs; - Out << "PAWI.index = " << index << "; PAWI.attrs = 0 "; + Out << "PAWI.Index = " << index << "; PAWI.Attrs = 0 "; if (attrs & ParamAttr::SExt) Out << " | ParamAttr::SExt"; if (attrs & ParamAttr::ZExt) @@ -1745,6 +1745,7 @@ Out << "#include \n"; Out << "#include \n"; Out << "#include \n"; + Out << "#include \n"; Out << "#include \n"; Out << "#include \n"; Out << "#include \n"; From matthijs at stdin.nl Wed May 14 02:58:46 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Wed, 14 May 2008 09:58:46 +0200 Subject: [llvm-commits] [llvm] r51083 - in /llvm/trunk: include/llvm/Analysis/LoopInfo.h lib/Transforms/Scalar/LoopUnroll.cpp lib/Transforms/Utils/UnrollLoop.cpp In-Reply-To: <85C936E8-6573-43C3-BE65-F321055BFD22@apple.com> References: <200805140024.m4E0OF5Y009664@zion.cs.uiuc.edu> <85C936E8-6573-43C3-BE65-F321055BFD22@apple.com> Message-ID: <20080514075846.GM2450@katherina.student.utwente.nl> Hi, > a) no header: > > /Volumes/Data/sources/llvm-clean/lib/Transforms/Scalar/LoopUnroll.cpp: > 23:46: error: llvm/Transforms/Utils/UnrollLoop.h: No such file or > directory Apparently Dan forgot an "svn add" before committing. I've attached the file, could someone commit it? > b) getting the complaint that UnrollLoop needs to be declared within > namespace llvm. This is almost certainly caused by the absence of the include file above. Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: UnrollLoop.h Type: text/x-chdr Size: 839 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080514/176d27d2/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080514/176d27d2/attachment-0001.bin From sanjiv.gupta at microchip.com Wed May 14 03:03:23 2008 From: sanjiv.gupta at microchip.com (Sanjiv Gupta) Date: Wed, 14 May 2008 08:03:23 -0000 Subject: [llvm-commits] [llvm] r51096 - in /llvm/trunk: autoconf/configure.ac configure Message-ID: <200805140803.m4E83OJ7031999@zion.cs.uiuc.edu> Author: sgupta Date: Wed May 14 03:03:23 2008 New Revision: 51096 URL: http://llvm.org/viewvc/llvm-project?rev=51096&view=rev Log: Added configure switches for PIC16 in configure.ac. Regenerated configure. Modified: llvm/trunk/autoconf/configure.ac llvm/trunk/configure Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=51096&r1=51095&r2=51096&view=diff ============================================================================== --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Wed May 14 03:03:23 2008 @@ -216,6 +216,7 @@ ia64-*) llvm_cv_target_arch="IA64" ;; arm-*) llvm_cv_target_arch="ARM" ;; mips-*) llvm_cv_target_arch="Mips" ;; + pic16-*) llvm_cv_target_arch="PIC16" ;; *) llvm_cv_target_arch="Unknown" ;; esac]) @@ -314,6 +315,7 @@ IA64) AC_SUBST(TARGET_HAS_JIT,0) ;; ARM) AC_SUBST(TARGET_HAS_JIT,0) ;; Mips) AC_SUBST(TARGET_HAS_JIT,0) ;; + PIC16) AC_SUBST(TARGET_HAS_JIT,0) ;; *) AC_SUBST(TARGET_HAS_JIT,0) ;; esac fi @@ -363,7 +365,7 @@ [Build specific host targets: all,host-only,{target-name} (default=all)]),, enableval=all) case "$enableval" in - all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU CBackend MSIL CppBackend" ;; + all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU PIC16 CBackend MSIL CppBackend" ;; host-only) case "$llvm_cv_target_arch" in x86) TARGETS_TO_BUILD="X86" ;; @@ -375,6 +377,7 @@ ARM) TARGETS_TO_BUILD="ARM" ;; Mips) TARGETS_TO_BUILD="Mips" ;; CellSPU|SPU) TARGETS_TO_BUILD="CellSPU" ;; + PIC16) TARGETS_TO_BUILD="PIC16" ;; *) AC_MSG_ERROR([Can not set target to build]) ;; esac ;; @@ -389,6 +392,7 @@ arm) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;; mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;; spu) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;; + pic16) TARGETS_TO_BUILD="PIC16 $TARGETS_TO_BUILD" ;; cbe) TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;; msil) TARGETS_TO_BUILD="MSIL $TARGETS_TO_BUILD" ;; cpp) TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;; Modified: llvm/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=51096&r1=51095&r2=51096&view=diff ============================================================================== --- llvm/trunk/configure (original) +++ llvm/trunk/configure Wed May 14 03:03:23 2008 @@ -4746,7 +4746,7 @@ fi case "$enableval" in - all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU CBackend MSIL CppBackend PIC16" ;; + all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU PIC16 CBackend MSIL CppBackend" ;; host-only) case "$llvm_cv_target_arch" in x86) TARGETS_TO_BUILD="X86" ;; @@ -4757,8 +4757,8 @@ IA64) TARGETS_TO_BUILD="IA64" ;; ARM) TARGETS_TO_BUILD="ARM" ;; Mips) TARGETS_TO_BUILD="Mips" ;; - PIC16) TARGETS_TO_BUILD="PIC16" ;; CellSPU|SPU) TARGETS_TO_BUILD="CellSPU" ;; + PIC16) TARGETS_TO_BUILD="PIC16" ;; *) { { echo "$as_me:$LINENO: error: Can not set target to build" >&5 echo "$as_me: error: Can not set target to build" >&2;} { (exit 1); exit 1; }; } ;; @@ -4774,8 +4774,8 @@ ia64) TARGETS_TO_BUILD="IA64 $TARGETS_TO_BUILD" ;; arm) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;; mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;; - pic16) TARGETS_TO_BUILD="PIC16 $TARGETS_TO_BUILD" ;; spu) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;; + pic16) TARGETS_TO_BUILD="PIC16 $TARGETS_TO_BUILD" ;; cbe) TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;; msil) TARGETS_TO_BUILD="MSIL $TARGETS_TO_BUILD" ;; cpp) TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;; @@ -10636,7 +10636,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 12783 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -14498,11 +14498,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:14496: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14501: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14500: \$? = $ac_status" >&5 + echo "$as_me:14505: \$? = $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. @@ -14766,11 +14766,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:14764: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14769: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14768: \$? = $ac_status" >&5 + echo "$as_me:14773: \$? = $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. @@ -14870,11 +14870,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:14868: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14873: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14872: \$? = $ac_status" >&5 + echo "$as_me:14877: \$? = $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 @@ -17322,7 +17322,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:19793: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:19792: \$? = $ac_status" >&5 + echo "$as_me:19797: \$? = $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. @@ -19894,11 +19894,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:19892: $lt_compile\"" >&5) + (eval echo "\"\$as_me:19897: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:19896: \$? = $ac_status" >&5 + echo "$as_me:19901: \$? = $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 @@ -21464,11 +21464,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:21462: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21467: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:21466: \$? = $ac_status" >&5 + echo "$as_me:21471: \$? = $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. @@ -21568,11 +21568,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:21566: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21571: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:21570: \$? = $ac_status" >&5 + echo "$as_me:21575: \$? = $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 @@ -23803,11 +23803,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:23801: $lt_compile\"" >&5) + (eval echo "\"\$as_me:23806: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:23805: \$? = $ac_status" >&5 + echo "$as_me:23810: \$? = $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. @@ -24071,11 +24071,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:24069: $lt_compile\"" >&5) + (eval echo "\"\$as_me:24074: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:24073: \$? = $ac_status" >&5 + echo "$as_me:24078: \$? = $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. @@ -24175,11 +24175,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:24173: $lt_compile\"" >&5) + (eval echo "\"\$as_me:24178: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:24177: \$? = $ac_status" >&5 + echo "$as_me:24182: \$? = $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 From isanbard at gmail.com Wed May 14 03:07:55 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 14 May 2008 01:07:55 -0700 Subject: [llvm-commits] [llvm] r51027 - in /llvm/trunk/lib/Target/PIC16: ./ Makefile PIC16.h PIC16.td PIC16AsmPrinter.cpp PIC16CallingConv.td PIC16ConstantPoolValue.cpp PIC16ConstantPoolValue.h PIC16ISelDAGToDAG.cpp PIC16ISelLowering.cpp PIC16ISelLowering.h PIC16InstrFormats.td PIC16InstrInfo.cpp PIC16InstrInfo.h PIC16InstrInfo.td PIC16RegisterInfo.cpp PIC16RegisterInfo.h PIC16RegisterInfo.td PIC16Subtarget.cpp PIC16Subtarget.h PIC16TargetAsmInfo.cpp PIC16TargetAsmInfo.h PIC16TargetMachine.cpp PIC16TargetMachine.h In-Reply-To: <200805130903.m4D930nv014096@zion.cs.uiuc.edu> References: <200805130903.m4D930nv014096@zion.cs.uiuc.edu> Message-ID: <79F612A1-BF5F-44C3-956E-A8A261622D68@gmail.com> Hi Sanjiv, On May 13, 2008, at 2:02 AM, Sanjiv Gupta wrote: > Adding files for Microchip's PIC16 target. > Excellent work! Thank you. I just have a few stylistic changes. Overall comments: - Please remove all tabs from the files (except for Makefile, of course). - Please verify that all code fits in 80-columns. > A brief description about PIC16: > =============================== > PIC16 is an 8-bit microcontroller with only one 8-bit register which > is the > accumulator. All arithmetic/load/store operations are 8-bit only. > The architecture has two address spaces: program and data. The > program memory > is divided into 2K pages and the data memory is divided into banks > of 128 byte, with only 80 usable bytes, resulting in an non- > contiguous data memory. > > It supports direct data memory access (by specifying the address as > part of the instruction) and indirect data and program memory access > (in an unorthodox fashion which utilize a 16 bit pointer register). > > Two classes of registers exist: (8-bit class which is only one > accumulator) (16-bit class, which contains one or more 16 bit > pointer(s)) > Would you be interested in writing this information into the documentation? Perhaps here: docs/CodeGenerator.html You know, in your copious spare time. ;-) > Added: llvm/trunk/lib/Target/PIC16/PIC16.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16.td?rev=51027&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/PIC16/PIC16.td (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16.td Tue May 13 04:02:57 2008 > @@ -0,0 +1,46 @@ > +//===- PIC16.td - Describe the PIC16 Target Machine -----------*- > tblgen -*-==// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > = > = > = > ----------------------------------------------------------------------= > ==// > +// This is the top level entry point for the PIC16 target. > +// > = > = > = > ----------------------------------------------------------------------= > ==// > + > +// > = > = > = > ----------------------------------------------------------------------= > ==// > +// Target-independent interfaces > +// > = > = > = > ----------------------------------------------------------------------= > ==// > + > +include "../Target.td" > + > +// > = > = > = > ----------------------------------------------------------------------= > ==// > +// Descriptions > +// > = > = > = > ----------------------------------------------------------------------= > ==// > + > +include "PIC16RegisterInfo.td" > +include "PIC16CallingConv.td" > +include "PIC16InstrInfo.td" > + > +def PIC16InstrInfo : InstrInfo { > + let TSFlagsFields = []; > + let TSFlagsShifts = []; > +} > + > + > + > +// Not currently supported, but work as SubtargetFeature placeholder. Do you want to add this as a FIXME or a note in a PIC16-specific README file? > +def FeaturePIC16Old : SubtargetFeature<"pic16old", "IsPIC16Old", > "true", > + "PIC16 Old ISA Support">; > + > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,569 @@ > +//===-- PIC16AsmPrinter.cpp - PIC16 LLVM assembly writer > ------------------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > = > = > = > ----------------------------------------------------------------------= > ==// > +// > +// This file contains a printer that converts from our internal > representation > +// of machine-dependent LLVM code to PIC16 assembly language. > +// > +// > = > = > = > ----------------------------------------------------------------------= > ==// > + > +#define DEBUG_TYPE "asm-printer" > +#include "PIC16.h" > +#include "PIC16TargetMachine.h" > +#include "PIC16ConstantPoolValue.h" > +#include "PIC16InstrInfo.h" > +#include "llvm/Constants.h" > +#include "llvm/DerivedTypes.h" > +#include "llvm/Module.h" > +#include "llvm/ADT/SetVector.h" > +#include "llvm/ADT/Statistic.h" > +#include "llvm/ADT/StringExtras.h" > +#include "llvm/CodeGen/AsmPrinter.h" > +#include "llvm/CodeGen/MachineFunctionPass.h" > +#include "llvm/CodeGen/MachineConstantPool.h" > +#include "llvm/CodeGen/MachineFrameInfo.h" > +#include "llvm/CodeGen/MachineInstr.h" > +#include "llvm/Support/CommandLine.h" > +#include "llvm/Support/Debug.h" > +#include "llvm/Support/Mangler.h" > +#include "llvm/Support/MathExtras.h" > +#include "llvm/Target/TargetAsmInfo.h" > +#include "llvm/Target/TargetData.h" > +#include "llvm/Target/TargetMachine.h" > +#include "llvm/Target/TargetOptions.h" > +#include > + > +using namespace llvm; > + > +STATISTIC(EmittedInsts, "Number of machine instrs printed"); > + > +namespace { > + struct VISIBILITY_HIDDEN PIC16AsmPrinter : public AsmPrinter { > + PIC16AsmPrinter(std::ostream &O, TargetMachine &TM, const > TargetAsmInfo *T) > + : AsmPrinter(O, TM, T) { > + } > + > + > + /// We name each basic block in a Function with a unique > number, so > + /// that we can consistently refer to them later. This is cleared > + /// at the beginning of each call to runOnMachineFunction(). > + /// > + typedef std::map ValueMapTy; > + ValueMapTy NumberForBB; > + > + /// Keeps the set of GlobalValues that require non-lazy- > pointers for > + /// indirect access. > + std::set GVNonLazyPtrs; > + > + /// Keeps the set of external function GlobalAddresses that the > asm > + /// printer should generate stubs for. > + std::set FnStubs; > + > + /// True if asm printer is printing a series of CONSTPOOL_ENTRY. > + bool InCPMode; > + > + virtual const char *getPassName() const { > + return "PIC16 Assembly Printer"; > + } > + > + void printOperand(const MachineInstr *MI, int opNum, > + const char *Modifier = 0); > + > + void printSOImmOperand(const MachineInstr *MI, int opNum); > + > + void printAddrModeOperand(const MachineInstr *MI, int OpNo); > + > + void printRegisterList(const MachineInstr *MI, int opNum); > + void printCPInstOperand(const MachineInstr *MI, int opNum, > + const char *Modifier); > + > + > + bool printInstruction(const MachineInstr *MI); // autogenerated. > + void emitFunctionStart(MachineFunction &F); > + bool runOnMachineFunction(MachineFunction &F); > + bool doInitialization(Module &M); > + bool doFinalization(Module &M); > + > + virtual void > EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV); > + > + void getAnalysisUsage(AnalysisUsage &AU) const; > + > + public: Please re-indent "public:" and other access-specifier. > + void SwitchToTextSection(const char *NewSection, > + const GlobalValue *GV = NULL); > + void SwitchToDataSection(const char *NewSection, > + const GlobalValue *GV = NULL); > + void SwitchToDataOvrSection(const char *NewSection, > + const GlobalValue *GV = NULL); > + }; > +} // end of anonymous namespace > + > +#include "PIC16GenAsmWriter.inc" > + > +/// createPIC16CodePrinterPass - Returns a pass that prints the PIC16 > +/// assembly code for a MachineFunction to the given output stream, > +/// using the given target machine description. This should work > +/// regardless of whether the function is in SSA form. > +/// > +FunctionPass *llvm::createPIC16CodePrinterPass(std::ostream &o, > + PIC16TargetMachine > &tm) { > + return new PIC16AsmPrinter(o, tm, tm.getTargetAsmInfo()); > +} > + > +void PIC16AsmPrinter::getAnalysisUsage(AnalysisUsage &AU) const > +{ > + // Currently unimplemented. > +} > + > + > +void PIC16AsmPrinter :: Extra space before ::. > > +EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) > +{ > + printDataDirective(MCPV->getType()); > + > + PIC16ConstantPoolValue *ACPV = (PIC16ConstantPoolValue*)MCPV; > + GlobalValue *GV = ACPV->getGV(); > + std::string Name = GV ? Mang->getValueName(GV) : TAI- > >getGlobalPrefix(); > + if (!GV) > + Name += ACPV->getSymbol(); > + if (ACPV->isNonLazyPointer()) { > + GVNonLazyPtrs.insert(Name); > + O << TAI->getPrivateGlobalPrefix() << Name << "$non_lazy_ptr"; > + } else if (ACPV->isStub()) { > + FnStubs.insert(Name); > + O << TAI->getPrivateGlobalPrefix() << Name << "$stub"; > + } else > + O << Name; The formatting after the "} else" line is confusing. Please place braces around the statement in the "else" case here and reformat the rest of the code accordingly. > + if (ACPV->hasModifier()) O << "(" << ACPV->getModifier() << ")"; > + > + if (ACPV->getPCAdjustment() != 0) { > + O << "-(" << TAI->getPrivateGlobalPrefix() << "PC" > + << utostr(ACPV->getLabelId()) > + << "+" << (unsigned)ACPV->getPCAdjustment(); > + > + if (ACPV->mustAddCurrentAddress()) > + O << "-."; > + > + O << ")"; > + } > + O << "\n"; > + > + // If the constant pool value is a extern weak symbol, remember > to emit > + // the weak reference. > + if (GV && GV->hasExternalWeakLinkage()) > + ExtWeakSymbols.insert(GV); > +} > + > +/// Emit the directives used by ASM on the start of functions Please place the name of the method in the comment. > +void PIC16AsmPrinter:: emitFunctionStart(MachineFunction &MF) Extra space after the ::. > +{ > + // Print out the label for the function. > + const Function *F = MF.getFunction(); > + MachineFrameInfo *FrameInfo = MF.getFrameInfo(); > + if (FrameInfo->hasStackObjects()) { > + int indexBegin = FrameInfo->getObjectIndexBegin(); > + int indexEnd = FrameInfo->getObjectIndexEnd(); > + while (indexBegin + if (indexBegin ==0) > + SwitchToDataOvrSection(F->getParent()- > >getModuleIdentifier().c_str(), > + F); > + > + O << "\t\t" << CurrentFnName << "_" << indexBegin << " " > << "RES" > + << " " << FrameInfo->getObjectSize(indexBegin) << "\n" ; > + indexBegin++; > + } > + } > + SwitchToTextSection(CurrentFnName.c_str(), F); > + O << "_" << CurrentFnName << ":" ; > + O << "\n"; > +} > + > + > +/// runOnMachineFunction - This uses the printInstruction() > +/// method to print assembly for each instruction. > +/// > +bool PIC16AsmPrinter:: > +runOnMachineFunction(MachineFunction &MF) > +{ > + > + // DW.SetModuleInfo(&getAnalysis()); > + SetupMachineFunction(MF); > + O << "\n"; > + > + // NOTE: we don't print out constant pools here, they are handled > as > + // instructions. > + O << "\n"; > + Why two newlines here? I don't think we use "NOTE" in other places. If you just comment the code without it, it won't look like some sort of TODO or FIXME (like I just mistook it for :-). > + // What's my mangled name? > + CurrentFnName = Mang->getValueName(MF.getFunction()); > + > + // Emit the function start directives > + emitFunctionStart(MF); > + > + // Emit pre-function debug information. > + // DW.BeginFunction(&MF); > + Please remove dead code. > + // Print out code for the function. > + for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); > + I != E; ++I) { > + // Print a label for the basic block. > + if (I != MF.begin()) { > + printBasicBlockLabel(I, true); > + O << '\n'; > + } > + for (MachineBasicBlock::const_iterator II = I->begin(), E = I- > >end(); > + II != E; ++II) { > + // Print the assembly for the instruction. > + O << '\t'; > + printInstruction(II); > + ++EmittedInsts; > + } > + } > + > + // Emit post-function debug information. > + // DW.EndFunction(); > + Dead. > + // We didn't modify anything. > + return false; > +} > + > +void PIC16AsmPrinter:: > +printOperand(const MachineInstr *MI, int opNum, const char *Modifier) > +{ > + const MachineOperand &MO = MI->getOperand(opNum); > + const TargetRegisterInfo &RI = *TM.getRegisterInfo(); > + > + switch (MO.getType()) > + { Could you put the brace on the same line as the "switch" and realign all of the case statements? > + case MachineOperand::MO_Register: > + { The case statements don't need braces. > > + if (TargetRegisterInfo::isPhysicalRegister(MO.getReg())) > + O << RI.get(MO.getReg()).Name; > + else > + assert(0 && "not implemented"); > + break; > + } > + case MachineOperand::MO_Immediate: > + { > + if (!Modifier || strcmp(Modifier, "no_hash") != 0) > + O << "#"; > + O << (int)MO.getImm(); > + break; > + } > + case MachineOperand::MO_MachineBasicBlock: > + { > + printBasicBlockLabel(MO.getMBB()); > + return; > + } > + case MachineOperand::MO_GlobalAddress: > + { > + O << Mang->getValueName(MO.getGlobal())<<'+'< + break; > + } > + case MachineOperand::MO_ExternalSymbol: > + { > + O << MO.getSymbolName(); > + break; > + } > + case MachineOperand::MO_ConstantPoolIndex: > + { > + O << TAI->getPrivateGlobalPrefix() << "CPI" << > getFunctionNumber() > + << '_' << MO.getIndex(); > + break; > + } > + case MachineOperand::MO_FrameIndex: > + { > + O << "_" << CurrentFnName > + << '+' << MO.getIndex(); > + break; > + } > + case MachineOperand::MO_JumpTableIndex: > + { > + O << TAI->getPrivateGlobalPrefix() << "JTI" << > getFunctionNumber() > + << '_' << MO.getIndex(); > + break; > + } > + default: > + { > + O << ""; abort (); > + break; > + } > + } // end switch. > +} > + > +static void > +printSOImm(std::ostream &O, int64_t V, const TargetAsmInfo *TAI) > +{ > + assert(V < (1 << 12) && "Not a valid so_imm value!"); > + unsigned Imm = V; > + Why do you use a temporary variable? If you want it as an unsigned, you can cast it in the "O< + O << Imm; > +} > + > +/// printSOImmOperand - SOImm is 4-bit rotate amount in bits 8-11 > with 8-bit > +/// immediate in bits 0-7. s/rotate/rotated/ > +void PIC16AsmPrinter:: > +printSOImmOperand(const MachineInstr *MI, int OpNum) > +{ > + const MachineOperand &MO = MI->getOperand(OpNum); > + assert(MO.isImmediate() && "Not a valid so_imm value!"); > + printSOImm(O, MO.getImm(), TAI); > +} > + > + > +void PIC16AsmPrinter:: printAddrModeOperand(const MachineInstr *MI, > int Op) > +{ > + const MachineOperand &MO1 = MI->getOperand(Op); > + const MachineOperand &MO2 = MI->getOperand(Op+1); > + > + if (MO2.isFrameIndex ()) { > + printOperand(MI, Op+1); > + return; > + } > + > + if (!MO1.isRegister()) { // FIXME: This is for CP entries, but > isn't right. > + printOperand(MI, Op); > + return; > + } > + > + // If this is Stack Slot > + if (MO1.isRegister()) { > + if(strcmp(TM.getRegisterInfo()->get(MO1.getReg()).Name, "SP")==0) > + { Please put brace on same line as "if" > > + O << CurrentFnName <<"_"<< MO2.getImm(); > + return; > + } > + O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).Name; > + O << "+"; > + O << MO2.getImm(); > + O << "]"; > + return; > + } > + > + O << "[" << TM.getRegisterInfo()->get(MO1.getReg()).Name; > + O << "]"; > +} > + > + > +void PIC16AsmPrinter:: printRegisterList(const MachineInstr *MI, > int opNum) Extra space after ::. > +{ > + O << "{"; > + for (unsigned i = opNum, e = MI->getNumOperands(); i != e; ++i) { > + printOperand(MI, i); > + if (i != e-1) O << ", "; > + } > + O << "}"; > +} > + ... > > +bool PIC16AsmPrinter:: doInitialization(Module &M) > > +{ > + // Emit initial debug information. > + // DW.BeginModule(&M); > + Dead code. > > + bool Result = AsmPrinter::doInitialization(M); > + return Result; > +} > + > +bool PIC16AsmPrinter:: doFinalization(Module &M) > +{ > + const TargetData *TD = TM.getTargetData(); > + > + for (Module::const_global_iterator I = M.global_begin(), E = > M.global_end(); > + I != E; ++I) { > + if (!I->hasInitializer()) // External global require no code > + continue; > + > + if (EmitSpecialLLVMGlobal(I)) { > + continue; > + } > + > + std::string name = Mang->getValueName(I); > + Constant *C = I->getInitializer(); > + const Type *Type = C->getType(); Please don't name the variable "Type". It's confusing for those reading. Please pick either "Ty" or another more descriptive name. > + unsigned Size = TD->getABITypeSize(Type); > + unsigned Align = TD->getPreferredAlignmentLog(I); > + > + const char *VisibilityDirective = NULL; > + if (I->hasHiddenVisibility()) > + VisibilityDirective = TAI->getHiddenDirective(); > + else if (I->hasProtectedVisibility()) > + VisibilityDirective = TAI->getProtectedDirective(); > + > + if (VisibilityDirective) > + O << VisibilityDirective << name << "\n"; > + > + if (C->isNullValue()) { > + if (I->hasExternalLinkage()) { > + if (const char *Directive = TAI->getZeroFillDirective()) { > + O << "\t.globl\t" << name << "\n"; > + O << Directive << "__DATA__, __common, " << name << ", " > + << Size << ", " << Align << "\n"; > + continue; > + } > + } > + > + if (!I->hasSection() && > + (I->hasInternalLinkage() || I->hasWeakLinkage() || > + I->hasLinkOnceLinkage())) { > + if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, > avoid it. > + if (!NoZerosInBSS && TAI->getBSSSection()) > + SwitchToDataSection(M.getModuleIdentifier().c_str(), I); > + else > + SwitchToDataSection(TAI->getDataSection(), I); > + if (TAI->getLCOMMDirective() != NULL) { > + if (I->hasInternalLinkage()) { > + O << TAI->getLCOMMDirective() << name << "," << Size; > + } else > + O << TAI->getCOMMDirective() << name << "," << Size; > + } else { > + if (I->hasInternalLinkage()) > + O << "\t.local\t" << name << "\n"; > + > + O << TAI->getCOMMDirective() <<"\t" << name << " " > <<"RES"<< " " > + << Size; > + O << "\n\t\tGLOBAL" <<" "<< name; > + if (TAI->getCOMMDirectiveTakesAlignment()) > + O << "," << (TAI->getAlignmentIsInBytes() ? (1 << > Align) : Align); > + } > + continue; > + } > + } > + > + switch (I->getLinkage()) > + { Brace. > > + case GlobalValue::AppendingLinkage: > + { Braces not needed. > > + // FIXME: appending linkage variables should go into a > section of > + // their name or something. For now, just emit them as > external. > + // Fall through > + } > + case GlobalValue::ExternalLinkage: > + { > + O << "\t.globl " << name << "\n"; > + // FALL THROUGH > + } ... > --- llvm/trunk/lib/Target/PIC16/PIC16CallingConv.td (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16CallingConv.td Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,17 @@ > +//===- PIC16CallingConv.td - Calling Conventions Sparc -----*- > tablegen -*-===// s/Sparc/PIC16/ > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp Tue May 13 > 04:02:57 2008 > +class VISIBILITY_HIDDEN PIC16DAGToDAGISel : public SelectionDAGISel { > + > + /// TM - Keep a reference to PIC16TargetMachine. > + PIC16TargetMachine &TM; > + > + /// PIC16Lowering - This object fully describes how to lower LLVM > code to an > + /// PIC16-specific SelectionDAG. > + PIC16TargetLowering PIC16Lowering; > + > + /// Subtarget - Keep a pointer to the PIC16Subtarget around so > that we can > + /// make the right decision when generating code for different > targets. > + //TODO: add initialization on constructor > + //const PIC16Subtarget *Subtarget; > + Please use "FIXME" instead of "TODO". If this is dead, please delete it. > +private: > + // Include the pieces autogenerated from the target description. > + #include "PIC16GenDAGISel.inc" > + Please put in column 1. > > + SDNode *Select(SDOperand N); > + > + // Select addressing mode. currently assume base + offset addr > mode. > + bool SelectAM(SDOperand Op, SDOperand N, SDOperand &Base, > SDOperand &Offset); > + bool SelectDirectAM(SDOperand Op, SDOperand N, SDOperand &Base, > + SDOperand &Offset); > + bool StoreInDirectAM(SDOperand Op, SDOperand N, SDOperand &fsr); > + bool LoadFSR(SDOperand Op, SDOperand N, SDOperand &Base, > SDOperand &Offset); > + bool LoadNothing(SDOperand Op, SDOperand N, SDOperand &Base, > + SDOperand &Offset); > + > + // getI8Imm - Return a target constant with the specified > + // value, of type i8. > + inline SDOperand getI8Imm(unsigned Imm) { > + return CurDAG->getTargetConstant(Imm, MVT::i8); > + } > + > + > + #ifndef NDEBUG column 1 > > + unsigned Indent; > + #endif ditto. > > +}; > + > +} > + > +/// InstructionSelectBasicBlock - This callback is invoked by > +/// SelectionDAGISel when it has created a SelectionDAG for us to > codegen. > +void PIC16DAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &SD) > +{ > + DEBUG(BB->dump()); > + // Codegen the basic block. > + #ifndef NDEBUG > + DOUT << "===== Instruction selection begins:\n"; > + Indent = 0; > + #endif > + > + // Select target instructions for the DAG. > + SD.setRoot(SelectRoot(SD.getRoot())); > + > + #ifndef NDEBUG > + DOUT << "===== Instruction selection ends:\n"; > + #endif > + It's not entirely necessary to put DOUT statements inside of NDEBUG #ifdefs. They are that way automatically. > > +bool PIC16DAGToDAGISel:: > +SelectDirectAM (SDOperand Op, SDOperand N, SDOperand &Base, > SDOperand &Offset) > +{ > + GlobalAddressSDNode *GA; > + ConstantSDNode *GC; > + > + // if Address is FI, get the TargetFrameIndex. > + if (FrameIndexSDNode *FIN = dyn_cast(N)) { > + cout << "--------- its frame Index\n"; cout? Or DOUT? ... > +//don't thake this seriously, it will change > +bool PIC16DAGToDAGISel:: > +LoadNothing (SDOperand Op, SDOperand N, SDOperand &Base, SDOperand > &Offset) > +{ > + GlobalAddressSDNode *GA; > + if (N.getOpcode() == ISD::GlobalAddress) { > + GA = dyn_cast(N); > + cout << "==========" << GA->getOffset() << "\n"; cout or DOUT? > +/// Select instructions not customized! Used for > +/// expanded, promoted and normal instructions Name of method in comments please. End sentence in a period. > +SDNode* PIC16DAGToDAGISel::Select(SDOperand N) > +{ > + SDNode *Node = N.Val; > + unsigned Opcode = Node->getOpcode(); > + > + // Dump information about the Node being selected > + #ifndef NDEBUG Line 1. etc. DOUT and DEBUG are already NDEBUG aware. See include/llvm/ Support/Debug.h for more information. > + DOUT << std::string(Indent, ' ') << "Selecting: "; > + DEBUG(Node->dump(CurDAG)); > + DOUT << "\n"; > + Indent += 2; > + #endif > + ... > > + /// > + // Instruction Selection not handled by custom or by the > + // auto-generated tablegen selection should be handled here. > + /// This looks more like a FIXME. Please add one. > + switch(Opcode) { > + default: break; > + } > + > Added: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp?rev=51027&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,801 @@ > +//===-- PIC16ISelLowering.cpp - PIC16 DAG Lowering Implementation > ---------===// ... > + > +const char *PIC16TargetLowering:: getTargetNodeName(unsigned > Opcode) const > +{ > + switch (Opcode) > + { > + case PIC16ISD::Hi : return "PIC16ISD::Hi"; > + case PIC16ISD::Lo : return "PIC16ISD::Lo"; > + case PIC16ISD::Package : return "PIC16ISD::Package"; > + case PIC16ISD::Wrapper : return "PIC16ISD::Wrapper"; > + case PIC16ISD::SetBank : return "PIC16ISD::SetBank"; > + case PIC16ISD::SetPage : return "PIC16ISD::SetPage"; > + case PIC16ISD::Branch : return "PIC16ISD::Branch"; > + case PIC16ISD::Cmp : return "PIC16ISD::Cmp"; Spacing. > + case PIC16ISD::BTFSS : return "PIC16ISD::BTFSS"; > + case PIC16ISD::BTFSC : return "PIC16ISD::BTFSC"; > + case PIC16ISD::XORCC : return "PIC16ISD::XORCC"; > + case PIC16ISD::SUBCC : return "PIC16ISD::SUBCC"; > + default : return NULL; > + } > +} > + > +PIC16TargetLowering:: > +PIC16TargetLowering(PIC16TargetMachine &TM): TargetLowering(TM) > +{ > + // PIC16 does not have i1 type, so use i8 for > + // setcc operations results (slt, sgt, ...). > + // setSetCCResultType(MVT::i8); > + // setSetCCResultContents(ZeroOrOneSetCCResult); > + Dead? > + // Store operations for i1 types must be promoted > + // setStoreXAction(MVT::i1, Promote); > + // setStoreXAction(MVT::i8, Legal); > + // setStoreXAction(MVT::i16, Custom); > + // setStoreXAction(MVT::i32, Expand); > + > + // setOperationAction(ISD::BUILD_PAIR, MVT::i32, Expand); > + // setOperationAction(ISD::BUILD_PAIR, MVT::i16, Expand); > + Dead? > ... > + > +SDOperand PIC16TargetLowering:: LowerOperation(SDOperand Op, > SelectionDAG &DAG) > +{ > + SDVTList VTList16 = DAG.getVTList(MVT::i16, MVT::i16, MVT::Other); > + switch (Op.getOpcode()) > + { > + case ISD::STORE: cout? or DOUT? > > + cout << "reduce store\n"; > + break; > + case ISD::FORMAL_ARGUMENTS: > + cout<<"==== lowering formal args\n"; > + return LowerFORMAL_ARGUMENTS(Op, DAG); > + case ISD::GlobalAddress: > + cout<<"==== lowering GA\n"; > + return LowerGlobalAddress(Op, DAG); > + case ISD::RET: > + cout<<"==== lowering ret\n"; > + return LowerRET(Op, DAG); > + case ISD::FrameIndex: > + cout<<"==== lowering frame index\n"; > + return LowerFrameIndex(Op, DAG); > + case ISD::ADDE: > + cout <<"==== lowering adde\n"; > + break; > + case ISD::LOAD: > + case ISD::ADD: > + break; > + case ISD::BR_CC: > + cout << "==== lowering BR_CC\n"; > + return LowerBR_CC(Op, DAG); > + } //end swithch > + return SDOperand(); > +} > + ... > + case ISD::SETNE: > + { > + cout << "setne\n"; cout or DOUT? ... > + // If this load is directly stored, replace the load value with > the stored > + // value. > + // TODO: Handle store large -> read small portion. > + // TODO: Handle TRUNCSTORE/LOADEXT s/TODO/FIXME/ ... > +// > = > = > = > ----------------------------------------------------------------------= > ==// > +// Target Optimization Hooks > +// > = > = > = > ----------------------------------------------------------------------= > ==// > + > +SDOperand PIC16TargetLowering::PerformDAGCombine(SDNode *N, > + DAGCombinerInfo > &DCI) const > +{ > + int i; > + ConstantSDNode *CST; > + SelectionDAG &DAG = DCI.DAG; > + > + switch (N->getOpcode()) > + { > + default: break; > + case PIC16ISD::Package : > + cout <<"==== combining PIC16ISD::Package\n"; cout or DOUT? ... > --- llvm/trunk/lib/Target/PIC16/PIC16InstrFormats.td (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16InstrFormats.td Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,112 @@ > +//===- PIC16RegisterInfo.td - PIC16 Register defs ------------*- > tblgen -*-===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > = > = > = > ----------------------------------------------------------------------= > ==// > + > +// > = > = > = > ----------------------------------------------------------------------= > ==// > +// Describe PIC16 instructions format > +// > +// All the possible PIC16 fields are: > +// > +// opcode - operation code. > +// f - 7-bit register file address. > +// d - 1-bit direction specifier > +// k - 8/11 bit literals > +// b - 3 bits bit num specifier > +// Could you use more descriptive names? > --- llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp (added) > +++ llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp Tue May 13 > 04:02:57 2008 > @@ -0,0 +1,143 @@ > +//===- PIC16InstrInfo.cpp - PIC16 Instruction Information > -----------------===// > +// ... > +// TODO: Add the subtarget support on this constructor. s/TODO/FIXME/ I have to finish here. Anyway, there are many similar things you might find in the rest of the code. Thanks! :-) -bw From matthijs at stdin.nl Wed May 14 03:11:04 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Wed, 14 May 2008 10:11:04 +0200 Subject: [llvm-commits] [llvm] r51083 - in /llvm/trunk: include/llvm/Analysis/LoopInfo.h lib/Transforms/Scalar/LoopUnroll.cpp lib/Transforms/Utils/UnrollLoop.cpp In-Reply-To: <20080514075846.GM2450@katherina.student.utwente.nl> References: <200805140024.m4E0OF5Y009664@zion.cs.uiuc.edu> <85C936E8-6573-43C3-BE65-F321055BFD22@apple.com> <20080514075846.GM2450@katherina.student.utwente.nl> Message-ID: <20080514081104.GO2450@katherina.student.utwente.nl> Uhm, never mind this post. I should finish reading my email before yelling, Dan has already commited the missing file... On Wed, May 14, 2008 at 09:58:46AM +0200, Matthijs Kooijman wrote: > Hi, > > > a) no header: > > > > /Volumes/Data/sources/llvm-clean/lib/Transforms/Scalar/LoopUnroll.cpp: > > 23:46: error: llvm/Transforms/Utils/UnrollLoop.h: No such file or > > directory > Apparently Dan forgot an "svn add" before committing. I've attached the file, > could someone commit it? > > > b) getting the complaint that UnrollLoop needs to be declared within > > namespace llvm. > This is almost certainly caused by the absence of the include file above. > > Gr. > > Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080514/dcb46c1a/attachment.bin From arnold.schwaighofer at gmail.com Wed May 14 04:17:13 2008 From: arnold.schwaighofer at gmail.com (Arnold Schwaighofer) Date: Wed, 14 May 2008 09:17:13 -0000 Subject: [llvm-commits] [llvm] r51097 - in /llvm/trunk/docs: CodeGenerator.html LangRef.html Message-ID: <200805140917.m4E9HEPv002319@zion.cs.uiuc.edu> Author: arnolds Date: Wed May 14 04:17:12 2008 New Revision: 51097 URL: http://llvm.org/viewvc/llvm-project?rev=51097&view=rev Log: Add documentation for tail call optimization to CodeGenerator.html. Add a link referring to it to LangRef.html. Modified: llvm/trunk/docs/CodeGenerator.html llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/CodeGenerator.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CodeGenerator.html?rev=51097&r1=51096&r2=51097&view=diff ============================================================================== --- llvm/trunk/docs/CodeGenerator.html (original) +++ llvm/trunk/docs/CodeGenerator.html Wed May 14 04:17:12 2008 @@ -84,6 +84,7 @@
      3. Target-specific Implementation Notes
          +
        • Tail call optimization
        • The X86 backend
        • The PowerPC backend
            @@ -1620,7 +1621,51 @@ + + + +
            +

            Tail call optimization, callee reusing the stack of the caller, is currently supported on x86/x86-64 and PowerPC. It is performed if: +

              +
            • Caller and callee have the calling convention fastcc.
            • +
            • The call is a tail call - in tail position (ret immediately follows call and ret uses value of call or is void).
            • +
            • Option -tailcallopt is enabled.
            • +
            • Platform specific constraints are met.
            • +
            +

            +

            x86/x86-64 constraints: +

              +
            • No variable argument lists are used.
            • +
            • On x86-64 when generating GOT/PIC code only module-local calls (visibility = hidden or protected) are supported.
            • +
            +

            +

            PowerPC constraints: +

              +
            • No variable argument lists are used.
            • +
            • No byval parameters are used.
            • +
            • On ppc32/64 GOT/PIC only module-local calls (visibility = hidden or protected) are supported.
            • +
            +

            +

            Example:

            +

            Call as llc -tailcallopt test.ll. +

            +
            +declare fastcc i32 @tailcallee(i32 inreg %a1, i32 inreg %a2, i32 %a3, i32 %a4)
            +
            +define fastcc i32 @tailcaller(i32 %in1, i32 %in2) {
            +  %l1 = add i32 %in1, %in2
            +  %tmp = tail call fastcc i32 @tailcallee(i32 %in1 inreg, i32 %in2 inreg, i32 %in1, i32 %l1)
            +  ret i32 %tmp
            +}
            +
            +

            +

            Implications of -tailcallopt:

            +

            To support tail call optimization in situations where the callee has more arguments than the caller a 'callee pops arguments' convention is used. This currently causes each fastcc call that is not tail call optimized (because one or more of above constraints are not met) to be followed by a readjustment of the stack. So performance might be worse in such cases.

            +

            On x86 and x86-64 one register is reserved for indirect tail calls (e.g via a function pointer). So there is one less register for integer argument passing. For x86 this means 2 registers (if inreg parameter attribute is used) and for x86-64 this means 5 register are used.

            +
            The X86 backend Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=51097&r1=51096&r2=51097&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Wed May 14 04:17:12 2008 @@ -586,9 +586,11 @@ (e.g. by passing things in registers). This calling convention allows the target to use whatever tricks it wants to produce fast code for the target, without having to conform to an externally specified ABI. Implementations of - this convention should allow arbitrary tail call optimization to be supported. - This calling convention does not support varargs and requires the prototype of - all callees to exactly match the prototype of the function definition. + this convention should allow arbitrary + tail call optimization to be + supported. This calling convention does not support varargs and requires the + prototype of all callees to exactly match the prototype of the function + definition.
    13. "coldcc" - The cold calling convention:
      From akyrtzi at gmail.com Wed May 14 04:39:32 2008 From: akyrtzi at gmail.com (Argiris Kirtzidis) Date: Wed, 14 May 2008 09:39:32 -0000 Subject: [llvm-commits] [llvm] r51098 - in /llvm/trunk/win32: Transforms/Transforms.vcproj VMCore/VMCore.vcproj Message-ID: <200805140939.m4E9dWcJ003298@zion.cs.uiuc.edu> Author: akirtzidis Date: Wed May 14 04:39:32 2008 New Revision: 51098 URL: http://llvm.org/viewvc/llvm-project?rev=51098&view=rev Log: Adding missing files to Transforms and VMCore VC++ projects. Modified: llvm/trunk/win32/Transforms/Transforms.vcproj llvm/trunk/win32/VMCore/VMCore.vcproj Modified: llvm/trunk/win32/Transforms/Transforms.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/Transforms/Transforms.vcproj?rev=51098&r1=51097&r2=51098&view=diff ============================================================================== --- llvm/trunk/win32/Transforms/Transforms.vcproj (original) +++ llvm/trunk/win32/Transforms/Transforms.vcproj Wed May 14 04:39:32 2008 @@ -683,6 +683,10 @@ > + + Modified: llvm/trunk/win32/VMCore/VMCore.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/VMCore/VMCore.vcproj?rev=51098&r1=51097&r2=51098&view=diff ============================================================================== --- llvm/trunk/win32/VMCore/VMCore.vcproj (original) +++ llvm/trunk/win32/VMCore/VMCore.vcproj Wed May 14 04:39:32 2008 @@ -443,6 +443,10 @@ > + + From baldrick at free.fr Wed May 14 04:46:01 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 14 May 2008 09:46:01 -0000 Subject: [llvm-commits] [llvm] r51099 - /llvm/trunk/test/C++Frontend/2008-02-13-sret.cpp Message-ID: <200805140946.m4E9k1oC003488@zion.cs.uiuc.edu> Author: baldrick Date: Wed May 14 04:46:01 2008 New Revision: 51099 URL: http://llvm.org/viewvc/llvm-project?rev=51099&view=rev Log: Make this test pass on x86-32 linux. Modified: llvm/trunk/test/C++Frontend/2008-02-13-sret.cpp Modified: llvm/trunk/test/C++Frontend/2008-02-13-sret.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/C%2B%2BFrontend/2008-02-13-sret.cpp?rev=51099&r1=51098&r2=51099&view=diff ============================================================================== --- llvm/trunk/test/C++Frontend/2008-02-13-sret.cpp (original) +++ llvm/trunk/test/C++Frontend/2008-02-13-sret.cpp Wed May 14 04:46:01 2008 @@ -1,5 +1,4 @@ -// RUN: %llvmgxx -S -O0 -m32 -emit-llvm %s -o - | grep {retval\\|memtmp} | \ -// RUN: grep S242 | grep {i32 1} | count 1 +// RUN: %llvmgxx -S -O1 -m32 -emit-llvm %s -o - | grep {store i32} | count 1 // Test that all 8 bytes of ret in check242 are copied, and only 4 bytes of // ret in check93 are copied (the same LLVM struct is used for both). From akyrtzi at gmail.com Wed May 14 04:58:45 2008 From: akyrtzi at gmail.com (Argiris Kirtzidis) Date: Wed, 14 May 2008 09:58:45 -0000 Subject: [llvm-commits] [llvm] r51100 - /llvm/trunk/win32/clang.sln Message-ID: <200805140958.m4E9wjwF003851@zion.cs.uiuc.edu> Author: akirtzidis Date: Wed May 14 04:58:45 2008 New Revision: 51100 URL: http://llvm.org/viewvc/llvm-project?rev=51100&view=rev Log: Upgrading clang VC++ solution to VC++ express 2008. Modified: llvm/trunk/win32/clang.sln Modified: llvm/trunk/win32/clang.sln URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/clang.sln?rev=51100&r1=51099&r2=51100&view=diff ============================================================================== --- llvm/trunk/win32/clang.sln (original) +++ llvm/trunk/win32/clang.sln Wed May 14 04:58:45 2008 @@ -1,19 +1,11 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "support", "Support\Support.vcproj", "{28AA9146-3482-4F41-9CC6-407B1D258508}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TableGen", "TableGen\TableGen.vcproj", "{339C2249-26B6-4172-B484-85653029AF57}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} @@ -21,10 +13,6 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Fibonacci", "Fibonacci\Fibonacci.vcproj", "{48FB551D-E37E-42EC-BC97-FF7219774867}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} @@ -37,39 +25,23 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExecutionEngine", "ExecutionEngine\ExecutionEngine.vcproj", "{76295AE8-A083-460E-9F80-6F2B8923264A}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VMCore", "VMCore\VMCore.vcproj", "{45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Target", "Target\Target.vcproj", "{059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CodeGen", "CodeGen\CodeGen.vcproj", "{08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57} @@ -77,29 +49,17 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "System", "System\System.vcproj", "{0F8407F3-FA23-4CF1-83A9-DCBE0B361489}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Analysis", "Analysis\Analysis.vcproj", "{0622E827-8464-489D-8B1C-B0B496F35C08}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x86", "x86\x86.vcproj", "{144EEBF6-8C9B-4473-B715-2C821666AF6C}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57} @@ -108,10 +68,6 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Transforms", "Transforms\Transforms.vcproj", "{C59374C1-9FC0-4147-B836-327DFDC52D99}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {339C2249-26B6-4172-B484-85653029AF57} = {339C2249-26B6-4172-B484-85653029AF57} @@ -119,16 +75,8 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Configure", "Configure\Configure.vcproj", "{19514E48-456C-4B9D-8637-F2285476461E}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lli", "lli\lli.vcproj", "{FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} @@ -142,10 +90,6 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llc", "llc\llc.vcproj", "{ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} @@ -159,10 +103,6 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-dis", "llvm-dis\llvm-dis.vcproj", "{B13476BC-30AB-4EA0-BC1E-212C0A459405}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} @@ -172,10 +112,6 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-as", "llvm-as\llvm-as.vcproj", "{4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} @@ -186,19 +122,11 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AsmParser", "AsmParser\AsmParser.vcproj", "{3DC216F5-1DDD-478A-84F8-C124E5C31982}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ar", "llvm-ar\llvm-ar.vcproj", "{0FF2B75C-49C1-4B49-A44A-531C93000296}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} @@ -209,10 +137,6 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ranlib", "llvm-ranlib\llvm-ranlib.vcproj", "{BB16C7EE-B4ED-4714-B5ED-B775C62A6612}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} @@ -223,10 +147,6 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-link", "llvm-link\llvm-link.vcproj", "{5E249789-49E1-4600-B12B-8AD2BB6439B2}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} @@ -237,10 +157,6 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Linker", "Linker\Linker.vcproj", "{342CF48F-760A-4040-A9A1-7D75AA2471CE}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} @@ -248,20 +164,12 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CBackend", "CBackend\CBackend.vcproj", "{057777CD-DED5-46DF-BF9A-6B76DE212549}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opt", "opt\opt.vcproj", "{006D8B41-C3C7-4448-85E1-AF8907E591E5}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} @@ -274,10 +182,6 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-bcanalyzer", "llvm-bcanalyzer\llvm-bcanalyzer.vcproj", "{E0B1E329-BE3E-456D-B372-5F397BE42C84}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} @@ -286,10 +190,6 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ld", "llvm-ld\llvm-ld.vcproj", "{64D8AA46-88DB-41F4-B837-053AE02406B8}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} @@ -304,10 +204,6 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-nm", "llvm-nm\llvm-nm.vcproj", "{5FF862CE-80A0-4B48-A80B-68AE325A0432}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} @@ -318,10 +214,6 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-prof", "llvm-prof\llvm-prof.vcproj", "{ACBE81D9-64B1-4133-823A-807A4E60B454}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} @@ -332,10 +224,6 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bugpoint", "bugpoint\bugpoint.vcproj", "{57249192-8E29-4D85-8B7A-FEFF1760B1DA}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} @@ -350,109 +238,57 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Bitcode", "Bitcode\Bitcode.vcproj", "{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Archive", "Archive\Archive.vcproj", "{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LLVM", "LLVM", "{455BCF47-13B6-451E-8321-8ED9C4866BAA}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Clang", "Clang", "{DAC2AB11-F09C-454B-86FD-9BDBBA25827F}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangLex", "..\tools\clang\win32\clangLex\clangLex.vcproj", "{030F6909-B2FA-4E53-BEA7-9A559CFC2F73}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangParse", "..\tools\clang\win32\clangParse\clangParse.vcproj", "{05DF3074-11AF-491A-B078-83BD2EDC31F6}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangAST", "..\tools\clang\win32\clangAST\clangAST.vcproj", "{5125C3DB-FBD6-4BF8-8D8B-CE51D6E93BCD}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangSema", "..\tools\clang\win32\clangSema\clangSema.vcproj", "{4727E8B7-AA99-41C9-AB09-A8A862595DB7}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangCodeGen", "..\tools\clang\win32\clangCodeGen\clangCodeGen.vcproj", "{4CEC5897-D957-47E7-A6AE-2021D4F44A8F}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" + ProjectSection(ProjectDependencies) = postProject + {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897} = {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangDriver", "..\tools\clang\win32\clangDriver\clangDriver.vcproj", "{7E7DA455-C276-4B93-8D02-8F7E2F629BAF}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection ProjectSection(ProjectDependencies) = postProject {030F6909-B2FA-4E53-BEA7-9A559CFC2F73} = {030F6909-B2FA-4E53-BEA7-9A559CFC2F73} - {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} - {F9FBDDA2-9EE1-473C-A456-BE20B7B2439D} = {F9FBDDA2-9EE1-473C-A456-BE20B7B2439D} + {6C98551A-4C36-4E74-8419-4D3EEEC9D8E0} = {6C98551A-4C36-4E74-8419-4D3EEEC9D8E0} {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} + {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} {05DF3074-11AF-491A-B078-83BD2EDC31F6} = {05DF3074-11AF-491A-B078-83BD2EDC31F6} {298B4876-6EF1-4E80-85D7-72F80693BBEB} = {298B4876-6EF1-4E80-85D7-72F80693BBEB} {4CEC5897-D957-47E7-A6AE-2021D4F44A8F} = {4CEC5897-D957-47E7-A6AE-2021D4F44A8F} + {F9FBDDA2-9EE1-473C-A456-BE20B7B2439D} = {F9FBDDA2-9EE1-473C-A456-BE20B7B2439D} {4727E8B7-AA99-41C9-AB09-A8A862595DB7} = {4727E8B7-AA99-41C9-AB09-A8A862595DB7} + {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} {5125C3DB-FBD6-4BF8-8D8B-CE51D6E93BCD} = {5125C3DB-FBD6-4BF8-8D8B-CE51D6E93BCD} {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} - {6C98551A-4C36-4E74-8419-4D3EEEC9D8E0} = {6C98551A-4C36-4E74-8419-4D3EEEC9D8E0} - {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangBasic", "..\tools\clang\win32\clangBasic\clangBasic.vcproj", "{298B4876-6EF1-4E80-85D7-72F80693BBEB}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangAnalysis", "..\tools\clang\win32\clangAnalysis\clangAnalysis.vcproj", "{6C98551A-4C36-4E74-8419-4D3EEEC9D8E0}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clangRewrite", "..\tools\clang\win32\clangRewrite\clangRewrite.vcproj", "{F9FBDDA2-9EE1-473C-A456-BE20B7B2439D}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection EndProject Global - GlobalSection(DPCodeReviewSolutionGUID) = preSolution - DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Configure|Win32 = Configure|Win32 Debug|Win32 = Debug|Win32 @@ -738,4 +574,7 @@ {6C98551A-4C36-4E74-8419-4D3EEEC9D8E0} = {DAC2AB11-F09C-454B-86FD-9BDBBA25827F} {F9FBDDA2-9EE1-473C-A456-BE20B7B2439D} = {DAC2AB11-F09C-454B-86FD-9BDBBA25827F} EndGlobalSection + GlobalSection(DPCodeReviewSolutionGUID) = preSolution + DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} + EndGlobalSection EndGlobal From romix.llvm at googlemail.com Wed May 14 05:17:11 2008 From: romix.llvm at googlemail.com (Roman Levenstein) Date: Wed, 14 May 2008 10:17:11 -0000 Subject: [llvm-commits] [llvm] r51102 - in /llvm/trunk: include/llvm/CodeGen/DAGISelHeader.h utils/TableGen/DAGISelEmitter.cpp Message-ID: <200805141017.m4EAHBpZ004383@zion.cs.uiuc.edu> Author: romix Date: Wed May 14 05:17:11 2008 New Revision: 51102 URL: http://llvm.org/viewvc/llvm-project?rev=51102&view=rev Log: Do not generate by TableGen the hard-coded standard, target-independent part of DAG instruction selectors. Introudce a dedicated header file for this part: include/llvm/CodeGen/DAGISelHeader.h TableGen now only generates the include preprocessor directive to include this new header. This is a preparation for supporting multiple implementations of instruction selectors in the future. Reviewed and approved by Evan and Dan. Added: llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Added: llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h?rev=51102&view=auto ============================================================================== --- llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h (added) +++ llvm/trunk/include/llvm/CodeGen/DAGISelHeader.h Wed May 14 05:17:11 2008 @@ -0,0 +1,192 @@ +//==-llvm/CodeGen/DAGISelHeader.h - Common DAG ISel definitions -*- C++ -*-==// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file provides definitions of the common, target-independent methods and +// data, which is used by SelectionDAG-based instruction selectors. +// +// *** NOTE: This file is #included into the middle of the target +// *** instruction selector class. These functions are really methods. +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CODEGEN_DAGISEL_HEADER_H +#define LLVM_CODEGEN_DAGISEL_HEADER_H + +/// ISelQueue - Instruction selector priority queue sorted +/// in the order of increasing NodeId() values. +std::vector ISelQueue; + +/// Keep track of nodes which have already been added to queue. +unsigned char *ISelQueued; + +/// Keep track of nodes which have already been selected. +unsigned char *ISelSelected; + +/// IsChainCompatible - Returns true if Chain is Op or Chain does +/// not reach Op. +static bool IsChainCompatible(SDNode *Chain, SDNode *Op) { + if (Chain->getOpcode() == ISD::EntryToken) + return true; + else if (Chain->getOpcode() == ISD::TokenFactor) + return false; + else if (Chain->getNumOperands() > 0) { + SDOperand C0 = Chain->getOperand(0); + if (C0.getValueType() == MVT::Other) + return C0.Val != Op && IsChainCompatible(C0.Val, Op); + } + return true; +} + +/// isel_sort - Sorting functions for the selection queue in the +/// increasing NodeId order. +struct isel_sort : public std::binary_function { + bool operator()(const SDNode* left, const SDNode* right) const { + return (left->getNodeId() > right->getNodeId()); + } +}; + +/// setQueued - marks the node with a given NodeId() as element of the +/// instruction selection queue. +inline void setQueued(int Id) { + ISelQueued[Id / 8] |= 1 << (Id % 8); +} + +/// isSelected - checks if the node with a given NodeId() is +/// in the instruction selection queue already. +inline bool isQueued(int Id) { + return ISelQueued[Id / 8] & (1 << (Id % 8)); +} + +/// setSelected - marks the node with a given NodeId() as selected. +inline void setSelected(int Id) { + ISelSelected[Id / 8] |= 1 << (Id % 8); +} + +/// isSelected - checks if the node with a given NodeId() is +/// selected already. +inline bool isSelected(int Id) { + return ISelSelected[Id / 8] & (1 << (Id % 8)); +} + +/// AddToISelQueue - adds a node to the instruction +/// selection queue. +void AddToISelQueue(SDOperand N) DISABLE_INLINE { + int Id = N.Val->getNodeId(); + if (Id != -1 && !isQueued(Id)) { + ISelQueue.push_back(N.Val); + std::push_heap(ISelQueue.begin(), ISelQueue.end(), isel_sort()); + setQueued(Id); + } +} + +/// ISelQueueUpdater - helper class to handle updates of the +/// instruciton selection queue. +class VISIBILITY_HIDDEN ISelQueueUpdater : + public SelectionDAG::DAGUpdateListener { + std::vector &ISelQueue; + bool HadDelete; // Indicate if any deletions were done. + public: + explicit ISelQueueUpdater(std::vector &isq) + : ISelQueue(isq), HadDelete(false) {} + + bool hadDelete() const { return HadDelete; } + + /// NodeDeleted - remove node from the selection queue. + virtual void NodeDeleted(SDNode *N) { + ISelQueue.erase(std::remove(ISelQueue.begin(), ISelQueue.end(), N), + ISelQueue.end()); + HadDelete = true; + } + + /// NodeUpdated - Ignore updates for now. + virtual void NodeUpdated(SDNode *N) {} + }; + +/// UpdateQueue - update the instruction selction queue to maintain +/// the increasing NodeId() ordering property. +inline void UpdateQueue(const ISelQueueUpdater &ISQU) { + if (ISQU.hadDelete()) + std::make_heap(ISelQueue.begin(), ISelQueue.end(),isel_sort()); +} + + +/// ReplaceUses - replace all uses of the old node F with the use +/// of the new node T. +void ReplaceUses(SDOperand F, SDOperand T) DISABLE_INLINE { + ISelQueueUpdater ISQU(ISelQueue); + CurDAG->ReplaceAllUsesOfValueWith(F, T, &ISQU); + setSelected(F.Val->getNodeId()); + UpdateQueue(ISQU); +} + +/// ReplaceUses - replace all uses of the old node F with the use +/// of the new node T. +void ReplaceUses(SDNode *F, SDNode *T) DISABLE_INLINE { + unsigned FNumVals = F->getNumValues(); + unsigned TNumVals = T->getNumValues(); + ISelQueueUpdater ISQU(ISelQueue); + if (FNumVals != TNumVals) { + for (unsigned i = 0, e = std::min(FNumVals, TNumVals); i < e; ++i) + CurDAG->ReplaceAllUsesOfValueWith(SDOperand(F, i), SDOperand(T, i), &ISQU); + } else { + CurDAG->ReplaceAllUsesWith(F, T, &ISQU); + } + setSelected(F->getNodeId()); + UpdateQueue(ISQU); +} + +/// SelectRoot - Top level entry to DAG instruction selector. +/// Selects instructions starting at the root of the current DAG. +SDOperand SelectRoot(SDOperand Root) { + SelectRootInit(); + unsigned NumBytes = (DAGSize + 7) / 8; + ISelQueued = new unsigned char[NumBytes]; + ISelSelected = new unsigned char[NumBytes]; + memset(ISelQueued, 0, NumBytes); + memset(ISelSelected, 0, NumBytes); + + // Create a dummy node (which is not added to allnodes), that adds + // a reference to the root node, preventing it from being deleted, + // and tracking any changes of the root. + HandleSDNode Dummy(CurDAG->getRoot()); + ISelQueue.push_back(CurDAG->getRoot().Val); + + // Select pending nodes from the instruction selection queue + // until no more nodes are left for selection. + while (!ISelQueue.empty()) { + SDNode *Node = ISelQueue.front(); + std::pop_heap(ISelQueue.begin(), ISelQueue.end(), isel_sort()); + ISelQueue.pop_back(); + // Skip already selected nodes. + if (isSelected(Node->getNodeId())) + continue; + SDNode *ResNode = Select(SDOperand(Node, 0)); + // If node should not be replaced, + // continue with the next one. + if (ResNode == Node) + continue; + // Replace node. + if (ResNode) + ReplaceUses(Node, ResNode); + // If after the replacement this node is not used any more, + // remove this dead node. + if (Node->use_empty()) { // Don't delete EntryToken, etc. + ISelQueueUpdater ISQU(ISelQueue); + CurDAG->RemoveDeadNode(Node, &ISQU); + UpdateQueue(ISQU); + } + } + + delete[] ISelQueued; + ISelQueued = NULL; + delete[] ISelSelected; + ISelSelected = NULL; + return Dummy.getValue(); +} + +#endif /* LLVM_CODEGEN_DAGISEL_HEADER_H */ Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=51102&r1=51101&r2=51102&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Wed May 14 05:17:11 2008 @@ -2011,147 +2011,10 @@ OS << "// *** NOTE: This file is #included into the middle of the target\n" << "// *** instruction selector class. These functions are really " << "methods.\n\n"; - - OS << "// Instruction selector priority queue:\n" - << "std::vector ISelQueue;\n"; - OS << "/// Keep track of nodes which have already been added to queue.\n" - << "unsigned char *ISelQueued;\n"; - OS << "/// Keep track of nodes which have already been selected.\n" - << "unsigned char *ISelSelected;\n"; - - - OS << "/// IsChainCompatible - Returns true if Chain is Op or Chain does\n"; - OS << "/// not reach Op.\n"; - OS << "static bool IsChainCompatible(SDNode *Chain, SDNode *Op) {\n"; - OS << " if (Chain->getOpcode() == ISD::EntryToken)\n"; - OS << " return true;\n"; - OS << " else if (Chain->getOpcode() == ISD::TokenFactor)\n"; - OS << " return false;\n"; - OS << " else if (Chain->getNumOperands() > 0) {\n"; - OS << " SDOperand C0 = Chain->getOperand(0);\n"; - OS << " if (C0.getValueType() == MVT::Other)\n"; - OS << " return C0.Val != Op && IsChainCompatible(C0.Val, Op);\n"; - OS << " }\n"; - OS << " return true;\n"; - OS << "}\n"; - - OS << "/// Sorting functions for the selection queue.\n" - << "struct isel_sort : public std::binary_function" - << " {\n" - << " bool operator()(const SDNode* left, const SDNode* right) " - << "const {\n" - << " return (left->getNodeId() > right->getNodeId());\n" - << " }\n" - << "};\n\n"; - - OS << "inline void setQueued(int Id) {\n"; - OS << " ISelQueued[Id / 8] |= 1 << (Id % 8);\n"; - OS << "}\n"; - OS << "inline bool isQueued(int Id) {\n"; - OS << " return ISelQueued[Id / 8] & (1 << (Id % 8));\n"; - OS << "}\n"; - OS << "inline void setSelected(int Id) {\n"; - OS << " ISelSelected[Id / 8] |= 1 << (Id % 8);\n"; - OS << "}\n"; - OS << "inline bool isSelected(int Id) {\n"; - OS << " return ISelSelected[Id / 8] & (1 << (Id % 8));\n"; - OS << "}\n\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"; - OS << " std::push_heap(ISelQueue.begin(), ISelQueue.end(), isel_sort());\n"; - OS << " setQueued(Id);\n"; - OS << " }\n"; - OS << "}\n\n"; - - - OS << "class VISIBILITY_HIDDEN ISelQueueUpdater :\n"; - OS << " public SelectionDAG::DAGUpdateListener {\n"; - OS << " std::vector &ISelQueue;\n"; - OS << " bool HadDelete;\n"; - OS << " public:\n"; - OS << " explicit ISelQueueUpdater(std::vector &isq)\n"; - OS << " : ISelQueue(isq), HadDelete(false) {}\n"; - OS << " \n"; - OS << " bool hadDelete() const { return HadDelete; }\n"; - OS << " \n"; - OS << " virtual void NodeDeleted(SDNode *N) {\n"; - OS << " ISelQueue.erase(std::remove(ISelQueue.begin(), ISelQueue.end(),"; - OS << " N),\n ISelQueue.end());\n"; - OS << " HadDelete = true;\n"; - OS << " }\n"; - OS << " \n"; - OS << " // Ignore updates.\n"; - OS << " virtual void NodeUpdated(SDNode *N) {}\n"; - OS << " };\n"; - - OS << "inline void UpdateQueue(const ISelQueueUpdater &ISQU) {\n"; - OS << " if (ISQU.hadDelete())\n"; - OS << " std::make_heap(ISelQueue.begin(), ISelQueue.end(),isel_sort());\n"; - OS << "}\n\n"; - - OS << "void ReplaceUses(SDOperand F, SDOperand T) DISABLE_INLINE {\n"; - OS << " ISelQueueUpdater ISQU(ISelQueue);\n"; - OS << " CurDAG->ReplaceAllUsesOfValueWith(F, T, &ISQU);\n"; - OS << " setSelected(F.Val->getNodeId());\n"; - OS << " UpdateQueue(ISQU);\n"; - OS << "}\n"; - OS << "void ReplaceUses(SDNode *F, SDNode *T) DISABLE_INLINE {\n"; - OS << " unsigned FNumVals = F->getNumValues();\n"; - OS << " unsigned TNumVals = T->getNumValues();\n"; - OS << " ISelQueueUpdater ISQU(ISelQueue);\n"; - OS << " if (FNumVals != TNumVals) {\n"; - OS << " for (unsigned i = 0, e = std::min(FNumVals, TNumVals); " - << "i < e; ++i)\n"; - OS << " CurDAG->ReplaceAllUsesOfValueWith(SDOperand(F, i), " - << "SDOperand(T, i), &ISQU);\n"; - OS << " } else {\n"; - OS << " CurDAG->ReplaceAllUsesWith(F, T, &ISQU);\n"; - OS << " }\n"; - OS << " setSelected(F->getNodeId());\n"; - OS << " UpdateQueue(ISQU);\n"; - OS << "}\n\n"; - OS << "// SelectRoot - Top level entry to DAG isel.\n"; - OS << "SDOperand SelectRoot(SDOperand Root) {\n"; - OS << " SelectRootInit();\n"; - OS << " unsigned NumBytes = (DAGSize + 7) / 8;\n"; - OS << " ISelQueued = new unsigned char[NumBytes];\n"; - OS << " ISelSelected = new unsigned char[NumBytes];\n"; - OS << " memset(ISelQueued, 0, NumBytes);\n"; - OS << " memset(ISelSelected, 0, NumBytes);\n"; - OS << "\n"; - OS << " // Create a dummy node (which is not added to allnodes), that adds\n" - << " // a reference to the root node, preventing it from being deleted,\n" - << " // and tracking any changes of the root.\n" - << " HandleSDNode Dummy(CurDAG->getRoot());\n" - << " ISelQueue.push_back(CurDAG->getRoot().Val);\n"; - OS << " while (!ISelQueue.empty()) {\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(SDOperand(Node, 0));\n"; - OS << " if (ResNode != Node) {\n"; - OS << " if (ResNode)\n"; - OS << " ReplaceUses(Node, ResNode);\n"; - OS << " if (Node->use_empty()) { // Don't delete EntryToken, etc.\n"; - OS << " ISelQueueUpdater ISQU(ISelQueue);\n"; - OS << " CurDAG->RemoveDeadNode(Node, &ISQU);\n"; - OS << " UpdateQueue(ISQU);\n"; - OS << " }\n"; - OS << " }\n"; - OS << " }\n"; - OS << " }\n"; - OS << "\n"; - OS << " delete[] ISelQueued;\n"; - OS << " ISelQueued = NULL;\n"; - OS << " delete[] ISelSelected;\n"; - OS << " ISelSelected = NULL;\n"; - OS << " return Dummy.getValue();\n"; - OS << "}\n"; + OS << "// Include standard, target-independent definitions and methods used\n" + << "// by the instruction selector.\n"; + OS << "#include \n\n"; EmitNodeTransforms(OS); EmitPredicateFunctions(OS); From romix.llvm at googlemail.com Wed May 14 05:21:17 2008 From: romix.llvm at googlemail.com (Roman Levenstein) Date: Wed, 14 May 2008 12:21:17 +0200 Subject: [llvm-commits] Speeding up instruction selection (SelectionDAGISel) In-Reply-To: <5379EE9F-FBA2-4CF7-A407-022686094FA8@apple.com> References: <5379EE9F-FBA2-4CF7-A407-022686094FA8@apple.com> Message-ID: Hi, 2008/5/7 Evan Cheng : > A couple of requests. Since you are moving it into its own file, I > would like to see a bit more refinement. Specifically, can you update > it so its coding style is a bit more consistent with the rest of the > llvm world. e.g. > > + if (!isSelected(Node->getNodeId())) { > + SDNode *ResNode = Select(SDOperand(Node, 0)); > + if (ResNode != Node) { > + if (ResNode) > + ReplaceUses(Node, ResNode); > + if (Node->use_empty()) { // Don't delete EntryToken, etc. > + ISelQueueUpdater ISQU(ISelQueue); > + CurDAG->RemoveDeadNode(Node, &ISQU); > + UpdateQueue(ISQU); > + } > + } > + } > > => > > + if (isSelected(Node->getNodeId())) { > continue; > + SDNode *ResNode = Select(SDOperand(Node, 0)); > + if (ResNode == Node) > continue; > + if (ResNode) > + ReplaceUses(Node, ResNode); > + if (Node->use_empty()) { // Don't delete EntryToken, etc. > + ISelQueueUpdater ISQU(ISelQueue); > + CurDAG->RemoveDeadNode(Node, &ISQU); > + UpdateQueue(ISQU); > + } Done. > Also, can you update the comments? Add a bit more contents and make > use of doxygen style comments? > e.g. > +// SelectRoot - Top level entry to DAG isel. Done and committed. -Roman > On May 6, 2008, at 5:55 AM, Roman Levenstein wrote: > > > > > Hi Even, Hi Dan, > > > > Here is a patch as discussed in this mail-thread. > > > > 1) It changes the tablegen and moves the common part of all > > instruciton selectors into include/llvm/CodeGen/IDAGISelHeader.h file. > > Tablegen now only generates the include preprocessor directive for > > this file. > > I prefer this method to extending the SelectionDAGISel parent > > class, because it may provide more flexibility. For example, based > > on some #defines controlling the type of the code selector and > > generated by TableGen based on the comman-line parameters > > different versions of the code selection algorithms cam be used. > > > > 2) I provide in the include/llvm/CodeGen/IDAGISelHeader.h the current > > standard LLC implementation. > > > > So, the current patch only re-factors the LLVM and tablegen code, but > > introduces no functionality change. > > > > Regarding the speed-up: In my previous report about this patch I did a > > mistake by measuring the times for the DEBUG version of llc. > > There it is really a win (up to 20% on some use-cases, as I reported > > before)! But for the optimized version of the llc, the win is almost > > minimal :-( > > Good lesson for me: never rely on the performance data produced by a > > debug build. They are totally different from release builds in many > > cases. > > > > 3) I can later provide provide the implementation of of my previous > > patch that does instruction selection > > without using any sorted data-structures and achieves very good > > speed-ups due to this fact. But the question is: > > Does it still make sense, if the performance improvement for > > optimized builds is minimal? > > > > For both standard and my implementation of instruction selection > > without queues: > > All Dejagnu pass without any problems. > > No problems on MultiSource. > > > > Please review and tell, if it is OK to commit this patch. > > And indicate if the approach without queues is still interesting. > > > > Thanks, > > -Roman > > > > 2008/4/24 Evan Cheng : > >> Yes, moving it out of tblegen is a good idea. I don't have strong > >> preference as to where it is moved to. > >> > >> Evan > >> > >> > >> > >> On Apr 23, 2008, at 3:31 PM, Dan Gohman wrote: > >> > >>> > >>> On Apr 23, 2008, at 10:27 AM, Roman Levenstein wrote: > >>>> > >>>> Just to make it clear: > >>>> This patch is applied currently to the output of Tablegen. > >>>> But the proper patch will need to change the Tablegen to generate > >>>> correct *.inc files. > >>>> Thinking about it, I have a question: > >>>> Right now, the beginning of the generrated instruction selector > >>>> files > >>>> is always the same, independent of the *.td file and target > >>>> architecture. > >>>> But it is generated by tablegen still and therefore cannot be > >>>> substituted easily, without changing the tablegen. > >>>> Question: May be it is better to define this common part in an > >>>> include > >>>> file, e.g. ISelHeader.h, and then tablegen would generate only the > >>>> #include line. What do you think? > >>> > >>> Another option is to move common code into the > >>> SelectionDAGISel parent class, which is a common base class > >>> for each of the targets' DAGToDAGISel classes. > >>> > >>> Dan > >>> > >>> _______________________________________________ > >>> llvm-commits mailing list > >>> llvm-commits at cs.uiuc.edu > >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > >> > >> _______________________________________________ > >> llvm-commits mailing list > >> llvm-commits at cs.uiuc.edu > >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > >> > > _______________________________________________ > > > > llvm-commits mailing list > > llvm-commits at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From sanjiv.gupta at microchip.com Wed May 14 06:31:40 2008 From: sanjiv.gupta at microchip.com (Sanjiv Gupta) Date: Wed, 14 May 2008 11:31:40 -0000 Subject: [llvm-commits] [llvm] r51105 - in /llvm/trunk/lib/Target/PIC16: PIC16.td PIC16AsmPrinter.cpp PIC16CallingConv.td PIC16ConstantPoolValue.h PIC16ISelDAGToDAG.cpp PIC16ISelLowering.cpp PIC16ISelLowering.h PIC16InstrFormats.td PIC16InstrInfo.cpp PIC16InstrInfo.td PIC16RegisterInfo.cpp PIC16RegisterInfo.h PIC16Subtarget.cpp PIC16Subtarget.h PIC16TargetMachine.cpp PIC16TargetMachine.h Message-ID: <200805141131.m4EBVfEB006732@zion.cs.uiuc.edu> Author: sgupta Date: Wed May 14 06:31:39 2008 New Revision: 51105 URL: http://llvm.org/viewvc/llvm-project?rev=51105&view=rev Log: Detabification. Fixed indentation and spacing. Changed cout to DOUT, and TODOs to FIXMEs. Other changes as per coding conventions. Modified: llvm/trunk/lib/Target/PIC16/PIC16.td llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp llvm/trunk/lib/Target/PIC16/PIC16CallingConv.td llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.h llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.h llvm/trunk/lib/Target/PIC16/PIC16InstrFormats.td llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h llvm/trunk/lib/Target/PIC16/PIC16Subtarget.cpp llvm/trunk/lib/Target/PIC16/PIC16Subtarget.h llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h Modified: llvm/trunk/lib/Target/PIC16/PIC16.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16.td?rev=51105&r1=51104&r2=51105&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16.td (original) +++ llvm/trunk/lib/Target/PIC16/PIC16.td Wed May 14 06:31:39 2008 @@ -32,7 +32,7 @@ // Not currently supported, but work as SubtargetFeature placeholder. def FeaturePIC16Old : SubtargetFeature<"pic16old", "IsPIC16Old", "true", - "PIC16 Old ISA Support">; + "PIC16 Old ISA Support">; //===----------------------------------------------------------------------===// // PIC16 processors supported. Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=51105&r1=51104&r2=51105&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Wed May 14 06:31:39 2008 @@ -95,11 +95,11 @@ public: void SwitchToTextSection(const char *NewSection, - const GlobalValue *GV = NULL); + const GlobalValue *GV = NULL); void SwitchToDataSection(const char *NewSection, - const GlobalValue *GV = NULL); + const GlobalValue *GV = NULL); void SwitchToDataOvrSection(const char *NewSection, - const GlobalValue *GV = NULL); + const GlobalValue *GV = NULL); }; } // end of anonymous namespace @@ -117,7 +117,7 @@ void PIC16AsmPrinter::getAnalysisUsage(AnalysisUsage &AU) const { - // Currently unimplemented. + // FIXME: Currently unimplemented. } @@ -137,77 +137,70 @@ } else if (ACPV->isStub()) { FnStubs.insert(Name); O << TAI->getPrivateGlobalPrefix() << Name << "$stub"; - } else + } else { O << Name; - if (ACPV->hasModifier()) O << "(" << ACPV->getModifier() << ")"; + } - if (ACPV->getPCAdjustment() != 0) { - O << "-(" << TAI->getPrivateGlobalPrefix() << "PC" - << utostr(ACPV->getLabelId()) - << "+" << (unsigned)ACPV->getPCAdjustment(); + if (ACPV->hasModifier()) O << "(" << ACPV->getModifier() << ")"; - if (ACPV->mustAddCurrentAddress()) - O << "-."; + if (ACPV->getPCAdjustment() != 0) { + O << "-(" << TAI->getPrivateGlobalPrefix() << "PC" + << utostr(ACPV->getLabelId()) + << "+" << (unsigned)ACPV->getPCAdjustment(); - O << ")"; - } - O << "\n"; + if (ACPV->mustAddCurrentAddress()) + O << "-."; + + O << ")"; + } + O << "\n"; - // If the constant pool value is a extern weak symbol, remember to emit - // the weak reference. - if (GV && GV->hasExternalWeakLinkage()) - ExtWeakSymbols.insert(GV); -} - -/// Emit the directives used by ASM on the start of functions -void PIC16AsmPrinter:: emitFunctionStart(MachineFunction &MF) -{ - // Print out the label for the function. - const Function *F = MF.getFunction(); - MachineFrameInfo *FrameInfo = MF.getFrameInfo(); - if (FrameInfo->hasStackObjects()) { - int indexBegin = FrameInfo->getObjectIndexBegin(); - int indexEnd = FrameInfo->getObjectIndexEnd(); - while (indexBegingetParent()->getModuleIdentifier().c_str(), - F); - - O << "\t\t" << CurrentFnName << "_" << indexBegin << " " << "RES" - << " " << FrameInfo->getObjectSize(indexBegin) << "\n" ; - indexBegin++; - } - } - SwitchToTextSection(CurrentFnName.c_str(), F); - O << "_" << CurrentFnName << ":" ; - O << "\n"; + // If the constant pool value is a extern weak symbol, remember to emit + // the weak reference. + if (GV && GV->hasExternalWeakLinkage()) + ExtWeakSymbols.insert(GV); +} + +/// emitFunctionStart - Emit the directives used by ASM on the start of +/// functions. +void PIC16AsmPrinter::emitFunctionStart(MachineFunction &MF) +{ + // Print out the label for the function. + const Function *F = MF.getFunction(); + MachineFrameInfo *FrameInfo = MF.getFrameInfo(); + if (FrameInfo->hasStackObjects()) { + int indexBegin = FrameInfo->getObjectIndexBegin(); + int indexEnd = FrameInfo->getObjectIndexEnd(); + while (indexBegin < indexEnd) { + if (indexBegin == 0) + SwitchToDataOvrSection(F->getParent()->getModuleIdentifier().c_str(), + F); + + O << "\t\t" << CurrentFnName << "_" << indexBegin << " " << "RES" + << " " << FrameInfo->getObjectSize(indexBegin) << "\n" ; + indexBegin++; + } + } + SwitchToTextSection(CurrentFnName.c_str(), F); + O << "_" << CurrentFnName << ":" ; + O << "\n"; } /// runOnMachineFunction - This uses the printInstruction() /// method to print assembly for each instruction. /// -bool PIC16AsmPrinter:: -runOnMachineFunction(MachineFunction &MF) +bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) { - - // DW.SetModuleInfo(&getAnalysis()); SetupMachineFunction(MF); O << "\n"; - // NOTE: we don't print out constant pools here, they are handled as - // instructions. - O << "\n"; - // What's my mangled name? CurrentFnName = Mang->getValueName(MF.getFunction()); // Emit the function start directives emitFunctionStart(MF); - // Emit pre-function debug information. - // DW.BeginFunction(&MF); - // Print out code for the function. for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); I != E; ++I) { @@ -225,9 +218,6 @@ } } - // Emit post-function debug information. - // DW.EndFunction(); - // We didn't modify anything. return false; } @@ -238,61 +228,50 @@ const MachineOperand &MO = MI->getOperand(opNum); const TargetRegisterInfo &RI = *TM.getRegisterInfo(); - switch (MO.getType()) - { + switch (MO.getType()) { case MachineOperand::MO_Register: - { if (TargetRegisterInfo::isPhysicalRegister(MO.getReg())) O << RI.get(MO.getReg()).Name; else assert(0 && "not implemented"); break; - } + case MachineOperand::MO_Immediate: - { if (!Modifier || strcmp(Modifier, "no_hash") != 0) O << "#"; O << (int)MO.getImm(); break; - } + case MachineOperand::MO_MachineBasicBlock: - { printBasicBlockLabel(MO.getMBB()); return; - } + case MachineOperand::MO_GlobalAddress: - { O << Mang->getValueName(MO.getGlobal())<<'+'<getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() << '_' << MO.getIndex(); break; - } + case MachineOperand::MO_FrameIndex: - { O << "_" << CurrentFnName << '+' << MO.getIndex(); break; - } + case MachineOperand::MO_JumpTableIndex: - { O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber() << '_' << MO.getIndex(); break; - } + default: - { O << ""; abort (); break; - } } // end switch. } @@ -300,15 +279,13 @@ printSOImm(std::ostream &O, int64_t V, const TargetAsmInfo *TAI) { assert(V < (1 << 12) && "Not a valid so_imm value!"); - unsigned Imm = V; - O << Imm; + O << (unsigned) V; } -/// printSOImmOperand - SOImm is 4-bit rotate amount in bits 8-11 with 8-bit +/// printSOImmOperand - SOImm is 4-bit rotated amount in bits 8-11 with 8-bit /// immediate in bits 0-7. -void PIC16AsmPrinter:: -printSOImmOperand(const MachineInstr *MI, int OpNum) +void PIC16AsmPrinter::printSOImmOperand(const MachineInstr *MI, int OpNum) { const MachineOperand &MO = MI->getOperand(OpNum); assert(MO.isImmediate() && "Not a valid so_imm value!"); @@ -316,7 +293,7 @@ } -void PIC16AsmPrinter:: printAddrModeOperand(const MachineInstr *MI, int Op) +void PIC16AsmPrinter::printAddrModeOperand(const MachineInstr *MI, int Op) { const MachineOperand &MO1 = MI->getOperand(Op); const MachineOperand &MO2 = MI->getOperand(Op+1); @@ -326,15 +303,15 @@ return; } - if (!MO1.isRegister()) { // FIXME: This is for CP entries, but isn't right. + if (!MO1.isRegister()) { + // FIXME: This is for CP entries, but isn't right. printOperand(MI, Op); return; } // If this is Stack Slot if (MO1.isRegister()) { - if(strcmp(TM.getRegisterInfo()->get(MO1.getReg()).Name, "SP")==0) - { + if (strcmp(TM.getRegisterInfo()->get(MO1.getReg()).Name, "SP") == 0) { O << CurrentFnName <<"_"<< MO2.getImm(); return; } @@ -350,7 +327,7 @@ } -void PIC16AsmPrinter:: printRegisterList(const MachineInstr *MI, int opNum) +void PIC16AsmPrinter::printRegisterList(const MachineInstr *MI, int opNum) { O << "{"; for (unsigned i = opNum, e = MI->getNumOperands(); i != e; ++i) { @@ -391,16 +368,13 @@ } -bool PIC16AsmPrinter:: doInitialization(Module &M) +bool PIC16AsmPrinter::doInitialization(Module &M) { - // Emit initial debug information. - // DW.BeginModule(&M); - bool Result = AsmPrinter::doInitialization(M); return Result; } -bool PIC16AsmPrinter:: doFinalization(Module &M) +bool PIC16AsmPrinter::doFinalization(Module &M) { const TargetData *TD = TM.getTargetData(); @@ -415,8 +389,8 @@ std::string name = Mang->getValueName(I); Constant *C = I->getInitializer(); - const Type *Type = C->getType(); - unsigned Size = TD->getABITypeSize(Type); + const Type *Ty = C->getType(); + unsigned Size = TD->getABITypeSize(Ty); unsigned Align = TD->getPreferredAlignmentLog(I); const char *VisibilityDirective = NULL; @@ -443,7 +417,7 @@ I->hasLinkOnceLinkage())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. if (!NoZerosInBSS && TAI->getBSSSection()) - SwitchToDataSection(M.getModuleIdentifier().c_str(), I); + SwitchToDataSection(M.getModuleIdentifier().c_str(), I); else SwitchToDataSection(TAI->getDataSection(), I); if (TAI->getLCOMMDirective() != NULL) { @@ -453,33 +427,29 @@ O << TAI->getCOMMDirective() << name << "," << Size; } else { if (I->hasInternalLinkage()) - O << "\t.local\t" << name << "\n"; + O << "\t.local\t" << name << "\n"; O << TAI->getCOMMDirective() <<"\t" << name << " " <<"RES"<< " " - << Size; + << Size; O << "\n\t\tGLOBAL" <<" "<< name; if (TAI->getCOMMDirectiveTakesAlignment()) - O << "," << (TAI->getAlignmentIsInBytes() ? (1 << Align) : Align); + O << "," << (TAI->getAlignmentIsInBytes() ? (1 << Align) : Align); } continue; } } - switch (I->getLinkage()) - { + switch (I->getLinkage()) { case GlobalValue::AppendingLinkage: - { // FIXME: appending linkage variables should go into a section of // their name or something. For now, just emit them as external. - // Fall through - } + // FALL THROUGH + case GlobalValue::ExternalLinkage: - { O << "\t.globl " << name << "\n"; // FALL THROUGH - } + case GlobalValue::InternalLinkage: - { if (I->isConstant()) { const ConstantArray *CVA = dyn_cast(C); if (TAI->getCStringSection() && CVA && CVA->isCString()) { @@ -488,12 +458,10 @@ } } break; - } + default: - { assert(0 && "Unknown linkage type!"); break; - } } // end switch. EmitAlignment(Align, I); @@ -517,53 +485,53 @@ void PIC16AsmPrinter:: SwitchToTextSection(const char *NewSection, const GlobalValue *GV) { - O << "\n"; - if (NewSection && *NewSection) { - std::string codeSection = "code_"; - codeSection += NewSection; - codeSection += " "; - codeSection += "CODE"; - AsmPrinter::SwitchToTextSection(codeSection.c_str(),GV); - } - else - AsmPrinter::SwitchToTextSection(NewSection,GV); + O << "\n"; + if (NewSection && *NewSection) { + std::string codeSection = "code_"; + codeSection += NewSection; + codeSection += " "; + codeSection += "CODE"; + AsmPrinter::SwitchToTextSection(codeSection.c_str(), GV); + } + else + AsmPrinter::SwitchToTextSection(NewSection, GV); } void PIC16AsmPrinter:: SwitchToDataSection(const char *NewSection, const GlobalValue *GV) { - //Need to append index for page - O << "\n"; - if (NewSection && *NewSection) { - std::string dataSection ="udata_"; - dataSection+=NewSection; - if (dataSection.substr(dataSection.length()-2).compare(".o") == 0) { - dataSection = dataSection.substr(0,dataSection.length()-2); - } - dataSection += " "; - dataSection += "UDATA"; - AsmPrinter::SwitchToDataSection(dataSection.c_str(),GV); - } - else - AsmPrinter::SwitchToDataSection(NewSection,GV); + // Need to append index for page. + O << "\n"; + if (NewSection && *NewSection) { + std::string dataSection = "udata_"; + dataSection += NewSection; + if (dataSection.substr(dataSection.length() - 2).compare(".o") == 0) { + dataSection = dataSection.substr(0, dataSection.length() - 2); + } + dataSection += " "; + dataSection += "UDATA"; + AsmPrinter::SwitchToDataSection(dataSection.c_str(), GV); + } + else + AsmPrinter::SwitchToDataSection(NewSection, GV); } void PIC16AsmPrinter:: SwitchToDataOvrSection(const char *NewSection, const GlobalValue *GV) { - O << "\n"; - if (NewSection && *NewSection) { - std::string dataSection = "frame_"; - dataSection += NewSection; - if (dataSection.substr(dataSection.length()-2).compare(".o") == 0) { - dataSection = dataSection.substr(0,dataSection.length()-2); - } - dataSection += "_"; - dataSection += CurrentFnName; - dataSection += " "; - dataSection += "UDATA_OVR"; - AsmPrinter::SwitchToDataSection(dataSection.c_str(),GV); - } - else - AsmPrinter::SwitchToDataSection(NewSection,GV); + O << "\n"; + if (NewSection && *NewSection) { + std::string dataSection = "frame_"; + dataSection += NewSection; + if (dataSection.substr(dataSection.length() - 2).compare(".o") == 0) { + dataSection = dataSection.substr(0, dataSection.length() - 2); + } + dataSection += "_"; + dataSection += CurrentFnName; + dataSection += " "; + dataSection += "UDATA_OVR"; + AsmPrinter::SwitchToDataSection(dataSection.c_str(), GV); + } + else + AsmPrinter::SwitchToDataSection(NewSection, GV); } Modified: llvm/trunk/lib/Target/PIC16/PIC16CallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16CallingConv.td?rev=51105&r1=51104&r2=51105&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16CallingConv.td (original) +++ llvm/trunk/lib/Target/PIC16/PIC16CallingConv.td Wed May 14 06:31:39 2008 @@ -1,4 +1,4 @@ -//===- PIC16CallingConv.td - Calling Conventions Sparc -----*- tablegen -*-===// +//===- PIC16CallingConv.td - Calling Conventions PIC16 -----*- tablegen -*-===// // // The LLVM Compiler Infrastructure // @@ -14,4 +14,3 @@ //===----------------------------------------------------------------------===// // Return Value Calling Conventions //===----------------------------------------------------------------------===// - Modified: llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.h?rev=51105&r1=51104&r2=51105&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16ConstantPoolValue.h Wed May 14 06:31:39 2008 @@ -41,15 +41,15 @@ public: PIC16ConstantPoolValue(GlobalValue *gv, unsigned id, - PIC16CP::PIC16CPKind Kind = PIC16CP::CPValue, - unsigned char PCAdj = 0, const char *Modifier = NULL, - bool AddCurrentAddress = false); + PIC16CP::PIC16CPKind Kind = PIC16CP::CPValue, + unsigned char PCAdj = 0, const char *Modifier = NULL, + bool AddCurrentAddress = false); PIC16ConstantPoolValue(const char *s, unsigned id, - PIC16CP::PIC16CPKind Kind = PIC16CP::CPValue, - unsigned char PCAdj = 0, const char *Modifier = NULL, - bool AddCurrentAddress = false); + PIC16CP::PIC16CPKind Kind = PIC16CP::CPValue, + unsigned char PCAdj = 0, const char *Modifier = NULL, + bool AddCurrentAddress = false); PIC16ConstantPoolValue(GlobalValue *GV, PIC16CP::PIC16CPKind Kind, - const char *Modifier); + const char *Modifier); GlobalValue *getGV() const { return GV; } Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp?rev=51105&r1=51104&r2=51105&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp Wed May 14 06:31:39 2008 @@ -56,11 +56,6 @@ /// PIC16-specific SelectionDAG. PIC16TargetLowering PIC16Lowering; - /// Subtarget - Keep a pointer to the PIC16Subtarget around so that we can - /// make the right decision when generating code for different targets. - //TODO: add initialization on constructor - //const PIC16Subtarget *Subtarget; - public: PIC16DAGToDAGISel(PIC16TargetMachine &tm) : SelectionDAGISel(PIC16Lowering), @@ -75,18 +70,18 @@ private: // Include the pieces autogenerated from the target description. - #include "PIC16GenDAGISel.inc" +#include "PIC16GenDAGISel.inc" SDNode *Select(SDOperand N); // Select addressing mode. currently assume base + offset addr mode. bool SelectAM(SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset); bool SelectDirectAM(SDOperand Op, SDOperand N, SDOperand &Base, - SDOperand &Offset); + SDOperand &Offset); bool StoreInDirectAM(SDOperand Op, SDOperand N, SDOperand &fsr); bool LoadFSR(SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset); bool LoadNothing(SDOperand Op, SDOperand N, SDOperand &Base, - SDOperand &Offset); + SDOperand &Offset); // getI8Imm - Return a target constant with the specified // value, of type i8. @@ -95,9 +90,9 @@ } - #ifndef NDEBUG +#ifndef NDEBUG unsigned Indent; - #endif +#endif }; } @@ -108,17 +103,16 @@ { DEBUG(BB->dump()); // Codegen the basic block. - #ifndef NDEBUG + DOUT << "===== Instruction selection begins:\n"; +#ifndef NDEBUG Indent = 0; - #endif +#endif // Select target instructions for the DAG. SD.setRoot(SelectRoot(SD.getRoot())); - #ifndef NDEBUG DOUT << "===== Instruction selection ends:\n"; - #endif SD.RemoveDeadNodes(); @@ -135,7 +129,7 @@ // if Address is FI, get the TargetFrameIndex. if (FrameIndexSDNode *FIN = dyn_cast(N)) { - cout << "--------- its frame Index\n"; + DOUT << "--------- its frame Index\n"; Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32); Offset = CurDAG->getTargetConstant(0, MVT::i32); return true; @@ -154,11 +148,11 @@ Offset = CurDAG->getTargetConstant((unsigned char)GC->getValue(), MVT::i8); if ((GA = dyn_cast(N.getOperand(0)))) { Base = CurDAG->getTargetGlobalAddress(GA->getGlobal(), MVT::i16, - GC->getValue()); + GC->getValue()); return true; } else if (FrameIndexSDNode *FIN - = dyn_cast(N.getOperand(0))) { + = dyn_cast(N.getOperand(0))) { Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32); return true; } @@ -168,7 +162,7 @@ } -//FIXME: must also account for preinc/predec/postinc/postdec +// FIXME: must also account for preinc/predec/postinc/postdec. bool PIC16DAGToDAGISel:: StoreInDirectAM (SDOperand Op, SDOperand N, SDOperand &fsr) { @@ -181,12 +175,12 @@ else if (isa(N.Val)) { //FIXME an attempt to retrieve the register number //but does not work - cout << "this is a register\n"; + DOUT << "this is a register\n"; Reg = dyn_cast(N.Val); fsr = CurDAG->getRegister(Reg->getReg(),MVT::i16); } else { - cout << "this is not a register\n"; + DOUT << "this is not a register\n"; // FIXME must use whatever load is using fsr = CurDAG->getRegister(1,MVT::i16); } @@ -204,7 +198,7 @@ GA = dyn_cast(N); Offset = CurDAG->getTargetConstant((unsigned char)GA->getOffset(), MVT::i8); Base = CurDAG->getTargetGlobalAddress(GA->getGlobal(), MVT::i16, - GA->getOffset()); + GA->getOffset()); return true; } else if (N.getOpcode() == PIC16ISD::Package) { @@ -215,17 +209,17 @@ return false; } -//don't thake this seriously, it will change +// LoadNothing - Don't thake this seriously, it will change. bool PIC16DAGToDAGISel:: LoadNothing (SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset) { GlobalAddressSDNode *GA; if (N.getOpcode() == ISD::GlobalAddress) { GA = dyn_cast(N); - cout << "==========" << GA->getOffset() << "\n"; + DOUT << "==========" << GA->getOffset() << "\n"; Offset = CurDAG->getTargetConstant((unsigned char)GA->getOffset(), MVT::i8); Base = CurDAG->getTargetGlobalAddress(GA->getGlobal(), MVT::i16, - GA->getOffset()); + GA->getOffset()); return true; } @@ -233,34 +227,34 @@ } -/// Select instructions not customized! Used for -/// expanded, promoted and normal instructions +/// Select - Select instructions not customized! Used for +/// expanded, promoted and normal instructions. SDNode* PIC16DAGToDAGISel::Select(SDOperand N) { SDNode *Node = N.Val; unsigned Opcode = Node->getOpcode(); // Dump information about the Node being selected - #ifndef NDEBUG +#ifndef NDEBUG DOUT << std::string(Indent, ' ') << "Selecting: "; DEBUG(Node->dump(CurDAG)); DOUT << "\n"; Indent += 2; - #endif +#endif // If we have a custom node, we already have selected! if (Opcode >= ISD::BUILTIN_OP_END && Opcode < PIC16ISD::FIRST_NUMBER) { - #ifndef NDEBUG +#ifndef NDEBUG DOUT << std::string(Indent-2, ' ') << "== "; DEBUG(Node->dump(CurDAG)); DOUT << "\n"; Indent -= 2; - #endif +#endif return NULL; } /// - // Instruction Selection not handled by custom or by the + // FIXME: Instruction Selection not handled by custom or by the // auto-generated tablegen selection should be handled here. /// switch(Opcode) { @@ -270,7 +264,7 @@ // Select the default instruction. SDNode *ResNode = SelectCode(N); - #ifndef NDEBUG +#ifndef NDEBUG DOUT << std::string(Indent-2, ' ') << "=> "; if (ResNode == NULL || ResNode == N.Val) DEBUG(N.Val->dump(CurDAG)); @@ -278,7 +272,7 @@ DEBUG(ResNode->dump(CurDAG)); DOUT << "\n"; Indent -= 2; - #endif +#endif return ResNode; } Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp?rev=51105&r1=51104&r2=51105&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Wed May 14 06:31:39 2008 @@ -35,8 +35,7 @@ const char *PIC16TargetLowering:: getTargetNodeName(unsigned Opcode) const { - switch (Opcode) - { + switch (Opcode) { case PIC16ISD::Hi : return "PIC16ISD::Hi"; case PIC16ISD::Lo : return "PIC16ISD::Lo"; case PIC16ISD::Package : return "PIC16ISD::Package"; @@ -44,7 +43,7 @@ case PIC16ISD::SetBank : return "PIC16ISD::SetBank"; case PIC16ISD::SetPage : return "PIC16ISD::SetPage"; case PIC16ISD::Branch : return "PIC16ISD::Branch"; - case PIC16ISD::Cmp : return "PIC16ISD::Cmp"; + case PIC16ISD::Cmp : return "PIC16ISD::Cmp"; case PIC16ISD::BTFSS : return "PIC16ISD::BTFSS"; case PIC16ISD::BTFSC : return "PIC16ISD::BTFSC"; case PIC16ISD::XORCC : return "PIC16ISD::XORCC"; @@ -56,97 +55,77 @@ PIC16TargetLowering:: PIC16TargetLowering(PIC16TargetMachine &TM): TargetLowering(TM) { - // PIC16 does not have i1 type, so use i8 for - // setcc operations results (slt, sgt, ...). - // setSetCCResultType(MVT::i8); - // setSetCCResultContents(ZeroOrOneSetCCResult); - - // Set up the register classes - addRegisterClass(MVT::i8, PIC16::CPURegsRegisterClass); + // Set up the register classes. + addRegisterClass(MVT::i8, PIC16::CPURegsRegisterClass); addRegisterClass(MVT::i16, PIC16::PTRRegsRegisterClass); - // Custom - // Load extented operations for i1 types must be promoted - setLoadXAction(ISD::EXTLOAD, MVT::i1, Promote); + // Load extented operations for i1 types must be promoted . + setLoadXAction(ISD::EXTLOAD, MVT::i1, Promote); setLoadXAction(ISD::ZEXTLOAD, MVT::i1, Promote); setLoadXAction(ISD::SEXTLOAD, MVT::i1, Promote); - // Store operations for i1 types must be promoted - // setStoreXAction(MVT::i1, Promote); - // setStoreXAction(MVT::i8, Legal); - // setStoreXAction(MVT::i16, Custom); - // setStoreXAction(MVT::i32, Expand); - - // setOperationAction(ISD::BUILD_PAIR, MVT::i32, Expand); - // setOperationAction(ISD::BUILD_PAIR, MVT::i16, Expand); - - setOperationAction(ISD::ADD, MVT::i1, Promote); - setOperationAction(ISD::ADD, MVT::i8, Legal); - setOperationAction(ISD::ADD, MVT::i16, Custom); - setOperationAction(ISD::ADD, MVT::i32, Expand); - setOperationAction(ISD::ADD, MVT::i64, Expand); - - setOperationAction(ISD::SUB, MVT::i1, Promote); - setOperationAction(ISD::SUB, MVT::i8, Legal); - setOperationAction(ISD::SUB, MVT::i16, Custom); - setOperationAction(ISD::SUB, MVT::i32, Expand); - setOperationAction(ISD::SUB, MVT::i64, Expand); - - setOperationAction(ISD::ADDC, MVT::i1, Promote); - setOperationAction(ISD::ADDC, MVT::i8, Legal); - setOperationAction(ISD::ADDC, MVT::i16, Custom); - setOperationAction(ISD::ADDC, MVT::i32, Expand); - setOperationAction(ISD::ADDC, MVT::i64, Expand); - - setOperationAction(ISD::ADDE, MVT::i1, Promote); - setOperationAction(ISD::ADDE, MVT::i8, Legal); - setOperationAction(ISD::ADDE, MVT::i16, Custom); - setOperationAction(ISD::ADDE, MVT::i32, Expand); - setOperationAction(ISD::ADDE, MVT::i64, Expand); - - setOperationAction(ISD::SUBC, MVT::i1, Promote); - setOperationAction(ISD::SUBC, MVT::i8, Legal); - setOperationAction(ISD::SUBC, MVT::i16, Custom); - setOperationAction(ISD::SUBC, MVT::i32, Expand); - setOperationAction(ISD::SUBC, MVT::i64, Expand); - - setOperationAction(ISD::SUBE, MVT::i1, Promote); - setOperationAction(ISD::SUBE, MVT::i8, Legal); - setOperationAction(ISD::SUBE, MVT::i16, Custom); - setOperationAction(ISD::SUBE, MVT::i32, Expand); - setOperationAction(ISD::SUBE, MVT::i64, Expand); + setOperationAction(ISD::ADD, MVT::i1, Promote); + setOperationAction(ISD::ADD, MVT::i8, Legal); + setOperationAction(ISD::ADD, MVT::i16, Custom); + setOperationAction(ISD::ADD, MVT::i32, Expand); + setOperationAction(ISD::ADD, MVT::i64, Expand); + + setOperationAction(ISD::SUB, MVT::i1, Promote); + setOperationAction(ISD::SUB, MVT::i8, Legal); + setOperationAction(ISD::SUB, MVT::i16, Custom); + setOperationAction(ISD::SUB, MVT::i32, Expand); + setOperationAction(ISD::SUB, MVT::i64, Expand); + + setOperationAction(ISD::ADDC, MVT::i1, Promote); + setOperationAction(ISD::ADDC, MVT::i8, Legal); + setOperationAction(ISD::ADDC, MVT::i16, Custom); + setOperationAction(ISD::ADDC, MVT::i32, Expand); + setOperationAction(ISD::ADDC, MVT::i64, Expand); + + setOperationAction(ISD::ADDE, MVT::i1, Promote); + setOperationAction(ISD::ADDE, MVT::i8, Legal); + setOperationAction(ISD::ADDE, MVT::i16, Custom); + setOperationAction(ISD::ADDE, MVT::i32, Expand); + setOperationAction(ISD::ADDE, MVT::i64, Expand); + + setOperationAction(ISD::SUBC, MVT::i1, Promote); + setOperationAction(ISD::SUBC, MVT::i8, Legal); + setOperationAction(ISD::SUBC, MVT::i16, Custom); + setOperationAction(ISD::SUBC, MVT::i32, Expand); + setOperationAction(ISD::SUBC, MVT::i64, Expand); + + setOperationAction(ISD::SUBE, MVT::i1, Promote); + setOperationAction(ISD::SUBE, MVT::i8, Legal); + setOperationAction(ISD::SUBE, MVT::i16, Custom); + setOperationAction(ISD::SUBE, MVT::i32, Expand); + setOperationAction(ISD::SUBE, MVT::i64, Expand); // PIC16 does not have these NodeTypes below. - setOperationAction(ISD::SETCC, MVT::i1, Expand); - setOperationAction(ISD::SETCC, MVT::i8, Expand); - setOperationAction(ISD::SETCC, MVT::Other, Expand); + setOperationAction(ISD::SETCC, MVT::i1, Expand); + setOperationAction(ISD::SETCC, MVT::i8, Expand); + setOperationAction(ISD::SETCC, MVT::Other, Expand); setOperationAction(ISD::SELECT_CC, MVT::i1, Custom); setOperationAction(ISD::SELECT_CC, MVT::i8, Custom); - setOperationAction(ISD::BRCOND, MVT::i1, Expand); - setOperationAction(ISD::BRCOND, MVT::i8, Expand); - setOperationAction(ISD::BRCOND, MVT::Other, Expand); - setOperationAction(ISD::BR_CC, MVT::i1, Custom); - setOperationAction(ISD::BR_CC, MVT::i8, Custom); + setOperationAction(ISD::BRCOND, MVT::i1, Expand); + setOperationAction(ISD::BRCOND, MVT::i8, Expand); + setOperationAction(ISD::BRCOND, MVT::Other, Expand); + + setOperationAction(ISD::BR_CC, MVT::i1, Custom); + setOperationAction(ISD::BR_CC, MVT::i8, Custom); setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand); - // Do we really need to Custom lower the GA ?? - // setOperationAction(ISD::GlobalAddress, MVT::i16, Custom); + // FIXME: Do we really need to Custom lower the GA ?? setOperationAction(ISD::GlobalAddress, MVT::i8, Custom); setOperationAction(ISD::RET, MVT::Other, Custom); - // PIC16 not supported intrinsics. - // setOperationAction(ISD::MEMMOVE, MVT::Other, Expand); - // setOperationAction(ISD::MEMSET, MVT::Other, Expand); - // setOperationAction(ISD::MEMCPY, MVT::Other, Expand); - setOperationAction(ISD::CTPOP, MVT::i32, Expand); - setOperationAction(ISD::CTTZ , MVT::i32, Expand); - setOperationAction(ISD::CTLZ , MVT::i32, Expand); - setOperationAction(ISD::ROTL , MVT::i32, Expand); - setOperationAction(ISD::ROTR , MVT::i32, Expand); + setOperationAction(ISD::CTTZ, MVT::i32, Expand); + setOperationAction(ISD::CTLZ, MVT::i32, Expand); + setOperationAction(ISD::ROTL, MVT::i32, Expand); + setOperationAction(ISD::ROTR, MVT::i32, Expand); setOperationAction(ISD::BSWAP, MVT::i32, Expand); setOperationAction(ISD::SHL_PARTS, MVT::i32, Expand); @@ -158,14 +137,12 @@ setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); setOperationAction(ISD::LABEL, MVT::Other, Expand); - // Use the default for now + // Use the default for now. setOperationAction(ISD::STACKSAVE, MVT::Other, Expand); setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand); setOperationAction(ISD::LOAD, MVT::i1, Promote); setOperationAction(ISD::LOAD, MVT::i8, Legal); - // setOperationAction(ISD::LOAD, MVT::i16, Expand); - // setOperationAction(ISD::LOAD, MVT::i32, Expand); setTargetDAGCombine(ISD::LOAD); setTargetDAGCombine(ISD::STORE); @@ -176,11 +153,6 @@ setTargetDAGCombine(ISD::SUBC); setTargetDAGCombine(ISD::SUB); - // We must find a way to get rid of Package nodes in the map - // setTargetDAGCombine(PIC16ISD::Package); - - // getValueTypeActions().setTypeAction((MVT::ValueType)MVT::i16, Expand); - setStackPointerRegisterToSaveRestore(PIC16::STKPTR); computeRegisterProperties(); } @@ -189,33 +161,39 @@ SDOperand PIC16TargetLowering:: LowerOperation(SDOperand Op, SelectionDAG &DAG) { SDVTList VTList16 = DAG.getVTList(MVT::i16, MVT::i16, MVT::Other); - switch (Op.getOpcode()) - { + switch (Op.getOpcode()) { case ISD::STORE: - cout << "reduce store\n"; - break; + DOUT << "reduce store\n"; + break; + case ISD::FORMAL_ARGUMENTS: - cout<<"==== lowering formal args\n"; + DOUT << "==== lowering formal args\n"; return LowerFORMAL_ARGUMENTS(Op, DAG); + case ISD::GlobalAddress: - cout<<"==== lowering GA\n"; + DOUT << "==== lowering GA\n"; return LowerGlobalAddress(Op, DAG); - case ISD::RET: - cout<<"==== lowering ret\n"; + + case ISD::RET: + DOUT << "==== lowering ret\n"; return LowerRET(Op, DAG); - case ISD::FrameIndex: - cout<<"==== lowering frame index\n"; + + case ISD::FrameIndex: + DOUT << "==== lowering frame index\n"; return LowerFrameIndex(Op, DAG); + case ISD::ADDE: - cout <<"==== lowering adde\n"; + DOUT << "==== lowering adde\n"; break; + case ISD::LOAD: case ISD::ADD: break; - case ISD::BR_CC: - cout << "==== lowering BR_CC\n"; + + case ISD::BR_CC: + DOUT << "==== lowering BR_CC\n"; return LowerBR_CC(Op, DAG); - } //end swithch + } // end switch. return SDOperand(); } @@ -224,9 +202,7 @@ // Lower helper functions //===----------------------------------------------------------------------===// - -SDOperand -PIC16TargetLowering::LowerBR_CC(SDOperand Op, SelectionDAG &DAG) +SDOperand PIC16TargetLowering::LowerBR_CC(SDOperand Op, SelectionDAG &DAG) { MVT::ValueType VT = Op.getValueType(); SDOperand Chain = Op.getOperand(0); @@ -239,74 +215,66 @@ unsigned branchOpcode; SDOperand branchOperand; - SDOperand StatusReg = DAG.getRegister(PIC16::STATUSREG,MVT::i8); - SDOperand CPUReg = DAG.getRegister(PIC16::WREG,MVT::i8); - switch(CC) - { + SDOperand StatusReg = DAG.getRegister(PIC16::STATUSREG, MVT::i8); + SDOperand CPUReg = DAG.getRegister(PIC16::WREG, MVT::i8); + switch(CC) { default: assert(0 && "This condition code is not handled yet!!"); abort(); + case ISD::SETNE: - { - cout << "setne\n"; + DOUT << "setne\n"; cmpOpcode = PIC16ISD::XORCC; branchOpcode = PIC16ISD::BTFSS; - branchOperand = DAG.getConstant(2,MVT::i8); + branchOperand = DAG.getConstant(2, MVT::i8); break; - } + case ISD::SETEQ: - { - cout << "seteq\n"; + DOUT << "seteq\n"; cmpOpcode = PIC16ISD::XORCC; branchOpcode = PIC16ISD::BTFSC; - branchOperand = DAG.getConstant(2,MVT::i8); + branchOperand = DAG.getConstant(2, MVT::i8); break; - } + case ISD::SETGT: - { assert(0 && "Greater Than condition code is not handled yet!!"); abort(); - } + break; + case ISD::SETGE: - { - cout << "setge\n"; + DOUT << "setge\n"; cmpOpcode = PIC16ISD::SUBCC; branchOpcode = PIC16ISD::BTFSS; branchOperand = DAG.getConstant(1, MVT::i8); break; - } + case ISD::SETLT: - { - cout << "setlt\n"; + DOUT << "setlt\n"; cmpOpcode = PIC16ISD::SUBCC; branchOpcode = PIC16ISD::BTFSC; branchOperand = DAG.getConstant(1,MVT::i8); break; - } + case ISD::SETLE: - { assert(0 && "Less Than Equal condition code is not handled yet!!"); abort(); - } + break; } // End of Switch SDVTList VTList = DAG.getVTList(MVT::i8, MVT::Flag); SDOperand CmpValue = DAG.getNode(cmpOpcode, VTList, LHS, RHS).getValue(1); - // SDOperand CCOper = DAG.getConstant(CC,MVT::i8); - // Result = DAG.getNode(branchOpcode,VT, Chain, JumpVal, CCOper, StatusReg, - // CmpValue); Result = DAG.getNode(branchOpcode, VT, Chain, JumpVal, branchOperand, - StatusReg, CmpValue); + StatusReg, CmpValue); return Result; - - // return SDOperand(); } //===----------------------------------------------------------------------===// // Misc Lower Operation implementation //===----------------------------------------------------------------------===// -// Create a constant pool entry for global value and wrap it in a wrapper node. + +// LowerGlobalAddress - Create a constant pool entry for global value +// and wrap it in a wrapper node. SDOperand PIC16TargetLowering::LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG) { @@ -314,7 +282,7 @@ GlobalAddressSDNode *GSDN = cast(Op); GlobalValue *GV = GSDN->getGlobal(); - //for now only do the ram. + // FIXME: for now only do the ram. SDOperand CPAddr = DAG.getTargetConstantPool(GV, PtrVT, 2); SDOperand CPBank = DAG.getNode(PIC16ISD::SetBank, MVT::i8, CPAddr); CPAddr = DAG.getNode(PIC16ISD::Wrapper, MVT::i8, CPAddr,CPBank); @@ -325,11 +293,11 @@ SDOperand PIC16TargetLowering::LowerRET(SDOperand Op, SelectionDAG &DAG) { - switch(Op.getNumOperands()) - { + switch(Op.getNumOperands()) { default: assert(0 && "Do not know how to return this many arguments!"); abort(); + case 1: return SDOperand(); // ret void is legal } @@ -360,8 +328,8 @@ // If this load is directly stored, replace the load value with the stored // value. - // TODO: Handle store large -> read small portion. - // TODO: Handle TRUNCSTORE/LOADEXT + // FIXME: Handle store large -> read small portion. + // FIXME: Handle TRUNCSTORE/LOADEXT LoadSDNode *LD = cast(N); SDOperand Ptr = LD->getBasePtr(); if (LD->getExtensionType() == ISD::NON_EXTLOAD) { @@ -381,7 +349,7 @@ toWorklist = DAG.getNode(ISD::ADD, MVT::i16, Src, DAG.getConstant(1, MVT::i16)); Outs[1] = DAG.getLoad(MVT::i8, Chain, toWorklist, NULL, 0); - // Add to worklist may not be needed. + // FIXME: Add to worklist may not be needed. // It is meant to merge sequences of add with constant into one. DCI.AddToWorklist(toWorklist.Val); @@ -405,7 +373,7 @@ bool changed = false; int i; SDOperand LoOps[3], HiOps[3]; - SDOperand OutOps[3]; //[0]:left, [1]:right, [2]:carry + SDOperand OutOps[3]; // [0]:left, [1]:right, [2]:carry SDOperand InOp[2]; SDOperand retVal; SDOperand as1,as2; @@ -415,8 +383,7 @@ InOp[0] = N->getOperand(0); InOp[1] = N->getOperand(1); - switch (N->getOpcode()) - { + switch (N->getOpcode()) { case ISD::ADD: if (InOp[0].getOpcode() == ISD::Constant && InOp[1].getOpcode() == ISD::Constant) { @@ -424,12 +391,15 @@ ConstantSDNode *CST1 = dyn_cast(InOp[1]); return DAG.getConstant(CST0->getValue() + CST1->getValue(), MVT::i16); } + break; + case ISD::ADDE: case ISD::ADDC: AS = ISD::ADD; ASE = ISD::ADDE; ASC = ISD::ADDC; break; + case ISD::SUB: if (InOp[0].getOpcode() == ISD::Constant && InOp[1].getOpcode() == ISD::Constant) { @@ -437,23 +407,25 @@ ConstantSDNode *CST1 = dyn_cast(InOp[1]); return DAG.getConstant(CST0->getValue() - CST1->getValue(), MVT::i16); } + break; + case ISD::SUBE: case ISD::SUBC: AS = ISD::SUB; ASE = ISD::SUBE; ASC = ISD::SUBC; break; - } + } // end switch. assert ((N->getValueType(0) == MVT::i16) - && "expecting an MVT::i16 node for lowering"); + && "expecting an MVT::i16 node for lowering"); assert ((N->getOperand(0).getValueType() == MVT::i16) - && (N->getOperand(1).getValueType() == MVT::i16) - && "both inputs to addx/subx:i16 must be i16"); + && (N->getOperand(1).getValueType() == MVT::i16) + && "both inputs to addx/subx:i16 must be i16"); for (i = 0; i < 2; i++) { if (InOp[i].getOpcode() == ISD::GlobalAddress) { - //we don't want to lower subs/adds with global address (at least not yet) + // We don't want to lower subs/adds with global address yet. return SDOperand(); } else if (InOp[i].getOpcode() == ISD::Constant) { @@ -469,11 +441,11 @@ else if (InOp[i].getOpcode() == ISD::LOAD) { changed = true; // LowerLOAD returns a Package node or it may combine and return - // anything else + // anything else. SDOperand lowered = LowerLOAD(InOp[i].Val, DAG, DCI); // So If LowerLOAD returns something other than Package, - // then just call ADD again + // then just call ADD again. if (lowered.getOpcode() != PIC16ISD::Package) return LowerADDSUB(N, DAG, DCI); @@ -487,15 +459,15 @@ (InOp[i].getOpcode() == ISD::SUBE) || (InOp[i].getOpcode() == ISD::SUBC)) { changed = true; - //must call LowerADDSUB recursively here.... - //LowerADDSUB returns a Package node + // Must call LowerADDSUB recursively here, + // LowerADDSUB returns a Package node. SDOperand lowered = LowerADDSUB(InOp[i].Val, DAG, DCI); LoOps[i] = lowered.getOperand(0); HiOps[i] = lowered.getOperand(1); } else if (InOp[i].getOpcode() == ISD::SIGN_EXTEND) { - //FIXME: I am just zero extending. for now. + // FIXME: I am just zero extending. for now. changed = true; LoOps[i] = InOp[i].getOperand(0); HiOps[i] = DAG.getConstant(0, MVT::i8); @@ -505,14 +477,14 @@ DAG.viewGraph(); assert (0 && "not implemented yet"); } - } //end for + } // end for. assert (changed && "nothing changed while lowering SUBx/ADDx"); VTList = DAG.getVTList(MVT::i8, MVT::Flag); if (N->getOpcode() == ASE) { - //we must take in the existing carry - //if this node is part of an existing subx/addx sequence + // We must take in the existing carry + // if this node is part of an existing subx/addx sequence. LoOps[2] = N->getOperand(2).getValue(1); as1 = DAG.getNode (ASE, VTList, LoOps, 3); } @@ -521,11 +493,11 @@ } HiOps[2] = as1.getValue(1); as2 = DAG.getNode (ASE, VTList, HiOps, 3); - //we must build a pair that also provides the carry from sube/adde + // We must build a pair that also provides the carry from sube/adde. OutOps[0] = as1; OutOps[1] = as2; OutOps[2] = as2.getValue(1); - //breaking an original i16 so lets make the Package also an i16 + // Breaking an original i16, so lets make the Package also an i16. if (N->getOpcode() == ASE) { VTList = DAG.getVTList(MVT::i16, MVT::Flag); retVal = DAG.getNode (PIC16ISD::Package, VTList, OutOps, 3); @@ -548,13 +520,6 @@ //===----------------------------------------------------------------------===// // Calling Convention Implementation -// -// The lower operations present on calling convention works on this order: -// LowerCALL (virt regs --> phys regs, virt regs --> stack) -// LowerFORMAL_ARGUMENTS (phys --> virt regs, stack --> virt regs) -// LowerRET (virt regs --> phys regs) -// LowerCALL (phys regs --> virt regs) -// //===----------------------------------------------------------------------===// #include "PIC16GenCallingConv.inc" @@ -574,7 +539,7 @@ SDOperand Root = Op.getOperand(0); // Return the new list of results. - // Just copy right now. + // FIXME: Just copy right now. ArgValues.push_back(Root); return DAG.getNode(ISD::MERGE_VALUES, Op.Val->getVTList(), &ArgValues[0], @@ -601,184 +566,182 @@ ConstantSDNode *CST; SelectionDAG &DAG = DCI.DAG; - switch (N->getOpcode()) - { - default: break; - case PIC16ISD::Package : - cout <<"==== combining PIC16ISD::Package\n"; - return SDOperand(); - case ISD::ADD : - case ISD::SUB : - if ((N->getOperand(0).getOpcode() == ISD::GlobalAddress) || - (N->getOperand(0).getOpcode() == ISD::FrameIndex)) { - //do not touch pointer adds - return SDOperand (); - } - case ISD::ADDE : - case ISD::ADDC : - case ISD::SUBE : - case ISD::SUBC : - if (N->getValueType(0) == MVT::i16) { - SDOperand retVal = LowerADDSUB(N, DAG,DCI); - // LowerADDSUB has already combined the result, - // so we just return nothing to avoid assertion failure from llvm - // if N has been deleted already + switch (N->getOpcode()) { + default: + break; + + case PIC16ISD::Package: + DOUT << "==== combining PIC16ISD::Package\n"; return SDOperand(); - } - else if (N->getValueType(0) == MVT::i8) { - //sanity check .... - for (int i=0; i<2; i++) { - if (N->getOperand (i).getOpcode() == PIC16ISD::Package) { - assert (0 && - "don't want to have PIC16ISD::Package as intput to add:i8"); + + case ISD::ADD: + case ISD::SUB: + if ((N->getOperand(0).getOpcode() == ISD::GlobalAddress) || + (N->getOperand(0).getOpcode() == ISD::FrameIndex)) { + // Do not touch pointer adds. + return SDOperand (); + } + break; + + case ISD::ADDE : + case ISD::ADDC : + case ISD::SUBE : + case ISD::SUBC : + if (N->getValueType(0) == MVT::i16) { + SDOperand retVal = LowerADDSUB(N, DAG,DCI); + // LowerADDSUB has already combined the result, + // so we just return nothing to avoid assertion failure from llvm + // if N has been deleted already. + return SDOperand(); + } + else if (N->getValueType(0) == MVT::i8) { + // Sanity check .... + for (int i=0; i<2; i++) { + if (N->getOperand (i).getOpcode() == PIC16ISD::Package) { + assert (0 && + "don't want to have PIC16ISD::Package as intput to add:i8"); + } } } - } - break; - case ISD::STORE : - { - SDOperand Chain = N->getOperand(0); - SDOperand Src = N->getOperand(1); - SDOperand Dest = N->getOperand(2); - unsigned int DstOff = 0; - int NUM_STORES; - SDOperand Stores[6]; - - - // if source operand is expected to be extended to - // some higher type then - remove this extension - // SDNode and do the extension manually - if ((Src.getOpcode() == ISD::ANY_EXTEND) || - (Src.getOpcode() == ISD::SIGN_EXTEND) || - (Src.getOpcode() == ISD::ZERO_EXTEND)) { - Src = Src.Val->getOperand(0); - Stores[0] = DAG.getStore(Chain, Src, Dest, NULL,0); - return Stores[0]; - } + break; - switch(Src.getValueType()) + // FIXME: split this large chunk of code. + case ISD::STORE : { - case MVT::i8: - break; - case MVT::i16: - NUM_STORES = 2; - break; - case MVT::i32: - NUM_STORES = 4; - break; - case MVT::i64: - NUM_STORES = 8; - break; - } + SDOperand Chain = N->getOperand(0); + SDOperand Src = N->getOperand(1); + SDOperand Dest = N->getOperand(2); + unsigned int DstOff = 0; + int NUM_STORES; + SDOperand Stores[6]; + + // if source operand is expected to be extended to + // some higher type then - remove this extension + // SDNode and do the extension manually + if ((Src.getOpcode() == ISD::ANY_EXTEND) || + (Src.getOpcode() == ISD::SIGN_EXTEND) || + (Src.getOpcode() == ISD::ZERO_EXTEND)) { + Src = Src.Val->getOperand(0); + Stores[0] = DAG.getStore(Chain, Src, Dest, NULL,0); + return Stores[0]; + } + + switch(Src.getValueType()) { + case MVT::i8: + break; + + case MVT::i16: + NUM_STORES = 2; + break; + + case MVT::i32: + NUM_STORES = 4; + break; + + case MVT::i64: + NUM_STORES = 8; + break; + } - if (isa(Dest) && isa(Src) && - (Src.getValueType() != MVT::i8)) { - //create direct addressing a = b - Chain = Src.getOperand(0); - for (i=0; i(Dest) && isa(Src) && + (Src.getValueType() != MVT::i8)) { + //create direct addressing a = b + Chain = Src.getOperand(0); + for (i=0; i(Dest) && isa(Src) - && (Src.getValueType() != MVT::i8)) - { - //create direct addressing a = CONST - CST = dyn_cast(Src); - for (i = 0; i < NUM_STORES; i++) { - SDOperand CNST = DAG.getConstant(CST->getValue() >> i*8, MVT::i8); - SDOperand ADN = DAG.getNode(ISD::ADD, MVT::i16, Dest, - DAG.getConstant(DstOff, MVT::i16)); - Stores[i] = DAG.getStore(Chain, CNST, ADN, NULL, 0); - Chain = Stores[i]; - DstOff += 1; - } + Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &Stores[0], i); + return Chain; + } + else if (isa(Dest) && isa(Src) + && (Src.getValueType() != MVT::i8)) { + //create direct addressing a = CONST + CST = dyn_cast(Src); + for (i = 0; i < NUM_STORES; i++) { + SDOperand CNST = DAG.getConstant(CST->getValue() >> i*8, MVT::i8); + SDOperand ADN = DAG.getNode(ISD::ADD, MVT::i16, Dest, + DAG.getConstant(DstOff, MVT::i16)); + Stores[i] = DAG.getStore(Chain, CNST, ADN, NULL, 0); + Chain = Stores[i]; + DstOff += 1; + } - Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &Stores[0], i); - return Chain; - } - else if (isa(Dest) && isa(Src) - && (Src.getValueType() != MVT::i8)) { - //create indirect addressing - CST = dyn_cast(Src); - Chain = Dest.getOperand(0); - SDOperand Load; - Load = DAG.getLoad(MVT::i16, Chain,Dest.getOperand(1), NULL, 0); - Chain = Load.getValue(1); - for (i=0; igetValue() >> i*8, MVT::i8); - Stores[i] = DAG.getStore(Chain, CNST, Load, NULL, 0); - Chain = Stores[i]; - DstOff += 1; - } + Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &Stores[0], i); + return Chain; + } + else if (isa(Dest) && isa(Src) + && (Src.getValueType() != MVT::i8)) { + // Create indirect addressing. + CST = dyn_cast(Src); + Chain = Dest.getOperand(0); + SDOperand Load; + Load = DAG.getLoad(MVT::i16, Chain,Dest.getOperand(1), NULL, 0); + Chain = Load.getValue(1); + for (i=0; igetValue() >> i*8, MVT::i8); + Stores[i] = DAG.getStore(Chain, CNST, Load, NULL, 0); + Chain = Stores[i]; + DstOff += 1; + } - Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &Stores[0], i); - return Chain; - } - else if (isa(Dest) && isa(Src)) { - // GlobalAddressSDNode *GAD = dyn_cast(Src); - return SDOperand(); - } - else if (Src.getOpcode() == PIC16ISD::Package) { - StoreSDNode *st = dyn_cast(N); - SDOperand toWorkList, retVal; - Chain = N->getOperand(0); + Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &Stores[0], i); + return Chain; + } + else if (isa(Dest) && isa(Src)) { + // GlobalAddressSDNode *GAD = dyn_cast(Src); + return SDOperand(); + } + else if (Src.getOpcode() == PIC16ISD::Package) { + StoreSDNode *st = dyn_cast(N); + SDOperand toWorkList, retVal; + Chain = N->getOperand(0); + + if (st->isTruncatingStore()) { + retVal = DAG.getStore(Chain, Src.getOperand(0), Dest, NULL, 0); + } + else { + toWorkList = DAG.getNode(ISD::ADD, MVT::i16, Dest, + DAG.getConstant(1, MVT::i16)); + Stores[1] = DAG.getStore(Chain, Src.getOperand(0), Dest, NULL, 0); + Stores[0] = DAG.getStore(Chain, Src.getOperand(1), toWorkList, NULL, + 0); + + // We want to merge sequence of add with constant to one add and a + // constant, so add the ADD node to worklist to have llvm do that + // automatically. + DCI.AddToWorklist(toWorkList.Val); + + // We don't need the Package so add to worklist so llvm deletes it + DCI.AddToWorklist(Src.Val); + retVal = DAG.getNode(ISD::TokenFactor, MVT::Other, &Stores[0], 2); + } - if (st->isTruncatingStore()) { - retVal = DAG.getStore(Chain, Src.getOperand(0), Dest, NULL, 0); + return retVal; + } + else if (Src.getOpcode() == ISD::TRUNCATE) { } else { - toWorkList = DAG.getNode(ISD::ADD, MVT::i16, Dest, - DAG.getConstant(1, MVT::i16)); - Stores[1] = DAG.getStore(Chain, Src.getOperand(0), Dest, NULL, 0); - Stores[0] = DAG.getStore(Chain, Src.getOperand(1), toWorkList, NULL, 0); - - // We want to merge sequence of add with constant to one add and a - // constant, so add the ADD node to worklist to have llvm do that - // automatically. - DCI.AddToWorklist(toWorkList.Val); - - // We don't need the Package so add to worklist so llvm deletes it - DCI.AddToWorklist(Src.Val); - retVal = DAG.getNode(ISD::TokenFactor, MVT::Other, &Stores[0], 2); } + } // end ISD::STORE. + break; - return retVal; - } - else if (Src.getOpcode() == ISD::TRUNCATE) { - } - else { - // DAG.setGraphColor(N, "blue"); - // DAG.viewGraph(); - // assert (0 && "input to store not implemented yet"); + case ISD::LOAD : + { + SDOperand Ptr = N->getOperand(1); + if (Ptr.getOpcode() == PIC16ISD::Package) { + assert (0 && "not implemented yet"); + } } - } //end ISD::STORE - - break; - case ISD::LOAD : - { - SDOperand Ptr = N->getOperand(1); - if (Ptr.getOpcode() == PIC16ISD::Package) { - // DAG.setGraphColor(N, "blue"); - // DAG.viewGraph(); - // Here we must make so that: - // Ptr.getOperand(0) --> fsrl - // Ptr.getOperand(1) --> fsrh - assert (0 && "not implemented yet"); - } - //return SDOperand(); - //break; - } - }//end switch + break; + } // end switch. return SDOperand(); } @@ -793,8 +756,8 @@ if ((Src.getOpcode() == ISD::LOAD) && (Src.getValueType() == MVT::i8)) return &Src; for (i=0; i pattern> - : Instruction + : Instruction { field bits<14> Inst; let Namespace = "PIC16"; dag OutOperandList = outs; - dag InOperandList = ins; + dag InOperandList = ins; - let AsmString = asmstr; - let Pattern = pattern; + let AsmString = asmstr; + let Pattern = pattern; } @@ -41,8 +41,8 @@ //===----------------------------------------------------------------------===// class ByteFormat op, dag outs, dag ins, string asmstr, - list pattern> - :PIC16Inst + list pattern> + :PIC16Inst { bits<1> d; bits<7> f; @@ -74,8 +74,8 @@ //===----------------------------------------------------------------------===// class LiteralFormat op, dag outs, dag ins, string asmstr, - list pattern> - : PIC16Inst + list pattern> + : PIC16Inst { bits<8> k; @@ -90,8 +90,8 @@ //===----------------------------------------------------------------------===// class ControlFormat op, dag outs, dag ins, string asmstr, - list pattern> - :PIC16Inst + list pattern> + :PIC16Inst { bits<11> k; Modified: llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp?rev=51105&r1=51104&r2=51105&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp Wed May 14 06:31:39 2008 @@ -21,7 +21,7 @@ using namespace llvm; -// TODO: Add the subtarget support on this constructor. +// FIXME: Add the subtarget support on this constructor. PIC16InstrInfo::PIC16InstrInfo(PIC16TargetMachine &tm) : TargetInstrInfoImpl(PIC16Insts, array_lengthof(PIC16Insts)), TM(tm), RI(*this) {} @@ -87,7 +87,7 @@ .addReg(SrcReg,false,false,true,true) .addExternalSymbol(tmpName) // the current printer expects 3 operands, .addExternalSymbol(tmpName); // all we need is actually one, - // so we repeat. + // so we repeat. } else assert(0 && "Can't store this register to stack slot"); @@ -120,7 +120,7 @@ /// instructions inserted. unsigned PIC16InstrInfo:: InsertBranch(MachineBasicBlock &MBB, - MachineBasicBlock *TBB, MachineBasicBlock *FBB, + MachineBasicBlock *TBB, MachineBasicBlock *FBB, const std::vector &Cond) const { // Shouldn't be a fall through. @@ -134,7 +134,7 @@ return 1; } - // TODO: If the there are some conditions specified then conditional branch + // FIXME: If the there are some conditions specified then conditional branch // should be generated. // For the time being no instruction is being generated therefore // returning NULL. Modified: llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td?rev=51105&r1=51104&r2=51105&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td (original) +++ llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td Wed May 14 06:31:39 2008 @@ -46,7 +46,7 @@ def callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_PIC16CallSeq, [SDNPHasChain, SDNPOutFlag]>; -def PIC16Wrapper : SDNode<"PIC16ISD::Wrapper", SDTIntUnaryOp>; +def PIC16Wrapper : SDNode<"PIC16ISD::Wrapper", SDTIntUnaryOp>; // so_imm_XFORM - Return a so_imm value packed into the format described for // so_imm def below. @@ -74,7 +74,7 @@ !strconcat(instr_asm, " $c"), [(set CPURegs:$dst, (OpNode CPURegs:$b, Od:$c))]>; -// Memory Load/Store +// Memory Load/Store. class LoadDirect op, string instr_asm, PatFrag OpNode>: ByteFormat< op, (outs CPURegs:$dst), @@ -103,7 +103,7 @@ !strconcat(instr_asm, " $fsr"), [(OpNode CPURegs:$src, PTRRegs:$fsr)]>; -// Move +// Move. class MovLit op, string instr_asm>: LiteralFormat< op, (outs CPURegs:$dst), @@ -162,52 +162,52 @@ } // Load/Store -def LFSR1 : LoadInDirect <0x4, "lfsr", load>; +def LFSR1 : LoadInDirect <0x4, "lfsr", load>; let isReMaterializable = 1 in { -def MOVF : LoadDirect <0x23, "movf", load>; +def MOVF : LoadDirect <0x23, "movf", load>; } -def MOVWF : StoreDirect <0x2b, "movwf", store>; +def MOVWF : StoreDirect <0x2b, "movwf", store>; -def MOVFSRINC : StoreInDirect <0x5, "movfsrinc", store>; +def MOVFSRINC : StoreInDirect <0x5, "movfsrinc", store>; -def RETURN : ControlFormat<0x03, (outs), (ins), "return", []>; +def RETURN : ControlFormat<0x03, (outs), (ins), "return", []>; -def ADDWF : Arith1M<0x01, "addwf", add>; -def ADDFW : Arith1R<0x02, "addfw", add>; +def ADDWF : Arith1M<0x01, "addwf", add>; +def ADDFW : Arith1R<0x02, "addfw", add>; -def ADDWFE : Arith1M<0x03, "addwfe", adde>; -def ADDFWE : Arith1R<0x04, "addfwe", adde>; +def ADDWFE : Arith1M<0x03, "addwfe", adde>; +def ADDFWE : Arith1R<0x04, "addfwe", adde>; -def ADDWFC : Arith1M<0x05, "addwfc", addc>; -def ADDFWC : Arith1R<0x06, "addfwc", addc>; +def ADDWFC : Arith1M<0x05, "addwfc", addc>; +def ADDFWC : Arith1R<0x06, "addfwc", addc>; -def SUBWF : Arith1M<0x07, "subwf", sub>; -def SUBFW : Arith1R<0x08, "subfw", sub>; +def SUBWF : Arith1M<0x07, "subwf", sub>; +def SUBFW : Arith1R<0x08, "subfw", sub>; -def SUBWFE : Arith1M<0x09, "subwfe", sube>; -def SUBFWE : Arith1R<0x0a, "subfwe", sube>; +def SUBWFE : Arith1M<0x09, "subwfe", sube>; +def SUBFWE : Arith1R<0x0a, "subfwe", sube>; -def SUBWFC : Arith1M<0x0b, "subwfc", subc>; -def SUBFWC : Arith1R<0x0d, "subfwc", subc>; +def SUBWFC : Arith1M<0x0b, "subwfc", subc>; +def SUBFWC : Arith1R<0x0d, "subfwc", subc>; -def SUBRFW : Arith2R<0x08, "subfw", sub>; +def SUBRFW : Arith2R<0x08, "subfw", sub>; -def SUBRFWE : Arith2R<0x0a, "subfwe", sube>; +def SUBRFWE : Arith2R<0x0a, "subfwe", sube>; -def SUBRFWC : Arith2R<0x0d, "subfwc", subc>; +def SUBRFWC : Arith2R<0x0d, "subfwc", subc>; -def brtarget : Operand; +def brtarget : Operand; class UncondJump< bits<4> op, string instr_asm>: BitFormat< op, - (outs), - (ins brtarget:$target), - !strconcat(instr_asm, " $target"), - [(br bb:$target)]>; + (outs), + (ins brtarget:$target), + !strconcat(instr_asm, " $target"), + [(br bb:$target)]>; -def GOTO : UncondJump<0x1, "goto">; +def GOTO : UncondJump<0x1, "goto">; class LogicM op, string instr_asm, SDNode OpNode> : ByteFormat< op, @@ -246,7 +246,7 @@ /* For comparison before branch */ def SDT_PIC16Cmp : SDTypeProfile<1, 3, [SDTCisSameAs<0,1>]>; def SDTIntBinOpPIC16 : SDTypeProfile<1, 2, [SDTCisSameAs<0,1>, - SDTCisSameAs<1,2>, SDTCisInt<1>]>; + SDTCisSameAs<1,2>, SDTCisInt<1>]>; def PIC16Cmp : SDNode<"PIC16ISD::Cmp",SDTIntBinOpPIC16, [SDNPOutFlag]>; def PIC16XORCC : SDNode<"PIC16ISD::XORCC",SDTIntBinOpPIC16, [SDNPOutFlag]>; @@ -260,23 +260,23 @@ /* For branch conditions */ def SDT_PIC16Branch : SDTypeProfile<0, 3, [SDTCisVT<0, OtherVT>, - SDTCisVT<1,i8>, SDTCisVT<2,i8>]>; + SDTCisVT<1,i8>, SDTCisVT<2,i8>]>; def PIC16Branch : SDNode<"PIC16ISD::Branch",SDT_PIC16Branch, - [SDNPHasChain, SDNPInFlag]>; + [SDNPHasChain, SDNPInFlag]>; def PIC16BTFSS : SDNode<"PIC16ISD::BTFSS",SDT_PIC16Branch, - [SDNPHasChain, SDNPInFlag]>; + [SDNPHasChain, SDNPInFlag]>; def PIC16BTFSC : SDNode<"PIC16ISD::BTFSC",SDT_PIC16Branch, - [SDNPHasChain, SDNPInFlag]>; + [SDNPHasChain, SDNPInFlag]>; class InstrBitTestCC op, string instr_asm,SDNode OpNode>: BitFormat< op, - (outs), - (ins brtarget:$target ,so_imm:$i, STATUSRegs:$s ), - !strconcat(instr_asm, " $s, $i, $target"), - [(OpNode bb:$target, so_imm:$i, STATUSRegs:$s )]>; + (outs), + (ins brtarget:$target ,so_imm:$i, STATUSRegs:$s ), + !strconcat(instr_asm, " $s, $i, $target"), + [(OpNode bb:$target, so_imm:$i, STATUSRegs:$s )]>; def BTFSS : InstrBitTestCC<0x1,"btfss",PIC16BTFSS>; def BTFSC : InstrBitTestCC<0x1,"btfsc",PIC16BTFSC>; Modified: llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp?rev=51105&r1=51104&r2=51105&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp Wed May 14 06:31:39 2008 @@ -34,7 +34,7 @@ using namespace llvm; -// TODO: add subtarget support +// FIXME: add subtarget support. PIC16RegisterInfo::PIC16RegisterInfo(const TargetInstrInfo &tii) : PIC16GenRegisterInfo(PIC16::ADJCALLSTACKDOWN, PIC16::ADJCALLSTACKUP), TII(tii) {} @@ -44,8 +44,8 @@ unsigned PIC16RegisterInfo:: getRegisterNumbering(unsigned RegEnum) { - assert (RegEnum <= 31 && "Unknown register number!"); - return RegEnum; + assert (RegEnum <= 31 && "Unknown register number!"); + return RegEnum; } void PIC16RegisterInfo:: @@ -61,16 +61,15 @@ unsigned DestReg, const MachineInstr *Orig) const { - MachineInstr *MI = Orig->clone(); - MI->getOperand(0).setReg(DestReg); - MBB.insert(I, MI); + MachineInstr *MI = Orig->clone(); + MI->getOperand(0).setReg(DestReg); + MBB.insert(I, MI); } MachineInstr *PIC16RegisterInfo:: foldMemoryOperand(MachineInstr* MI, unsigned OpNum, int FI) const { MachineInstr *NewMI = NULL; - return NewMI; } @@ -152,27 +151,24 @@ int stackSize = MF.getFrameInfo()->getStackSize(); int spOffset = MF.getFrameInfo()->getObjectOffset(FrameIndex); - #ifndef NDEBUG DOUT << "\nFunction : " << MF.getFunction()->getName() << "\n"; DOUT << "<--------->\n"; +#ifndef NDEBUG MI.print(DOUT); +#endif DOUT << "FrameIndex : " << FrameIndex << "\n"; DOUT << "spOffset : " << spOffset << "\n"; DOUT << "stackSize : " << stackSize << "\n"; - #endif - // as explained on LowerFORMAL_ARGUMENTS, detect negative offsets + // As explained on LowerFORMAL_ARGUMENTS, detect negative offsets // and adjust SPOffsets considering the final stack size. int Offset = ((spOffset < 0) ? (stackSize + (-(spOffset+4))) : (spOffset)); - //Offset += MI.getOperand(i+1).getImm(); - #ifndef NDEBUG DOUT << "Offset : " << Offset << "\n"; DOUT << "<--------->\n"; - #endif // MI.getOperand(i+1).ChangeToImmediate(Offset); - MI.getOperand(i).ChangeToRegister(getFrameRegister(MF),false); + MI.getOperand(i).ChangeToRegister(getFrameRegister(MF), false); } void PIC16RegisterInfo:: @@ -186,7 +182,8 @@ } void PIC16RegisterInfo:: -processFunctionBeforeFrameFinalized(MachineFunction &MF) const { +processFunctionBeforeFrameFinalized(MachineFunction &MF) const +{ } unsigned PIC16RegisterInfo:: Modified: llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h?rev=51105&r1=51104&r2=51105&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h Wed May 14 06:31:39 2008 @@ -44,8 +44,8 @@ } void copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, - unsigned DestReg, unsigned SrcReg, - const TargetRegisterClass *RC) const; + unsigned DestReg, unsigned SrcReg, + const TargetRegisterClass *RC) const; const unsigned *getCalleeSavedRegs(const MachineFunction* MF = 0) const; Modified: llvm/trunk/lib/Target/PIC16/PIC16Subtarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16Subtarget.cpp?rev=51105&r1=51104&r2=51105&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16Subtarget.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16Subtarget.cpp Wed May 14 06:31:39 2008 @@ -11,13 +11,13 @@ // //===----------------------------------------------------------------------===// -#include "PIC16Subtarget.h" #include "PIC16.h" +#include "PIC16Subtarget.h" #include "PIC16GenSubtarget.inc" using namespace llvm; PIC16Subtarget::PIC16Subtarget(const TargetMachine &TM, const Module &M, - const std::string &FS) + const std::string &FS) :IsPIC16Old(false) { std::string CPU = "generic"; Modified: llvm/trunk/lib/Target/PIC16/PIC16Subtarget.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16Subtarget.h?rev=51105&r1=51104&r2=51105&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16Subtarget.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16Subtarget.h Wed May 14 06:31:39 2008 @@ -14,8 +14,8 @@ #ifndef PIC16SUBTARGET_H #define PIC16SUBTARGET_H -#include "llvm/Target/TargetSubtarget.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetSubtarget.h" #include @@ -30,7 +30,7 @@ /// of the specified module. /// PIC16Subtarget(const TargetMachine &TM, const Module &M, - const std::string &FS); + const std::string &FS); /// ParseSubtargetFeatures - Parses features string setting specified /// subtarget options. Definition of function is auto generated by tblgen. Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp?rev=51105&r1=51104&r2=51105&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.cpp Wed May 14 06:31:39 2008 @@ -12,12 +12,12 @@ //===----------------------------------------------------------------------===// #include "PIC16.h" -#include "PIC16TargetMachine.h" #include "PIC16TargetAsmInfo.h" +#include "PIC16TargetMachine.h" #include "llvm/Module.h" #include "llvm/PassManager.h" -#include "llvm/Target/TargetMachineRegistry.h" #include "llvm/Target/TargetAsmInfo.h" +#include "llvm/Target/TargetMachineRegistry.h" using namespace llvm; @@ -33,8 +33,7 @@ FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0) { } -const TargetAsmInfo *PIC16TargetMachine:: -createTargetAsmInfo() const +const TargetAsmInfo *PIC16TargetMachine::createTargetAsmInfo() const { return new PIC16TargetAsmInfo(*this); } @@ -43,8 +42,7 @@ // Pass Pipeline Configuration //===----------------------------------------------------------------------===// -bool PIC16TargetMachine:: -addInstSelector(PassManagerBase &PM, bool Fast) +bool PIC16TargetMachine::addInstSelector(PassManagerBase &PM, bool Fast) { // Install an instruction selector. PM.add(createPIC16ISelDag(*this)); @@ -57,7 +55,7 @@ return false; } -bool PIC16TargetMachine:: addPreEmitPass(PassManagerBase &PM, bool Fast) +bool PIC16TargetMachine::addPreEmitPass(PassManagerBase &PM, bool Fast) { return true; } Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h?rev=51105&r1=51104&r2=51105&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16TargetMachine.h Wed May 14 06:31:39 2008 @@ -54,7 +54,7 @@ virtual bool addPrologEpilogInserter(PassManagerBase &PM, bool Fast); virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - std::ostream &Out); + std::ostream &Out); }; } // end namespace llvm From ggreif at gmail.com Wed May 14 08:39:36 2008 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 14 May 2008 13:39:36 -0000 Subject: [llvm-commits] [llvm] r51106 - /llvm/branches/ggreif/use-diet/Makefile.rules Message-ID: <200805141339.m4EDdbW1010168@zion.cs.uiuc.edu> Author: ggreif Date: Wed May 14 08:39:34 2008 New Revision: 51106 URL: http://llvm.org/viewvc/llvm-project?rev=51106&view=rev Log: enhance targets and to report the searched files and not to hang on an empty file list waiting for the console Modified: llvm/branches/ggreif/use-diet/Makefile.rules Modified: llvm/branches/ggreif/use-diet/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/Makefile.rules?rev=51106&r1=51105&r2=51106&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/Makefile.rules (original) +++ llvm/branches/ggreif/use-diet/Makefile.rules Wed May 14 08:39:34 2008 @@ -1738,10 +1738,17 @@ endif check-line-length: - @egrep -n '.{81}' $(Sources) + @echo searching for overlength lines in files: $(Sources) + @echo + @echo + @egrep -n '.{81}' $(Sources) /dev/null check-for-tabs: - @egrep -n ' ' $(Sources) + @echo searching for tabs in files: $(Sources) + @echo + @echo + @egrep -n ' ' $(Sources) /dev/null + check-footprint: @ls -l $(LibDir) | awk '\ BEGIN { sum = 0; } \ From ggreif at gmail.com Wed May 14 08:44:26 2008 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 14 May 2008 13:44:26 -0000 Subject: [llvm-commits] [llvm] r51107 - in /llvm/branches/ggreif/use-diet/lib: AsmParser/ Bitcode/Reader/ ExecutionEngine/JIT/ Linker/ Transforms/IPO/ Transforms/Instrumentation/ Transforms/Scalar/ Transforms/Utils/ Message-ID: <200805141344.m4EDiR2J010308@zion.cs.uiuc.edu> Author: ggreif Date: Wed May 14 08:44:26 2008 New Revision: 51107 URL: http://llvm.org/viewvc/llvm-project?rev=51107&view=rev Log: correct 80col violations caused by API change Modified: llvm/branches/ggreif/use-diet/lib/AsmParser/llvmAsmParser.y llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp llvm/branches/ggreif/use-diet/lib/ExecutionEngine/JIT/JIT.cpp llvm/branches/ggreif/use-diet/lib/Linker/LinkModules.cpp llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalOpt.cpp llvm/branches/ggreif/use-diet/lib/Transforms/Instrumentation/RSProfiling.cpp llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/GVNPRE.cpp llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/LoopRotation.cpp llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/TailRecursionElimination.cpp llvm/branches/ggreif/use-diet/lib/Transforms/Utils/CodeExtractor.cpp llvm/branches/ggreif/use-diet/lib/Transforms/Utils/InlineFunction.cpp llvm/branches/ggreif/use-diet/lib/Transforms/Utils/LCSSA.cpp llvm/branches/ggreif/use-diet/lib/Transforms/Utils/SimplifyCFG.cpp Modified: llvm/branches/ggreif/use-diet/lib/AsmParser/llvmAsmParser.y URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/AsmParser/llvmAsmParser.y?rev=51107&r1=51106&r2=51107&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/AsmParser/llvmAsmParser.y (original) +++ llvm/branches/ggreif/use-diet/lib/AsmParser/llvmAsmParser.y Wed May 14 08:44:26 2008 @@ -2711,7 +2711,8 @@ PAL = PAListPtr::get(Attrs.begin(), Attrs.end()); // Create the InvokeInst - InvokeInst *II = InvokeInst::Create(V, Normal, Except, Args.begin(),Args.end()); + InvokeInst *II = InvokeInst::Create(V, Normal, Except, + Args.begin(), Args.end()); II->setCallingConv($2); II->setParamAttrs(PAL); $$ = II; Modified: llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp?rev=51107&r1=51106&r2=51107&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp Wed May 14 08:44:26 2008 @@ -1484,7 +1484,8 @@ } } - I = InvokeInst::Create(Callee, NormalBB, UnwindBB, Ops.begin(), Ops.end()); + I = InvokeInst::Create(Callee, NormalBB, UnwindBB, + Ops.begin(), Ops.end()); cast(I)->setCallingConv(CCInfo); cast(I)->setParamAttrs(PAL); break; Modified: llvm/branches/ggreif/use-diet/lib/ExecutionEngine/JIT/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/ExecutionEngine/JIT/JIT.cpp?rev=51107&r1=51106&r2=51107&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/ExecutionEngine/JIT/JIT.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/ExecutionEngine/JIT/JIT.cpp Wed May 14 08:44:26 2008 @@ -265,12 +265,13 @@ Args.push_back(C); } - CallInst *TheCall = CallInst::Create(F, Args.begin(), Args.end(), "", StubBB); + CallInst *TheCall = CallInst::Create(F, Args.begin(), Args.end(), + "", StubBB); TheCall->setTailCall(); if (TheCall->getType() != Type::VoidTy) - ReturnInst::Create(TheCall, StubBB); // Return result of the call. + ReturnInst::Create(TheCall, StubBB); // Return result of the call. else - ReturnInst::Create(StubBB); // Just return void. + ReturnInst::Create(StubBB); // Just return void. // Finally, return the value returned by our nullary stub function. return runFunction(Stub, std::vector()); Modified: llvm/branches/ggreif/use-diet/lib/Linker/LinkModules.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Linker/LinkModules.cpp?rev=51107&r1=51106&r2=51107&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Linker/LinkModules.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Linker/LinkModules.cpp Wed May 14 08:44:26 2008 @@ -850,7 +850,8 @@ // We have a definition of the same name but different type in the // source module. Copy the prototype to the destination and replace // uses of the destination's prototype with the new prototype. - Function *NewDF = Function::Create(SF->getFunctionType(), SF->getLinkage(), + Function *NewDF = Function::Create(SF->getFunctionType(), + SF->getLinkage(), SF->getName(), Dest); CopyGVAttributes(NewDF, SF); @@ -886,7 +887,8 @@ } else if (!DF || SF->hasInternalLinkage() || DF->hasInternalLinkage()) { // Function does not already exist, simply insert an function signature // identical to SF into the dest module. - Function *NewDF = Function::Create(SF->getFunctionType(), SF->getLinkage(), + Function *NewDF = Function::Create(SF->getFunctionType(), + SF->getLinkage(), SF->getName(), Dest); CopyGVAttributes(NewDF, SF); Modified: llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalOpt.cpp?rev=51107&r1=51106&r2=51107&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalOpt.cpp Wed May 14 08:44:26 2008 @@ -1082,7 +1082,8 @@ GEPIdx.push_back(GEPI->getOperand(1)); GEPIdx.append(GEPI->op_begin()+3, GEPI->op_end()); - Value *NGEPI = GetElementPtrInst::Create(NewPtr, GEPIdx.begin(), GEPIdx.end(), + Value *NGEPI = GetElementPtrInst::Create(NewPtr, + GEPIdx.begin(), GEPIdx.end(), GEPI->getName(), GEPI); GEPI->replaceAllUsesWith(NGEPI); GEPI->eraseFromParent(); Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Instrumentation/RSProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Instrumentation/RSProfiling.cpp?rev=51107&r1=51106&r2=51107&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/Instrumentation/RSProfiling.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/Instrumentation/RSProfiling.cpp Wed May 14 08:44:26 2008 @@ -381,8 +381,8 @@ if (bb == &bb->getParent()->getEntryBlock()) TransCache[bb] = bb; //don't translate entry block else - TransCache[bb] = BasicBlock::Create("dup_" + bb->getName(), bb->getParent(), - NULL); + TransCache[bb] = BasicBlock::Create("dup_" + bb->getName(), + bb->getParent(), NULL); return TransCache[bb]; } else if (Instruction* i = dyn_cast(v)) { //we have already translated this Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/GVNPRE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/GVNPRE.cpp?rev=51107&r1=51106&r2=51107&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/GVNPRE.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/GVNPRE.cpp Wed May 14 08:44:26 2008 @@ -909,12 +909,13 @@ Instruction* newVal = 0; if (ShuffleVectorInst* S = dyn_cast(U)) newVal = new ShuffleVectorInst(newOp1, newOp2, newOp3, - S->getName()+".expr"); + S->getName() + ".expr"); else if (InsertElementInst* I = dyn_cast(U)) newVal = InsertElementInst::Create(newOp1, newOp2, newOp3, - I->getName()+".expr"); + I->getName() + ".expr"); else if (SelectInst* I = dyn_cast(U)) - newVal = SelectInst::Create(newOp1, newOp2, newOp3, I->getName()+".expr"); + newVal = SelectInst::Create(newOp1, newOp2, newOp3, + I->getName() + ".expr"); uint32_t v = VN.lookup_or_add(newVal); Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp?rev=51107&r1=51106&r2=51107&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp Wed May 14 08:44:26 2008 @@ -8348,7 +8348,8 @@ if (AddOp != TI) std::swap(NewTrueOp, NewFalseOp); Instruction *NewSel = - SelectInst::Create(CondVal, NewTrueOp,NewFalseOp,SI.getName()+".p"); + SelectInst::Create(CondVal, NewTrueOp, + NewFalseOp, SI.getName() + ".p"); NewSel = InsertNewInstBefore(NewSel, SI); return BinaryOperator::createAdd(SubOp->getOperand(0), NewSel); @@ -8374,7 +8375,8 @@ if (OpToFold) { Constant *C = GetSelectFoldableConstant(TVI); Instruction *NewSel = - SelectInst::Create(SI.getCondition(), TVI->getOperand(2-OpToFold), C); + SelectInst::Create(SI.getCondition(), + TVI->getOperand(2-OpToFold), C); InsertNewInstBefore(NewSel, SI); NewSel->takeName(TVI); if (BinaryOperator *BO = dyn_cast(TVI)) @@ -8399,7 +8401,8 @@ if (OpToFold) { Constant *C = GetSelectFoldableConstant(FVI); Instruction *NewSel = - SelectInst::Create(SI.getCondition(), C, FVI->getOperand(2-OpToFold)); + SelectInst::Create(SI.getCondition(), C, + FVI->getOperand(2-OpToFold)); InsertNewInstBefore(NewSel, SI); NewSel->takeName(FVI); if (BinaryOperator *BO = dyn_cast(FVI)) @@ -8757,7 +8760,8 @@ } // Insert this value into the result vector. - Result = InsertElementInst::Create(Result, ExtractedElts[Idx], i, "tmp"); + Result = InsertElementInst::Create(Result, ExtractedElts[Idx], + i, "tmp"); InsertNewInstBefore(cast(Result), CI); } return CastInst::create(Instruction::BitCast, Result, CI.getType()); @@ -9090,7 +9094,8 @@ Instruction *NC; if (InvokeInst *II = dyn_cast(Caller)) { NC = InvokeInst::Create(Callee, II->getNormalDest(), II->getUnwindDest(), - Args.begin(), Args.end(), Caller->getName(), Caller); + Args.begin(), Args.end(), + Caller->getName(), Caller); cast(NC)->setCallingConv(II->getCallingConv()); cast(NC)->setParamAttrs(NewCallerPAL); } else { @@ -9331,7 +9336,8 @@ Value *InRHS = FirstInst->getOperand(1); PHINode *NewLHS = 0, *NewRHS = 0; if (LHSVal == 0) { - NewLHS = PHINode::Create(LHSType, FirstInst->getOperand(0)->getName()+".pn"); + NewLHS = PHINode::Create(LHSType, + FirstInst->getOperand(0)->getName() + ".pn"); NewLHS->reserveOperandSpace(PN.getNumOperands()/2); NewLHS->addIncoming(InLHS, PN.getIncomingBlock(0)); InsertNewInstBefore(NewLHS, PN); @@ -9339,7 +9345,8 @@ } if (RHSVal == 0) { - NewRHS = PHINode::Create(RHSType, FirstInst->getOperand(1)->getName()+".pn"); + NewRHS = PHINode::Create(RHSType, + FirstInst->getOperand(1)->getName() + ".pn"); NewRHS->reserveOperandSpace(PN.getNumOperands()/2); NewRHS->addIncoming(InRHS, PN.getIncomingBlock(0)); InsertNewInstBefore(NewRHS, PN); @@ -10864,8 +10871,8 @@ cast(I->getOperand(0)->getType())->getAddressSpace(); Value *Ptr = InsertBitCastBefore(I->getOperand(0), PointerType::get(EI.getType(), AS),EI); - GetElementPtrInst *GEP = - GetElementPtrInst::Create(Ptr, EI.getOperand(1), I->getName() + ".gep"); + GetElementPtrInst *GEP = + GetElementPtrInst::Create(Ptr, EI.getOperand(1), I->getName()+".gep"); InsertNewInstBefore(GEP, EI); return new LoadInst(GEP); } Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/LoopRotation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/LoopRotation.cpp?rev=51107&r1=51106&r2=51107&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/LoopRotation.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/LoopRotation.cpp Wed May 14 08:44:26 2008 @@ -471,7 +471,8 @@ // Right now original pre-header has two successors, new header and // exit block. Insert new block between original pre-header and // new header such that loop's new pre-header has only one successor. - BasicBlock *NewPreHeader = BasicBlock::Create("bb.nph", OrigHeader->getParent(), + BasicBlock *NewPreHeader = BasicBlock::Create("bb.nph", + OrigHeader->getParent(), NewHeader); LoopInfo &LI = LPM.getAnalysis(); if (Loop *PL = LI.getLoopFor(OrigPreHeader)) Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/TailRecursionElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/TailRecursionElimination.cpp?rev=51107&r1=51106&r2=51107&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/TailRecursionElimination.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/TailRecursionElimination.cpp Wed May 14 08:44:26 2008 @@ -401,7 +401,8 @@ Instruction *InsertPos = OldEntry->begin(); for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I) { - PHINode *PN = PHINode::Create(I->getType(), I->getName()+".tr", InsertPos); + PHINode *PN = PHINode::Create(I->getType(), + I->getName() + ".tr", InsertPos); I->replaceAllUsesWith(PN); // Everyone use the PHI node now! PN->addIncoming(I, NewEntry); ArgumentPHIs.push_back(PN); Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Utils/CodeExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Utils/CodeExtractor.cpp?rev=51107&r1=51106&r2=51107&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/Utils/CodeExtractor.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/Utils/CodeExtractor.cpp Wed May 14 08:44:26 2008 @@ -641,7 +641,8 @@ Function *oldFunction = header->getParent(); // This takes place of the original loop - BasicBlock *codeReplacer = BasicBlock::Create("codeRepl", oldFunction, header); + BasicBlock *codeReplacer = BasicBlock::Create("codeRepl", oldFunction, + header); // The new function needs a root node because other nodes can branch to the // head of the region, but the entry node of a function cannot have preds. Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Utils/InlineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Utils/InlineFunction.cpp?rev=51107&r1=51106&r2=51107&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/Utils/InlineFunction.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/Utils/InlineFunction.cpp Wed May 14 08:44:26 2008 @@ -532,7 +532,8 @@ GR->eraseFromParent(); } } else { - PHINode *PHI = PHINode::Create(RTy, TheCall->getName(), AfterCallBB->begin()); + PHINode *PHI = PHINode::Create(RTy, TheCall->getName(), + AfterCallBB->begin()); PHIs.push_back(PHI); // Anything that used the result of the function call should now use the // PHI node as their operand. Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Utils/LCSSA.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Utils/LCSSA.cpp?rev=51107&r1=51106&r2=51107&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/Utils/LCSSA.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/Utils/LCSSA.cpp Wed May 14 08:44:26 2008 @@ -281,8 +281,8 @@ // Otherwise, the idom is the loop, so we need to insert a PHI node. Do so // now, then get values to fill in the incoming values for the PHI. - PHINode *PN = PHINode::Create(OrigInst->getType(), OrigInst->getName()+".lcssa", - BBN->begin()); + PHINode *PN = PHINode::Create(OrigInst->getType(), + OrigInst->getName() + ".lcssa", BBN->begin()); PN->reserveOperandSpace(std::distance(pred_begin(BBN), pred_end(BBN))); V = PN; Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Utils/SimplifyCFG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Utils/SimplifyCFG.cpp?rev=51107&r1=51106&r2=51107&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/Utils/SimplifyCFG.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/Utils/SimplifyCFG.cpp Wed May 14 08:44:26 2008 @@ -802,7 +802,8 @@ AddPredecessorToBlock(NewSuccessors[i], Pred, BB); // Now that the successors are updated, create the new Switch instruction. - SwitchInst *NewSI = SwitchInst::Create(CV, PredDefault, PredCases.size(), PTI); + SwitchInst *NewSI = SwitchInst::Create(CV, PredDefault, + PredCases.size(), PTI); for (unsigned i = 0, e = PredCases.size(); i != e; ++i) NewSI->addCase(PredCases[i].first, PredCases[i].second); @@ -1919,7 +1920,8 @@ if (!TrueWhenEqual) std::swap(DefaultBB, EdgeBB); // Create the new switch instruction now. - SwitchInst *New = SwitchInst::Create(CompVal, DefaultBB,Values.size(),BI); + SwitchInst *New = SwitchInst::Create(CompVal, DefaultBB, + Values.size(), BI); // Add all of the 'cases' to the switch instruction. for (unsigned i = 0, e = Values.size(); i != e; ++i) From tonic at nondot.org Wed May 14 11:32:44 2008 From: tonic at nondot.org (Tanya Lattner) Date: Wed, 14 May 2008 16:32:44 -0000 Subject: [llvm-commits] [llvm] r51108 - /llvm/trunk/test/LLVMC/dg.exp Message-ID: <200805141632.m4EGWiGH015487@zion.cs.uiuc.edu> Author: tbrethou Date: Wed May 14 11:32:44 2008 New Revision: 51108 URL: http://llvm.org/viewvc/llvm-project?rev=51108&view=rev Log: Check if llvm-gcc is available before running tests. Patch by Matthijs Kooijman! Modified: llvm/trunk/test/LLVMC/dg.exp Modified: llvm/trunk/test/LLVMC/dg.exp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/dg.exp?rev=51108&r1=51107&r2=51108&view=diff ============================================================================== --- llvm/trunk/test/LLVMC/dg.exp (original) +++ llvm/trunk/test/LLVMC/dg.exp Wed May 14 11:32:44 2008 @@ -1,3 +1,10 @@ load_lib llvm.exp -RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{c,cpp}]] +if [ llvm_gcc_supports c ] then { + RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{c}]] +} + +if [ llvm_gcc_supports c++ ] then { + RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{cpp}]] +} + From clattner at apple.com Wed May 14 11:38:58 2008 From: clattner at apple.com (Chris Lattner) Date: Wed, 14 May 2008 09:38:58 -0700 Subject: [llvm-commits] [llvm] r51107 - in /llvm/branches/ggreif/use-diet/lib: AsmParser/ Bitcode/Reader/ ExecutionEngine/JIT/ Linker/ Transforms/IPO/ Transforms/Instrumentation/ Transforms/Scalar/ Transforms/Utils/ In-Reply-To: <200805141344.m4EDiR2J010308@zion.cs.uiuc.edu> References: <200805141344.m4EDiR2J010308@zion.cs.uiuc.edu> Message-ID: <53AA1202-2748-46A7-AF1B-8BC16D355BF4@apple.com> On May 14, 2008, at 6:44 AM, Gabor Greif wrote: > Author: ggreif > Date: Wed May 14 08:44:26 2008 > New Revision: 51107 > > URL: http://llvm.org/viewvc/llvm-project?rev=51107&view=rev > Log: > correct 80col violations caused by API change Why are you doing this on a branch? This is perfect for incremental development. -Chris From dpatel at apple.com Wed May 14 13:04:30 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 14 May 2008 18:04:30 -0000 Subject: [llvm-commits] [llvm] r51110 - /llvm/trunk/tools/opt/opt.cpp Message-ID: <200805141804.m4EI4VZT018437@zion.cs.uiuc.edu> Author: dpatel Date: Wed May 14 13:04:30 2008 New Revision: 51110 URL: http://llvm.org/viewvc/llvm-project?rev=51110&view=rev Log: Recover nestedloop regression reported by nightly tester. Modified: llvm/trunk/tools/opt/opt.cpp Modified: llvm/trunk/tools/opt/opt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=51110&r1=51109&r2=51110&view=diff ============================================================================== --- llvm/trunk/tools/opt/opt.cpp (original) +++ llvm/trunk/tools/opt/opt.cpp Wed May 14 13:04:30 2008 @@ -280,6 +280,8 @@ addPass(PM, createLICMPass()); // Hoist loop invariants addPass(PM, createLoopUnswitchPass()); // Unswitch loops. addPass(PM, createLoopIndexSplitPass()); // Index split loops. + // FIXME : Removing instcombine causes nestedloop regression. + addPass(PM, createInstructionCombiningPass()); addPass(PM, createIndVarSimplifyPass()); // Canonicalize indvars addPass(PM, createLoopDeletionPass()); // Delete dead loops addPass(PM, createLoopUnrollPass()); // Unroll small loops From dpatel at apple.com Wed May 14 13:05:57 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 14 May 2008 18:05:57 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r51111 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Message-ID: <200805141805.m4EI5vON018487@zion.cs.uiuc.edu> Author: dpatel Date: Wed May 14 13:05:57 2008 New Revision: 51111 URL: http://llvm.org/viewvc/llvm-project?rev=51111&view=rev Log: Revert previous patch. Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=51111&r1=51110&r2=51111&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Wed May 14 13:05:57 2008 @@ -377,6 +377,7 @@ PM->add(createLICMPass()); // Hoist loop invariants PM->add(createLoopUnswitchPass(optimize_size ? true : false)); PM->add(createLoopIndexSplitPass()); // Split loop index + PM->add(createInstructionCombiningPass()); PM->add(createIndVarSimplifyPass()); // Canonicalize indvars PM->add(createLoopDeletionPass()); // Delete dead loops if (flag_unroll_loops) From gohman at apple.com Wed May 14 13:17:09 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 14 May 2008 18:17:09 -0000 Subject: [llvm-commits] [llvm] r51112 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAG.cpp test/CodeGen/X86/pr2326.ll Message-ID: <200805141817.m4EIH984018794@zion.cs.uiuc.edu> Author: djg Date: Wed May 14 13:17:09 2008 New Revision: 51112 URL: http://llvm.org/viewvc/llvm-project?rev=51112&view=rev Log: When bit-twiddling CondCode values for integer comparisons produces SETOEQ, is it does with (SETEQ & SETULE), map it to SETEQ. Added: llvm/trunk/test/CodeGen/X86/pr2326.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=51112&r1=51111&r2=51112&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed May 14 13:17:09 2008 @@ -293,6 +293,7 @@ switch (Result) { default: break; case ISD::SETUO : Result = ISD::SETFALSE; break; // SETUGT & SETULT + case ISD::SETOEQ: // SETEQ & SETU[LG]E case ISD::SETUEQ: Result = ISD::SETEQ ; break; // SETUGE & SETULE case ISD::SETOLT: Result = ISD::SETULT ; break; // SETULT & SETNE case ISD::SETOGT: Result = ISD::SETUGT ; break; // SETUGT & SETNE Added: llvm/trunk/test/CodeGen/X86/pr2326.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr2326.ll?rev=51112&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/pr2326.ll (added) +++ llvm/trunk/test/CodeGen/X86/pr2326.ll Wed May 14 13:17:09 2008 @@ -0,0 +1,24 @@ +; RUN: llvm-as < %s | llc -march=x86 | grep sete +; PR2326 + +define i32 @func_59(i32 %p_60) nounwind { +entry: + %l_108 = alloca i32 ; [#uses=2] + %tmp15 = load i32* null, align 4 ; [#uses=1] + %tmp16 = load i32* %l_108, align 4 ; [#uses=1] + %tmp17 = icmp eq i32 %tmp15, %tmp16 ; [#uses=1] + %tmp1718 = zext i1 %tmp17 to i8 ; [#uses=1] + %tmp19 = load i32* null, align 4 ; [#uses=1] + %tmp20 = load i32* %l_108, align 4 ; [#uses=1] + %tmp21 = icmp ule i32 %tmp19, %tmp20 ; [#uses=1] + %tmp2122 = zext i1 %tmp21 to i8 ; [#uses=1] + %toBool23 = icmp ne i8 %tmp1718, 0 ; [#uses=1] + %toBool24 = icmp ne i8 %tmp2122, 0 ; [#uses=1] + %tmp25 = and i1 %toBool23, %toBool24 ; [#uses=1] + %tmp2526 = zext i1 %tmp25 to i8 ; [#uses=1] + %tmp252627 = zext i8 %tmp2526 to i32 ; [#uses=1] + %tmp29 = call i32 (...)* @func_15( i32 %tmp252627, i32 0 ) nounwind ; [#uses=0] + unreachable +} + +declare i32 @func_15(...) From dpatel at apple.com Wed May 14 15:01:01 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 14 May 2008 20:01:01 -0000 Subject: [llvm-commits] [llvm] r51114 - in /llvm/trunk: include/llvm/Transforms/IPO.h lib/Transforms/IPO/Internalize.cpp test/Transforms/Internalize/ test/Transforms/Internalize/2008-05-09-AllButMain.ll test/Transforms/Internalize/2008-05-09-AllButMain.ll.apifile test/Transforms/Internalize/dg.exp Message-ID: <200805142001.m4EK1276022152@zion.cs.uiuc.edu> Author: dpatel Date: Wed May 14 15:01:01 2008 New Revision: 51114 URL: http://llvm.org/viewvc/llvm-project?rev=51114&view=rev Log: Simplify internalize pass. Add test case. Patch by Matthijs Kooijman! Added: llvm/trunk/test/Transforms/Internalize/ llvm/trunk/test/Transforms/Internalize/2008-05-09-AllButMain.ll llvm/trunk/test/Transforms/Internalize/2008-05-09-AllButMain.ll.apifile llvm/trunk/test/Transforms/Internalize/dg.exp Modified: llvm/trunk/include/llvm/Transforms/IPO.h llvm/trunk/lib/Transforms/IPO/Internalize.cpp Modified: llvm/trunk/include/llvm/Transforms/IPO.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO.h?rev=51114&r1=51113&r2=51114&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/IPO.h (original) +++ llvm/trunk/include/llvm/Transforms/IPO.h Wed May 14 15:01:01 2008 @@ -102,12 +102,17 @@ //===----------------------------------------------------------------------===// /// createInternalizePass - This pass loops over all of the functions in the -/// input module, looking for a main function. If a list of symbols is -/// specified with the -internalize-public-api-* command line options, those -/// symbols are internalized. Otherwise if InternalizeEverything is set and -/// the main function is found, all other globals are marked as internal. +/// input module, internalizing all globals (functions and variables) not part +/// of the api. If a list of symbols is specified with the +/// -internalize-public-api-* command line options, those symbols are not +/// internalized and all others are. Otherwise if AllButMain is set and the +/// main function is found, all other globals are marked as internal. /// ModulePass *createInternalizePass(bool InternalizeEverything); + +/// createInternalizePass - This pass loops over all of the functions in the +/// input module, internalizing all globals (functions and variables) not in the +/// given exportList. ModulePass *createInternalizePass(const std::vector &exportList); //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/Transforms/IPO/Internalize.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Internalize.cpp?rev=51114&r1=51113&r2=51114&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Internalize.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Internalize.cpp Wed May 14 15:01:01 2008 @@ -43,7 +43,9 @@ namespace { class VISIBILITY_HIDDEN InternalizePass : public ModulePass { std::set ExternalNames; - bool DontInternalize; + /// If no api symbols were specified and a main function is defined, + /// assume the main function is the only API + bool AllButMain; public: static char ID; // Pass identification, replacement for typeid explicit InternalizePass(bool InternalizeEverything = true); @@ -57,19 +59,16 @@ static RegisterPass X("internalize", "Internalize Global Symbols"); -InternalizePass::InternalizePass(bool InternalizeEverything) - : ModulePass((intptr_t)&ID), DontInternalize(false){ - if (!APIFile.empty()) // If a filename is specified, use it +InternalizePass::InternalizePass(bool AllButMain) + : ModulePass((intptr_t)&ID), AllButMain(AllButMain){ + if (!APIFile.empty()) // If a filename is specified, use it. LoadFile(APIFile.c_str()); - else if (!APIList.empty()) // Else, if a list is specified, use it. + if (!APIList.empty()) // If a list is specified, use it as well. ExternalNames.insert(APIList.begin(), APIList.end()); - else if (!InternalizeEverything) - // Finally, if we're allowed to, internalize all but main. - DontInternalize = true; } InternalizePass::InternalizePass(const std::vector&exportList) - : ModulePass((intptr_t)&ID), DontInternalize(false){ + : ModulePass((intptr_t)&ID), AllButMain(false){ for(std::vector::const_iterator itr = exportList.begin(); itr != exportList.end(); itr++) { ExternalNames.insert(*itr); @@ -80,8 +79,9 @@ // Load the APIFile... std::ifstream In(Filename); if (!In.good()) { - cerr << "WARNING: Internalize couldn't load file '" << Filename << "'!\n"; - return; // Do not internalize anything... + cerr << "WARNING: Internalize couldn't load file '" << Filename + << "'! Continuing as if it's empty.\n"; + return; // Just continue as if the file were empty } while (In) { std::string Symbol; @@ -92,13 +92,14 @@ } bool InternalizePass::runOnModule(Module &M) { - if (DontInternalize) return false; - - // If no list or file of symbols was specified, check to see if there is a - // "main" symbol defined in the module. If so, use it, otherwise do not - // internalize the module, it must be a library or something. - // if (ExternalNames.empty()) { + // Return if we're not in 'all but main' mode and have no external api + if (!AllButMain) + return false; + // If no list or file of symbols was specified, check to see if there is a + // "main" symbol defined in the module. If so, use it, otherwise do not + // internalize the module, it must be a library or something. + // Function *MainFunc = M.getFunction("main"); if (MainFunc == 0 || MainFunc->isDeclaration()) return false; // No main found, must be a library... @@ -109,7 +110,7 @@ bool Changed = false; - // Found a main function, mark all functions not named main as internal. + // Mark all functions not in the api as internal. for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) if (!I->isDeclaration() && // Function must be defined here !I->hasInternalLinkage() && // Can't already have internal linkage @@ -134,7 +135,8 @@ ExternalNames.insert("llvm.noinline"); ExternalNames.insert("llvm.global.annotations"); - // Mark all global variables with initializers as internal as well. + // Mark all global variables with initializers that are not in the api as + // internal as well. for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) if (!I->isDeclaration() && !I->hasInternalLinkage() && Added: llvm/trunk/test/Transforms/Internalize/2008-05-09-AllButMain.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Internalize/2008-05-09-AllButMain.ll?rev=51114&view=auto ============================================================================== --- llvm/trunk/test/Transforms/Internalize/2008-05-09-AllButMain.ll (added) +++ llvm/trunk/test/Transforms/Internalize/2008-05-09-AllButMain.ll Wed May 14 15:01:01 2008 @@ -0,0 +1,27 @@ +; No arguments means internalize all but main +; RUN: llvm-as < %s | opt -internalize | llvm-dis | grep internal | count 4 +; Internalize all but foo and j +; RUN: llvm-as < %s | opt -internalize -internalize-public-api-list foo -internalize-public-api-list j | llvm-dis | grep internal | count 3 +; Non existent files should be treated as if they were empty (so internalize all but main) +; RUN: llvm-as < %s | opt -internalize -internalize-public-api-file /nonexistent/file | llvm-dis | grep internal | count 4 +; RUN: llvm-as < %s | opt -internalize -internalize-public-api-list bar -internalize-public-api-list foo -internalize-public-api-file /nonexistent/file | llvm-dis | grep internal | count 3 +; -file and -list options should be merged, the .apifile contains foo and j +; RUN: llvm-as < %s | opt -internalize -internalize-public-api-list bar -internalize-public-api-file %s.apifile | llvm-dis | grep internal | count 2 + + at i = weak global i32 0 ; [#uses=0] + at j = weak global i32 0 ; [#uses=0] + +define void @main(...) { +entry: + ret void +} + +define void @foo(...) { +entry: + ret void +} + +define void @bar(...) { +entry: + ret void +} Added: llvm/trunk/test/Transforms/Internalize/2008-05-09-AllButMain.ll.apifile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Internalize/2008-05-09-AllButMain.ll.apifile?rev=51114&view=auto ============================================================================== --- llvm/trunk/test/Transforms/Internalize/2008-05-09-AllButMain.ll.apifile (added) +++ llvm/trunk/test/Transforms/Internalize/2008-05-09-AllButMain.ll.apifile Wed May 14 15:01:01 2008 @@ -0,0 +1,2 @@ +foo +j Added: llvm/trunk/test/Transforms/Internalize/dg.exp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Internalize/dg.exp?rev=51114&view=auto ============================================================================== --- llvm/trunk/test/Transforms/Internalize/dg.exp (added) +++ llvm/trunk/test/Transforms/Internalize/dg.exp Wed May 14 15:01:01 2008 @@ -0,0 +1,3 @@ +load_lib llvm.exp + +RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]] From evan.cheng at apple.com Wed May 14 15:07:51 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 14 May 2008 20:07:51 -0000 Subject: [llvm-commits] [llvm] r51115 - in /llvm/trunk/lib/CodeGen/SelectionDAG: ScheduleDAG.cpp ScheduleDAGRRList.cpp SelectionDAGISel.cpp Message-ID: <200805142007.m4EK7qPM022348@zion.cs.uiuc.edu> Author: evancheng Date: Wed May 14 15:07:51 2008 New Revision: 51115 URL: http://llvm.org/viewvc/llvm-project?rev=51115&view=rev Log: Silence some compiler warnings. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=51115&r1=51114&r2=51115&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Wed May 14 15:07:51 2008 @@ -407,6 +407,7 @@ if (InstanceNo > 0) VRBaseMap.erase(SDOperand(Node, ResNo)); bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,ResNo),SrcReg)); + isNew; // Silence compiler warning. assert(isNew && "Node emitted out of order - early"); return; } @@ -465,6 +466,7 @@ if (InstanceNo > 0) VRBaseMap.erase(SDOperand(Node, ResNo)); bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,ResNo), VRBase)); + isNew; // Silence compiler warning. assert(isNew && "Node emitted out of order - early"); } @@ -522,6 +524,7 @@ } bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,i), VRBase)); + isNew; // Silence compiler warning. assert(isNew && "Node emitted out of order - early"); } } @@ -719,9 +722,11 @@ if (VRBase) { // Grab the destination register +#ifndef NDEBUG const TargetRegisterClass *DRC = MRI.getRegClass(VRBase); assert(SRC && DRC && SRC == DRC && "Source subregister and destination must have the same class"); +#endif } else { // Create the reg assert(SRC && "Couldn't find source register class"); @@ -772,6 +777,7 @@ assert(0 && "Node is not insert_subreg, extract_subreg, or subreg_to_reg"); bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,0), VRBase)); + isNew; // Silence compiler warning. assert(isNew && "Node emitted out of order - early"); } @@ -799,10 +805,10 @@ unsigned NumResults = CountResults(Node); unsigned NodeOperands = CountOperands(Node); unsigned MemOperandsEnd = ComputeMemOperandsEnd(Node); - unsigned NumMIOperands = NodeOperands + NumResults; bool HasPhysRegOuts = (NumResults > II.getNumDefs()) && II.getImplicitDefs() != 0; #ifndef NDEBUG + unsigned NumMIOperands = NodeOperands + NumResults; assert((II.getNumOperands() == NumMIOperands || HasPhysRegOuts || II.isVariadic()) && "#operands for dag node doesn't match .td file!"); @@ -999,6 +1005,7 @@ assert(I->Reg && "Unknown physical register!"); unsigned VRBase = MRI.createVirtualRegister(SU->CopyDstRC); bool isNew = VRBaseMap.insert(std::make_pair(SU, VRBase)); + isNew; // Silence compiler warning. assert(isNew && "Node emitted out of order - early"); TII->copyRegToReg(*BB, BB->end(), VRBase, I->Reg, SU->CopyDstRC, SU->CopySrcRC); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=51115&r1=51114&r2=51115&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Wed May 14 15:07:51 2008 @@ -1317,6 +1317,7 @@ void remove(SUnit *SU) { assert(!Queue.empty() && "Queue is empty!"); size_t RemovedNum = Queue.erase(SU); + RemovedNum; // Silence compiler warning. assert(RemovedNum > 0 && "Not in queue!"); assert(RemovedNum == 1 && "Multiple times in the queue!"); SU->NodeQueueId = 0; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=51115&r1=51114&r2=51115&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed May 14 15:07:51 2008 @@ -807,7 +807,7 @@ unsigned NumRegs = TLI.getVectorTypeBreakdown(ValueVT, IntermediateVT, NumIntermediates, RegisterVT); - + NumRegs; // Silence a compiler warning. assert(NumRegs == NumParts && "Part count doesn't match vector breakdown!"); assert(RegisterVT == PartVT && "Part type doesn't match vector breakdown!"); assert(RegisterVT == Parts[0].getValueType() && @@ -1024,6 +1024,7 @@ DAG.getTargetLoweringInfo() .getVectorTypeBreakdown(ValueVT, IntermediateVT, NumIntermediates, RegisterVT); + NumRegs; // Silence a compiler warning. unsigned NumElements = MVT::getVectorNumElements(ValueVT); assert(NumRegs == NumParts && "Part count doesn't match vector breakdown!"); @@ -3752,14 +3753,13 @@ // If this is an expanded reference, add the rest of the regs to Regs. if (NumRegs != 1) { TargetRegisterClass::iterator I = PhysReg.second->begin(); - TargetRegisterClass::iterator E = PhysReg.second->end(); for (; *I != PhysReg.first; ++I) - assert(I != E && "Didn't find reg!"); + assert(I != PhysReg.second->end() && "Didn't find reg!"); // Already added the first reg. --NumRegs; ++I; for (; NumRegs; --NumRegs, ++I) { - assert(I != E && "Ran out of registers to allocate!"); + assert(I != PhysReg.second->end() && "Ran out of registers to allocate!"); Regs.push_back(*I); } } From dalej at apple.com Wed May 14 15:12:51 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 14 May 2008 20:12:51 -0000 Subject: [llvm-commits] [llvm] r51118 - in /llvm/trunk: include/llvm/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Bitcode/Writer/ lib/CodeGen/ lib/ExecutionEngine/ lib/Linker/ lib/Target/Alpha/ lib/Target/CBackend/ lib/Target/CellSPU/ lib/Target/CppBackend/ lib/Target/IA64/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/ lib/VMCore/ Message-ID: <200805142012.m4EKCqbd022612@zion.cs.uiuc.edu> Author: johannes Date: Wed May 14 15:12:51 2008 New Revision: 51118 URL: http://llvm.org/viewvc/llvm-project?rev=51118&view=rev Log: Add CommonLinkage; currently tentative definitions are represented as "weak", but there are subtle differences in some cases on Darwin, so we need both. The intent is that "common" will behave identically to "weak" unless somebody changes their target to do something else. No functional change as yet. Modified: llvm/trunk/include/llvm/GlobalValue.h llvm/trunk/lib/AsmParser/LLLexer.cpp llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp llvm/trunk/lib/CodeGen/ELFWriter.cpp llvm/trunk/lib/CodeGen/MachOWriter.cpp llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp llvm/trunk/lib/Linker/LinkModules.cpp llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp llvm/trunk/lib/Target/CBackend/CBackend.cpp llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp llvm/trunk/lib/Target/X86/X86IntelAsmPrinter.cpp llvm/trunk/lib/Target/X86/X86Subtarget.cpp llvm/trunk/lib/VMCore/AsmWriter.cpp Modified: llvm/trunk/include/llvm/GlobalValue.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/GlobalValue.h?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/include/llvm/GlobalValue.h (original) +++ llvm/trunk/include/llvm/GlobalValue.h Wed May 14 15:12:51 2008 @@ -38,7 +38,8 @@ DLLImportLinkage, ///< Function to be imported from DLL DLLExportLinkage, ///< Function to be accessible from DLL ExternalWeakLinkage,///< ExternalWeak linkage description - GhostLinkage ///< Stand-in functions for streaming fns from BC files + GhostLinkage, ///< Stand-in functions for streaming fns from BC files + CommonLinkage ///< Tentative definitions }; /// @brief An enumeration for the kinds of visibility of global values. @@ -100,6 +101,7 @@ bool hasExternalLinkage() const { return Linkage == ExternalLinkage; } bool hasLinkOnceLinkage() const { return Linkage == LinkOnceLinkage; } bool hasWeakLinkage() const { return Linkage == WeakLinkage; } + bool hasCommonLinkage() const { return Linkage == CommonLinkage; } bool hasAppendingLinkage() const { return Linkage == AppendingLinkage; } bool hasInternalLinkage() const { return Linkage == InternalLinkage; } bool hasDLLImportLinkage() const { return Linkage == DLLImportLinkage; } Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLLexer.cpp (original) +++ llvm/trunk/lib/AsmParser/LLLexer.cpp Wed May 14 15:12:51 2008 @@ -451,6 +451,7 @@ KEYWORD("appending", APPENDING); KEYWORD("dllimport", DLLIMPORT); KEYWORD("dllexport", DLLEXPORT); + KEYWORD("common", COMMON); KEYWORD("hidden", HIDDEN); KEYWORD("protected", PROTECTED); KEYWORD("extern_weak", EXTERN_WEAK); Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Wed May 14 15:12:51 2008 @@ -66,6 +66,7 @@ case 5: return GlobalValue::DLLImportLinkage; case 6: return GlobalValue::DLLExportLinkage; case 7: return GlobalValue::ExternalWeakLinkage; + case 8: return GlobalValue::CommonLinkage; } } Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Wed May 14 15:12:51 2008 @@ -270,6 +270,7 @@ case GlobalValue::DLLImportLinkage: return 5; case GlobalValue::DLLExportLinkage: return 6; case GlobalValue::ExternalWeakLinkage: return 7; + case GlobalValue::CommonLinkage: return 8; } } Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Wed May 14 15:12:51 2008 @@ -282,7 +282,8 @@ // 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 (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage()) { + if (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage() || + GV->hasCommonLinkage()) { ELFSym CommonSym(GV); // Value for common symbols is the alignment required. CommonSym.Value = Align; @@ -313,7 +314,7 @@ BSSSym.SetType(ELFSym::STT_OBJECT); switch (GV->getLinkage()) { - default: // weak/linkonce handled above + default: // weak/linkonce/common handled above assert(0 && "Unexpected linkage type!"); case GlobalValue::AppendingLinkage: // FIXME: This should be improved! case GlobalValue::ExternalLinkage: Modified: llvm/trunk/lib/CodeGen/MachOWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachOWriter.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachOWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/MachOWriter.cpp Wed May 14 15:12:51 2008 @@ -403,7 +403,8 @@ // 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()) { + if (NoInit || GV->hasLinkOnceLinkage() || GV->hasWeakLinkage() || + GV->hasCommonLinkage()) { MachOSym ExtOrCommonSym(GV, Mang->getValueName(GV), MachOSym::NO_SECT,TM); // For undefined (N_UNDF) external (N_EXT) types, n_value is the size in // bytes of the symbol. @@ -951,6 +952,7 @@ break; case GlobalValue::WeakLinkage: case GlobalValue::LinkOnceLinkage: + case GlobalValue::CommonLinkage: assert(!isa(gv) && "Unexpected linkage type for Function!"); case GlobalValue::ExternalLinkage: GVName = TAI->getGlobalPrefix() + name; Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Wed May 14 15:12:51 2008 @@ -884,7 +884,7 @@ continue; // Otherwise, we know it's linkonce/weak, replace it if this is a strong - // symbol. + // symbol. FIXME is this right for common? if (GV->hasExternalLinkage() || GVEntry->hasExternalWeakLinkage()) GVEntry = GV; } Modified: llvm/trunk/lib/Linker/LinkModules.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Linker/LinkModules.cpp (original) +++ llvm/trunk/lib/Linker/LinkModules.cpp Wed May 14 15:12:51 2008 @@ -410,10 +410,12 @@ "': can only link appending global with another appending global!"); LinkFromSrc = true; // Special cased. LT = Src->getLinkage(); - } else if (Src->hasWeakLinkage() || Src->hasLinkOnceLinkage()) { - // At this point we know that Dest has LinkOnce, External*, Weak, or - // DLL* linkage. - if ((Dest->hasLinkOnceLinkage() && Src->hasWeakLinkage()) || + } else if (Src->hasWeakLinkage() || Src->hasLinkOnceLinkage() || + Src->hasCommonLinkage()) { + // At this point we know that Dest has LinkOnce, External*, Weak, Common, + // or DLL* linkage. + if ((Dest->hasLinkOnceLinkage() && + (Src->hasWeakLinkage() || Src->hasCommonLinkage())) || Dest->hasExternalWeakLinkage()) { LinkFromSrc = true; LT = Src->getLinkage(); @@ -421,7 +423,8 @@ LinkFromSrc = false; LT = Dest->getLinkage(); } - } else if (Dest->hasWeakLinkage() || Dest->hasLinkOnceLinkage()) { + } else if (Dest->hasWeakLinkage() || Dest->hasLinkOnceLinkage() || + Dest->hasCommonLinkage()) { // At this point we know that Src has External* or DLL* linkage. if (Src->hasExternalWeakLinkage()) { LinkFromSrc = false; @@ -792,10 +795,12 @@ if (DGV->getInitializer() != SInit) return Error(Err, "Global Variable Collision on '" + SGV->getName() + "': global variables have different initializers"); - } else if (DGV->hasLinkOnceLinkage() || DGV->hasWeakLinkage()) { + } else if (DGV->hasLinkOnceLinkage() || DGV->hasWeakLinkage() || + DGV->hasCommonLinkage()) { // Nothing is required, mapped values will take the new global // automatically. - } else if (SGV->hasLinkOnceLinkage() || SGV->hasWeakLinkage()) { + } else if (SGV->hasLinkOnceLinkage() || SGV->hasWeakLinkage() || + SGV->hasCommonLinkage()) { // Nothing is required, mapped values will take the new global // automatically. } else if (DGV->hasAppendingLinkage()) { @@ -916,16 +921,19 @@ DF->setLinkage(SF->getLinkage()); // Visibility of prototype is overridden by vis of definition. DF->setVisibility(SF->getVisibility()); - } else if (SF->hasWeakLinkage() || SF->hasLinkOnceLinkage()) { + } else if (SF->hasWeakLinkage() || SF->hasLinkOnceLinkage() || + SF->hasCommonLinkage()) { // At this point we know that DF has LinkOnce, Weak, or External* linkage. ValueMap[SF] = DF; // Linkonce+Weak = Weak // *+External Weak = * - if ((DF->hasLinkOnceLinkage() && SF->hasWeakLinkage()) || + if ((DF->hasLinkOnceLinkage() && + (SF->hasWeakLinkage() || SF->hasCommonLinkage())) || DF->hasExternalWeakLinkage()) DF->setLinkage(SF->getLinkage()); - } else if (DF->hasWeakLinkage() || DF->hasLinkOnceLinkage()) { + } else if (DF->hasWeakLinkage() || DF->hasLinkOnceLinkage() || + DF->hasCommonLinkage()) { // At this point we know that SF has LinkOnce or External* linkage. ValueMap[SF] = DF; if (!SF->hasLinkOnceLinkage() && !SF->hasExternalWeakLinkage()) Modified: llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp Wed May 14 15:12:51 2008 @@ -225,6 +225,7 @@ switch (I->getLinkage()) { case GlobalValue::LinkOnceLinkage: case GlobalValue::WeakLinkage: + case GlobalValue::CommonLinkage: O << TAI->getWeakRefDirective() << name << '\n'; break; case GlobalValue::AppendingLinkage: Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Wed May 14 15:12:51 2008 @@ -1604,7 +1604,8 @@ for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) { - if (I->hasExternalLinkage() || I->hasExternalWeakLinkage()) + if (I->hasExternalLinkage() || I->hasExternalWeakLinkage() || + I->hasCommonLinkage()) Out << "extern "; else if (I->hasDLLImportLinkage()) Out << "__declspec(dllimport) "; @@ -1678,6 +1679,8 @@ if (I->hasLinkOnceLinkage()) Out << " __attribute__((common))"; + else if (I->hasCommonLinkage()) // FIXME is this right? + Out << " __ATTRIBUTE_WEAK__"; else if (I->hasWeakLinkage()) Out << " __ATTRIBUTE_WEAK__"; else if (I->hasExternalWeakLinkage()) @@ -1715,6 +1718,8 @@ Out << " __attribute__((common))"; else if (I->hasWeakLinkage()) Out << " __ATTRIBUTE_WEAK__"; + else if (I->hasCommonLinkage()) + Out << " __ATTRIBUTE_WEAK__"; if (I->hasHiddenVisibility()) Out << " __HIDDEN__"; @@ -1724,6 +1729,7 @@ // this, however, occurs when the variable has weak linkage. In this // case, the assembler will complain about the variable being both weak // and common, so we disable this optimization. + // FIXME common linkage should avoid this problem. if (!I->getInitializer()->isNullValue()) { Out << " = " ; writeOperand(I->getInitializer()); Modified: llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp Wed May 14 15:12:51 2008 @@ -340,7 +340,7 @@ // stubs if (TM.getRelocationModel() != Reloc::Static) { if (((GV->isDeclaration() || GV->hasWeakLinkage() || - GV->hasLinkOnceLinkage()))) { + GV->hasLinkOnceLinkage() || GV->hasCommonLinkage()))) { GVStubs.insert(Name); O << "L" << Name << "$non_lazy_ptr"; return; @@ -510,7 +510,7 @@ if (C->isNullValue() && /* FIXME: Verify correct */ (I->hasInternalLinkage() || I->hasWeakLinkage() || - I->hasLinkOnceLinkage() || + I->hasLinkOnceLinkage() || I->hasCommonLinkage() || (I->hasExternalLinkage() && !I->hasSection()))) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. if (I->hasExternalLinkage()) { @@ -537,6 +537,7 @@ switch (I->getLinkage()) { case GlobalValue::LinkOnceLinkage: case GlobalValue::WeakLinkage: + case GlobalValue::CommonLinkage: O << "\t.global " << name << '\n' << "\t.weak_definition " << name << '\n'; SwitchToDataSection(".section __DATA,__datacoal_nt,coalesced", I); Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Wed May 14 15:12:51 2008 @@ -301,6 +301,8 @@ Out << "GlobalValue::ExternalWeakLinkage"; break; case GlobalValue::GhostLinkage: Out << "GlobalValue::GhostLinkage"; break; + case GlobalValue::CommonLinkage: + Out << "GlobalValue::CommonLinkage"; break; } } Modified: llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp Wed May 14 15:12:51 2008 @@ -275,6 +275,7 @@ if (C->isNullValue() && (I->hasLinkOnceLinkage() || I->hasInternalLinkage() || + I->hasCommonLinkage() || I->hasWeakLinkage() /* FIXME: Verify correct */)) { SwitchToDataSection(".data", I); if (I->hasInternalLinkage()) { @@ -289,6 +290,7 @@ } else { switch (I->getLinkage()) { case GlobalValue::LinkOnceLinkage: + case GlobalValue::CommonLinkage: case GlobalValue::WeakLinkage: // FIXME: Verify correct for weak. // Nonnull linkonce -> weak O << "\t.weak " << name << "\n"; Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Wed May 14 15:12:51 2008 @@ -461,7 +461,8 @@ // Is this correct ? if (C->isNullValue() && (I->hasLinkOnceLinkage() || - I->hasInternalLinkage() || I->hasWeakLinkage())) + I->hasInternalLinkage() || I->hasWeakLinkage() || + I->hasCommonLinkage())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. @@ -487,7 +488,8 @@ switch (I->getLinkage()) { case GlobalValue::LinkOnceLinkage: - case GlobalValue::WeakLinkage: + case GlobalValue::CommonLinkage: + case GlobalValue::WeakLinkage: // FIXME: Verify correct for weak. // Nonnull linkonce -> weak O << "\t.weak " << name << "\n"; Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Wed May 14 15:12:51 2008 @@ -414,7 +414,7 @@ if (!I->hasSection() && (I->hasInternalLinkage() || I->hasWeakLinkage() || - I->hasLinkOnceLinkage())) { + I->hasLinkOnceLinkage() || I->hasCommonLinkage())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. if (!NoZerosInBSS && TAI->getBSSSection()) SwitchToDataSection(M.getModuleIdentifier().c_str(), I); Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Wed May 14 15:12:51 2008 @@ -185,7 +185,7 @@ if (MO.getType() == MachineOperand::MO_GlobalAddress) { GlobalValue *GV = MO.getGlobal(); if (((GV->isDeclaration() || GV->hasWeakLinkage() || - GV->hasLinkOnceLinkage()))) { + GV->hasLinkOnceLinkage() || GV->hasCommonLinkage()))) { // Dynamically-resolved functions need a stub for the function. std::string Name = Mang->getValueName(GV); FnStubs.insert(Name); @@ -390,7 +390,7 @@ // External or weakly linked global variables need non-lazily-resolved stubs if (TM.getRelocationModel() != Reloc::Static) { if (((GV->isDeclaration() || GV->hasWeakLinkage() || - GV->hasLinkOnceLinkage()))) { + GV->hasLinkOnceLinkage() || GV->hasCommonLinkage()))) { GVStubs.insert(Name); O << "L" << Name << "$non_lazy_ptr"; return; @@ -671,8 +671,8 @@ unsigned Align = TD->getPreferredAlignmentLog(I); if (C->isNullValue() && /* FIXME: Verify correct */ - !I->hasSection() && - (I->hasInternalLinkage() || I->hasWeakLinkage() || + !I->hasSection() && (I->hasCommonLinkage() || + I->hasInternalLinkage() || I->hasWeakLinkage() || I->hasLinkOnceLinkage() || I->hasExternalLinkage())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. if (I->hasExternalLinkage()) { @@ -696,6 +696,7 @@ switch (I->getLinkage()) { case GlobalValue::LinkOnceLinkage: case GlobalValue::WeakLinkage: + case GlobalValue::CommonLinkage: O << "\t.global " << name << '\n' << "\t.type " << name << ", @object\n" << "\t.weak " << name << '\n'; @@ -936,8 +937,8 @@ unsigned Align = TD->getPreferredAlignmentLog(I); if (C->isNullValue() && /* FIXME: Verify correct */ - !I->hasSection() && - (I->hasInternalLinkage() || I->hasWeakLinkage() || + !I->hasSection() && (I->hasCommonLinkage() || + I->hasInternalLinkage() || I->hasWeakLinkage() || I->hasLinkOnceLinkage() || I->hasExternalLinkage())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. if (I->hasExternalLinkage()) { @@ -961,6 +962,7 @@ switch (I->getLinkage()) { case GlobalValue::LinkOnceLinkage: case GlobalValue::WeakLinkage: + case GlobalValue::CommonLinkage: O << "\t.globl " << name << '\n' << "\t.weak_definition " << name << '\n'; SwitchToDataSection("\t.section __DATA,__datacoal_nt,coalesced", I); Modified: llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp Wed May 14 15:12:51 2008 @@ -231,8 +231,8 @@ unsigned Size = TD->getABITypeSize(C->getType()); unsigned Align = TD->getPreferredAlignment(I); - if (C->isNullValue() && - (I->hasLinkOnceLinkage() || I->hasInternalLinkage() || + if (C->isNullValue() && (I->hasCommonLinkage() || + I->hasLinkOnceLinkage() || I->hasInternalLinkage() || I->hasWeakLinkage() /* FIXME: Verify correct */)) { SwitchToDataSection(".data", I); if (I->hasInternalLinkage()) @@ -243,6 +243,7 @@ O << "\n"; } else { switch (I->getLinkage()) { + case GlobalValue::CommonLinkage: case GlobalValue::LinkOnceLinkage: case GlobalValue::WeakLinkage: // FIXME: Verify correct for weak. // Nonnull linkonce -> weak Modified: llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp Wed May 14 15:12:51 2008 @@ -309,7 +309,8 @@ // non-lazily-resolved stubs if (GV->isDeclaration() || GV->hasWeakLinkage() || - GV->hasLinkOnceLinkage()) { + GV->hasLinkOnceLinkage() || + GV->hasCommonLinkage()) { // Dynamically-resolved functions need a stub for the function. if (isCallOp && isa(GV)) { FnStubs.insert(Name); Modified: llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp Wed May 14 15:12:51 2008 @@ -200,7 +200,7 @@ if (!I->isThreadLocal() && (I->hasInternalLinkage() || I->hasWeakLinkage() || - I->hasLinkOnceLinkage())) { + I->hasLinkOnceLinkage() || I->hasCommonLinkage())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. if (!NoZerosInBSS && TAI->getBSSSection()) SwitchToDataSection(TAI->getBSSSection(), I); @@ -235,6 +235,7 @@ } switch (I->getLinkage()) { + case GlobalValue::CommonLinkage: case GlobalValue::LinkOnceLinkage: case GlobalValue::WeakLinkage: if (Subtarget->isTargetDarwin()) { Modified: llvm/trunk/lib/Target/X86/X86IntelAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86IntelAsmPrinter.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86IntelAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86IntelAsmPrinter.cpp Wed May 14 15:12:51 2008 @@ -373,6 +373,7 @@ bool bCustomSegment = false; switch (I->getLinkage()) { + case GlobalValue::CommonLinkage: case GlobalValue::LinkOnceLinkage: case GlobalValue::WeakLinkage: SwitchToDataSection(""); Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original) +++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Wed May 14 15:12:51 2008 @@ -41,6 +41,7 @@ if (isTargetDarwin()) { return (!isDirectCall && (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || + GV->hasCommonLinkage() || (GV->isDeclaration() && !GV->hasNotBeenReadFromBitcode()))); } else if (isTargetELF()) { // Extra load is needed for all non-statics. Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=51118&r1=51117&r2=51118&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Wed May 14 15:12:51 2008 @@ -930,6 +930,7 @@ } else { switch (GV->getLinkage()) { case GlobalValue::InternalLinkage: Out << "internal "; break; + case GlobalValue::CommonLinkage: Out << "common "; break; case GlobalValue::LinkOnceLinkage: Out << "linkonce "; break; case GlobalValue::WeakLinkage: Out << "weak "; break; case GlobalValue::AppendingLinkage: Out << "appending "; break; @@ -1049,6 +1050,7 @@ case GlobalValue::InternalLinkage: Out << "internal "; break; case GlobalValue::LinkOnceLinkage: Out << "linkonce "; break; case GlobalValue::WeakLinkage: Out << "weak "; break; + case GlobalValue::CommonLinkage: Out << "common "; break; case GlobalValue::AppendingLinkage: Out << "appending "; break; case GlobalValue::DLLImportLinkage: Out << "dllimport "; break; case GlobalValue::DLLExportLinkage: Out << "dllexport "; break; From dalej at apple.com Wed May 14 15:13:36 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 14 May 2008 20:13:36 -0000 Subject: [llvm-commits] [llvm] r51119 - in /llvm/trunk/lib/AsmParser: llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs Message-ID: <200805142013.m4EKDa0o022643@zion.cs.uiuc.edu> Author: johannes Date: Wed May 14 15:13:36 2008 New Revision: 51119 URL: http://llvm.org/viewvc/llvm-project?rev=51119&view=rev Log: Generated files for CommonLinkage. Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=51119&r1=51118&r2=51119&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Wed May 14 15:13:36 2008 @@ -120,110 +120,111 @@ DLLIMPORT = 301, DLLEXPORT = 302, EXTERN_WEAK = 303, - OPAQUE = 304, - EXTERNAL = 305, - TARGET = 306, - TRIPLE = 307, - ALIGN = 308, - ADDRSPACE = 309, - DEPLIBS = 310, - CALL = 311, - TAIL = 312, - ASM_TOK = 313, - MODULE = 314, - SIDEEFFECT = 315, - CC_TOK = 316, - CCC_TOK = 317, - FASTCC_TOK = 318, - COLDCC_TOK = 319, - X86_STDCALLCC_TOK = 320, - X86_FASTCALLCC_TOK = 321, - DATALAYOUT = 322, - RET = 323, - BR = 324, - SWITCH = 325, - INVOKE = 326, - UNWIND = 327, - UNREACHABLE = 328, - ADD = 329, - SUB = 330, - MUL = 331, - UDIV = 332, - SDIV = 333, - FDIV = 334, - UREM = 335, - SREM = 336, - FREM = 337, - AND = 338, - OR = 339, - XOR = 340, - SHL = 341, - LSHR = 342, - ASHR = 343, - ICMP = 344, - FCMP = 345, - VICMP = 346, - VFCMP = 347, - EQ = 348, - NE = 349, - SLT = 350, - SGT = 351, - SLE = 352, - SGE = 353, - ULT = 354, - UGT = 355, - ULE = 356, - UGE = 357, - OEQ = 358, - ONE = 359, - OLT = 360, - OGT = 361, - OLE = 362, - OGE = 363, - ORD = 364, - UNO = 365, - UEQ = 366, - UNE = 367, - MALLOC = 368, - ALLOCA = 369, - FREE = 370, - LOAD = 371, - STORE = 372, - GETELEMENTPTR = 373, - TRUNC = 374, - ZEXT = 375, - SEXT = 376, - FPTRUNC = 377, - FPEXT = 378, - BITCAST = 379, - UITOFP = 380, - SITOFP = 381, - FPTOUI = 382, - FPTOSI = 383, - INTTOPTR = 384, - PTRTOINT = 385, - PHI_TOK = 386, - SELECT = 387, - VAARG = 388, - EXTRACTELEMENT = 389, - INSERTELEMENT = 390, - SHUFFLEVECTOR = 391, - GETRESULT = 392, - SIGNEXT = 393, - ZEROEXT = 394, - NORETURN = 395, - INREG = 396, - SRET = 397, - NOUNWIND = 398, - NOALIAS = 399, - BYVAL = 400, - NEST = 401, - READNONE = 402, - READONLY = 403, - GC = 404, - DEFAULT = 405, - HIDDEN = 406, - PROTECTED = 407 + COMMON = 304, + OPAQUE = 305, + EXTERNAL = 306, + TARGET = 307, + TRIPLE = 308, + ALIGN = 309, + ADDRSPACE = 310, + DEPLIBS = 311, + CALL = 312, + TAIL = 313, + ASM_TOK = 314, + MODULE = 315, + SIDEEFFECT = 316, + CC_TOK = 317, + CCC_TOK = 318, + FASTCC_TOK = 319, + COLDCC_TOK = 320, + X86_STDCALLCC_TOK = 321, + X86_FASTCALLCC_TOK = 322, + DATALAYOUT = 323, + RET = 324, + BR = 325, + SWITCH = 326, + INVOKE = 327, + UNWIND = 328, + UNREACHABLE = 329, + ADD = 330, + SUB = 331, + MUL = 332, + UDIV = 333, + SDIV = 334, + FDIV = 335, + UREM = 336, + SREM = 337, + FREM = 338, + AND = 339, + OR = 340, + XOR = 341, + SHL = 342, + LSHR = 343, + ASHR = 344, + ICMP = 345, + FCMP = 346, + VICMP = 347, + VFCMP = 348, + EQ = 349, + NE = 350, + SLT = 351, + SGT = 352, + SLE = 353, + SGE = 354, + ULT = 355, + UGT = 356, + ULE = 357, + UGE = 358, + OEQ = 359, + ONE = 360, + OLT = 361, + OGT = 362, + OLE = 363, + OGE = 364, + ORD = 365, + UNO = 366, + UEQ = 367, + UNE = 368, + MALLOC = 369, + ALLOCA = 370, + FREE = 371, + LOAD = 372, + STORE = 373, + GETELEMENTPTR = 374, + TRUNC = 375, + ZEXT = 376, + SEXT = 377, + FPTRUNC = 378, + FPEXT = 379, + BITCAST = 380, + UITOFP = 381, + SITOFP = 382, + FPTOUI = 383, + FPTOSI = 384, + INTTOPTR = 385, + PTRTOINT = 386, + PHI_TOK = 387, + SELECT = 388, + VAARG = 389, + EXTRACTELEMENT = 390, + INSERTELEMENT = 391, + SHUFFLEVECTOR = 392, + GETRESULT = 393, + SIGNEXT = 394, + ZEROEXT = 395, + NORETURN = 396, + INREG = 397, + SRET = 398, + NOUNWIND = 399, + NOALIAS = 400, + BYVAL = 401, + NEST = 402, + READNONE = 403, + READONLY = 404, + GC = 405, + DEFAULT = 406, + HIDDEN = 407, + PROTECTED = 408 }; #endif /* Tokens. */ @@ -273,116 +274,117 @@ #define DLLIMPORT 301 #define DLLEXPORT 302 #define EXTERN_WEAK 303 -#define OPAQUE 304 -#define EXTERNAL 305 -#define TARGET 306 -#define TRIPLE 307 -#define ALIGN 308 -#define ADDRSPACE 309 -#define DEPLIBS 310 -#define CALL 311 -#define TAIL 312 -#define ASM_TOK 313 -#define MODULE 314 -#define SIDEEFFECT 315 -#define CC_TOK 316 -#define CCC_TOK 317 -#define FASTCC_TOK 318 -#define COLDCC_TOK 319 -#define X86_STDCALLCC_TOK 320 -#define X86_FASTCALLCC_TOK 321 -#define DATALAYOUT 322 -#define RET 323 -#define BR 324 -#define SWITCH 325 -#define INVOKE 326 -#define UNWIND 327 -#define UNREACHABLE 328 -#define ADD 329 -#define SUB 330 -#define MUL 331 -#define UDIV 332 -#define SDIV 333 -#define FDIV 334 -#define UREM 335 -#define SREM 336 -#define FREM 337 -#define AND 338 -#define OR 339 -#define XOR 340 -#define SHL 341 -#define LSHR 342 -#define ASHR 343 -#define ICMP 344 -#define FCMP 345 -#define VICMP 346 -#define VFCMP 347 -#define EQ 348 -#define NE 349 -#define SLT 350 -#define SGT 351 -#define SLE 352 -#define SGE 353 -#define ULT 354 -#define UGT 355 -#define ULE 356 -#define UGE 357 -#define OEQ 358 -#define ONE 359 -#define OLT 360 -#define OGT 361 -#define OLE 362 -#define OGE 363 -#define ORD 364 -#define UNO 365 -#define UEQ 366 -#define UNE 367 -#define MALLOC 368 -#define ALLOCA 369 -#define FREE 370 -#define LOAD 371 -#define STORE 372 -#define GETELEMENTPTR 373 -#define TRUNC 374 -#define ZEXT 375 -#define SEXT 376 -#define FPTRUNC 377 -#define FPEXT 378 -#define BITCAST 379 -#define UITOFP 380 -#define SITOFP 381 -#define FPTOUI 382 -#define FPTOSI 383 -#define INTTOPTR 384 -#define PTRTOINT 385 -#define PHI_TOK 386 -#define SELECT 387 -#define VAARG 388 -#define EXTRACTELEMENT 389 -#define INSERTELEMENT 390 -#define SHUFFLEVECTOR 391 -#define GETRESULT 392 -#define SIGNEXT 393 -#define ZEROEXT 394 -#define NORETURN 395 -#define INREG 396 -#define SRET 397 -#define NOUNWIND 398 -#define NOALIAS 399 -#define BYVAL 400 -#define NEST 401 -#define READNONE 402 -#define READONLY 403 -#define GC 404 -#define DEFAULT 405 -#define HIDDEN 406 -#define PROTECTED 407 +#define COMMON 304 +#define OPAQUE 305 +#define EXTERNAL 306 +#define TARGET 307 +#define TRIPLE 308 +#define ALIGN 309 +#define ADDRSPACE 310 +#define DEPLIBS 311 +#define CALL 312 +#define TAIL 313 +#define ASM_TOK 314 +#define MODULE 315 +#define SIDEEFFECT 316 +#define CC_TOK 317 +#define CCC_TOK 318 +#define FASTCC_TOK 319 +#define COLDCC_TOK 320 +#define X86_STDCALLCC_TOK 321 +#define X86_FASTCALLCC_TOK 322 +#define DATALAYOUT 323 +#define RET 324 +#define BR 325 +#define SWITCH 326 +#define INVOKE 327 +#define UNWIND 328 +#define UNREACHABLE 329 +#define ADD 330 +#define SUB 331 +#define MUL 332 +#define UDIV 333 +#define SDIV 334 +#define FDIV 335 +#define UREM 336 +#define SREM 337 +#define FREM 338 +#define AND 339 +#define OR 340 +#define XOR 341 +#define SHL 342 +#define LSHR 343 +#define ASHR 344 +#define ICMP 345 +#define FCMP 346 +#define VICMP 347 +#define VFCMP 348 +#define EQ 349 +#define NE 350 +#define SLT 351 +#define SGT 352 +#define SLE 353 +#define SGE 354 +#define ULT 355 +#define UGT 356 +#define ULE 357 +#define UGE 358 +#define OEQ 359 +#define ONE 360 +#define OLT 361 +#define OGT 362 +#define OLE 363 +#define OGE 364 +#define ORD 365 +#define UNO 366 +#define UEQ 367 +#define UNE 368 +#define MALLOC 369 +#define ALLOCA 370 +#define FREE 371 +#define LOAD 372 +#define STORE 373 +#define GETELEMENTPTR 374 +#define TRUNC 375 +#define ZEXT 376 +#define SEXT 377 +#define FPTRUNC 378 +#define FPEXT 379 +#define BITCAST 380 +#define UITOFP 381 +#define SITOFP 382 +#define FPTOUI 383 +#define FPTOSI 384 +#define INTTOPTR 385 +#define PTRTOINT 386 +#define PHI_TOK 387 +#define SELECT 388 +#define VAARG 389 +#define EXTRACTELEMENT 390 +#define INSERTELEMENT 391 +#define SHUFFLEVECTOR 392 +#define GETRESULT 393 +#define SIGNEXT 394 +#define ZEROEXT 395 +#define NORETURN 396 +#define INREG 397 +#define SRET 398 +#define NOUNWIND 399 +#define NOALIAS 400 +#define BYVAL 401 +#define NEST 402 +#define READNONE 403 +#define READONLY 404 +#define GC 405 +#define DEFAULT 406 +#define HIDDEN 407 +#define PROTECTED 408 /* Copy the first part of user declarations. */ -#line 14 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 14 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1338,7 +1340,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 949 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 949 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1386,7 +1388,7 @@ llvm::FCmpInst::Predicate FPredicate; } /* Line 193 of yacc.c. */ -#line 1390 "llvmAsmParser.tab.c" +#line 1392 "llvmAsmParser.tab.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -1399,7 +1401,7 @@ /* Line 216 of yacc.c. */ -#line 1403 "llvmAsmParser.tab.c" +#line 1405 "llvmAsmParser.tab.c" #ifdef short # undef short @@ -1612,22 +1614,22 @@ #endif /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 43 +#define YYFINAL 44 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 2035 +#define YYLAST 2040 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 167 +#define YYNTOKENS 168 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 85 /* YYNRULES -- Number of rules. */ -#define YYNRULES 326 +#define YYNRULES 327 /* YYNRULES -- Number of states. */ -#define YYNSTATES 655 +#define YYNSTATES 656 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 407 +#define YYMAXUTOK 408 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -1639,15 +1641,15 @@ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 153, 154, 157, 2, 156, 2, 2, 2, 2, 2, + 154, 155, 158, 2, 157, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 162, 155, 163, 2, 2, 2, 2, 2, 2, 2, + 163, 156, 164, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 159, 158, 161, 2, 2, 2, 2, 2, 166, + 2, 160, 159, 162, 2, 2, 2, 2, 2, 167, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 160, 2, 2, 164, 2, 165, 2, 2, 2, 2, + 161, 2, 2, 165, 2, 166, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -1675,7 +1677,7 @@ 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152 + 145, 146, 147, 148, 149, 150, 151, 152, 153 }; #if YYDEBUG @@ -1691,141 +1693,141 @@ 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 130, 135, 136, 139, 140, 142, 144, 146, 147, 150, 152, 154, 156, 158, - 160, 162, 164, 166, 167, 169, 171, 173, 174, 176, - 178, 179, 181, 183, 185, 187, 188, 190, 192, 193, - 195, 197, 199, 201, 203, 206, 208, 210, 212, 214, - 216, 218, 220, 222, 224, 227, 228, 231, 233, 235, - 237, 239, 241, 243, 244, 247, 248, 251, 252, 255, - 256, 260, 263, 264, 266, 267, 271, 273, 276, 278, - 280, 282, 284, 286, 288, 290, 292, 294, 298, 300, - 303, 309, 315, 321, 327, 331, 334, 340, 345, 348, - 350, 352, 354, 358, 360, 364, 366, 367, 369, 373, - 378, 382, 386, 391, 396, 400, 407, 413, 416, 419, - 422, 425, 428, 431, 434, 437, 440, 443, 446, 449, - 456, 462, 471, 478, 485, 493, 501, 509, 517, 524, - 533, 542, 546, 548, 550, 552, 554, 555, 558, 565, - 567, 568, 570, 573, 574, 578, 579, 583, 587, 591, - 595, 596, 605, 606, 616, 617, 627, 633, 636, 640, - 642, 646, 650, 654, 658, 660, 661, 667, 671, 673, - 677, 679, 680, 691, 693, 695, 700, 702, 704, 707, - 711, 712, 714, 716, 718, 720, 722, 724, 726, 728, - 730, 734, 736, 742, 744, 746, 748, 750, 752, 754, - 757, 759, 763, 766, 769, 773, 776, 777, 779, 782, - 785, 789, 799, 809, 818, 833, 835, 837, 844, 850, - 853, 860, 868, 873, 878, 885, 892, 893, 894, 898, - 901, 903, 909, 915, 922, 929, 936, 943, 948, 955, - 960, 965, 972, 979, 982, 991, 993, 995, 996, 1000, - 1007, 1011, 1018, 1021, 1027, 1035, 1041 + 160, 162, 164, 166, 168, 169, 171, 173, 175, 176, + 178, 180, 181, 183, 185, 187, 189, 190, 192, 194, + 195, 197, 199, 201, 203, 205, 208, 210, 212, 214, + 216, 218, 220, 222, 224, 226, 229, 230, 233, 235, + 237, 239, 241, 243, 245, 246, 249, 250, 253, 254, + 257, 258, 262, 265, 266, 268, 269, 273, 275, 278, + 280, 282, 284, 286, 288, 290, 292, 294, 296, 300, + 302, 305, 311, 317, 323, 329, 333, 336, 342, 347, + 350, 352, 354, 356, 360, 362, 366, 368, 369, 371, + 375, 380, 384, 388, 393, 398, 402, 409, 415, 418, + 421, 424, 427, 430, 433, 436, 439, 442, 445, 448, + 451, 458, 464, 473, 480, 487, 495, 503, 511, 519, + 526, 535, 544, 548, 550, 552, 554, 556, 557, 560, + 567, 569, 570, 572, 575, 576, 580, 581, 585, 589, + 593, 597, 598, 607, 608, 618, 619, 629, 635, 638, + 642, 644, 648, 652, 656, 660, 662, 663, 669, 673, + 675, 679, 681, 682, 693, 695, 697, 702, 704, 706, + 709, 713, 714, 716, 718, 720, 722, 724, 726, 728, + 730, 732, 736, 738, 744, 746, 748, 750, 752, 754, + 756, 759, 761, 765, 768, 771, 775, 778, 779, 781, + 784, 787, 791, 801, 811, 820, 835, 837, 839, 846, + 852, 855, 862, 870, 875, 880, 887, 894, 895, 896, + 900, 903, 905, 911, 917, 924, 931, 938, 945, 950, + 957, 962, 967, 974, 981, 984, 993, 995, 997, 998, + 1002, 1009, 1013, 1020, 1023, 1029, 1037, 1043 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 213, 0, -1, 74, -1, 75, -1, 76, -1, 77, - -1, 78, -1, 79, -1, 80, -1, 81, -1, 82, - -1, 86, -1, 87, -1, 88, -1, 83, -1, 84, - -1, 85, -1, 119, -1, 120, -1, 121, -1, 122, - -1, 123, -1, 124, -1, 125, -1, 126, -1, 127, - -1, 128, -1, 129, -1, 130, -1, 93, -1, 94, - -1, 95, -1, 96, -1, 97, -1, 98, -1, 99, - -1, 100, -1, 101, -1, 102, -1, 103, -1, 104, - -1, 105, -1, 106, -1, 107, -1, 108, -1, 109, - -1, 110, -1, 111, -1, 112, -1, 99, -1, 100, - -1, 101, -1, 102, -1, 26, -1, 27, -1, 11, + 214, 0, -1, 75, -1, 76, -1, 77, -1, 78, + -1, 79, -1, 80, -1, 81, -1, 82, -1, 83, + -1, 87, -1, 88, -1, 89, -1, 84, -1, 85, + -1, 86, -1, 120, -1, 121, -1, 122, -1, 123, + -1, 124, -1, 125, -1, 126, -1, 127, -1, 128, + -1, 129, -1, 130, -1, 131, -1, 94, -1, 95, + -1, 96, -1, 97, -1, 98, -1, 99, -1, 100, + -1, 101, -1, 102, -1, 103, -1, 104, -1, 105, + -1, 106, -1, 107, -1, 108, -1, 109, -1, 110, + -1, 111, -1, 112, -1, 113, -1, 100, -1, 101, + -1, 102, -1, 103, -1, 26, -1, 27, -1, 11, -1, 12, -1, 13, -1, 16, -1, 15, -1, 14, - -1, 19, -1, 22, -1, 24, -1, 175, -1, -1, - 54, 153, 4, 154, -1, -1, 175, 155, -1, -1, - 20, -1, 23, -1, 181, -1, -1, 179, 155, -1, + -1, 19, -1, 22, -1, 24, -1, 176, -1, -1, + 55, 154, 4, 155, -1, -1, 176, 156, -1, -1, + 20, -1, 23, -1, 182, -1, -1, 180, 156, -1, 42, -1, 44, -1, 43, -1, 45, -1, 47, -1, - 46, -1, 48, -1, 50, -1, -1, 150, -1, 151, - -1, 152, -1, -1, 46, -1, 48, -1, -1, 42, - -1, 43, -1, 44, -1, 47, -1, -1, 44, -1, - 42, -1, -1, 62, -1, 63, -1, 64, -1, 65, - -1, 66, -1, 61, 4, -1, 139, -1, 120, -1, - 138, -1, 121, -1, 141, -1, 142, -1, 144, -1, - 145, -1, 146, -1, 53, 4, -1, -1, 190, 189, - -1, 140, -1, 143, -1, 139, -1, 138, -1, 147, - -1, 148, -1, -1, 192, 191, -1, -1, 149, 22, - -1, -1, 53, 4, -1, -1, 156, 53, 4, -1, - 34, 22, -1, -1, 196, -1, -1, 156, 199, 198, - -1, 196, -1, 53, 4, -1, 11, -1, 12, -1, - 13, -1, 16, -1, 15, -1, 14, -1, 17, -1, - 49, -1, 200, -1, 201, 177, 157, -1, 235, -1, - 158, 4, -1, 201, 153, 205, 154, 192, -1, 10, - 153, 205, 154, 192, -1, 159, 4, 160, 201, 161, - -1, 162, 4, 160, 201, 163, -1, 164, 206, 165, - -1, 164, 165, -1, 162, 164, 206, 165, 163, -1, - 162, 164, 165, 163, -1, 201, 190, -1, 201, -1, - 10, -1, 202, -1, 204, 156, 202, -1, 204, -1, - 204, 156, 39, -1, 39, -1, -1, 201, -1, 206, - 156, 201, -1, 201, 159, 209, 161, -1, 201, 159, - 161, -1, 201, 166, 22, -1, 201, 162, 209, 163, - -1, 201, 164, 209, 165, -1, 201, 164, 165, -1, - 201, 162, 164, 209, 165, 163, -1, 201, 162, 164, - 165, 163, -1, 201, 40, -1, 201, 41, -1, 201, - 235, -1, 201, 208, -1, 201, 25, -1, 173, 3, - -1, 173, 5, -1, 173, 4, -1, 173, 6, -1, - 11, 26, -1, 11, 27, -1, 174, 9, -1, 170, - 153, 207, 38, 201, 154, -1, 118, 153, 207, 247, - 154, -1, 132, 153, 207, 156, 207, 156, 207, 154, - -1, 168, 153, 207, 156, 207, 154, -1, 169, 153, - 207, 156, 207, 154, -1, 89, 171, 153, 207, 156, - 207, 154, -1, 90, 172, 153, 207, 156, 207, 154, - -1, 91, 171, 153, 207, 156, 207, 154, -1, 92, - 172, 153, 207, 156, 207, 154, -1, 134, 153, 207, - 156, 207, 154, -1, 135, 153, 207, 156, 207, 156, - 207, 154, -1, 136, 153, 207, 156, 207, 156, 207, - 154, -1, 209, 156, 207, -1, 207, -1, 32, -1, - 33, -1, 37, -1, -1, 203, 235, -1, 124, 153, - 212, 38, 201, 154, -1, 214, -1, -1, 215, -1, - 214, 215, -1, -1, 31, 216, 231, -1, -1, 30, - 217, 232, -1, 59, 58, 221, -1, 178, 18, 201, - -1, 178, 18, 10, -1, -1, 180, 184, 211, 210, - 207, 177, 218, 198, -1, -1, 180, 182, 184, 211, - 210, 207, 177, 219, 198, -1, -1, 180, 183, 184, - 211, 210, 201, 177, 220, 198, -1, 180, 184, 35, - 187, 212, -1, 51, 222, -1, 55, 155, 223, -1, - 22, -1, 52, 155, 22, -1, 67, 155, 22, -1, - 159, 224, 161, -1, 224, 156, 22, -1, 22, -1, - -1, 225, 156, 201, 190, 176, -1, 201, 190, 176, - -1, 225, -1, 225, 156, 39, -1, 39, -1, -1, - 188, 203, 179, 153, 226, 154, 192, 197, 194, 193, - -1, 28, -1, 164, -1, 186, 184, 227, 228, -1, - 29, -1, 165, -1, 239, 230, -1, 185, 184, 227, - -1, -1, 60, -1, 3, -1, 4, -1, 9, -1, - 26, -1, 27, -1, 40, -1, 41, -1, 25, -1, - 162, 209, 163, -1, 208, -1, 58, 233, 22, 156, - 22, -1, 7, -1, 8, -1, 175, -1, 179, -1, - 235, -1, 234, -1, 201, 236, -1, 237, -1, 238, - 156, 237, -1, 239, 240, -1, 229, 240, -1, 241, - 178, 242, -1, 241, 244, -1, -1, 21, -1, 68, - 238, -1, 68, 10, -1, 69, 17, 236, -1, 69, - 11, 236, 156, 17, 236, 156, 17, 236, -1, 70, - 173, 236, 156, 17, 236, 159, 243, 161, -1, 70, - 173, 236, 156, 17, 236, 159, 161, -1, 71, 188, - 203, 236, 153, 246, 154, 192, 38, 17, 236, 72, - 17, 236, -1, 72, -1, 73, -1, 243, 173, 234, - 156, 17, 236, -1, 173, 234, 156, 17, 236, -1, - 178, 249, -1, 201, 159, 236, 156, 236, 161, -1, - 245, 156, 159, 236, 156, 236, 161, -1, 201, 190, - 236, 190, -1, 17, 190, 236, 190, -1, 246, 156, - 201, 190, 236, 190, -1, 246, 156, 17, 190, 236, - 190, -1, -1, -1, 247, 156, 237, -1, 57, 56, - -1, 56, -1, 168, 201, 236, 156, 236, -1, 169, - 201, 236, 156, 236, -1, 89, 171, 201, 236, 156, - 236, -1, 90, 172, 201, 236, 156, 236, -1, 91, - 171, 201, 236, 156, 236, -1, 92, 172, 201, 236, - 156, 236, -1, 170, 237, 38, 201, -1, 132, 237, - 156, 237, 156, 237, -1, 133, 237, 156, 201, -1, - 134, 237, 156, 237, -1, 135, 237, 156, 237, 156, - 237, -1, 136, 237, 156, 237, 156, 237, -1, 131, - 245, -1, 248, 188, 203, 236, 153, 246, 154, 192, - -1, 251, -1, 36, -1, -1, 113, 201, 195, -1, - 113, 201, 156, 11, 236, 195, -1, 114, 201, 195, - -1, 114, 201, 156, 11, 236, 195, -1, 115, 237, - -1, 250, 116, 201, 236, 195, -1, 250, 117, 237, - 156, 201, 236, 195, -1, 137, 201, 236, 156, 4, - -1, 118, 201, 236, 247, -1 + 49, -1, 46, -1, 48, -1, 51, -1, -1, 151, + -1, 152, -1, 153, -1, -1, 46, -1, 48, -1, + -1, 42, -1, 43, -1, 44, -1, 47, -1, -1, + 44, -1, 42, -1, -1, 63, -1, 64, -1, 65, + -1, 66, -1, 67, -1, 62, 4, -1, 140, -1, + 121, -1, 139, -1, 122, -1, 142, -1, 143, -1, + 145, -1, 146, -1, 147, -1, 54, 4, -1, -1, + 191, 190, -1, 141, -1, 144, -1, 140, -1, 139, + -1, 148, -1, 149, -1, -1, 193, 192, -1, -1, + 150, 22, -1, -1, 54, 4, -1, -1, 157, 54, + 4, -1, 34, 22, -1, -1, 197, -1, -1, 157, + 200, 199, -1, 197, -1, 54, 4, -1, 11, -1, + 12, -1, 13, -1, 16, -1, 15, -1, 14, -1, + 17, -1, 50, -1, 201, -1, 202, 178, 158, -1, + 236, -1, 159, 4, -1, 202, 154, 206, 155, 193, + -1, 10, 154, 206, 155, 193, -1, 160, 4, 161, + 202, 162, -1, 163, 4, 161, 202, 164, -1, 165, + 207, 166, -1, 165, 166, -1, 163, 165, 207, 166, + 164, -1, 163, 165, 166, 164, -1, 202, 191, -1, + 202, -1, 10, -1, 203, -1, 205, 157, 203, -1, + 205, -1, 205, 157, 39, -1, 39, -1, -1, 202, + -1, 207, 157, 202, -1, 202, 160, 210, 162, -1, + 202, 160, 162, -1, 202, 167, 22, -1, 202, 163, + 210, 164, -1, 202, 165, 210, 166, -1, 202, 165, + 166, -1, 202, 163, 165, 210, 166, 164, -1, 202, + 163, 165, 166, 164, -1, 202, 40, -1, 202, 41, + -1, 202, 236, -1, 202, 209, -1, 202, 25, -1, + 174, 3, -1, 174, 5, -1, 174, 4, -1, 174, + 6, -1, 11, 26, -1, 11, 27, -1, 175, 9, + -1, 171, 154, 208, 38, 202, 155, -1, 119, 154, + 208, 248, 155, -1, 133, 154, 208, 157, 208, 157, + 208, 155, -1, 169, 154, 208, 157, 208, 155, -1, + 170, 154, 208, 157, 208, 155, -1, 90, 172, 154, + 208, 157, 208, 155, -1, 91, 173, 154, 208, 157, + 208, 155, -1, 92, 172, 154, 208, 157, 208, 155, + -1, 93, 173, 154, 208, 157, 208, 155, -1, 135, + 154, 208, 157, 208, 155, -1, 136, 154, 208, 157, + 208, 157, 208, 155, -1, 137, 154, 208, 157, 208, + 157, 208, 155, -1, 210, 157, 208, -1, 208, -1, + 32, -1, 33, -1, 37, -1, -1, 204, 236, -1, + 125, 154, 213, 38, 202, 155, -1, 215, -1, -1, + 216, -1, 215, 216, -1, -1, 31, 217, 232, -1, + -1, 30, 218, 233, -1, 60, 59, 222, -1, 179, + 18, 202, -1, 179, 18, 10, -1, -1, 181, 185, + 212, 211, 208, 178, 219, 199, -1, -1, 181, 183, + 185, 212, 211, 208, 178, 220, 199, -1, -1, 181, + 184, 185, 212, 211, 202, 178, 221, 199, -1, 181, + 185, 35, 188, 213, -1, 52, 223, -1, 56, 156, + 224, -1, 22, -1, 53, 156, 22, -1, 68, 156, + 22, -1, 160, 225, 162, -1, 225, 157, 22, -1, + 22, -1, -1, 226, 157, 202, 191, 177, -1, 202, + 191, 177, -1, 226, -1, 226, 157, 39, -1, 39, + -1, -1, 189, 204, 180, 154, 227, 155, 193, 198, + 195, 194, -1, 28, -1, 165, -1, 187, 185, 228, + 229, -1, 29, -1, 166, -1, 240, 231, -1, 186, + 185, 228, -1, -1, 61, -1, 3, -1, 4, -1, + 9, -1, 26, -1, 27, -1, 40, -1, 41, -1, + 25, -1, 163, 210, 164, -1, 209, -1, 59, 234, + 22, 157, 22, -1, 7, -1, 8, -1, 176, -1, + 180, -1, 236, -1, 235, -1, 202, 237, -1, 238, + -1, 239, 157, 238, -1, 240, 241, -1, 230, 241, + -1, 242, 179, 243, -1, 242, 245, -1, -1, 21, + -1, 69, 239, -1, 69, 10, -1, 70, 17, 237, + -1, 70, 11, 237, 157, 17, 237, 157, 17, 237, + -1, 71, 174, 237, 157, 17, 237, 160, 244, 162, + -1, 71, 174, 237, 157, 17, 237, 160, 162, -1, + 72, 189, 204, 237, 154, 247, 155, 193, 38, 17, + 237, 73, 17, 237, -1, 73, -1, 74, -1, 244, + 174, 235, 157, 17, 237, -1, 174, 235, 157, 17, + 237, -1, 179, 250, -1, 202, 160, 237, 157, 237, + 162, -1, 246, 157, 160, 237, 157, 237, 162, -1, + 202, 191, 237, 191, -1, 17, 191, 237, 191, -1, + 247, 157, 202, 191, 237, 191, -1, 247, 157, 17, + 191, 237, 191, -1, -1, -1, 248, 157, 238, -1, + 58, 57, -1, 57, -1, 169, 202, 237, 157, 237, + -1, 170, 202, 237, 157, 237, -1, 90, 172, 202, + 237, 157, 237, -1, 91, 173, 202, 237, 157, 237, + -1, 92, 172, 202, 237, 157, 237, -1, 93, 173, + 202, 237, 157, 237, -1, 171, 238, 38, 202, -1, + 133, 238, 157, 238, 157, 238, -1, 134, 238, 157, + 202, -1, 135, 238, 157, 238, -1, 136, 238, 157, + 238, 157, 238, -1, 137, 238, 157, 238, 157, 238, + -1, 132, 246, -1, 249, 189, 204, 237, 154, 247, + 155, 193, -1, 252, -1, 36, -1, -1, 114, 202, + 196, -1, 114, 202, 157, 11, 237, 196, -1, 115, + 202, 196, -1, 115, 202, 157, 11, 237, 196, -1, + 116, 238, -1, 251, 117, 202, 237, 196, -1, 251, + 118, 238, 157, 202, 237, 196, -1, 138, 202, 237, + 157, 4, -1, 119, 202, 237, 248, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -1839,31 +1841,31 @@ 1130, 1131, 1131, 1132, 1133, 1138, 1139, 1139, 1139, 1139, 1139, 1141, 1141, 1141, 1142, 1142, 1144, 1145, 1149, 1153, 1158, 1158, 1160, 1161, 1166, 1172, 1173, 1174, 1175, 1176, - 1180, 1181, 1182, 1186, 1187, 1188, 1189, 1193, 1194, 1195, - 1199, 1200, 1201, 1202, 1203, 1207, 1208, 1209, 1212, 1213, - 1214, 1215, 1216, 1217, 1218, 1225, 1226, 1227, 1228, 1229, - 1230, 1231, 1232, 1233, 1234, 1238, 1239, 1244, 1245, 1246, - 1247, 1248, 1249, 1252, 1253, 1258, 1259, 1266, 1267, 1273, - 1274, 1283, 1291, 1292, 1297, 1298, 1299, 1304, 1317, 1317, - 1317, 1317, 1317, 1317, 1317, 1320, 1324, 1328, 1335, 1340, - 1348, 1377, 1402, 1407, 1417, 1427, 1431, 1441, 1448, 1457, - 1464, 1469, 1474, 1481, 1482, 1489, 1496, 1504, 1510, 1522, - 1550, 1566, 1593, 1621, 1647, 1667, 1693, 1713, 1725, 1732, - 1798, 1808, 1818, 1824, 1834, 1840, 1850, 1855, 1860, 1873, - 1885, 1907, 1915, 1921, 1932, 1937, 1942, 1947, 1952, 1958, - 1964, 1973, 1977, 1985, 1985, 1988, 1988, 1991, 2003, 2024, - 2029, 2037, 2038, 2042, 2042, 2046, 2046, 2049, 2052, 2076, - 2088, 2087, 2099, 2098, 2108, 2107, 2118, 2158, 2161, 2167, - 2177, 2181, 2186, 2188, 2193, 2198, 2207, 2217, 2228, 2232, - 2241, 2250, 2255, 2384, 2384, 2386, 2395, 2395, 2397, 2402, - 2414, 2418, 2423, 2427, 2431, 2435, 2439, 2443, 2447, 2451, - 2455, 2480, 2484, 2494, 2498, 2502, 2507, 2514, 2514, 2520, - 2529, 2534, 2539, 2543, 2552, 2561, 2570, 2574, 2582, 2589, - 2593, 2598, 2608, 2627, 2636, 2721, 2725, 2732, 2743, 2756, - 2766, 2777, 2787, 2798, 2806, 2816, 2823, 2826, 2827, 2834, - 2838, 2843, 2859, 2876, 2890, 2904, 2918, 2932, 2944, 2952, - 2959, 2965, 2971, 2977, 2992, 3082, 3087, 3091, 3098, 3105, - 3113, 3120, 3128, 3136, 3150, 3167, 3175 + 1177, 1181, 1182, 1183, 1187, 1188, 1189, 1190, 1194, 1195, + 1196, 1200, 1201, 1202, 1203, 1204, 1208, 1209, 1210, 1213, + 1214, 1215, 1216, 1217, 1218, 1219, 1226, 1227, 1228, 1229, + 1230, 1231, 1232, 1233, 1234, 1235, 1239, 1240, 1245, 1246, + 1247, 1248, 1249, 1250, 1253, 1254, 1259, 1260, 1267, 1268, + 1274, 1275, 1284, 1292, 1293, 1298, 1299, 1300, 1305, 1318, + 1318, 1318, 1318, 1318, 1318, 1318, 1321, 1325, 1329, 1336, + 1341, 1349, 1378, 1403, 1408, 1418, 1428, 1432, 1442, 1449, + 1458, 1465, 1470, 1475, 1482, 1483, 1490, 1497, 1505, 1511, + 1523, 1551, 1567, 1594, 1622, 1648, 1668, 1694, 1714, 1726, + 1733, 1799, 1809, 1819, 1825, 1835, 1841, 1851, 1856, 1861, + 1874, 1886, 1908, 1916, 1922, 1933, 1938, 1943, 1948, 1953, + 1959, 1965, 1974, 1978, 1986, 1986, 1989, 1989, 1992, 2004, + 2025, 2030, 2038, 2039, 2043, 2043, 2047, 2047, 2050, 2053, + 2077, 2089, 2088, 2100, 2099, 2109, 2108, 2119, 2159, 2162, + 2168, 2178, 2182, 2187, 2189, 2194, 2199, 2208, 2218, 2229, + 2233, 2242, 2251, 2256, 2385, 2385, 2387, 2396, 2396, 2398, + 2403, 2415, 2419, 2424, 2428, 2432, 2436, 2440, 2444, 2448, + 2452, 2456, 2481, 2485, 2495, 2499, 2503, 2508, 2515, 2515, + 2521, 2530, 2535, 2540, 2544, 2553, 2562, 2571, 2575, 2583, + 2590, 2594, 2599, 2609, 2628, 2637, 2722, 2726, 2733, 2744, + 2757, 2767, 2778, 2788, 2799, 2807, 2817, 2824, 2827, 2828, + 2835, 2839, 2844, 2860, 2877, 2891, 2905, 2919, 2933, 2945, + 2953, 2960, 2966, 2972, 2978, 2993, 3083, 3088, 3092, 3099, + 3106, 3114, 3121, 3129, 3137, 3151, 3168, 3176 }; #endif @@ -1880,7 +1882,7 @@ "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL", "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO", "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK", - "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", + "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "COMMON", "OPAQUE", "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK", "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", @@ -1939,47 +1941,47 @@ 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 40, 41, 61, 44, 42, 92, 91, - 120, 93, 60, 62, 123, 125, 99 + 405, 406, 407, 408, 40, 41, 61, 44, 42, 92, + 91, 120, 93, 60, 62, 123, 125, 99 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 167, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 169, 169, 169, 169, 169, 169, 170, 170, 170, - 170, 170, 170, 170, 170, 170, 170, 170, 170, 171, + 0, 168, 169, 169, 169, 169, 169, 169, 169, 169, + 169, 170, 170, 170, 170, 170, 170, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 172, - 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 173, 174, 174, 174, 174, - 174, 175, 175, 175, 176, 176, 177, 177, 178, 178, - 179, 179, 180, 180, 181, 182, 182, 182, 182, 182, - 183, 183, 183, 184, 184, 184, 184, 185, 185, 185, - 186, 186, 186, 186, 186, 187, 187, 187, 188, 188, - 188, 188, 188, 188, 188, 189, 189, 189, 189, 189, - 189, 189, 189, 189, 189, 190, 190, 191, 191, 191, - 191, 191, 191, 192, 192, 193, 193, 194, 194, 195, - 195, 196, 197, 197, 198, 198, 199, 199, 200, 200, - 200, 200, 200, 200, 200, 201, 201, 201, 201, 201, - 201, 201, 201, 201, 201, 201, 201, 201, 202, 203, - 203, 204, 204, 205, 205, 205, 205, 206, 206, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 208, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 174, 175, 175, 175, 175, + 175, 176, 176, 176, 177, 177, 178, 178, 179, 179, + 180, 180, 181, 181, 182, 183, 183, 183, 183, 183, + 183, 184, 184, 184, 185, 185, 185, 185, 186, 186, + 186, 187, 187, 187, 187, 187, 188, 188, 188, 189, + 189, 189, 189, 189, 189, 189, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 191, 191, 192, 192, + 192, 192, 192, 192, 193, 193, 194, 194, 195, 195, + 196, 196, 197, 198, 198, 199, 199, 200, 200, 201, + 201, 201, 201, 201, 201, 201, 202, 202, 202, 202, + 202, 202, 202, 202, 202, 202, 202, 202, 202, 203, + 204, 204, 205, 205, 206, 206, 206, 206, 207, 207, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, - 208, 209, 209, 210, 210, 211, 211, 212, 212, 213, - 213, 214, 214, 216, 215, 217, 215, 215, 215, 215, - 218, 215, 219, 215, 220, 215, 215, 215, 215, 221, - 222, 222, 223, 224, 224, 224, 225, 225, 226, 226, - 226, 226, 227, 228, 228, 229, 230, 230, 231, 232, - 233, 233, 234, 234, 234, 234, 234, 234, 234, 234, - 234, 234, 234, 235, 235, 235, 235, 236, 236, 237, - 238, 238, 239, 239, 240, 241, 241, 241, 242, 242, - 242, 242, 242, 242, 242, 242, 242, 243, 243, 244, - 245, 245, 246, 246, 246, 246, 246, 247, 247, 248, - 248, 249, 249, 249, 249, 249, 249, 249, 249, 249, - 249, 249, 249, 249, 249, 249, 250, 250, 251, 251, - 251, 251, 251, 251, 251, 251, 251 + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 210, 210, 211, 211, 212, 212, 213, 213, + 214, 214, 215, 215, 217, 216, 218, 216, 216, 216, + 216, 219, 216, 220, 216, 221, 216, 216, 216, 216, + 222, 223, 223, 224, 225, 225, 225, 226, 226, 227, + 227, 227, 227, 228, 229, 229, 230, 231, 231, 232, + 233, 234, 234, 235, 235, 235, 235, 235, 235, 235, + 235, 235, 235, 235, 236, 236, 236, 236, 237, 237, + 238, 239, 239, 240, 240, 241, 242, 242, 242, 243, + 243, 243, 243, 243, 243, 243, 243, 243, 244, 244, + 245, 246, 246, 247, 247, 247, 247, 247, 248, 248, + 249, 249, 250, 250, 250, 250, 250, 250, 250, 250, + 250, 250, 250, 250, 250, 250, 250, 251, 251, 252, + 252, 252, 252, 252, 252, 252, 252, 252 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -1993,31 +1995,31 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, 0, 2, 0, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, - 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, - 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 0, 2, 1, 1, 1, - 1, 1, 1, 0, 2, 0, 2, 0, 2, 0, - 3, 2, 0, 1, 0, 3, 1, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 1, 2, - 5, 5, 5, 5, 3, 2, 5, 4, 2, 1, - 1, 1, 3, 1, 3, 1, 0, 1, 3, 4, - 3, 3, 4, 4, 3, 6, 5, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, - 5, 8, 6, 6, 7, 7, 7, 7, 6, 8, - 8, 3, 1, 1, 1, 1, 0, 2, 6, 1, - 0, 1, 2, 0, 3, 0, 3, 3, 3, 3, - 0, 8, 0, 9, 0, 9, 5, 2, 3, 1, - 3, 3, 3, 3, 1, 0, 5, 3, 1, 3, - 1, 0, 10, 1, 1, 4, 1, 1, 2, 3, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 1, 5, 1, 1, 1, 1, 1, 1, 2, - 1, 3, 2, 2, 3, 2, 0, 1, 2, 2, - 3, 9, 9, 8, 14, 1, 1, 6, 5, 2, - 6, 7, 4, 4, 6, 6, 0, 0, 3, 2, - 1, 5, 5, 6, 6, 6, 6, 4, 6, 4, - 4, 6, 6, 2, 8, 1, 1, 0, 3, 6, - 3, 6, 2, 5, 7, 5, 4 + 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, + 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 0, 2, 1, 1, + 1, 1, 1, 1, 0, 2, 0, 2, 0, 2, + 0, 3, 2, 0, 1, 0, 3, 1, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, + 2, 5, 5, 5, 5, 3, 2, 5, 4, 2, + 1, 1, 1, 3, 1, 3, 1, 0, 1, 3, + 4, 3, 3, 4, 4, 3, 6, 5, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 6, 5, 8, 6, 6, 7, 7, 7, 7, 6, + 8, 8, 3, 1, 1, 1, 1, 0, 2, 6, + 1, 0, 1, 2, 0, 3, 0, 3, 3, 3, + 3, 0, 8, 0, 9, 0, 9, 5, 2, 3, + 1, 3, 3, 3, 3, 1, 0, 5, 3, 1, + 3, 1, 0, 10, 1, 1, 4, 1, 1, 2, + 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 5, 1, 1, 1, 1, 1, 1, + 2, 1, 3, 2, 2, 3, 2, 0, 1, 2, + 2, 3, 9, 9, 8, 14, 1, 1, 6, 5, + 2, 6, 7, 4, 4, 6, 6, 0, 0, 3, + 2, 1, 5, 5, 6, 6, 6, 6, 4, 6, + 4, 4, 6, 6, 2, 8, 1, 1, 0, 3, + 6, 3, 6, 2, 5, 7, 5, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -2025,666 +2027,668 @@ means the default is an error. */ static const yytype_uint16 yydefact[] = { - 73, 61, 70, 62, 71, 63, 215, 213, 0, 0, - 0, 0, 0, 0, 83, 72, 0, 73, 211, 87, - 90, 0, 0, 227, 0, 0, 68, 0, 74, 75, - 77, 76, 78, 80, 79, 81, 82, 84, 85, 86, - 83, 83, 206, 1, 212, 88, 89, 83, 216, 91, - 92, 93, 94, 83, 276, 214, 276, 0, 0, 235, - 228, 229, 217, 263, 264, 219, 138, 139, 140, 143, - 142, 141, 144, 145, 0, 0, 0, 0, 265, 266, - 146, 218, 148, 206, 206, 95, 205, 0, 98, 98, - 277, 273, 69, 246, 247, 248, 272, 230, 231, 234, - 0, 166, 149, 0, 0, 0, 0, 155, 167, 0, - 0, 166, 0, 0, 0, 97, 96, 0, 203, 204, - 0, 0, 99, 100, 101, 102, 103, 0, 249, 0, - 317, 275, 0, 232, 165, 115, 161, 163, 0, 0, - 0, 0, 0, 0, 154, 0, 0, 147, 0, 0, - 160, 0, 159, 0, 226, 138, 139, 140, 143, 142, - 141, 0, 0, 67, 67, 104, 0, 243, 244, 245, - 316, 300, 0, 0, 0, 0, 98, 285, 286, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 14, 15, - 16, 11, 12, 13, 0, 0, 0, 0, 0, 0, - 0, 0, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 274, 98, 289, 0, 315, 233, - 158, 0, 123, 67, 67, 157, 0, 168, 0, 123, - 67, 67, 0, 207, 186, 187, 182, 184, 183, 185, - 188, 181, 177, 178, 0, 0, 0, 0, 0, 0, + 73, 61, 70, 62, 71, 63, 216, 214, 0, 0, + 0, 0, 0, 0, 84, 72, 0, 73, 212, 88, + 91, 0, 0, 228, 0, 0, 68, 0, 74, 75, + 77, 76, 78, 81, 79, 82, 80, 83, 85, 86, + 87, 84, 84, 207, 1, 213, 89, 90, 84, 217, + 92, 93, 94, 95, 84, 277, 215, 277, 0, 0, + 236, 229, 230, 218, 264, 265, 220, 139, 140, 141, + 144, 143, 142, 145, 146, 0, 0, 0, 0, 266, + 267, 147, 219, 149, 207, 207, 96, 206, 0, 99, + 99, 278, 274, 69, 247, 248, 249, 273, 231, 232, + 235, 0, 167, 150, 0, 0, 0, 0, 156, 168, + 0, 0, 167, 0, 0, 0, 98, 97, 0, 204, + 205, 0, 0, 100, 101, 102, 103, 104, 0, 250, + 0, 318, 276, 0, 233, 166, 116, 162, 164, 0, + 0, 0, 0, 0, 0, 155, 0, 0, 148, 0, + 0, 161, 0, 160, 0, 227, 139, 140, 141, 144, + 143, 142, 0, 0, 67, 67, 105, 0, 244, 245, + 246, 317, 301, 0, 0, 0, 0, 99, 286, 287, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, + 15, 16, 11, 12, 13, 0, 0, 0, 0, 0, + 0, 0, 0, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 275, 99, 290, 0, 316, + 234, 159, 0, 124, 67, 67, 158, 0, 169, 0, + 124, 67, 67, 0, 208, 187, 188, 183, 185, 184, + 186, 189, 182, 178, 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 180, 179, 220, 0, 299, 279, 67, 270, 278, 0, - 0, 55, 0, 0, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 0, 53, 54, 49, 50, 51, - 52, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 0, 0, 0, 129, 129, 322, 67, 67, 313, - 0, 0, 0, 0, 0, 67, 67, 67, 0, 0, - 0, 0, 0, 106, 108, 107, 105, 109, 110, 111, - 112, 113, 116, 164, 162, 151, 152, 153, 156, 66, - 150, 222, 224, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 170, 202, 0, 0, 0, 174, 0, - 171, 0, 0, 0, 134, 241, 252, 253, 254, 259, - 255, 256, 257, 258, 250, 0, 261, 268, 267, 269, - 0, 0, 280, 0, 0, 67, 67, 67, 67, 0, - 318, 0, 320, 297, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 67, 0, 114, 120, - 119, 117, 118, 121, 122, 124, 134, 134, 0, 0, - 0, 0, 0, 297, 0, 0, 0, 0, 0, 169, - 155, 167, 0, 172, 173, 0, 0, 0, 0, 221, - 240, 115, 238, 0, 251, 0, 0, 271, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 326, 0, - 0, 0, 309, 310, 0, 0, 0, 0, 0, 307, - 0, 129, 0, 223, 225, 67, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 201, 176, 0, 0, 0, - 0, 0, 0, 136, 134, 65, 0, 123, 0, 260, - 0, 0, 296, 0, 0, 0, 0, 129, 130, 129, - 0, 0, 0, 0, 0, 0, 325, 301, 302, 296, - 0, 323, 67, 208, 0, 0, 0, 0, 190, 0, - 0, 0, 0, 175, 0, 0, 67, 131, 137, 135, - 64, 237, 239, 115, 132, 0, 0, 0, 115, 115, - 0, 303, 304, 305, 306, 319, 321, 298, 0, 0, - 308, 311, 312, 0, 129, 0, 0, 0, 0, 0, - 198, 0, 0, 192, 193, 189, 65, 133, 127, 262, - 0, 0, 0, 0, 123, 0, 290, 0, 123, 324, - 194, 195, 196, 197, 0, 0, 0, 236, 0, 125, - 0, 283, 0, 0, 106, 108, 115, 115, 0, 115, - 115, 291, 314, 191, 199, 200, 128, 0, 242, 281, - 0, 282, 0, 293, 292, 0, 0, 0, 126, 0, - 0, 0, 115, 115, 0, 0, 0, 295, 294, 288, - 0, 0, 287, 0, 284 + 0, 181, 180, 221, 0, 300, 280, 67, 271, 279, + 0, 0, 55, 0, 0, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 0, 53, 54, 49, 50, + 51, 52, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 0, 0, 0, 130, 130, 323, 67, 67, + 314, 0, 0, 0, 0, 0, 67, 67, 67, 0, + 0, 0, 0, 0, 107, 109, 108, 106, 110, 111, + 112, 113, 114, 117, 165, 163, 152, 153, 154, 157, + 66, 151, 223, 225, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 171, 203, 0, 0, 0, 175, + 0, 172, 0, 0, 0, 135, 242, 253, 254, 255, + 260, 256, 257, 258, 259, 251, 0, 262, 269, 268, + 270, 0, 0, 281, 0, 0, 67, 67, 67, 67, + 0, 319, 0, 321, 298, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 67, 0, 115, + 121, 120, 118, 119, 122, 123, 125, 135, 135, 0, + 0, 0, 0, 0, 298, 0, 0, 0, 0, 0, + 170, 156, 168, 0, 173, 174, 0, 0, 0, 0, + 222, 241, 116, 239, 0, 252, 0, 0, 272, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 327, + 0, 0, 0, 310, 311, 0, 0, 0, 0, 0, + 308, 0, 130, 0, 224, 226, 67, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 202, 177, 0, 0, + 0, 0, 0, 0, 137, 135, 65, 0, 124, 0, + 261, 0, 0, 297, 0, 0, 0, 0, 130, 131, + 130, 0, 0, 0, 0, 0, 0, 326, 302, 303, + 297, 0, 324, 67, 209, 0, 0, 0, 0, 191, + 0, 0, 0, 0, 176, 0, 0, 67, 132, 138, + 136, 64, 238, 240, 116, 133, 0, 0, 0, 116, + 116, 0, 304, 305, 306, 307, 320, 322, 299, 0, + 0, 309, 312, 313, 0, 130, 0, 0, 0, 0, + 0, 199, 0, 0, 193, 194, 190, 65, 134, 128, + 263, 0, 0, 0, 0, 124, 0, 291, 0, 124, + 325, 195, 196, 197, 198, 0, 0, 0, 237, 0, + 126, 0, 284, 0, 0, 107, 109, 116, 116, 0, + 116, 116, 292, 315, 192, 200, 201, 129, 0, 243, + 282, 0, 283, 0, 294, 293, 0, 0, 0, 127, + 0, 0, 0, 116, 116, 0, 0, 0, 296, 295, + 289, 0, 0, 288, 0, 285 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 267, 268, 269, 294, 311, 161, 162, 78, 551, - 112, 12, 79, 14, 15, 40, 41, 42, 47, 53, - 117, 127, 342, 230, 425, 345, 628, 609, 400, 503, - 588, 449, 504, 80, 163, 136, 153, 137, 138, 109, - 364, 386, 365, 120, 87, 154, 16, 17, 18, 20, - 19, 374, 426, 427, 62, 23, 60, 100, 452, 453, - 128, 169, 54, 95, 55, 48, 455, 387, 82, 389, - 277, 278, 56, 91, 92, 224, 613, 131, 319, 560, - 468, 225, 226, 227, 228 + -1, 268, 269, 270, 295, 312, 162, 163, 79, 552, + 113, 12, 80, 14, 15, 41, 42, 43, 48, 54, + 118, 128, 343, 231, 426, 346, 629, 610, 401, 504, + 589, 450, 505, 81, 164, 137, 154, 138, 139, 110, + 365, 387, 366, 121, 88, 155, 16, 17, 18, 20, + 19, 375, 427, 428, 63, 23, 61, 101, 453, 454, + 129, 170, 55, 96, 56, 49, 456, 388, 83, 390, + 278, 279, 57, 92, 93, 225, 614, 132, 320, 561, + 469, 226, 227, 228, 229 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -572 +#define YYPACT_NINF -560 static const yytype_int16 yypact[] = { - 445, -572, -572, -572, -572, -572, -572, -572, -2, -122, - 19, -58, 90, -40, 26, -572, 112, 855, -572, 52, - 217, -28, 4, -572, 12, 146, -572, 1594, -572, -572, - -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, - 70, 70, 125, -572, -572, -572, -572, 70, -572, -572, - -572, -572, -572, 70, 166, -572, -8, 176, 185, 201, - -572, -572, -572, -572, -572, 80, -572, -572, -572, -572, - -572, -572, -572, -572, 232, 241, 2, 227, -572, -572, - -572, -1, -572, 211, 211, 137, -572, 118, 258, 258, - -572, -572, 87, -572, -572, -572, -572, -572, -572, -572, - -57, 1357, -572, 105, 139, 1020, 80, -572, -1, -107, - 109, 1357, 145, 118, 118, -572, -572, 1400, -572, -572, - 1634, 302, -572, -572, -572, -572, -572, 1677, -572, -16, - 1856, -572, 290, -572, -572, -1, -572, 159, 177, 1695, - 1695, 179, -102, 1695, -572, 331, 189, -572, 1634, 1695, - 80, 186, -1, 247, -572, 226, 335, 338, 339, 342, - 344, 269, 345, 1123, 303, -572, 24, -572, -572, -572, - -572, -572, 300, 1752, 76, 347, 258, -572, -572, -572, - -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, - -572, -572, -572, -572, 314, 845, 314, 845, 1695, 1695, - 1695, 1695, -572, -572, -572, -572, -572, -572, -572, -572, - -572, -572, -572, -572, 1695, 1695, 1695, 1695, 1695, 1695, - 1695, 1695, 1695, 1695, -572, 258, -572, 97, -572, -572, - 172, 1418, -572, -43, -31, -572, 196, -1, 206, -572, - 303, -12, 1400, -572, -572, -572, -572, -572, -572, -572, - -572, -572, -572, -572, 314, 845, 314, 845, 208, 216, - 219, 220, 223, 1473, 1795, 1063, 348, 224, 225, 234, - -572, -572, -572, 237, -572, 80, 843, -572, 238, 524, - 524, -572, 524, 1677, -572, -572, -572, -572, -572, -572, - -572, -572, -572, -572, 1695, -572, -572, -572, -572, -572, - -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, - -572, 1695, 1695, 1695, 27, 29, -572, 843, -23, 248, - 249, 263, 264, 265, 266, 843, 843, 843, 341, 1677, - 1695, 1695, 389, -572, -572, -572, -572, -572, -572, -572, - -572, -572, -572, -572, -572, 198, -572, -572, -572, -572, - 198, -572, 145, 359, 250, 270, 271, 272, 1634, 1634, - 1634, 1634, 1634, -572, -572, -30, 1314, -104, -572, -101, - -572, 1634, 1634, 1634, 275, 1518, -572, -572, -572, -572, - -572, -572, -572, -572, 366, 1634, -572, -572, -572, -572, - 1695, 276, -572, 277, 524, 843, 843, 843, 843, 25, - -572, 35, -572, -572, 524, 278, 1695, 1695, 1695, 1695, - 1695, 280, 282, 283, 1695, 524, 843, 287, -572, -572, - -572, -572, -572, -572, -572, -572, 275, 275, 1695, 1634, - 1634, 1634, 1634, -572, 291, 292, 293, 294, 1634, -572, - 288, 975, -99, -572, -572, 296, 297, 408, 9, -572, - -572, -1, 299, 304, -572, 435, -96, -572, 442, 443, - 308, 306, 310, 325, 326, 524, 479, 524, 328, 329, - 524, 334, -1, -572, 336, 337, 487, 524, 524, -1, - 349, 350, 1695, -572, -572, -20, 351, 352, 353, 354, - 102, 1634, 1634, 1634, 1634, -572, -572, 356, 1634, 1634, - 1695, 489, 497, -572, 275, 571, 1576, -572, 357, -572, - 524, 524, 1853, 524, 524, 524, 524, 350, -572, 350, - 1695, 524, 358, 1695, 1695, 1695, -572, -572, -572, 1853, - 459, -572, 843, -572, 1634, 1634, 1634, 1634, -572, 360, - 369, 364, 368, -572, 371, 376, -15, -572, -572, -572, - -572, -572, -572, -1, 6, 512, 380, 378, 71, -1, - 171, -572, -572, -572, -572, -572, -572, -572, 379, 524, - -572, -572, -572, 174, 350, 385, 387, 388, 391, 1634, - -572, 1634, 1634, -572, -572, -572, 571, -572, 499, -572, - 536, -6, 699, 699, -572, 1871, -572, 393, -572, -572, - -572, -572, -572, -572, 401, 407, 409, -572, 558, 418, - 524, -572, 1265, -3, 415, 417, -572, -572, -19, 71, - -1, -572, 198, -572, -572, -572, -572, 549, -572, -572, - 416, -572, 1265, 172, 172, 556, 699, 699, -572, 557, - 419, 524, -572, -572, 524, 559, 507, 172, 172, -572, - 524, 563, -572, 524, -572 + 590, -560, -560, -560, -560, -560, -560, -560, 9, -119, + 23, -66, 80, -43, -1, -560, 132, 897, -560, 131, + 219, 16, 43, -560, 48, 203, -560, 1564, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -6, -6, 230, -560, -560, -560, -560, -6, -560, + -560, -560, -560, -560, -6, 211, -560, -10, 223, 234, + 246, -560, -560, -560, -560, -560, 119, -560, -560, -560, + -560, -560, -560, -560, -560, 289, 296, 2, 227, -560, + -560, -560, 3, -560, 266, 266, 247, -560, 34, 121, + 121, -560, -560, 233, -560, -560, -560, -560, -560, -560, + -560, 67, 1400, -560, 146, 151, 830, 119, -560, 3, + -102, 171, 1400, 159, 34, 34, -560, -560, 1441, -560, + -560, 1682, 322, -560, -560, -560, -560, -560, 1723, -560, + -16, 1902, -560, 306, -560, -560, 3, -560, 172, 176, + 1741, 1741, 168, -101, 1741, -560, 332, 182, -560, 1682, + 1741, 119, 184, 3, 252, -560, 102, 335, 339, 340, + 343, 345, 106, 346, 1164, 303, -560, 213, -560, -560, + -560, -560, -560, 302, 1764, 52, 349, 121, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, 591, 440, 591, 440, 1741, + 1741, 1741, 1741, -560, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, 1741, 1741, 1741, 1741, 1741, + 1741, 1741, 1741, 1741, 1741, -560, 121, -560, 36, -560, + -560, 200, 1461, -560, -20, -37, -560, 198, 3, 215, + -560, 303, 4, 1441, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, 591, 440, 591, 440, 217, + 218, 220, 222, 224, 1482, 1782, 1061, 351, 225, 226, + 237, -560, -560, -560, 240, -560, 119, 742, -560, 231, + 884, 884, -560, 884, 1723, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, 1741, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + -560, -560, 1741, 1741, 1741, -21, 24, -560, 742, -35, + 238, 241, 249, 254, 255, 256, 742, 742, 742, 366, + 1723, 1741, 1741, 373, -560, -560, -560, -560, -560, -560, + -560, -560, -560, -560, -560, -560, 175, -560, -560, -560, + -560, 175, -560, 159, 371, 260, 261, 262, 263, 1682, + 1682, 1682, 1682, 1682, -560, -560, 91, 1105, -96, -560, + -69, -560, 1682, 1682, 1682, 264, 1502, -560, -560, -560, + -560, -560, -560, -560, -560, 359, 1682, -560, -560, -560, + -560, 1741, 265, -560, 267, 884, 742, 742, 742, 742, + 21, -560, 40, -560, -560, 884, 272, 1741, 1741, 1741, + 1741, 1741, 268, 269, 270, 1741, 884, 742, 276, -560, + -560, -560, -560, -560, -560, -560, -560, 264, 264, 1741, + 1682, 1682, 1682, 1682, -560, 277, 280, 281, 282, 1682, + -560, 259, 1015, -62, -560, -560, 287, 290, 408, 19, + -560, -560, 3, 291, 294, -560, 428, -61, -560, 434, + 435, 299, 297, 301, 304, 305, 884, 452, 884, 307, + 308, 884, 311, 3, -560, 312, 313, 455, 884, 884, + 3, 309, 319, 1741, -560, -560, -15, 320, 325, 326, + 327, 137, 1682, 1682, 1682, 1682, -560, -560, 321, 1682, + 1682, 1741, 438, 482, -560, 264, 386, 1523, -560, 334, + -560, 884, 884, 1805, 884, 884, 884, 884, 319, -560, + 319, 1741, 884, 336, 1741, 1741, 1741, -560, -560, -560, + 1805, 443, -560, 742, -560, 1682, 1682, 1682, 1682, -560, + 337, 347, 344, 348, -560, 354, 355, 15, -560, -560, + -560, -560, -560, -560, 3, -18, 470, 356, 352, 5, + 3, 156, -560, -560, -560, -560, -560, -560, -560, 341, + 884, -560, -560, -560, 163, 319, 360, 362, 365, 369, + 1682, -560, 1682, 1682, -560, -560, -560, 386, -560, 457, + -560, 497, -7, 577, 577, -560, 1846, -560, 372, -560, + -560, -560, -560, -560, -560, 380, 382, 383, -560, 517, + 404, 884, -560, 1307, -2, 401, 402, -560, -560, 82, + 5, 3, -560, 175, -560, -560, -560, -560, 540, -560, + -560, 406, -560, 1307, 200, 200, 547, 577, 577, -560, + 548, 409, 884, -560, -560, 884, 551, 496, 200, 200, + -560, 884, 554, -560, 884, -560 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -572, 451, 453, 454, -174, -152, -173, -572, 0, 1, - -146, 493, 3, -572, -572, -572, -572, 49, -572, -572, - -572, -139, -572, -416, -572, -223, -572, -572, -311, 34, - -572, -397, -572, -572, -26, 361, -120, -572, 478, 486, - -64, -153, -250, 164, 207, 355, -572, -572, 577, -572, - -572, -572, -572, -572, -572, -572, -572, -572, -572, -572, - 528, -572, -572, -572, -572, -572, -572, -571, -115, 162, - -191, -572, -572, 540, -572, -572, -572, -572, -572, 89, - 187, -572, -572, -572, -572 + -560, 441, 442, 444, -174, -167, -173, -560, 0, -13, + -141, 483, 13, -560, -560, -560, -560, 30, -560, -560, + -560, -139, -560, -416, -560, -238, -560, -560, -311, 22, + -560, -406, -560, -560, -26, 350, -120, -560, 471, 485, + -64, -157, -251, 100, 194, 363, -560, -560, 571, -560, + -560, -560, -560, -560, -560, -560, -560, -560, -560, -560, + 499, -560, -560, -560, -560, -560, -560, -559, -115, 162, + -191, -560, -560, 535, -560, -560, -560, -560, -560, 63, + 160, -560, -560, -560, -560 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -211 +#define YYTABLE_NINF -212 static const yytype_int16 yytable[] = { - 11, 81, 282, 13, 402, 281, 104, 166, 281, 316, - 270, 110, 167, 90, 367, 369, 350, 11, 272, 635, - 13, 93, 312, 110, 320, 321, 322, 323, 324, 483, - 484, 110, 328, 24, 110, 505, 465, 283, 243, 110, - 501, 630, 110, 501, 2, 313, 467, 4, 271, 143, - 21, 108, 438, 110, 143, 438, 164, 438, 144, 443, - 438, 640, 502, 236, 444, 22, 497, 509, 29, 30, - 31, 32, 33, 34, 35, 135, 36, 25, 466, 108, - 354, 110, 356, 110, 240, 135, 329, 279, 466, 83, - 84, 152, 11, 280, 351, 352, 88, 26, 45, 132, - 46, 152, 89, 355, 133, 357, 1, 549, 27, 3, - 111, 5, 43, 233, 234, 28, 442, 237, 346, 419, - 420, 421, 111, 241, 422, -144, 438, 57, 423, 424, - 111, 439, 347, 111, 533, 456, 404, 586, 111, 585, - 417, 111, 592, 593, 419, 420, 421, 276, 168, 422, - 118, 119, 111, 423, 424, 611, -67, 94, 631, 58, - 85, 388, 86, 394, 388, 388, 105, 388, 61, 273, - 531, 59, 314, 315, 276, 317, 37, 38, 39, 115, - 111, 116, 111, 399, -67, 401, -67, 90, 318, 276, - 276, 276, 276, 276, 325, 326, 327, 276, 97, 457, - 633, 634, 388, 636, 637, 135, 565, 98, 566, 415, - 388, 388, 388, 330, 331, 471, 152, 473, 474, 475, - 37, 38, 39, 99, -144, 332, 647, 648, -144, -55, - -55, -55, -55, 101, 63, 64, 102, 106, 66, 67, - 68, 69, 70, 71, 72, 103, 1, 2, 86, 3, - 4, 5, 244, 245, 63, 64, 538, 152, 520, 49, - 50, 51, 145, 599, 52, 139, 1, 2, 395, 3, - 4, 5, 246, 247, 248, 249, 73, 148, 149, 388, - 388, 388, 388, 388, 554, 396, 397, 398, 270, 388, - 113, 114, 333, 334, 433, 434, 435, 436, 437, 140, - 388, 388, 147, 152, 416, 276, 165, 445, 446, 447, - 335, 336, 229, 337, 338, 231, 339, 340, 341, 121, - 122, 123, 124, 125, 126, 594, 271, 595, 598, 567, - 595, 232, 570, 571, 572, 238, 419, 420, 421, 242, - 441, 422, 235, 239, -56, 423, 424, -57, -60, 451, - 388, -59, 388, -58, 250, 388, 274, 110, 281, 348, - 349, 358, 388, 388, 276, 486, 487, 488, 489, 359, - 370, 618, 360, 361, 495, 622, 362, 371, 372, 414, - 276, 472, 276, 276, 276, 74, 75, 373, 479, 76, - 375, 77, 107, 418, 390, 388, 388, 428, 388, 388, - 388, 388, 485, 429, 405, 406, 388, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 388, 612, 407, - 408, 409, 410, 430, 431, 432, 454, 539, 540, 541, - 542, 448, 458, 459, 544, 545, 476, 470, 477, 478, - 632, 391, 392, 482, 393, -210, 500, 491, 492, 493, - 494, 496, 498, 499, 388, 506, 532, 508, 507, 510, - 511, 512, 513, -69, 1, 2, 514, 3, 4, 5, - 575, 576, 577, 578, 546, 6, 7, 388, 388, 403, - 553, 515, 516, 518, 520, 521, 559, 411, 412, 413, - 523, 526, 524, 525, 276, 388, 8, 276, 276, 276, - 9, 548, 529, 559, 10, 550, 530, 534, 535, 536, - 537, 547, 466, 555, 569, 604, 579, 605, 606, 543, - 581, 388, 388, 580, 582, 583, 388, 376, 377, 388, - 584, 63, 64, 378, 589, 388, 590, 591, 388, 600, - 596, 601, 602, 1, 2, 603, 3, 4, 5, 379, - 380, 381, 608, 610, 621, 623, 460, 461, 462, 463, - 464, 624, 626, 625, 382, 383, 469, 627, -18, 620, - -19, 638, 639, 641, 644, 645, 650, 480, 481, 651, - 653, 221, 384, 222, 223, 130, 550, 607, 587, 146, - 1, 142, 344, 3, 44, 5, 96, 353, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 254, 255, 256, 257, 129, 573, 0, - 490, 0, 0, 0, 332, 0, 0, 517, 0, 519, - 0, 0, 522, 0, 0, 0, 0, 0, 0, 527, - 528, 0, 258, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 0, 259, 0, 260, 261, - 262, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 556, 557, 0, 561, 562, 563, 564, 0, - 0, 0, 0, 568, 0, 0, 385, 0, 0, 0, - 0, 333, 334, 0, 574, 0, 0, 0, 0, 0, - 0, 0, 376, 377, 0, 0, 63, 64, 378, 335, - 336, 0, 337, 338, 0, 339, 340, 341, 1, 2, - 0, 3, 4, 5, 379, 380, 381, 0, 0, 0, - 0, 597, 0, 0, 0, 0, 0, 0, 0, 382, - 383, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 332, 0, 616, 617, 0, 384, 0, 0, + 11, 82, 351, 283, 282, 403, 105, 271, 167, 282, + 317, 91, 168, 13, 368, 370, 502, 11, 111, 94, + 111, 484, 485, 313, 273, 321, 322, 323, 324, 325, + 13, 314, 466, 329, 111, 111, 506, 24, 284, 244, + 111, 29, 30, 31, 32, 33, 34, 35, 36, 272, + 37, 468, 109, 502, 631, 144, 144, 165, 111, 111, + -145, 439, 21, 280, 145, 237, 119, 120, 444, 281, + 111, 84, 85, 503, 641, 467, 136, 22, 89, 111, + 109, 355, 25, 357, 90, 241, 136, 330, 439, 356, + 26, 358, 153, 11, 467, 439, 439, 445, 27, 550, + 352, 353, 153, 510, 498, -55, -55, -55, -55, 247, + 248, 249, 250, 28, 234, 235, 443, 112, 238, 112, + 636, 420, 421, 422, 242, 405, 423, 348, 245, 246, + 424, 425, 44, 112, 112, 457, 400, -67, 587, 112, + 534, 418, 347, 593, 594, 38, 39, 40, 277, 169, + 38, 39, 40, 331, 332, 612, 95, 112, 112, -145, + 632, -67, 389, -145, 395, 389, 389, 106, 389, 112, + 586, 532, 58, 315, 316, 277, 318, 46, 112, 47, + 274, 402, -67, 122, 123, 124, 125, 126, 127, 319, + 277, 277, 277, 277, 277, 326, 327, 328, 277, 59, + 458, 634, 635, 389, 637, 638, 136, 566, 60, 567, + 416, 389, 389, 389, 149, 150, 472, 153, 474, 475, + 476, 420, 421, 422, 133, 62, 423, 648, 649, 134, + 424, 425, 91, 2, 64, 65, 4, 107, 67, 68, + 69, 70, 71, 72, 73, 98, 1, 2, 439, 3, + 4, 5, 1, 440, 333, 3, 99, 5, 153, 64, + 65, 50, 51, 52, 600, 86, 53, 87, 100, 396, + 555, 1, 2, 102, 3, 4, 5, 74, 114, 115, + 389, 389, 389, 389, 389, 271, 397, 398, 399, 116, + 389, 117, 539, 103, 521, 434, 435, 436, 437, 438, + 104, 389, 389, 87, 153, 417, 277, 140, 446, 447, + 448, 595, 141, 596, 420, 421, 422, 148, 599, 423, + 596, 334, 335, 424, 425, 146, 166, 272, 230, 232, + 568, 233, 236, 571, 572, 573, 239, 240, 243, 336, + 337, 442, 338, 339, -56, 340, 341, 342, -57, -60, + 452, 389, -59, 389, -58, 251, 389, 619, 111, 275, + 282, 623, 349, 389, 389, 277, 487, 488, 489, 490, + 350, 359, 360, 371, 361, 496, 362, 419, 363, 372, + 373, 277, 473, 277, 277, 277, 75, 76, 391, 480, + 77, 374, 78, 108, 376, 406, 389, 389, 407, 389, + 389, 389, 389, 486, 415, 1, 408, 389, 3, 429, + 5, 409, 410, 411, 430, 431, 432, 433, 389, 613, + 455, 449, 459, 497, 460, 477, 478, 479, 540, 541, + 542, 543, 471, 483, 492, 545, 546, 493, 494, 495, + 333, 633, 392, 393, 499, 394, 501, 500, 507, 508, + 509, 511, 512, 513, 514, 389, 519, 533, 515, 527, + 548, 516, 517, 530, 521, 522, 296, 297, 524, 525, + 526, 576, 577, 578, 579, 547, 531, 535, 389, 389, + 404, 554, 536, 537, 538, 544, 549, 560, 412, 413, + 414, 556, 590, 570, 580, 277, 389, 467, 277, 277, + 277, 582, 581, 597, 560, 583, 551, 334, 335, 584, + 585, 609, 592, 591, 611, 601, 605, 602, 606, 607, + 603, 627, 389, 389, 604, 336, 337, 389, 338, 339, + 389, 340, 341, 342, 622, 624, 389, 625, 626, 389, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 628, -18, -19, 461, 462, 463, + 464, 465, 639, 640, 642, 645, 646, 470, 651, 652, + 621, 654, 222, 223, 608, 224, 131, 588, 481, 482, + 377, 378, 345, 147, 64, 65, 379, 551, 45, 130, + -211, 143, 97, 574, 491, 0, 1, 2, 0, 3, + 4, 5, 380, 381, 382, 0, 354, 0, -69, 1, + 2, 0, 3, 4, 5, 0, 0, 383, 384, 0, + 6, 7, 0, 0, 0, 0, 0, 0, 518, 0, + 520, 333, 0, 523, 0, 0, 385, 0, 0, 0, + 528, 529, 8, 0, 0, 0, 9, 0, 0, 0, + 10, 0, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 255, 256, 257, + 258, 0, 0, 557, 558, 0, 562, 563, 564, 565, + 0, 0, 0, 0, 569, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 575, 259, 203, 615, 616, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 0, + 260, 0, 261, 262, 263, 0, 336, 337, 0, 338, + 339, 0, 340, 341, 342, 0, 0, 0, 0, 0, + 0, 0, 598, 0, 0, 0, 0, 0, 0, 0, + 386, 0, 0, 0, 0, 377, 378, 0, 0, 64, + 65, 379, 0, 0, 0, 617, 618, 0, 0, 0, + 0, 1, 2, 0, 3, 4, 5, 380, 381, 382, + 0, 0, 0, 630, 0, 0, 0, 0, 0, 0, + 0, 0, 383, 384, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 111, 0, 643, + 644, 385, 0, 0, 647, 0, 0, 650, 0, 0, + 0, 0, 0, 653, 0, 0, 655, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 255, 256, 257, 258, 0, 64, 65, 0, + 107, 67, 68, 69, 70, 71, 72, 73, 0, 1, + 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, + 0, 259, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 0, 260, 0, 261, 262, 263, + 74, 0, 0, 0, 0, 0, 0, 377, 378, 0, + 0, 64, 65, 379, 0, 0, 112, -210, 0, 0, + 0, 0, 0, 1, 2, 386, 3, 4, 5, 380, + 381, 382, 0, 0, 0, -69, 1, 2, 0, 3, + 4, 5, 0, 0, 383, 384, 0, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 629, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 254, 255, - 256, 257, 0, 0, 0, 0, 0, 0, 642, 643, - 0, 0, 0, 646, 0, 0, 649, 0, 0, 0, - 0, 0, 652, 0, 0, 654, 0, 258, 202, 614, - 615, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 0, 259, 0, 260, 261, 262, 0, 335, 336, 0, - 337, 338, 0, 339, 340, 341, 376, 377, 0, 0, - 63, 64, 378, 0, 0, -209, 0, 0, 0, 0, - 0, 385, 1, 2, 0, 3, 4, 5, 379, 380, - 381, 295, 296, -69, 1, 2, 0, 3, 4, 5, - 0, 0, 0, 382, 383, 6, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 110, 0, 0, - 0, 384, 0, 0, 0, 0, 8, 0, 0, 0, - 9, 0, 0, 0, 10, 0, 0, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 254, 255, 256, 257, 0, 0, 0, 0, - 0, 0, 0, 0, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 0, 0, - 0, 258, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 0, 259, 0, 260, 261, 262, - 0, 0, 63, 64, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 2, 111, 3, 4, 5, - 251, 0, 0, 0, 0, 385, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 252, 253, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 63, 64, 110, - 106, 66, 67, 68, 69, 70, 71, 72, 0, 1, - 2, 0, 3, 4, 5, 0, 0, 0, 0, 179, + 0, 0, 0, 385, 0, 0, 0, 0, 0, 8, + 0, 0, 0, 9, 0, 0, 0, 10, 0, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 255, 256, 257, 258, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, + 76, 0, 0, 77, 0, 78, 142, 0, 0, 0, + 0, 0, 0, 259, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 0, 260, 0, 261, + 262, 263, 64, 65, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 2, 0, 3, 4, 5, + 252, 0, 0, 0, 0, 0, 0, 386, 0, 0, + 0, 0, 0, 0, 0, 253, 254, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 64, 65, + 111, 107, 156, 157, 158, 159, 160, 161, 73, 0, + 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 254, 255, 256, 257, 0, 73, - 63, 64, 0, 106, 155, 156, 157, 158, 159, 160, - 72, 0, 1, 2, 0, 3, 4, 5, 0, 0, - 0, 0, 0, 258, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 0, 259, 0, 260, - 261, 262, 73, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 111, 0, - 63, 64, -67, 0, 263, 0, 0, 264, 0, 265, - 0, 266, 1, 2, 0, 3, 4, 5, 251, 0, + 190, 191, 192, 193, 194, 255, 256, 257, 258, 0, + 0, 74, 64, 65, 0, 107, 156, 157, 158, 159, + 160, 161, 73, 0, 1, 2, 0, 3, 4, 5, + 0, 0, 0, 0, 259, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 0, 260, 0, + 261, 262, 263, 0, 0, 74, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, + 0, 64, 65, -67, 0, 264, 0, 0, 265, 0, + 266, 0, 267, 1, 2, 0, 3, 4, 5, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 252, 253, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 110, 74, 75, - 0, 0, 76, 0, 77, 141, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 254, 255, 256, 257, 0, 0, 0, 0, - 0, 74, 75, 0, 0, 76, 0, 77, 368, 0, + 0, 0, 0, 0, 253, 254, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, + 75, 76, 0, 0, 77, 0, 78, 369, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 255, 256, 257, 258, 0, 0, + 0, 0, 0, 0, 75, 76, 0, 0, 77, 0, + 78, 441, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 259, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 0, 260, 0, 261, + 262, 263, 0, 0, 0, 0, 0, 0, 0, 0, + 377, 378, 0, 0, 0, 0, 379, 0, 112, 0, + 0, 0, 0, 0, 264, 0, 0, 265, 0, 266, + 0, 267, 380, 381, 382, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 383, 384, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 258, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 0, 259, 0, 260, 261, 262, - 0, 0, 0, 0, 0, 0, 0, 0, 376, 377, - 0, 0, 0, 0, 378, 0, 111, 0, 0, 0, - 0, 0, 263, 0, 0, 264, 0, 265, 0, 266, - 379, 380, 381, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 382, 383, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 385, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 63, 64, 384, 106, 155, 156, 157, 158, 159, - 160, 72, 0, 1, 2, 0, 3, 4, 5, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 254, 255, 256, 257, 0, 0, - 0, 0, 0, 73, 63, 64, 0, 106, 66, 67, - 68, 69, 70, 71, 72, 0, 1, 2, 0, 3, - 4, 5, 0, 258, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 134, 259, 0, 260, - 261, 262, 0, 0, 0, 0, 73, 63, 64, 0, - 150, 66, 67, 68, 69, 70, 71, 72, 0, 1, - 2, 0, 3, 4, 5, 63, 64, 385, 106, 66, - 67, 68, 69, 70, 71, 72, 0, 1, 2, 0, - 3, 4, 5, 0, 0, 0, 0, 0, 0, 73, - 0, 0, 0, 0, 0, 0, 0, 343, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 73, 0, 0, - 0, 0, 74, 75, 0, 0, 76, 0, 77, 440, - 63, 64, 0, 106, 155, 156, 157, 158, 159, 160, - 72, 0, 1, 2, 0, 3, 4, 5, 0, 0, + 0, 0, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 255, 256, 257, + 258, 0, 0, 0, 0, 0, 0, 64, 65, 0, + 107, 67, 68, 69, 70, 71, 72, 73, 0, 1, + 2, 0, 3, 4, 5, 0, 259, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 135, + 260, 0, 261, 262, 263, 0, 0, 0, 64, 65, + 74, 151, 67, 68, 69, 70, 71, 72, 73, 0, + 1, 2, 0, 3, 4, 5, 0, 0, 64, 65, + 386, 107, 67, 68, 69, 70, 71, 72, 73, 0, + 1, 2, 0, 3, 4, 5, 0, 0, 0, 64, + 65, 74, 107, 156, 157, 158, 159, 160, 161, 73, + 344, 1, 2, 0, 3, 4, 5, 0, 0, 64, + 65, 74, 107, 67, 68, 69, 70, 71, 72, 73, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 64, 65, 74, 107, 67, 68, 69, 70, 71, 72, + 73, 451, 1, 2, 0, 3, 4, 5, 0, 0, + 0, 0, 74, 0, 0, 0, 0, 0, 0, 75, + 76, 0, 553, 77, 0, 78, 152, 0, 0, 0, + 0, 64, 65, 74, 66, 67, 68, 69, 70, 71, + 72, 73, 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 74, 75, 0, 0, 76, - 0, 77, 73, 0, 151, 63, 64, 0, 106, 66, - 67, 68, 69, 70, 71, 72, 0, 1, 2, 0, - 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 450, 74, 75, - 0, 0, 76, 0, 77, 0, 0, 73, 0, 0, - 0, 0, 0, 0, 0, 0, 74, 75, 0, 0, - 76, 0, 77, 63, 64, 0, 106, 66, 67, 68, - 69, 70, 71, 72, 0, 1, 2, 0, 3, 4, - 5, 63, 64, 0, 65, 66, 67, 68, 69, 70, - 71, 72, 0, 1, 2, 552, 3, 4, 5, 0, - 0, 0, 0, 0, 0, 73, 0, 0, 0, 0, - 0, 74, 75, 0, 363, 76, 0, 77, 0, 0, - 0, 63, 64, 73, 106, 155, 156, 157, 158, 159, - 160, 72, 0, 1, 2, 0, 3, 4, 5, 0, + 75, 76, 0, 0, 77, 0, 78, 0, 0, 0, + 0, 0, 0, 0, 74, 0, 0, 0, 0, 0, + 75, 76, 0, 0, 77, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 74, 75, 0, 0, - 76, 0, 77, 73, 63, 64, 0, 150, 66, 67, - 68, 69, 70, 71, 72, 0, 1, 2, 0, 3, - 4, 5, 63, 64, 0, 106, 66, 67, 68, 69, - 70, 71, 72, 0, 1, 2, 0, 3, 4, 5, - 0, 0, 0, 0, 0, 0, 73, 0, 0, 0, - 0, 0, 0, 0, 74, 75, 0, 0, 76, 0, - 77, 0, 0, 0, 73, 0, 0, 0, 0, 0, - 0, 0, 74, 75, 0, 0, 76, 0, 77, 63, - 64, 0, 275, 66, 67, 68, 69, 70, 71, 72, - 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 75, 76, 0, 364, 77, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 74, 75, 0, 0, 76, 0, 77, 0, - 0, 73, 63, 64, 0, 106, 155, 156, 157, 158, - 159, 160, 72, 0, 1, 2, 0, 3, 4, 5, + 0, 75, 76, 0, 0, 77, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 74, 75, 0, 0, 76, - 0, 77, 0, 0, 73, 0, 0, 0, 0, 0, - 0, 0, 0, 74, 75, 0, 0, 76, 0, 77, - 63, 64, 0, 106, 66, 67, 68, 69, 70, 71, - 558, 0, 1, 2, 0, 3, 4, 5, 63, 64, - 0, 106, 66, 67, 68, 69, 70, 71, 619, 0, - 1, 2, 170, 3, 4, 5, 0, 0, 0, 0, - 0, 0, 73, 0, 0, 0, 0, 0, 0, 0, - 74, 75, 171, 172, 76, 0, 77, 0, 0, 0, - 73, 0, 0, 0, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 0, - 0, 0, 0, 74, 75, 0, 0, 76, 0, 366, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 198, - 199, 200, 0, 0, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 0, 0, 0, 0, 0, 0, + 0, 0, 75, 76, 0, 0, 77, 0, 78, 64, + 65, 0, 107, 156, 157, 158, 159, 160, 161, 73, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 75, 76, 0, 0, 77, 0, 78, + 64, 65, 74, 151, 67, 68, 69, 70, 71, 72, + 73, 0, 1, 2, 0, 3, 4, 5, 64, 65, + 0, 107, 67, 68, 69, 70, 71, 72, 73, 0, + 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, + 0, 64, 65, 74, 276, 67, 68, 69, 70, 71, + 72, 73, 0, 1, 2, 0, 3, 4, 5, 64, + 65, 74, 107, 156, 157, 158, 159, 160, 161, 73, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 64, 65, 74, 107, 67, 68, 69, 70, + 71, 72, 559, 0, 1, 2, 0, 3, 4, 5, + 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, + 0, 75, 76, 0, 0, 77, 0, 78, 0, 0, + 0, 0, 0, 64, 65, 74, 107, 67, 68, 69, + 70, 71, 72, 620, 0, 1, 2, 0, 3, 4, + 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 75, 76, 0, 0, 77, 0, 78, 0, + 0, 0, 0, 0, 0, 0, 74, 0, 0, 0, + 75, 76, 0, 0, 77, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 74, 75, 0, 0, 76, 0, 77, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, - 75, 0, 0, 76, 0, 77 + 0, 0, 0, 75, 76, 0, 0, 77, 0, 78, + 0, 0, 0, 0, 0, 0, 0, 0, 171, 0, + 0, 75, 76, 0, 0, 77, 0, 367, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, + 173, 0, 0, 0, 75, 76, 0, 0, 77, 0, + 78, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 75, 76, 0, 0, 77, + 0, 78, 0, 0, 0, 0, 199, 200, 201, 0, + 0, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221 }; static const yytype_int16 yycheck[] = { - 0, 27, 175, 0, 315, 11, 4, 127, 11, 200, - 163, 54, 28, 21, 264, 265, 239, 17, 164, 38, - 17, 29, 196, 54, 215, 216, 217, 218, 219, 426, - 427, 54, 223, 155, 54, 451, 11, 176, 153, 54, - 34, 612, 54, 34, 20, 197, 11, 23, 163, 156, - 52, 77, 156, 54, 156, 156, 120, 156, 165, 163, - 156, 632, 53, 165, 165, 67, 165, 163, 42, 43, - 44, 45, 46, 47, 48, 101, 50, 58, 53, 105, - 254, 54, 256, 54, 148, 111, 225, 11, 53, 40, - 41, 117, 92, 17, 240, 241, 47, 155, 46, 156, - 48, 127, 53, 255, 161, 257, 19, 504, 18, 22, - 153, 24, 0, 139, 140, 155, 366, 143, 161, 138, - 139, 140, 153, 149, 143, 54, 156, 155, 147, 148, - 153, 161, 163, 153, 154, 385, 159, 553, 153, 154, - 331, 153, 558, 559, 138, 139, 140, 173, 164, 143, - 32, 33, 153, 147, 148, 161, 157, 165, 161, 155, - 35, 276, 37, 283, 279, 280, 164, 282, 22, 166, - 481, 159, 198, 199, 200, 201, 150, 151, 152, 42, - 153, 44, 153, 156, 157, 156, 157, 21, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 22, 390, - 616, 617, 317, 619, 620, 231, 517, 22, 519, 329, - 325, 326, 327, 116, 117, 406, 242, 408, 409, 410, - 150, 151, 152, 22, 153, 53, 642, 643, 157, 3, - 4, 5, 6, 153, 7, 8, 4, 10, 11, 12, - 13, 14, 15, 16, 17, 4, 19, 20, 37, 22, - 23, 24, 26, 27, 7, 8, 154, 283, 156, 42, - 43, 44, 153, 574, 47, 160, 19, 20, 294, 22, - 23, 24, 3, 4, 5, 6, 49, 113, 114, 394, - 395, 396, 397, 398, 507, 311, 312, 313, 441, 404, - 83, 84, 120, 121, 358, 359, 360, 361, 362, 160, - 415, 416, 157, 329, 330, 331, 4, 371, 372, 373, - 138, 139, 22, 141, 142, 156, 144, 145, 146, 61, - 62, 63, 64, 65, 66, 154, 441, 156, 154, 520, - 156, 154, 523, 524, 525, 4, 138, 139, 140, 153, - 366, 143, 163, 154, 9, 147, 148, 9, 9, 375, - 465, 9, 467, 9, 9, 470, 56, 54, 11, 163, - 154, 153, 477, 478, 390, 429, 430, 431, 432, 153, - 22, 594, 153, 153, 438, 598, 153, 153, 153, 38, - 406, 407, 408, 409, 410, 158, 159, 153, 414, 162, - 153, 164, 165, 4, 156, 510, 511, 38, 513, 514, - 515, 516, 428, 153, 156, 156, 521, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 532, 591, 156, - 156, 156, 156, 153, 153, 153, 60, 491, 492, 493, - 494, 156, 156, 156, 498, 499, 156, 159, 156, 156, - 613, 279, 280, 156, 282, 0, 38, 156, 156, 156, - 156, 163, 156, 156, 569, 156, 482, 22, 154, 17, - 17, 153, 156, 18, 19, 20, 156, 22, 23, 24, - 534, 535, 536, 537, 500, 30, 31, 592, 593, 317, - 506, 156, 156, 4, 156, 156, 512, 325, 326, 327, - 156, 4, 156, 156, 520, 610, 51, 523, 524, 525, - 55, 4, 153, 529, 59, 505, 156, 156, 156, 156, - 156, 22, 53, 156, 156, 579, 156, 581, 582, 163, - 156, 636, 637, 154, 156, 154, 641, 3, 4, 644, - 154, 7, 8, 9, 22, 650, 156, 159, 653, 154, - 161, 154, 154, 19, 20, 154, 22, 23, 24, 25, - 26, 27, 53, 17, 161, 154, 394, 395, 396, 397, - 398, 154, 4, 154, 40, 41, 404, 149, 153, 595, - 153, 22, 156, 17, 17, 156, 17, 415, 416, 72, - 17, 130, 58, 130, 130, 92, 586, 586, 554, 111, - 19, 105, 231, 22, 17, 24, 56, 242, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 89, 529, -1, - 433, -1, -1, -1, 53, -1, -1, 465, -1, 467, - -1, -1, 470, -1, -1, -1, -1, -1, -1, 477, - 478, -1, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, -1, 132, -1, 134, 135, - 136, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 510, 511, -1, 513, 514, 515, 516, -1, - -1, -1, -1, 521, -1, -1, 162, -1, -1, -1, - -1, 120, 121, -1, 532, -1, -1, -1, -1, -1, - -1, -1, 3, 4, -1, -1, 7, 8, 9, 138, - 139, -1, 141, 142, -1, 144, 145, 146, 19, 20, - -1, 22, 23, 24, 25, 26, 27, -1, -1, -1, - -1, 569, -1, -1, -1, -1, -1, -1, -1, 40, - 41, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 53, -1, 592, 593, -1, 58, -1, -1, + 0, 27, 240, 176, 11, 316, 4, 164, 128, 11, + 201, 21, 28, 0, 265, 266, 34, 17, 55, 29, + 55, 427, 428, 197, 165, 216, 217, 218, 219, 220, + 17, 198, 11, 224, 55, 55, 452, 156, 177, 154, + 55, 42, 43, 44, 45, 46, 47, 48, 49, 164, + 51, 11, 78, 34, 613, 157, 157, 121, 55, 55, + 55, 157, 53, 11, 166, 166, 32, 33, 164, 17, + 55, 41, 42, 54, 633, 54, 102, 68, 48, 55, + 106, 255, 59, 257, 54, 149, 112, 226, 157, 256, + 156, 258, 118, 93, 54, 157, 157, 166, 18, 505, + 241, 242, 128, 164, 166, 3, 4, 5, 6, 3, + 4, 5, 6, 156, 140, 141, 367, 154, 144, 154, + 38, 139, 140, 141, 150, 160, 144, 164, 26, 27, + 148, 149, 0, 154, 154, 386, 157, 158, 554, 154, + 155, 332, 162, 559, 560, 151, 152, 153, 174, 165, + 151, 152, 153, 117, 118, 162, 166, 154, 154, 154, + 162, 158, 277, 158, 284, 280, 281, 165, 283, 154, + 155, 482, 156, 199, 200, 201, 202, 46, 154, 48, + 167, 157, 158, 62, 63, 64, 65, 66, 67, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 156, + 391, 617, 618, 318, 620, 621, 232, 518, 160, 520, + 330, 326, 327, 328, 114, 115, 407, 243, 409, 410, + 411, 139, 140, 141, 157, 22, 144, 643, 644, 162, + 148, 149, 21, 20, 7, 8, 23, 10, 11, 12, + 13, 14, 15, 16, 17, 22, 19, 20, 157, 22, + 23, 24, 19, 162, 54, 22, 22, 24, 284, 7, + 8, 42, 43, 44, 575, 35, 47, 37, 22, 295, + 508, 19, 20, 154, 22, 23, 24, 50, 84, 85, + 395, 396, 397, 398, 399, 442, 312, 313, 314, 42, + 405, 44, 155, 4, 157, 359, 360, 361, 362, 363, + 4, 416, 417, 37, 330, 331, 332, 161, 372, 373, + 374, 155, 161, 157, 139, 140, 141, 158, 155, 144, + 157, 121, 122, 148, 149, 154, 4, 442, 22, 157, + 521, 155, 164, 524, 525, 526, 4, 155, 154, 139, + 140, 367, 142, 143, 9, 145, 146, 147, 9, 9, + 376, 466, 9, 468, 9, 9, 471, 595, 55, 57, + 11, 599, 164, 478, 479, 391, 430, 431, 432, 433, + 155, 154, 154, 22, 154, 439, 154, 4, 154, 154, + 154, 407, 408, 409, 410, 411, 159, 160, 157, 415, + 163, 154, 165, 166, 154, 157, 511, 512, 157, 514, + 515, 516, 517, 429, 38, 19, 157, 522, 22, 38, + 24, 157, 157, 157, 154, 154, 154, 154, 533, 592, + 61, 157, 157, 164, 157, 157, 157, 157, 492, 493, + 494, 495, 160, 157, 157, 499, 500, 157, 157, 157, + 54, 614, 280, 281, 157, 283, 38, 157, 157, 155, + 22, 17, 17, 154, 157, 570, 4, 483, 157, 4, + 22, 157, 157, 154, 157, 157, 26, 27, 157, 157, + 157, 535, 536, 537, 538, 501, 157, 157, 593, 594, + 318, 507, 157, 157, 157, 164, 4, 513, 326, 327, + 328, 157, 22, 157, 157, 521, 611, 54, 524, 525, + 526, 157, 155, 162, 530, 157, 506, 121, 122, 155, + 155, 54, 160, 157, 17, 155, 580, 155, 582, 583, + 155, 4, 637, 638, 155, 139, 140, 642, 142, 143, + 645, 145, 146, 147, 162, 155, 651, 155, 155, 654, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 150, 154, 154, 395, 396, 397, + 398, 399, 22, 157, 17, 17, 157, 405, 17, 73, + 596, 17, 131, 131, 587, 131, 93, 555, 416, 417, + 3, 4, 232, 112, 7, 8, 9, 587, 17, 90, + 0, 106, 57, 530, 434, -1, 19, 20, -1, 22, + 23, 24, 25, 26, 27, -1, 243, -1, 18, 19, + 20, -1, 22, 23, 24, -1, -1, 40, 41, -1, + 30, 31, -1, -1, -1, -1, -1, -1, 466, -1, + 468, 54, -1, 471, -1, -1, 59, -1, -1, -1, + 478, 479, 52, -1, -1, -1, 56, -1, -1, -1, + 60, -1, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, -1, -1, 511, 512, -1, 514, 515, 516, 517, + -1, -1, -1, -1, 522, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 533, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, -1, + 133, -1, 135, 136, 137, -1, 139, 140, -1, 142, + 143, -1, 145, 146, 147, -1, -1, -1, -1, -1, + -1, -1, 570, -1, -1, -1, -1, -1, -1, -1, + 163, -1, -1, -1, -1, 3, 4, -1, -1, 7, + 8, 9, -1, -1, -1, 593, 594, -1, -1, -1, + -1, 19, 20, -1, 22, 23, 24, 25, 26, 27, + -1, -1, -1, 611, -1, -1, -1, -1, -1, -1, + -1, -1, 40, 41, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 55, -1, 637, + 638, 59, -1, -1, 642, -1, -1, 645, -1, -1, + -1, -1, -1, 651, -1, -1, 654, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, -1, 7, 8, -1, + 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, + 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, + -1, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, -1, 133, -1, 135, 136, 137, + 50, -1, -1, -1, -1, -1, -1, 3, 4, -1, + -1, 7, 8, 9, -1, -1, 154, 0, -1, -1, + -1, -1, -1, 19, 20, 163, 22, 23, 24, 25, + 26, 27, -1, -1, -1, 18, 19, 20, -1, 22, + 23, 24, -1, -1, 40, 41, -1, 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 610, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, -1, -1, -1, -1, -1, -1, 636, 637, - -1, -1, -1, 641, -1, -1, 644, -1, -1, -1, - -1, -1, 650, -1, -1, 653, -1, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - -1, 132, -1, 134, 135, 136, -1, 138, 139, -1, - 141, 142, -1, 144, 145, 146, 3, 4, -1, -1, - 7, 8, 9, -1, -1, 0, -1, -1, -1, -1, - -1, 162, 19, 20, -1, 22, 23, 24, 25, 26, - 27, 26, 27, 18, 19, 20, -1, 22, 23, 24, - -1, -1, -1, 40, 41, 30, 31, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 54, -1, -1, - -1, 58, -1, -1, -1, -1, 51, -1, -1, -1, - 55, -1, -1, -1, 59, -1, -1, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, -1, -1, -1, -1, - -1, -1, -1, -1, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, -1, -1, - -1, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, -1, 132, -1, 134, 135, 136, - -1, -1, 7, 8, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 19, 20, 153, 22, 23, 24, - 25, -1, -1, -1, -1, 162, -1, -1, -1, -1, + -1, -1, -1, 59, -1, -1, -1, -1, -1, 52, + -1, -1, -1, 56, -1, -1, -1, 60, -1, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 159, + 160, -1, -1, 163, -1, 165, 166, -1, -1, -1, + -1, -1, -1, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, -1, 133, -1, 135, + 136, 137, 7, 8, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 19, 20, -1, 22, 23, 24, + 25, -1, -1, -1, -1, -1, -1, 163, -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 7, 8, 54, - 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, - 20, -1, 22, 23, 24, -1, -1, -1, -1, 74, + -1, -1, -1, -1, -1, -1, -1, -1, 7, 8, + 55, 10, 11, 12, 13, 14, 15, 16, 17, -1, + 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, -1, 49, - 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, - 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, - -1, -1, -1, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, -1, 132, -1, 134, - 135, 136, 49, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 153, -1, - 7, 8, 157, -1, 159, -1, -1, 162, -1, 164, - -1, 166, 19, 20, -1, 22, 23, 24, 25, -1, + 85, 86, 87, 88, 89, 90, 91, 92, 93, -1, + -1, 50, 7, 8, -1, 10, 11, 12, 13, 14, + 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, + -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, -1, 133, -1, + 135, 136, 137, -1, -1, 50, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 154, + -1, 7, 8, 158, -1, 160, -1, -1, 163, -1, + 165, -1, 167, 19, 20, -1, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 40, 41, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 54, 158, 159, - -1, -1, 162, -1, 164, 165, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, -1, -1, -1, -1, - -1, 158, 159, -1, -1, 162, -1, 164, 165, -1, + -1, -1, -1, -1, 40, 41, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 55, + 159, 160, -1, -1, 163, -1, 165, 166, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, -1, -1, + -1, -1, -1, -1, 159, 160, -1, -1, 163, -1, + 165, 166, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, -1, 133, -1, 135, + 136, 137, -1, -1, -1, -1, -1, -1, -1, -1, + 3, 4, -1, -1, -1, -1, 9, -1, 154, -1, + -1, -1, -1, -1, 160, -1, -1, 163, -1, 165, + -1, 167, 25, 26, 27, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, -1, 132, -1, 134, 135, 136, - -1, -1, -1, -1, -1, -1, -1, -1, 3, 4, - -1, -1, -1, -1, 9, -1, 153, -1, -1, -1, - -1, -1, 159, -1, -1, 162, -1, 164, -1, 166, - 25, 26, 27, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 7, 8, 58, 10, 11, 12, 13, 14, 15, - 16, 17, -1, 19, 20, -1, 22, 23, 24, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, -1, -1, - -1, -1, -1, 49, 7, 8, -1, 10, 11, 12, - 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, - 23, 24, -1, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 39, 132, -1, 134, - 135, 136, -1, -1, -1, -1, 49, 7, 8, -1, + -1, -1, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, -1, -1, -1, -1, -1, -1, 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, - 20, -1, 22, 23, 24, 7, 8, 162, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, -1, -1, -1, -1, -1, -1, 49, - -1, -1, -1, -1, -1, -1, -1, 39, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 49, -1, -1, - -1, -1, 158, 159, -1, -1, 162, -1, 164, 165, - 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, - 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 158, 159, -1, -1, 162, - -1, 164, 49, -1, 124, 7, 8, -1, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 39, 158, 159, - -1, -1, 162, -1, 164, -1, -1, 49, -1, -1, - -1, -1, -1, -1, -1, -1, 158, 159, -1, -1, - 162, -1, 164, 7, 8, -1, 10, 11, 12, 13, - 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, - 24, 7, 8, -1, 10, 11, 12, 13, 14, 15, - 16, 17, -1, 19, 20, 39, 22, 23, 24, -1, - -1, -1, -1, -1, -1, 49, -1, -1, -1, -1, - -1, 158, 159, -1, 161, 162, -1, 164, -1, -1, - -1, 7, 8, 49, 10, 11, 12, 13, 14, 15, + 20, -1, 22, 23, 24, -1, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 39, + 133, -1, 135, 136, 137, -1, -1, -1, 7, 8, + 50, 10, 11, 12, 13, 14, 15, 16, 17, -1, + 19, 20, -1, 22, 23, 24, -1, -1, 7, 8, + 163, 10, 11, 12, 13, 14, 15, 16, 17, -1, + 19, 20, -1, 22, 23, 24, -1, -1, -1, 7, + 8, 50, 10, 11, 12, 13, 14, 15, 16, 17, + 39, 19, 20, -1, 22, 23, 24, -1, -1, 7, + 8, 50, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + 7, 8, 50, 10, 11, 12, 13, 14, 15, 16, + 17, 39, 19, 20, -1, 22, 23, 24, -1, -1, + -1, -1, 50, -1, -1, -1, -1, -1, -1, 159, + 160, -1, 39, 163, -1, 165, 125, -1, -1, -1, + -1, 7, 8, 50, 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 158, 159, -1, -1, - 162, -1, 164, 49, 7, 8, -1, 10, 11, 12, - 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, - 23, 24, 7, 8, -1, 10, 11, 12, 13, 14, - 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, - -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, - -1, -1, -1, -1, 158, 159, -1, -1, 162, -1, - 164, -1, -1, -1, 49, -1, -1, -1, -1, -1, - -1, -1, 158, 159, -1, -1, 162, -1, 164, 7, + 159, 160, -1, -1, 163, -1, 165, -1, -1, -1, + -1, -1, -1, -1, 50, -1, -1, -1, -1, -1, + 159, 160, -1, -1, 163, -1, 165, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 159, 160, -1, 162, 163, -1, 165, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 159, 160, -1, -1, 163, -1, 165, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 159, 160, -1, -1, 163, -1, 165, 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 158, 159, -1, -1, 162, -1, 164, -1, - -1, 49, 7, 8, -1, 10, 11, 12, 13, 14, - 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 158, 159, -1, -1, 162, - -1, 164, -1, -1, 49, -1, -1, -1, -1, -1, - -1, -1, -1, 158, 159, -1, -1, 162, -1, 164, - 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, + -1, -1, -1, 159, 160, -1, -1, 163, -1, 165, + 7, 8, 50, 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, - 19, 20, 36, 22, 23, 24, -1, -1, -1, -1, - -1, -1, 49, -1, -1, -1, -1, -1, -1, -1, - 158, 159, 56, 57, 162, -1, 164, -1, -1, -1, - 49, -1, -1, -1, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, - -1, -1, -1, 158, 159, -1, -1, 162, -1, 164, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 113, - 114, 115, -1, -1, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, -1, -1, -1, -1, -1, -1, + 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, + -1, 7, 8, 50, 10, 11, 12, 13, 14, 15, + 16, 17, -1, 19, 20, -1, 22, 23, 24, 7, + 8, 50, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, 7, 8, 50, 10, 11, 12, 13, 14, + 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, + -1, -1, 50, -1, -1, -1, -1, -1, -1, -1, + -1, 159, 160, -1, -1, 163, -1, 165, -1, -1, + -1, -1, -1, 7, 8, 50, 10, 11, 12, 13, + 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, + 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 159, 160, -1, -1, 163, -1, 165, -1, + -1, -1, -1, -1, -1, -1, 50, -1, -1, -1, + 159, 160, -1, -1, 163, -1, 165, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 158, 159, -1, -1, 162, -1, 164, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 158, - 159, -1, -1, 162, -1, 164 + -1, -1, -1, 159, 160, -1, -1, 163, -1, 165, + -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, + -1, 159, 160, -1, -1, 163, -1, 165, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 57, + 58, -1, -1, -1, 159, 160, -1, -1, 163, -1, + 165, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 159, 160, -1, -1, 163, + -1, 165, -1, -1, -1, -1, 114, 115, 116, -1, + -1, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 19, 20, 22, 23, 24, 30, 31, 51, 55, - 59, 175, 178, 179, 180, 181, 213, 214, 215, 217, - 216, 52, 67, 222, 155, 58, 155, 18, 155, 42, - 43, 44, 45, 46, 47, 48, 50, 150, 151, 152, - 182, 183, 184, 0, 215, 46, 48, 185, 232, 42, - 43, 44, 47, 186, 229, 231, 239, 155, 155, 159, - 223, 22, 221, 7, 8, 10, 11, 12, 13, 14, - 15, 16, 17, 49, 158, 159, 162, 164, 175, 179, - 200, 201, 235, 184, 184, 35, 37, 211, 184, 184, - 21, 240, 241, 29, 165, 230, 240, 22, 22, 22, - 224, 153, 4, 4, 4, 164, 10, 165, 201, 206, - 54, 153, 177, 211, 211, 42, 44, 187, 32, 33, - 210, 61, 62, 63, 64, 65, 66, 188, 227, 227, - 178, 244, 156, 161, 39, 201, 202, 204, 205, 160, - 160, 165, 206, 156, 165, 153, 205, 157, 210, 210, - 10, 124, 201, 203, 212, 11, 12, 13, 14, 15, - 16, 173, 174, 201, 207, 4, 203, 28, 164, 228, - 36, 56, 57, 68, 69, 70, 71, 72, 73, 74, + 0, 19, 20, 22, 23, 24, 30, 31, 52, 56, + 60, 176, 179, 180, 181, 182, 214, 215, 216, 218, + 217, 53, 68, 223, 156, 59, 156, 18, 156, 42, + 43, 44, 45, 46, 47, 48, 49, 51, 151, 152, + 153, 183, 184, 185, 0, 216, 46, 48, 186, 233, + 42, 43, 44, 47, 187, 230, 232, 240, 156, 156, + 160, 224, 22, 222, 7, 8, 10, 11, 12, 13, + 14, 15, 16, 17, 50, 159, 160, 163, 165, 176, + 180, 201, 202, 236, 185, 185, 35, 37, 212, 185, + 185, 21, 241, 242, 29, 166, 231, 241, 22, 22, + 22, 225, 154, 4, 4, 4, 165, 10, 166, 202, + 207, 55, 154, 178, 212, 212, 42, 44, 188, 32, + 33, 211, 62, 63, 64, 65, 66, 67, 189, 228, + 228, 179, 245, 157, 162, 39, 202, 203, 205, 206, + 161, 161, 166, 207, 157, 166, 154, 206, 158, 211, + 211, 10, 125, 202, 204, 213, 11, 12, 13, 14, + 15, 16, 174, 175, 202, 208, 4, 204, 28, 165, + 229, 36, 57, 58, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 113, 114, - 115, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 114, + 115, 116, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 168, 169, 170, 242, 248, 249, 250, 251, 22, - 190, 156, 154, 201, 201, 163, 165, 201, 4, 154, - 207, 201, 153, 235, 26, 27, 3, 4, 5, 6, - 9, 25, 40, 41, 89, 90, 91, 92, 118, 132, - 134, 135, 136, 159, 162, 164, 166, 168, 169, 170, - 208, 235, 177, 179, 56, 10, 201, 237, 238, 11, - 17, 11, 173, 188, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 171, 26, 27, 99, 100, 101, + 137, 138, 169, 170, 171, 243, 249, 250, 251, 252, + 22, 191, 157, 155, 202, 202, 164, 166, 202, 4, + 155, 208, 202, 154, 236, 26, 27, 3, 4, 5, + 6, 9, 25, 40, 41, 90, 91, 92, 93, 119, + 133, 135, 136, 137, 160, 163, 165, 167, 169, 170, + 171, 209, 236, 178, 180, 57, 10, 202, 238, 239, + 11, 17, 11, 174, 189, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 172, 26, 27, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 172, 171, 172, 201, 201, 237, 201, 201, 245, - 237, 237, 237, 237, 237, 201, 201, 201, 237, 188, - 116, 117, 53, 120, 121, 138, 139, 141, 142, 144, - 145, 146, 189, 39, 202, 192, 161, 163, 163, 154, - 192, 177, 177, 212, 171, 172, 171, 172, 153, 153, - 153, 153, 153, 161, 207, 209, 164, 209, 165, 209, - 22, 153, 153, 153, 218, 153, 3, 4, 9, 25, - 26, 27, 40, 41, 58, 162, 208, 234, 235, 236, - 156, 236, 236, 236, 203, 201, 201, 201, 201, 156, - 195, 156, 195, 236, 159, 156, 156, 156, 156, 156, - 156, 236, 236, 236, 38, 203, 201, 237, 4, 138, - 139, 140, 143, 147, 148, 191, 219, 220, 38, 153, - 153, 153, 153, 207, 207, 207, 207, 207, 156, 161, - 165, 201, 209, 163, 165, 207, 207, 207, 156, 198, - 39, 201, 225, 226, 60, 233, 209, 237, 156, 156, - 236, 236, 236, 236, 236, 11, 53, 11, 247, 236, - 159, 237, 201, 237, 237, 237, 156, 156, 156, 201, - 236, 236, 156, 198, 198, 201, 207, 207, 207, 207, - 247, 156, 156, 156, 156, 207, 163, 165, 156, 156, - 38, 34, 53, 196, 199, 190, 156, 154, 22, 163, - 17, 17, 153, 156, 156, 156, 156, 236, 4, 236, - 156, 156, 236, 156, 156, 156, 4, 236, 236, 153, - 156, 195, 201, 154, 156, 156, 156, 156, 154, 207, - 207, 207, 207, 163, 207, 207, 201, 22, 4, 198, - 175, 176, 39, 201, 192, 156, 236, 236, 17, 201, - 246, 236, 236, 236, 236, 195, 195, 237, 236, 156, - 237, 237, 237, 246, 236, 207, 207, 207, 207, 156, - 154, 156, 156, 154, 154, 154, 190, 196, 197, 22, - 156, 159, 190, 190, 154, 156, 161, 236, 154, 195, - 154, 154, 154, 154, 207, 207, 207, 176, 53, 194, - 17, 161, 173, 243, 120, 121, 236, 236, 192, 17, - 201, 161, 192, 154, 154, 154, 4, 149, 193, 236, - 234, 161, 173, 190, 190, 38, 190, 190, 22, 156, - 234, 17, 236, 236, 17, 156, 236, 190, 190, 236, - 17, 72, 236, 17, 236 + 112, 113, 173, 172, 173, 202, 202, 238, 202, 202, + 246, 238, 238, 238, 238, 238, 202, 202, 202, 238, + 189, 117, 118, 54, 121, 122, 139, 140, 142, 143, + 145, 146, 147, 190, 39, 203, 193, 162, 164, 164, + 155, 193, 178, 178, 213, 172, 173, 172, 173, 154, + 154, 154, 154, 154, 162, 208, 210, 165, 210, 166, + 210, 22, 154, 154, 154, 219, 154, 3, 4, 9, + 25, 26, 27, 40, 41, 59, 163, 209, 235, 236, + 237, 157, 237, 237, 237, 204, 202, 202, 202, 202, + 157, 196, 157, 196, 237, 160, 157, 157, 157, 157, + 157, 157, 237, 237, 237, 38, 204, 202, 238, 4, + 139, 140, 141, 144, 148, 149, 192, 220, 221, 38, + 154, 154, 154, 154, 208, 208, 208, 208, 208, 157, + 162, 166, 202, 210, 164, 166, 208, 208, 208, 157, + 199, 39, 202, 226, 227, 61, 234, 210, 238, 157, + 157, 237, 237, 237, 237, 237, 11, 54, 11, 248, + 237, 160, 238, 202, 238, 238, 238, 157, 157, 157, + 202, 237, 237, 157, 199, 199, 202, 208, 208, 208, + 208, 248, 157, 157, 157, 157, 208, 164, 166, 157, + 157, 38, 34, 54, 197, 200, 191, 157, 155, 22, + 164, 17, 17, 154, 157, 157, 157, 157, 237, 4, + 237, 157, 157, 237, 157, 157, 157, 4, 237, 237, + 154, 157, 196, 202, 155, 157, 157, 157, 157, 155, + 208, 208, 208, 208, 164, 208, 208, 202, 22, 4, + 199, 176, 177, 39, 202, 193, 157, 237, 237, 17, + 202, 247, 237, 237, 237, 237, 196, 196, 238, 237, + 157, 238, 238, 238, 247, 237, 208, 208, 208, 208, + 157, 155, 157, 157, 155, 155, 155, 191, 197, 198, + 22, 157, 160, 191, 191, 155, 157, 162, 237, 155, + 196, 155, 155, 155, 155, 208, 208, 208, 177, 54, + 195, 17, 162, 174, 244, 121, 122, 237, 237, 193, + 17, 202, 162, 193, 155, 155, 155, 4, 150, 194, + 237, 235, 162, 174, 191, 191, 38, 191, 191, 22, + 157, 235, 17, 237, 237, 17, 157, 237, 191, 191, + 237, 17, 73, 237, 17, 237 }; #define yyerrok (yyerrstatus = 0) @@ -3499,152 +3503,152 @@ switch (yyn) { case 29: -#line 1117 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1117 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} break; case 30: -#line 1117 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1117 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} break; case 31: -#line 1118 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1118 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} break; case 32: -#line 1118 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1118 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} break; case 33: -#line 1119 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1119 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} break; case 34: -#line 1119 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1119 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} break; case 35: -#line 1120 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1120 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} break; case 36: -#line 1120 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1120 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} break; case 37: -#line 1121 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1121 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} break; case 38: -#line 1121 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1121 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} break; case 39: -#line 1125 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1125 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} break; case 40: -#line 1125 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1125 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} break; case 41: -#line 1126 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1126 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} break; case 42: -#line 1126 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1126 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} break; case 43: -#line 1127 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1127 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} break; case 44: -#line 1127 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1127 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} break; case 45: -#line 1128 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1128 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} break; case 46: -#line 1128 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1128 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} break; case 47: -#line 1129 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1129 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} break; case 48: -#line 1129 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1129 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} break; case 49: -#line 1130 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1130 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} break; case 50: -#line 1130 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1130 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} break; case 51: -#line 1131 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1131 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} break; case 52: -#line 1131 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1131 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} break; case 53: -#line 1132 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1132 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} break; case 54: -#line 1133 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1133 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} break; case 65: -#line 1142 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1142 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 66: -#line 1144 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1144 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;} break; case 67: -#line 1145 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1145 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=0; ;} break; case 68: -#line 1149 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3652,7 +3656,7 @@ break; case 69: -#line 1153 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1153 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3660,7 +3664,7 @@ break; case 73: -#line 1161 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1161 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3668,7 +3672,7 @@ break; case 74: -#line 1166 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1166 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3676,152 +3680,157 @@ break; case 75: -#line 1172 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1172 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 76: -#line 1173 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1173 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 77: -#line 1174 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1174 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 78: -#line 1175 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1175 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 79: -#line 1176 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1176 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 80: -#line 1180 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} +#line 1177 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::CommonLinkage; ;} break; case 81: -#line 1181 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} +#line 1181 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 82: -#line 1182 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} +#line 1182 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 83: -#line 1186 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} +#line 1183 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 84: -#line 1187 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1187 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 85: -#line 1188 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} +#line 1188 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 86: -#line 1189 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} +#line 1189 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} break; case 87: -#line 1193 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} +#line 1190 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} break; case 88: -#line 1194 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} +#line 1194 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 89: -#line 1195 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} +#line 1195 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 90: -#line 1199 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} +#line 1196 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 91: -#line 1200 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} +#line 1200 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 92: -#line 1201 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} +#line 1201 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 93: -#line 1202 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} +#line 1202 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 94: -#line 1203 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} +#line 1203 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 95: -#line 1207 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} +#line 1204 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 96: -#line 1208 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} +#line 1208 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 97: -#line 1209 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} +#line 1209 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 98: -#line 1212 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::C; ;} +#line 1210 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 99: -#line 1213 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1213 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 100: -#line 1214 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::Fast; ;} +#line 1214 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::C; ;} break; case 101: -#line 1215 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::Cold; ;} +#line 1215 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 102: -#line 1216 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} +#line 1216 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 103: -#line 1217 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} +#line 1217 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; case 104: -#line 1218 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1218 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} + break; + + case 105: +#line 1219 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) GEN_ERROR("Calling conv too large"); @@ -3830,130 +3839,130 @@ ;} break; - case 105: -#line 1225 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} - break; - case 106: -#line 1226 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1226 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 107: -#line 1227 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::SExt; ;} +#line 1227 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 108: -#line 1228 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1228 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 109: -#line 1229 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::InReg; ;} +#line 1229 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 110: -#line 1230 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} +#line 1230 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::InReg; ;} break; case 111: -#line 1231 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;} +#line 1231 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} break; case 112: -#line 1232 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::ByVal; ;} +#line 1232 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;} break; case 113: -#line 1233 "/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::Nest; ;} +#line 1233 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::ByVal; ;} break; case 114: -#line 1234 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1234 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::Nest; ;} + break; + + case 115: +#line 1235 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;} break; - case 115: -#line 1238 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 116: +#line 1239 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; - case 116: -#line 1239 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 117: +#line 1240 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); ;} break; - case 117: -#line 1244 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 118: +#line 1245 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} break; - case 118: -#line 1245 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 119: +#line 1246 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} break; - case 119: -#line 1246 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 120: +#line 1247 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; - case 120: -#line 1247 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 121: +#line 1248 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; - case 121: -#line 1248 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 122: +#line 1249 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;} break; - case 122: -#line 1249 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 123: +#line 1250 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;} break; - case 123: -#line 1252 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 124: +#line 1253 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; - case 124: -#line 1253 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 125: +#line 1254 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); ;} break; - case 125: -#line 1258 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 126: +#line 1259 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; - case 126: -#line 1259 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 127: +#line 1260 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); ;} break; - case 127: -#line 1266 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 128: +#line 1267 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; - case 128: -#line 1267 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 129: +#line 1268 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3962,13 +3971,13 @@ ;} break; - case 129: -#line 1273 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 130: +#line 1274 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; - case 130: -#line 1274 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 131: +#line 1275 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3977,8 +3986,8 @@ ;} break; - case 131: -#line 1283 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 132: +#line 1284 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i) if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\') @@ -3988,28 +3997,28 @@ ;} break; - case 132: -#line 1291 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 133: +#line 1292 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; - case 133: -#line 1292 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 134: +#line 1293 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} break; - case 134: -#line 1297 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 135: +#line 1298 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; - case 135: -#line 1298 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 136: +#line 1299 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; - case 136: -#line 1299 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 137: +#line 1300 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV->setSection(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -4017,8 +4026,8 @@ ;} break; - case 137: -#line 1304 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 138: +#line 1305 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Alignment must be a power of two"); @@ -4027,24 +4036,24 @@ ;} break; - case 145: -#line 1320 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 146: +#line 1321 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR ;} break; - case 146: -#line 1324 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 147: +#line 1325 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); CHECK_FOR_ERROR ;} break; - case 147: -#line 1328 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 148: +#line 1329 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Pointer type? if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); @@ -4054,8 +4063,8 @@ ;} break; - case 148: -#line 1335 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 149: +#line 1336 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); CHECK_FOR_ERROR @@ -4063,8 +4072,8 @@ ;} break; - case 149: -#line 1340 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 150: +#line 1341 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Type UpReference if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder @@ -4075,8 +4084,8 @@ ;} break; - case 150: -#line 1348 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 151: +#line 1349 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4108,8 +4117,8 @@ ;} break; - case 151: -#line 1377 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 152: +#line 1378 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4136,8 +4145,8 @@ ;} break; - case 152: -#line 1402 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 153: +#line 1403 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Sized array type? (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); delete (yyvsp[(4) - (5)].TypeVal); @@ -4145,8 +4154,8 @@ ;} break; - case 153: -#line 1407 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 154: +#line 1408 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Vector type? const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) @@ -4159,8 +4168,8 @@ ;} break; - case 154: -#line 1417 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 155: +#line 1418 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), @@ -4173,16 +4182,16 @@ ;} break; - case 155: -#line 1427 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 156: +#line 1428 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR ;} break; - case 156: -#line 1431 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 157: +#line 1432 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements; for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), @@ -4195,16 +4204,16 @@ ;} break; - case 157: -#line 1441 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 158: +#line 1442 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); CHECK_FOR_ERROR ;} break; - case 158: -#line 1448 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 159: +#line 1449 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4213,8 +4222,8 @@ ;} break; - case 159: -#line 1457 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 160: +#line 1458 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); @@ -4224,15 +4233,15 @@ ;} break; - case 160: -#line 1464 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 161: +#line 1465 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); ;} break; - case 161: -#line 1469 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 162: +#line 1470 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); @@ -4240,16 +4249,16 @@ ;} break; - case 162: -#line 1474 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 163: +#line 1475 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); CHECK_FOR_ERROR ;} break; - case 164: -#line 1482 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 165: +#line 1483 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -4259,8 +4268,8 @@ ;} break; - case 165: -#line 1489 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 166: +#line 1490 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -4270,16 +4279,16 @@ ;} break; - case 166: -#line 1496 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 167: +#line 1497 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR ;} break; - case 167: -#line 1504 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 168: +#line 1505 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); @@ -4288,8 +4297,8 @@ ;} break; - case 168: -#line 1510 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 169: +#line 1511 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); delete (yyvsp[(3) - (3)].TypeVal); @@ -4297,8 +4306,8 @@ ;} break; - case 169: -#line 1522 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 170: +#line 1523 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4329,8 +4338,8 @@ ;} break; - case 170: -#line 1550 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 171: +#line 1551 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4349,8 +4358,8 @@ ;} break; - case 171: -#line 1566 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 172: +#line 1567 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4380,8 +4389,8 @@ ;} break; - case 172: -#line 1593 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 173: +#line 1594 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4412,8 +4421,8 @@ ;} break; - case 173: -#line 1621 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 174: +#line 1622 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (STy == 0) @@ -4442,8 +4451,8 @@ ;} break; - case 174: -#line 1647 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 175: +#line 1648 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4466,8 +4475,8 @@ ;} break; - case 175: -#line 1667 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 176: +#line 1668 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); if (STy == 0) @@ -4496,8 +4505,8 @@ ;} break; - case 176: -#line 1693 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 177: +#line 1694 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); @@ -4520,8 +4529,8 @@ ;} break; - case 177: -#line 1713 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 178: +#line 1714 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4536,8 +4545,8 @@ ;} break; - case 178: -#line 1725 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 179: +#line 1726 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4547,8 +4556,8 @@ ;} break; - case 179: -#line 1732 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 180: +#line 1733 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4617,8 +4626,8 @@ ;} break; - case 180: -#line 1798 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 181: +#line 1799 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4631,8 +4640,8 @@ ;} break; - case 181: -#line 1808 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 182: +#line 1809 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4645,8 +4654,8 @@ ;} break; - case 182: -#line 1818 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 183: +#line 1819 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4655,8 +4664,8 @@ ;} break; - case 183: -#line 1824 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 184: +#line 1825 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4669,8 +4678,8 @@ ;} break; - case 184: -#line 1834 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 185: +#line 1835 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4679,8 +4688,8 @@ ;} break; - case 185: -#line 1840 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 186: +#line 1841 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4693,8 +4702,8 @@ ;} break; - case 186: -#line 1850 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 187: +#line 1851 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); (yyval.ConstVal) = ConstantInt::getTrue(); @@ -4702,8 +4711,8 @@ ;} break; - case 187: -#line 1855 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 188: +#line 1856 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); (yyval.ConstVal) = ConstantInt::getFalse(); @@ -4711,8 +4720,8 @@ ;} break; - case 188: -#line 1860 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 189: +#line 1861 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Floating point constants if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal))) GEN_ERROR("Floating point constant invalid for type"); @@ -4726,8 +4735,8 @@ ;} break; - case 189: -#line 1873 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 190: +#line 1874 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); @@ -4742,8 +4751,8 @@ ;} break; - case 190: -#line 1885 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 191: +#line 1886 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); @@ -4768,8 +4777,8 @@ ;} break; - case 191: -#line 1907 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 192: +#line 1908 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); @@ -4780,8 +4789,8 @@ ;} break; - case 192: -#line 1915 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 193: +#line 1916 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Binary operator types must match"); @@ -4790,8 +4799,8 @@ ;} break; - case 193: -#line 1921 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 194: +#line 1922 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Logical operator types must match"); @@ -4805,8 +4814,8 @@ ;} break; - case 194: -#line 1932 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 195: +#line 1933 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("icmp operand types must match"); @@ -4814,8 +4823,8 @@ ;} break; - case 195: -#line 1937 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 196: +#line 1938 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match"); @@ -4823,8 +4832,8 @@ ;} break; - case 196: -#line 1942 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 197: +#line 1943 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vicmp operand types must match"); @@ -4832,8 +4841,8 @@ ;} break; - case 197: -#line 1947 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 198: +#line 1948 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vfcmp operand types must match"); @@ -4841,8 +4850,8 @@ ;} break; - case 198: -#line 1952 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 199: +#line 1953 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) GEN_ERROR("Invalid extractelement operands"); @@ -4851,8 +4860,8 @@ ;} break; - case 199: -#line 1958 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 200: +#line 1959 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid insertelement operands"); @@ -4861,8 +4870,8 @@ ;} break; - case 200: -#line 1964 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 201: +#line 1965 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -4871,16 +4880,16 @@ ;} break; - case 201: -#line 1973 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 202: +#line 1974 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); CHECK_FOR_ERROR ;} break; - case 202: -#line 1977 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 203: +#line 1978 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); @@ -4888,28 +4897,28 @@ ;} break; - case 203: -#line 1985 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 204: +#line 1986 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; - case 204: -#line 1985 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 205: +#line 1986 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; - case 205: -#line 1988 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 206: +#line 1989 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; - case 206: -#line 1988 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 207: +#line 1989 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; - case 207: -#line 1991 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 208: +#line 1992 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); @@ -4924,8 +4933,8 @@ ;} break; - case 208: -#line 2003 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 209: +#line 2004 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { Constant *Val = (yyvsp[(3) - (6)].ConstVal); const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); @@ -4940,8 +4949,8 @@ ;} break; - case 209: -#line 2024 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 210: +#line 2025 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -4949,8 +4958,8 @@ ;} break; - case 210: -#line 2029 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 211: +#line 2030 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -4958,40 +4967,40 @@ ;} break; - case 213: -#line 2042 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 214: +#line 2043 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = false; ;} break; - case 214: -#line 2042 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 215: +#line 2043 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.FunctionDone(); CHECK_FOR_ERROR ;} break; - case 215: -#line 2046 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 216: +#line 2047 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; - case 216: -#line 2046 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 217: +#line 2047 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 217: -#line 2049 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 218: +#line 2050 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 218: -#line 2052 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 219: +#line 2053 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); @@ -5018,8 +5027,8 @@ ;} break; - case 219: -#line 2076 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 220: +#line 2077 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); @@ -5033,8 +5042,8 @@ ;} break; - case 220: -#line 2088 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 221: +#line 2089 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { /* "Externally Visible" Linkage */ if ((yyvsp[(5) - (6)].ConstVal) == 0) @@ -5045,15 +5054,15 @@ ;} break; - case 221: -#line 2095 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 222: +#line 2096 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; - case 222: -#line 2099 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 223: +#line 2100 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(6) - (7)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); @@ -5062,15 +5071,15 @@ ;} break; - case 223: -#line 2104 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 224: +#line 2105 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; - case 224: -#line 2108 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 225: +#line 2109 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription()); @@ -5080,16 +5089,16 @@ ;} break; - case 225: -#line 2114 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 226: +#line 2115 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR ;} break; - case 226: -#line 2118 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 227: +#line 2119 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { std::string Name; if ((yyvsp[(1) - (5)].StrVal)) { @@ -5132,22 +5141,22 @@ ;} break; - case 227: -#line 2158 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 228: +#line 2159 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 228: -#line 2161 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 229: +#line 2162 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 229: -#line 2167 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 230: +#line 2168 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); if (AsmSoFar.empty()) @@ -5159,24 +5168,24 @@ ;} break; - case 230: -#line 2177 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 231: +#line 2178 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); ;} break; - case 231: -#line 2181 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 232: +#line 2182 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); ;} break; - case 233: -#line 2188 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 234: +#line 2189 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5184,8 +5193,8 @@ ;} break; - case 234: -#line 2193 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 235: +#line 2194 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5193,15 +5202,15 @@ ;} break; - case 235: -#line 2198 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 236: +#line 2199 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 236: -#line 2207 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 237: +#line 2208 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -5214,8 +5223,8 @@ ;} break; - case 237: -#line 2217 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 238: +#line 2218 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -5228,16 +5237,16 @@ ;} break; - case 238: -#line 2228 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 239: +#line 2229 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); CHECK_FOR_ERROR ;} break; - case 239: -#line 2232 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 240: +#line 2233 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); struct ArgListEntry E; @@ -5249,8 +5258,8 @@ ;} break; - case 240: -#line 2241 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 241: +#line 2242 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new ArgListType; struct ArgListEntry E; @@ -5262,16 +5271,16 @@ ;} break; - case 241: -#line 2250 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 242: +#line 2251 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR ;} break; - case 242: -#line 2256 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 243: +#line 2257 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { std::string FunctionName(*(yyvsp[(3) - (10)].StrVal)); delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory! @@ -5401,8 +5410,8 @@ ;} break; - case 245: -#line 2386 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 246: +#line 2387 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5413,16 +5422,16 @@ ;} break; - case 248: -#line 2397 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 249: +#line 2398 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR ;} break; - case 249: -#line 2402 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 250: +#line 2403 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); @@ -5432,88 +5441,88 @@ ;} break; - case 250: -#line 2414 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 251: +#line 2415 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 251: -#line 2418 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 252: +#line 2419 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 252: -#line 2423 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 253: +#line 2424 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); CHECK_FOR_ERROR ;} break; - case 253: -#line 2427 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 254: +#line 2428 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); CHECK_FOR_ERROR ;} break; - case 254: -#line 2431 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 255: +#line 2432 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); CHECK_FOR_ERROR ;} break; - case 255: -#line 2435 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 256: +#line 2436 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR ;} break; - case 256: -#line 2439 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 257: +#line 2440 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR ;} break; - case 257: -#line 2443 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 258: +#line 2444 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR ;} break; - case 258: -#line 2447 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 259: +#line 2448 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR ;} break; - case 259: -#line 2451 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 260: +#line 2452 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR ;} break; - case 260: -#line 2455 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 261: +#line 2456 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); int NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5541,16 +5550,16 @@ ;} break; - case 261: -#line 2480 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 262: +#line 2481 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR ;} break; - case 262: -#line 2484 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 263: +#line 2485 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal)); delete (yyvsp[(3) - (5)].StrVal); @@ -5559,24 +5568,24 @@ ;} break; - case 263: -#line 2494 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 264: +#line 2495 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR ;} break; - case 264: -#line 2498 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 265: +#line 2499 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR ;} break; - case 265: -#line 2502 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 266: +#line 2503 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5584,8 +5593,8 @@ ;} break; - case 266: -#line 2507 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 267: +#line 2508 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5593,8 +5602,8 @@ ;} break; - case 269: -#line 2520 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 270: +#line 2521 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -5604,8 +5613,8 @@ ;} break; - case 270: -#line 2529 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 271: +#line 2530 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); @@ -5613,32 +5622,32 @@ ;} break; - case 271: -#line 2534 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 272: +#line 2535 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal)); CHECK_FOR_ERROR ;} break; - case 272: -#line 2539 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 273: +#line 2540 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR ;} break; - case 273: -#line 2543 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 274: +#line 2544 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR ;} break; - case 274: -#line 2552 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 275: +#line 2553 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); CHECK_FOR_ERROR @@ -5649,8 +5658,8 @@ ;} break; - case 275: -#line 2561 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 276: +#line 2562 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) @@ -5662,16 +5671,16 @@ ;} break; - case 276: -#line 2570 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 277: +#line 2571 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty space between instruction lists (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); CHECK_FOR_ERROR ;} break; - case 277: -#line 2574 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 278: +#line 2575 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Labelled (named) basic block (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal))); delete (yyvsp[(1) - (1)].StrVal); @@ -5680,8 +5689,8 @@ ;} break; - case 278: -#line 2582 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 279: +#line 2583 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with a result... ValueList &VL = *(yyvsp[(2) - (2)].ValueList); assert(!VL.empty() && "Invalid ret operands!"); @@ -5691,16 +5700,16 @@ ;} break; - case 279: -#line 2589 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 280: +#line 2590 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = ReturnInst::Create(); CHECK_FOR_ERROR ;} break; - case 280: -#line 2593 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 281: +#line 2594 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); CHECK_FOR_ERROR @@ -5708,8 +5717,8 @@ ;} break; - case 281: -#line 2598 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 282: +#line 2599 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?"); BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal)); @@ -5722,8 +5731,8 @@ ;} break; - case 282: -#line 2608 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 283: +#line 2609 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR @@ -5745,8 +5754,8 @@ ;} break; - case 283: -#line 2627 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 284: +#line 2628 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); CHECK_FOR_ERROR @@ -5758,8 +5767,8 @@ ;} break; - case 284: -#line 2637 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 285: +#line 2638 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -5846,24 +5855,24 @@ ;} break; - case 285: -#line 2721 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 286: +#line 2722 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR ;} break; - case 286: -#line 2725 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 287: +#line 2726 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR ;} break; - case 287: -#line 2732 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 288: +#line 2733 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); @@ -5877,8 +5886,8 @@ ;} break; - case 288: -#line 2743 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 289: +#line 2744 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); @@ -5893,8 +5902,8 @@ ;} break; - case 289: -#line 2756 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 290: +#line 2757 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); @@ -5905,8 +5914,8 @@ ;} break; - case 290: -#line 2766 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 291: +#line 2767 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); @@ -5920,8 +5929,8 @@ ;} break; - case 291: -#line 2777 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 292: +#line 2778 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); @@ -5932,8 +5941,8 @@ ;} break; - case 292: -#line 2787 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 293: +#line 2788 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -5947,8 +5956,8 @@ ;} break; - case 293: -#line 2798 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 294: +#line 2799 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 // Labels are only valid in ASMs @@ -5959,8 +5968,8 @@ ;} break; - case 294: -#line 2806 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 295: +#line 2807 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -5973,8 +5982,8 @@ ;} break; - case 295: -#line 2816 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 296: +#line 2817 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); @@ -5984,18 +5993,18 @@ ;} break; - case 296: -#line 2823 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 297: +#line 2824 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamList) = new ParamList(); ;} break; - case 297: -#line 2826 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 298: +#line 2827 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); ;} break; - case 298: -#line 2827 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 299: +#line 2828 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); @@ -6003,24 +6012,24 @@ ;} break; - case 299: -#line 2834 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 300: +#line 2835 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 300: -#line 2838 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 301: +#line 2839 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 301: -#line 2843 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 302: +#line 2844 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6039,8 +6048,8 @@ ;} break; - case 302: -#line 2859 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 303: +#line 2860 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6060,8 +6069,8 @@ ;} break; - case 303: -#line 2876 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 304: +#line 2877 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6078,8 +6087,8 @@ ;} break; - case 304: -#line 2890 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 305: +#line 2891 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6096,8 +6105,8 @@ ;} break; - case 305: -#line 2904 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 306: +#line 2905 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6114,8 +6123,8 @@ ;} break; - case 306: -#line 2918 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 307: +#line 2919 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6132,8 +6141,8 @@ ;} break; - case 307: -#line 2932 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 308: +#line 2933 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6148,8 +6157,8 @@ ;} break; - case 308: -#line 2944 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 309: +#line 2945 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty) GEN_ERROR("select condition must be boolean"); @@ -6160,8 +6169,8 @@ ;} break; - case 309: -#line 2952 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 310: +#line 2953 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6171,8 +6180,8 @@ ;} break; - case 310: -#line 2959 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 311: +#line 2960 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) GEN_ERROR("Invalid extractelement operands"); @@ -6181,8 +6190,8 @@ ;} break; - case 311: -#line 2965 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 312: +#line 2966 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid insertelement operands"); @@ -6191,8 +6200,8 @@ ;} break; - case 312: -#line 2971 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 313: +#line 2972 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -6201,8 +6210,8 @@ ;} break; - case 313: -#line 2977 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 314: +#line 2978 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) @@ -6220,8 +6229,8 @@ ;} break; - case 314: -#line 2993 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 315: +#line 2994 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6313,32 +6322,32 @@ ;} break; - case 315: -#line 3082 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 316: +#line 3083 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); CHECK_FOR_ERROR ;} break; - case 316: -#line 3087 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 317: +#line 3088 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 317: -#line 3091 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 318: +#line 3092 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 318: -#line 3098 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 319: +#line 3099 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6348,8 +6357,8 @@ ;} break; - case 319: -#line 3105 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 320: +#line 3106 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6360,8 +6369,8 @@ ;} break; - case 320: -#line 3113 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 321: +#line 3114 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6371,8 +6380,8 @@ ;} break; - case 321: -#line 3120 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 322: +#line 3121 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6383,8 +6392,8 @@ ;} break; - case 322: -#line 3128 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 323: +#line 3129 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + @@ -6394,8 +6403,8 @@ ;} break; - case 323: -#line 3136 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 324: +#line 3137 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -6412,8 +6421,8 @@ ;} break; - case 324: -#line 3150 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 325: +#line 3151 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); @@ -6433,8 +6442,8 @@ ;} break; - case 325: -#line 3167 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 326: +#line 3168 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { Value *TmpVal = getVal((yyvsp[(2) - (5)].TypeVal)->get(), (yyvsp[(3) - (5)].ValIDVal)); if (!GetResultInst::isValidOperands(TmpVal, (yyvsp[(5) - (5)].UInt64Val))) @@ -6445,8 +6454,8 @@ ;} break; - case 326: -#line 3175 "/llvm/lib/AsmParser/llvmAsmParser.y" + case 327: +#line 3176 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); @@ -6466,7 +6475,7 @@ /* Line 1267 of yacc.c. */ -#line 6470 "llvmAsmParser.tab.c" +#line 6479 "llvmAsmParser.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -6680,7 +6689,7 @@ } -#line 3192 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3193 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=51119&r1=51118&r2=51119&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Wed May 14 15:13:36 2008 @@ -85,110 +85,111 @@ DLLIMPORT = 301, DLLEXPORT = 302, EXTERN_WEAK = 303, - OPAQUE = 304, - EXTERNAL = 305, - TARGET = 306, - TRIPLE = 307, - ALIGN = 308, - ADDRSPACE = 309, - DEPLIBS = 310, - CALL = 311, - TAIL = 312, - ASM_TOK = 313, - MODULE = 314, - SIDEEFFECT = 315, - CC_TOK = 316, - CCC_TOK = 317, - FASTCC_TOK = 318, - COLDCC_TOK = 319, - X86_STDCALLCC_TOK = 320, - X86_FASTCALLCC_TOK = 321, - DATALAYOUT = 322, - RET = 323, - BR = 324, - SWITCH = 325, - INVOKE = 326, - UNWIND = 327, - UNREACHABLE = 328, - ADD = 329, - SUB = 330, - MUL = 331, - UDIV = 332, - SDIV = 333, - FDIV = 334, - UREM = 335, - SREM = 336, - FREM = 337, - AND = 338, - OR = 339, - XOR = 340, - SHL = 341, - LSHR = 342, - ASHR = 343, - ICMP = 344, - FCMP = 345, - VICMP = 346, - VFCMP = 347, - EQ = 348, - NE = 349, - SLT = 350, - SGT = 351, - SLE = 352, - SGE = 353, - ULT = 354, - UGT = 355, - ULE = 356, - UGE = 357, - OEQ = 358, - ONE = 359, - OLT = 360, - OGT = 361, - OLE = 362, - OGE = 363, - ORD = 364, - UNO = 365, - UEQ = 366, - UNE = 367, - MALLOC = 368, - ALLOCA = 369, - FREE = 370, - LOAD = 371, - STORE = 372, - GETELEMENTPTR = 373, - TRUNC = 374, - ZEXT = 375, - SEXT = 376, - FPTRUNC = 377, - FPEXT = 378, - BITCAST = 379, - UITOFP = 380, - SITOFP = 381, - FPTOUI = 382, - FPTOSI = 383, - INTTOPTR = 384, - PTRTOINT = 385, - PHI_TOK = 386, - SELECT = 387, - VAARG = 388, - EXTRACTELEMENT = 389, - INSERTELEMENT = 390, - SHUFFLEVECTOR = 391, - GETRESULT = 392, - SIGNEXT = 393, - ZEROEXT = 394, - NORETURN = 395, - INREG = 396, - SRET = 397, - NOUNWIND = 398, - NOALIAS = 399, - BYVAL = 400, - NEST = 401, - READNONE = 402, - READONLY = 403, - GC = 404, - DEFAULT = 405, - HIDDEN = 406, - PROTECTED = 407 + COMMON = 304, + OPAQUE = 305, + EXTERNAL = 306, + TARGET = 307, + TRIPLE = 308, + ALIGN = 309, + ADDRSPACE = 310, + DEPLIBS = 311, + CALL = 312, + TAIL = 313, + ASM_TOK = 314, + MODULE = 315, + SIDEEFFECT = 316, + CC_TOK = 317, + CCC_TOK = 318, + FASTCC_TOK = 319, + COLDCC_TOK = 320, + X86_STDCALLCC_TOK = 321, + X86_FASTCALLCC_TOK = 322, + DATALAYOUT = 323, + RET = 324, + BR = 325, + SWITCH = 326, + INVOKE = 327, + UNWIND = 328, + UNREACHABLE = 329, + ADD = 330, + SUB = 331, + MUL = 332, + UDIV = 333, + SDIV = 334, + FDIV = 335, + UREM = 336, + SREM = 337, + FREM = 338, + AND = 339, + OR = 340, + XOR = 341, + SHL = 342, + LSHR = 343, + ASHR = 344, + ICMP = 345, + FCMP = 346, + VICMP = 347, + VFCMP = 348, + EQ = 349, + NE = 350, + SLT = 351, + SGT = 352, + SLE = 353, + SGE = 354, + ULT = 355, + UGT = 356, + ULE = 357, + UGE = 358, + OEQ = 359, + ONE = 360, + OLT = 361, + OGT = 362, + OLE = 363, + OGE = 364, + ORD = 365, + UNO = 366, + UEQ = 367, + UNE = 368, + MALLOC = 369, + ALLOCA = 370, + FREE = 371, + LOAD = 372, + STORE = 373, + GETELEMENTPTR = 374, + TRUNC = 375, + ZEXT = 376, + SEXT = 377, + FPTRUNC = 378, + FPEXT = 379, + BITCAST = 380, + UITOFP = 381, + SITOFP = 382, + FPTOUI = 383, + FPTOSI = 384, + INTTOPTR = 385, + PTRTOINT = 386, + PHI_TOK = 387, + SELECT = 388, + VAARG = 389, + EXTRACTELEMENT = 390, + INSERTELEMENT = 391, + SHUFFLEVECTOR = 392, + GETRESULT = 393, + SIGNEXT = 394, + ZEROEXT = 395, + NORETURN = 396, + INREG = 397, + SRET = 398, + NOUNWIND = 399, + NOALIAS = 400, + BYVAL = 401, + NEST = 402, + READNONE = 403, + READONLY = 404, + GC = 405, + DEFAULT = 406, + HIDDEN = 407, + PROTECTED = 408 }; #endif /* Tokens. */ @@ -238,117 +239,118 @@ #define DLLIMPORT 301 #define DLLEXPORT 302 #define EXTERN_WEAK 303 -#define OPAQUE 304 -#define EXTERNAL 305 -#define TARGET 306 -#define TRIPLE 307 -#define ALIGN 308 -#define ADDRSPACE 309 -#define DEPLIBS 310 -#define CALL 311 -#define TAIL 312 -#define ASM_TOK 313 -#define MODULE 314 -#define SIDEEFFECT 315 -#define CC_TOK 316 -#define CCC_TOK 317 -#define FASTCC_TOK 318 -#define COLDCC_TOK 319 -#define X86_STDCALLCC_TOK 320 -#define X86_FASTCALLCC_TOK 321 -#define DATALAYOUT 322 -#define RET 323 -#define BR 324 -#define SWITCH 325 -#define INVOKE 326 -#define UNWIND 327 -#define UNREACHABLE 328 -#define ADD 329 -#define SUB 330 -#define MUL 331 -#define UDIV 332 -#define SDIV 333 -#define FDIV 334 -#define UREM 335 -#define SREM 336 -#define FREM 337 -#define AND 338 -#define OR 339 -#define XOR 340 -#define SHL 341 -#define LSHR 342 -#define ASHR 343 -#define ICMP 344 -#define FCMP 345 -#define VICMP 346 -#define VFCMP 347 -#define EQ 348 -#define NE 349 -#define SLT 350 -#define SGT 351 -#define SLE 352 -#define SGE 353 -#define ULT 354 -#define UGT 355 -#define ULE 356 -#define UGE 357 -#define OEQ 358 -#define ONE 359 -#define OLT 360 -#define OGT 361 -#define OLE 362 -#define OGE 363 -#define ORD 364 -#define UNO 365 -#define UEQ 366 -#define UNE 367 -#define MALLOC 368 -#define ALLOCA 369 -#define FREE 370 -#define LOAD 371 -#define STORE 372 -#define GETELEMENTPTR 373 -#define TRUNC 374 -#define ZEXT 375 -#define SEXT 376 -#define FPTRUNC 377 -#define FPEXT 378 -#define BITCAST 379 -#define UITOFP 380 -#define SITOFP 381 -#define FPTOUI 382 -#define FPTOSI 383 -#define INTTOPTR 384 -#define PTRTOINT 385 -#define PHI_TOK 386 -#define SELECT 387 -#define VAARG 388 -#define EXTRACTELEMENT 389 -#define INSERTELEMENT 390 -#define SHUFFLEVECTOR 391 -#define GETRESULT 392 -#define SIGNEXT 393 -#define ZEROEXT 394 -#define NORETURN 395 -#define INREG 396 -#define SRET 397 -#define NOUNWIND 398 -#define NOALIAS 399 -#define BYVAL 400 -#define NEST 401 -#define READNONE 402 -#define READONLY 403 -#define GC 404 -#define DEFAULT 405 -#define HIDDEN 406 -#define PROTECTED 407 +#define COMMON 304 +#define OPAQUE 305 +#define EXTERNAL 306 +#define TARGET 307 +#define TRIPLE 308 +#define ALIGN 309 +#define ADDRSPACE 310 +#define DEPLIBS 311 +#define CALL 312 +#define TAIL 313 +#define ASM_TOK 314 +#define MODULE 315 +#define SIDEEFFECT 316 +#define CC_TOK 317 +#define CCC_TOK 318 +#define FASTCC_TOK 319 +#define COLDCC_TOK 320 +#define X86_STDCALLCC_TOK 321 +#define X86_FASTCALLCC_TOK 322 +#define DATALAYOUT 323 +#define RET 324 +#define BR 325 +#define SWITCH 326 +#define INVOKE 327 +#define UNWIND 328 +#define UNREACHABLE 329 +#define ADD 330 +#define SUB 331 +#define MUL 332 +#define UDIV 333 +#define SDIV 334 +#define FDIV 335 +#define UREM 336 +#define SREM 337 +#define FREM 338 +#define AND 339 +#define OR 340 +#define XOR 341 +#define SHL 342 +#define LSHR 343 +#define ASHR 344 +#define ICMP 345 +#define FCMP 346 +#define VICMP 347 +#define VFCMP 348 +#define EQ 349 +#define NE 350 +#define SLT 351 +#define SGT 352 +#define SLE 353 +#define SGE 354 +#define ULT 355 +#define UGT 356 +#define ULE 357 +#define UGE 358 +#define OEQ 359 +#define ONE 360 +#define OLT 361 +#define OGT 362 +#define OLE 363 +#define OGE 364 +#define ORD 365 +#define UNO 366 +#define UEQ 367 +#define UNE 368 +#define MALLOC 369 +#define ALLOCA 370 +#define FREE 371 +#define LOAD 372 +#define STORE 373 +#define GETELEMENTPTR 374 +#define TRUNC 375 +#define ZEXT 376 +#define SEXT 377 +#define FPTRUNC 378 +#define FPEXT 379 +#define BITCAST 380 +#define UITOFP 381 +#define SITOFP 382 +#define FPTOUI 383 +#define FPTOSI 384 +#define INTTOPTR 385 +#define PTRTOINT 386 +#define PHI_TOK 387 +#define SELECT 388 +#define VAARG 389 +#define EXTRACTELEMENT 390 +#define INSERTELEMENT 391 +#define SHUFFLEVECTOR 392 +#define GETRESULT 393 +#define SIGNEXT 394 +#define ZEROEXT 395 +#define NORETURN 396 +#define INREG 397 +#define SRET 398 +#define NOUNWIND 399 +#define NOALIAS 400 +#define BYVAL 401 +#define NEST 402 +#define READNONE 403 +#define READONLY 404 +#define GC 405 +#define DEFAULT 406 +#define HIDDEN 407 +#define PROTECTED 408 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 949 "/llvm/lib/AsmParser/llvmAsmParser.y" +#line 949 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -396,7 +398,7 @@ llvm::FCmpInst::Predicate FPredicate; } /* Line 1529 of yacc.c. */ -#line 400 "llvmAsmParser.tab.h" +#line 402 "llvmAsmParser.tab.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=51119&r1=51118&r2=51119&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Wed May 14 15:13:36 2008 @@ -1058,7 +1058,7 @@ %token ZEROINITIALIZER TRUETOK FALSETOK BEGINTOK ENDTOK %token DECLARE DEFINE GLOBAL CONSTANT SECTION ALIAS VOLATILE THREAD_LOCAL %token TO DOTDOTDOT NULL_TOK UNDEF INTERNAL LINKONCE WEAK APPENDING -%token DLLIMPORT DLLEXPORT EXTERN_WEAK +%token DLLIMPORT DLLEXPORT EXTERN_WEAK COMMON %token OPAQUE EXTERNAL TARGET TRIPLE ALIGN ADDRSPACE %token DEPLIBS CALL TAIL ASM_TOK MODULE SIDEEFFECT %token CC_TOK CCC_TOK FASTCC_TOK COLDCC_TOK X86_STDCALLCC_TOK X86_FASTCALLCC_TOK @@ -1174,6 +1174,7 @@ | LINKONCE { $$ = GlobalValue::LinkOnceLinkage; } | APPENDING { $$ = GlobalValue::AppendingLinkage; } | DLLEXPORT { $$ = GlobalValue::DLLExportLinkage; } + | COMMON { $$ = GlobalValue::CommonLinkage; } ; GVExternalLinkage From dalej at apple.com Wed May 14 15:14:09 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 14 May 2008 20:14:09 -0000 Subject: [llvm-commits] [llvm] r51120 - /llvm/trunk/lib/AsmParser/llvmAsmParser.y Message-ID: <200805142014.m4EKE9Nn022671@zion.cs.uiuc.edu> Author: johannes Date: Wed May 14 15:14:09 2008 New Revision: 51120 URL: http://llvm.org/viewvc/llvm-project?rev=51120&view=rev Log: CommonLinkage (missed a file) Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=51120&r1=51119&r2=51120&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Wed May 14 15:14:09 2008 @@ -1058,7 +1058,7 @@ %token ZEROINITIALIZER TRUETOK FALSETOK BEGINTOK ENDTOK %token DECLARE DEFINE GLOBAL CONSTANT SECTION ALIAS VOLATILE THREAD_LOCAL %token TO DOTDOTDOT NULL_TOK UNDEF INTERNAL LINKONCE WEAK APPENDING -%token DLLIMPORT DLLEXPORT EXTERN_WEAK +%token DLLIMPORT DLLEXPORT EXTERN_WEAK COMMON %token OPAQUE EXTERNAL TARGET TRIPLE ALIGN ADDRSPACE %token DEPLIBS CALL TAIL ASM_TOK MODULE SIDEEFFECT %token CC_TOK CCC_TOK FASTCC_TOK COLDCC_TOK X86_STDCALLCC_TOK X86_FASTCALLCC_TOK @@ -1174,6 +1174,7 @@ | LINKONCE { $$ = GlobalValue::LinkOnceLinkage; } | APPENDING { $$ = GlobalValue::AppendingLinkage; } | DLLEXPORT { $$ = GlobalValue::DLLExportLinkage; } + | COMMON { $$ = GlobalValue::CommonLinkage; } ; GVExternalLinkage From evan.cheng at apple.com Wed May 14 15:26:36 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 14 May 2008 20:26:36 -0000 Subject: [llvm-commits] [llvm] r51123 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Message-ID: <200805142026.m4EKQaPE023052@zion.cs.uiuc.edu> Author: evancheng Date: Wed May 14 15:26:35 2008 New Revision: 51123 URL: http://llvm.org/viewvc/llvm-project?rev=51123&view=rev Log: Really silence compiler warnings. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=51123&r1=51122&r2=51123&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Wed May 14 15:26:35 2008 @@ -406,8 +406,11 @@ // Just use the input register directly! if (InstanceNo > 0) VRBaseMap.erase(SDOperand(Node, ResNo)); +#ifndef NDEBUG bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,ResNo),SrcReg)); - isNew; // Silence compiler warning. +#else + VRBaseMap.insert(std::make_pair(SDOperand(Node,ResNo),SrcReg)); +#endif assert(isNew && "Node emitted out of order - early"); return; } @@ -465,8 +468,11 @@ if (InstanceNo > 0) VRBaseMap.erase(SDOperand(Node, ResNo)); +#ifndef NDEBUG bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,ResNo), VRBase)); - isNew; // Silence compiler warning. +#else + VRBaseMap.insert(std::make_pair(SDOperand(Node,ResNo), VRBase)); +#endif assert(isNew && "Node emitted out of order - early"); } @@ -523,8 +529,11 @@ MI->addOperand(MachineOperand::CreateReg(VRBase, true)); } +#ifndef NDEBUG bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,i), VRBase)); - isNew; // Silence compiler warning. +#else + VRBaseMap.insert(std::make_pair(SDOperand(Node,i), VRBase)); +#endif assert(isNew && "Node emitted out of order - early"); } } @@ -776,8 +785,11 @@ } else assert(0 && "Node is not insert_subreg, extract_subreg, or subreg_to_reg"); +#ifndef NDEBUG bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,0), VRBase)); - isNew; // Silence compiler warning. +#else + VRBaseMap.insert(std::make_pair(SDOperand(Node,0), VRBase)); +#endif assert(isNew && "Node emitted out of order - early"); } @@ -1004,8 +1016,11 @@ // Copy from physical register. assert(I->Reg && "Unknown physical register!"); unsigned VRBase = MRI.createVirtualRegister(SU->CopyDstRC); +#ifndef NDEBUG bool isNew = VRBaseMap.insert(std::make_pair(SU, VRBase)); - isNew; // Silence compiler warning. +#else + VRBaseMap.insert(std::make_pair(SU, VRBase)); +#endif assert(isNew && "Node emitted out of order - early"); TII->copyRegToReg(*BB, BB->end(), VRBase, I->Reg, SU->CopyDstRC, SU->CopySrcRC); From natebegeman at mac.com Wed May 14 15:28:31 2008 From: natebegeman at mac.com (Nate Begeman) Date: Wed, 14 May 2008 20:28:31 -0000 Subject: [llvm-commits] [llvm] r51125 - /llvm/trunk/include/llvm/Instructions.h Message-ID: <200805142028.m4EKSWgx023143@zion.cs.uiuc.edu> Author: sampo Date: Wed May 14 15:28:31 2008 New Revision: 51125 URL: http://llvm.org/viewvc/llvm-project?rev=51125&view=rev Log: Don't generate unused variables in a no-assert build Add some checks to the new vicmp,vfcmp instructions Modified: llvm/trunk/include/llvm/Instructions.h Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=51125&r1=51124&r2=51125&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Wed May 14 15:28:31 2008 @@ -627,12 +627,11 @@ assert(pred >= CmpInst::FIRST_ICMP_PREDICATE && pred <= CmpInst::LAST_ICMP_PREDICATE && "Invalid ICmp predicate value"); - const Type* Op0Ty = getOperand(0)->getType(); - const Type* Op1Ty = getOperand(1)->getType(); - assert(Op0Ty == Op1Ty && + assert(getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to ICmp instruction are not of the same type!"); // Check that the operands are the right type - assert((Op0Ty->isInteger() || isa(Op0Ty)) && + assert((getOperand(0)->getType()->isInteger() || + isa(getOperand(0)->getType())) && "Invalid operand types for ICmp instruction"); } @@ -648,12 +647,11 @@ assert(pred >= CmpInst::FIRST_ICMP_PREDICATE && pred <= CmpInst::LAST_ICMP_PREDICATE && "Invalid ICmp predicate value"); - const Type* Op0Ty = getOperand(0)->getType(); - const Type* Op1Ty = getOperand(1)->getType(); - assert(Op0Ty == Op1Ty && + assert(getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to ICmp instruction are not of the same type!"); // Check that the operands are the right type - assert((Op0Ty->isInteger() || isa(Op0Ty)) && + assert((getOperand(0)->getType()->isInteger() || + isa(getOperand(0)->getType())) && "Invalid operand types for ICmp instruction"); } @@ -796,12 +794,10 @@ InsertBefore) { assert(pred <= FCmpInst::LAST_FCMP_PREDICATE && "Invalid FCmp predicate value"); - const Type* Op0Ty = getOperand(0)->getType(); - const Type* Op1Ty = getOperand(1)->getType(); - assert(Op0Ty == Op1Ty && + assert(getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to FCmp instruction are not of the same type!"); // Check that the operands are the right type - assert(Op0Ty->isFloatingPoint() && + assert(getOperand(0)->getType()->isFloatingPoint() && "Invalid operand types for FCmp instruction"); } @@ -816,12 +812,10 @@ InsertAtEnd) { assert(pred <= FCmpInst::LAST_FCMP_PREDICATE && "Invalid FCmp predicate value"); - const Type* Op0Ty = getOperand(0)->getType(); - const Type* Op1Ty = getOperand(1)->getType(); - assert(Op0Ty == Op1Ty && + assert(getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to FCmp instruction are not of the same type!"); // Check that the operands are the right type - assert(Op0Ty->isFloatingPoint() && + assert(getOperand(0)->getType()->isFloatingPoint() && "Invalid operand types for FCmp instruction"); } @@ -913,6 +907,11 @@ Instruction *InsertBefore = 0 ///< Where to insert ) : CmpInst(LHS->getType(), Instruction::VICmp, pred, LHS, RHS, Name, InsertBefore) { + assert(pred >= CmpInst::FIRST_ICMP_PREDICATE && + pred <= CmpInst::LAST_ICMP_PREDICATE && + "Invalid VICmp predicate value"); + assert(getOperand(0)->getType() == getOperand(1)->getType() && + "Both operands to VICmp instruction are not of the same type!"); } /// @brief Constructor with insert-at-block-end semantics. @@ -924,6 +923,11 @@ BasicBlock *InsertAtEnd ///< Block to insert into. ) : CmpInst(LHS->getType(), Instruction::VICmp, pred, LHS, RHS, Name, InsertAtEnd) { + assert(pred >= CmpInst::FIRST_ICMP_PREDICATE && + pred <= CmpInst::LAST_ICMP_PREDICATE && + "Invalid VICmp predicate value"); + assert(getOperand(0)->getType() == getOperand(1)->getType() && + "Both operands to VICmp instruction are not of the same type!"); } /// @brief Return the predicate for this instruction. @@ -960,6 +964,10 @@ Instruction *InsertBefore = 0 ///< Where to insert ) : CmpInst(VectorType::getInteger(cast(LHS->getType())), Instruction::VFCmp, pred, LHS, RHS, Name, InsertBefore) { + assert(pred <= CmpInst::LAST_FCMP_PREDICATE && + "Invalid VFCmp predicate value"); + assert(getOperand(0)->getType() == getOperand(1)->getType() && + "Both operands to VFCmp instruction are not of the same type!"); } /// @brief Constructor with insert-at-block-end semantics. @@ -971,6 +979,10 @@ BasicBlock *InsertAtEnd ///< Block to insert into. ) : CmpInst(VectorType::getInteger(cast(LHS->getType())), Instruction::VFCmp, pred, LHS, RHS, Name, InsertAtEnd) { + assert(pred <= CmpInst::LAST_FCMP_PREDICATE && + "Invalid VFCmp predicate value"); + assert(getOperand(0)->getType() == getOperand(1)->getType() && + "Both operands to VFCmp instruction are not of the same type!"); } /// @brief Return the predicate for this instruction. From evan.cheng at apple.com Wed May 14 15:29:30 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 14 May 2008 20:29:30 -0000 Subject: [llvm-commits] [llvm] r51126 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200805142029.m4EKTU82023179@zion.cs.uiuc.edu> Author: evancheng Date: Wed May 14 15:29:30 2008 New Revision: 51126 URL: http://llvm.org/viewvc/llvm-project?rev=51126&view=rev Log: Really silence compiler warnings. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=51126&r1=51125&r2=51126&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed May 14 15:29:30 2008 @@ -807,8 +807,8 @@ unsigned NumRegs = TLI.getVectorTypeBreakdown(ValueVT, IntermediateVT, NumIntermediates, RegisterVT); - NumRegs; // Silence a compiler warning. assert(NumRegs == NumParts && "Part count doesn't match vector breakdown!"); + NumParts = NumRegs; // Silence a compiler warning. assert(RegisterVT == PartVT && "Part type doesn't match vector breakdown!"); assert(RegisterVT == Parts[0].getValueType() && "Part type doesn't match part!"); @@ -1024,10 +1024,10 @@ DAG.getTargetLoweringInfo() .getVectorTypeBreakdown(ValueVT, IntermediateVT, NumIntermediates, RegisterVT); - NumRegs; // Silence a compiler warning. unsigned NumElements = MVT::getVectorNumElements(ValueVT); assert(NumRegs == NumParts && "Part count doesn't match vector breakdown!"); + NumParts = NumRegs; // Silence a compiler warning. assert(RegisterVT == PartVT && "Part type doesn't match vector breakdown!"); // Split the vector into intermediate operands. From natebegeman at mac.com Wed May 14 15:29:46 2008 From: natebegeman at mac.com (Nate Begeman) Date: Wed, 14 May 2008 20:29:46 -0000 Subject: [llvm-commits] [llvm] r51127 - /llvm/trunk/include/llvm/Support/IRBuilder.h Message-ID: <200805142029.m4EKTk6Q023196@zion.cs.uiuc.edu> Author: sampo Date: Wed May 14 15:29:46 2008 New Revision: 51127 URL: http://llvm.org/viewvc/llvm-project?rev=51127&view=rev Log: Add support to IR builder for new vicmp, vfcmp routines Modified: llvm/trunk/include/llvm/Support/IRBuilder.h Modified: llvm/trunk/include/llvm/Support/IRBuilder.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/IRBuilder.h?rev=51127&r1=51126&r2=51127&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/IRBuilder.h (original) +++ llvm/trunk/include/llvm/Support/IRBuilder.h Wed May 14 15:29:46 2008 @@ -446,21 +446,36 @@ return CreateFCmp(FCmpInst::FCMP_UNE, LHS, RHS, Name); } - Value *CreateICmp(ICmpInst::Predicate P, Value *LHS, Value *RHS, - const char *Name = "") { + Value *CreateICmp(CmpInst::Predicate P, Value *LHS, Value *RHS, + const char *Name = "") { if (Constant *LC = dyn_cast(LHS)) if (Constant *RC = dyn_cast(RHS)) return ConstantExpr::getCompare(P, LC, RC); return Insert(new ICmpInst(P, LHS, RHS, Name)); } - Value *CreateFCmp(FCmpInst::Predicate P, Value *LHS, Value *RHS, - const char *Name = "") { + Value *CreateFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS, + const char *Name = "") { if (Constant *LC = dyn_cast(LHS)) if (Constant *RC = dyn_cast(RHS)) return ConstantExpr::getCompare(P, LC, RC); return Insert(new FCmpInst(P, LHS, RHS, Name)); } + Value *CreateVICmp(CmpInst::Predicate P, Value *LHS, Value *RHS, + const char *Name = "") { + if (Constant *LC = dyn_cast(LHS)) + if (Constant *RC = dyn_cast(RHS)) + return ConstantExpr::getCompare(P, LC, RC); + return Insert(new VICmpInst(P, LHS, RHS, Name)); + } + Value *CreateVFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS, + const char *Name = "") { + if (Constant *LC = dyn_cast(LHS)) + if (Constant *RC = dyn_cast(RHS)) + return ConstantExpr::getCompare(P, LC, RC); + return Insert(new VFCmpInst(P, LHS, RHS, Name)); + } + //===--------------------------------------------------------------------===// // Instruction creation methods: Other Instructions //===--------------------------------------------------------------------===// From evan.cheng at apple.com Wed May 14 15:33:21 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 14 May 2008 20:33:21 -0000 Subject: [llvm-commits] [llvm] r51129 - /llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Message-ID: <200805142033.m4EKXLL1023377@zion.cs.uiuc.edu> Author: evancheng Date: Wed May 14 15:33:21 2008 New Revision: 51129 URL: http://llvm.org/viewvc/llvm-project?rev=51129&view=rev Log: Silence warnings. Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp?rev=51129&r1=51128&r2=51129&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Wed May 14 15:33:21 2008 @@ -378,7 +378,7 @@ SDOperand retVal; SDOperand as1,as2; SDVTList VTList; - unsigned AS,ASE,ASC; + unsigned AS = 0, ASE = 0, ASC=0; InOp[0] = N->getOperand(0); InOp[1] = N->getOperand(1); @@ -612,7 +612,7 @@ SDOperand Src = N->getOperand(1); SDOperand Dest = N->getOperand(2); unsigned int DstOff = 0; - int NUM_STORES; + int NUM_STORES = 0; SDOperand Stores[6]; // if source operand is expected to be extended to From sabre at nondot.org Wed May 14 15:38:44 2008 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 May 2008 20:38:44 -0000 Subject: [llvm-commits] [llvm] r51130 - in /llvm/trunk/lib/Transforms/Scalar: SimplifyCFG.cpp SimplifyCFGPass.cpp Message-ID: <200805142038.m4EKciJb023553@zion.cs.uiuc.edu> Author: lattner Date: Wed May 14 15:38:44 2008 New Revision: 51130 URL: http://llvm.org/viewvc/llvm-project?rev=51130&view=rev Log: rename SimplifyCFG.cpp -> SimplifyCFGPass.cpp Added: llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp - copied, changed from r51108, llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp Removed: llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp Removed: llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp?rev=51129&view=auto ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp (removed) @@ -1,231 +0,0 @@ -//===- SimplifyCFG.cpp - CFG Simplification Pass --------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements dead code elimination and basic block merging, along -// with a collection of other peephole control flow optimizations. For example: -// -// * Removes basic blocks with no predecessors. -// * Merges a basic block into its predecessor if there is only one and the -// predecessor only has one successor. -// * Eliminates PHI nodes for basic blocks with a single predecessor. -// * Eliminates a basic block that only contains an unconditional branch. -// * Changes invoke instructions to nounwind functions to be calls. -// * Change things like "if (x) if (y)" into "if (x&y)". -// * etc.. -// -//===----------------------------------------------------------------------===// - -#define DEBUG_TYPE "simplifycfg" -#include "llvm/Transforms/Scalar.h" -#include "llvm/Transforms/Utils/Local.h" -#include "llvm/Constants.h" -#include "llvm/Instructions.h" -#include "llvm/Module.h" -#include "llvm/ParameterAttributes.h" -#include "llvm/Support/CFG.h" -#include "llvm/Support/Compiler.h" -#include "llvm/Pass.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/Statistic.h" -using namespace llvm; - -STATISTIC(NumSimpl, "Number of blocks simplified"); - -namespace { - struct VISIBILITY_HIDDEN CFGSimplifyPass : public FunctionPass { - static char ID; // Pass identification, replacement for typeid - CFGSimplifyPass() : FunctionPass((intptr_t)&ID) {} - - virtual bool runOnFunction(Function &F); - }; -} - -char CFGSimplifyPass::ID = 0; -static RegisterPass X("simplifycfg", "Simplify the CFG"); - -// Public interface to the CFGSimplification pass -FunctionPass *llvm::createCFGSimplificationPass() { - return new CFGSimplifyPass(); -} - -/// ChangeToUnreachable - Insert an unreachable instruction before the specified -/// instruction, making it and the rest of the code in the block dead. -static void ChangeToUnreachable(Instruction *I) { - BasicBlock *BB = I->getParent(); - // Loop over all of the successors, removing BB's entry from any PHI - // nodes. - for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI) - (*SI)->removePredecessor(BB); - - new UnreachableInst(I); - - // All instructions after this are dead. - BasicBlock::iterator BBI = I, BBE = BB->end(); - while (BBI != BBE) { - if (!BBI->use_empty()) - BBI->replaceAllUsesWith(UndefValue::get(BBI->getType())); - BB->getInstList().erase(BBI++); - } -} - -/// ChangeToCall - Convert the specified invoke into a normal call. -static void ChangeToCall(InvokeInst *II) { - BasicBlock *BB = II->getParent(); - SmallVector Args(II->op_begin()+3, II->op_end()); - CallInst *NewCall = CallInst::Create(II->getCalledValue(), Args.begin(), - Args.end(), "", II); - NewCall->takeName(II); - NewCall->setCallingConv(II->getCallingConv()); - NewCall->setParamAttrs(II->getParamAttrs()); - II->replaceAllUsesWith(NewCall); - - // Follow the call by a branch to the normal destination. - BranchInst::Create(II->getNormalDest(), II); - - // Update PHI nodes in the unwind destination - II->getUnwindDest()->removePredecessor(BB); - BB->getInstList().erase(II); -} - -static bool MarkAliveBlocks(BasicBlock *BB, - SmallPtrSet &Reachable) { - - SmallVector Worklist; - Worklist.push_back(BB); - bool Changed = false; - w